summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-03-26 20:45:19 (UTC)
committer zautrix <zautrix>2005-03-26 20:45:19 (UTC)
commita24f954912ee2dbb76dcbde1abc9f20b06abbf93 (patch) (unidiff)
tree8b864e1cd9e5016e2bb398a3c3c132e78f21029a
parentc9c3f9e65a72a3c79d7f67eba68fca4537004808 (diff)
downloadkdepimpi-a24f954912ee2dbb76dcbde1abc9f20b06abbf93.zip
kdepimpi-a24f954912ee2dbb76dcbde1abc9f20b06abbf93.tar.gz
kdepimpi-a24f954912ee2dbb76dcbde1abc9f20b06abbf93.tar.bz2
timer fixes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kalarmd/alarmdialog.cpp24
1 files changed, 20 insertions, 4 deletions
diff --git a/kalarmd/alarmdialog.cpp b/kalarmd/alarmdialog.cpp
index 751ba57..794c8ae 100644
--- a/kalarmd/alarmdialog.cpp
+++ b/kalarmd/alarmdialog.cpp
@@ -23,25 +23,27 @@
23 23
24// $Id$ 24// $Id$
25 25
26#include <qhbox.h> 26#include <qhbox.h>
27#include <qvbox.h> 27#include <qvbox.h>
28#include <qapp.h> 28#include <qapp.h>
29#include <qlabel.h> 29#include <qlabel.h>
30#include <qlayout.h> 30#include <qlayout.h>
31#include <qfile.h> 31#include <qfile.h>
32#include <qtimer.h> 32#include <qtimer.h>
33#include <qsound.h> 33#include <qsound.h>
34#include <qpushbutton.h> 34#include <qpushbutton.h>
35#define protected public
35#include <qspinbox.h> 36#include <qspinbox.h>
37#undef protected
36#include <stdlib.h> 38#include <stdlib.h>
37#ifndef _WIN32_ 39#ifndef _WIN32_
38#include <unistd.h> 40#include <unistd.h>
39#include <sys/ioctl.h> 41#include <sys/ioctl.h>
40#endif 42#endif
41#include <stdio.h> 43#include <stdio.h>
42#include <fcntl.h> 44#include <fcntl.h>
43 45
44#ifndef DESKTOP_VERSION 46#ifndef DESKTOP_VERSION
45#include <qtopia/alarmserver.h> 47#include <qtopia/alarmserver.h>
46#include <qpe/resource.h> 48#include <qpe/resource.h>
47#include <qtopia/sound.h> 49#include <qtopia/sound.h>
@@ -81,36 +83,50 @@ AlarmDialog::AlarmDialog(QWidget *parent,const char *name)
81 l->setAlignment( AlignCenter); 83 l->setAlignment( AlignCenter);
82 layout->addWidget ( mMessage ); 84 layout->addWidget ( mMessage );
83 layout->addWidget ( l ); 85 layout->addWidget ( l );
84 mMissedAlarms= new QLabel ( "", this ); 86 mMissedAlarms= new QLabel ( "", this );
85 mMissedAlarms->setAlignment( AlignCenter); 87 mMissedAlarms->setAlignment( AlignCenter);
86 88
87 playSoundTimer = new QTimer( this ); 89 playSoundTimer = new QTimer( this );
88 connect ( playSoundTimer, SIGNAL( timeout() ), this, SLOT (playSound() ) ); 90 connect ( playSoundTimer, SIGNAL( timeout() ), this, SLOT (playSound() ) );
89 91
90 playSoundTimer->stop(); 92 playSoundTimer->stop();
91 93
92 layout->addWidget ( mMissedAlarms ); 94 layout->addWidget ( mMissedAlarms );
93 QHBox *suspendBox = new QHBox( this ); 95 QVBox *suspendBox = new QVBox( this );
94 suspendBox->setSpacing(3); 96 suspendBox->setSpacing(3);
95 layout->addWidget ( suspendBox ); 97 layout->addWidget ( suspendBox );
96 (void)new QLabel("Suspend duration (minutes):",suspendBox); 98 QLabel* labb = new QLabel("Suspend duration (minutes):",suspendBox);
99 labb->setAlignment(AlignCenter);
100 fo = font();
101 fo.setPointSize( 36 );
97 mSuspendSpin = new QSpinBox(1,1440,1,suspendBox); 102 mSuspendSpin = new QSpinBox(1,1440,1,suspendBox);
103 mSuspendSpin->setFont( fo );
98 mSuspendSpin->setValue(7); // default suspend duration 104 mSuspendSpin->setValue(7); // default suspend duration
99 QHBox * bbox = new QHBox ( this ); 105 mSuspendSpin->setButtonSymbols( QSpinBox::PlusMinus );
106 mSuspendSpin->setButtonSymbols( QSpinBox::PlusMinus );
107 mSuspendSpin->upButton ()->setFixedSize( QSize( 48, 30 ));
108 mSuspendSpin->downButton ()->setFixedSize( QSize( 48, 30 ));
109 mSuspendSpin->setFixedSize( 100,62 );
110 mSuspendSpin->setButtonSymbols( QSpinBox::PlusMinus );
111
112 QVBox * bbox = new QVBox ( this );
100 layout->addWidget ( bbox ); 113 layout->addWidget ( bbox );
101 bbox->layout()->setSpacing( 5 ); 114 bbox->layout()->setSpacing( 2 );
102 QPushButton* suspend = new QPushButton( "Suspend", bbox); 115 QPushButton* suspend = new QPushButton( "Suspend", bbox);
103 QPushButton* silen = new QPushButton( " Stop sound ", bbox); 116 QPushButton* silen = new QPushButton( " Stop sound ", bbox);
104 QPushButton* okbut = new QPushButton( "Ok", bbox); 117 QPushButton* okbut = new QPushButton( "Ok", bbox);
118 suspend->setFont( fo );
119 silen->setFont( fo );
120 okbut->setFont( fo );
105 connect (silen , SIGNAL( clicked() ), this, SLOT (silent() ) ); 121 connect (silen , SIGNAL( clicked() ), this, SLOT (silent() ) );
106 connect (suspend , SIGNAL( clicked() ), this, SLOT (slotSuspend() ) ); 122 connect (suspend , SIGNAL( clicked() ), this, SLOT (slotSuspend() ) );
107 connect (okbut , SIGNAL( clicked() ), this, SLOT (slotOk() ) ); 123 connect (okbut , SIGNAL( clicked() ), this, SLOT (slotOk() ) );
108#ifndef _WIN32_ 124#ifndef _WIN32_
109 if ( QFile::exists ( "/dev/sharp_led" ) ) 125 if ( QFile::exists ( "/dev/sharp_led" ) )
110 fd_led = open ( "/dev/sharp_led", O_RDWR|O_NONBLOCK ); 126 fd_led = open ( "/dev/sharp_led", O_RDWR|O_NONBLOCK );
111 else 127 else
112#endif 128#endif
113 fd_led = 0; 129 fd_led = 0;
114 statusLED.which = SHARP_LED_SALARM; 130 statusLED.which = SHARP_LED_SALARM;
115 mSilent = false; 131 mSilent = false;
116 mSuspendCounter = 0; 132 mSuspendCounter = 0;