author | zecke <zecke> | 2002-05-21 14:21:59 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-05-21 14:21:59 (UTC) |
commit | d65dc25caec62d4c554c99fbc151bf4d07c63b72 (patch) (unidiff) | |
tree | 37485591f8cd642df0177ea77b860f8d4432e9ef | |
parent | 3eb1e88e5915c9dbd521a150cc5dd7eb7dbb3663 (diff) | |
download | opie-d65dc25caec62d4c554c99fbc151bf4d07c63b72.zip opie-d65dc25caec62d4c554c99fbc151bf4d07c63b72.tar.gz opie-d65dc25caec62d4c554c99fbc151bf4d07c63b72.tar.bz2 |
usbaility updates a clock should be able to set the time
-rw-r--r-- | noncore/tools/clock/clock.cpp | 24 | ||||
-rw-r--r-- | noncore/tools/clock/clock.h | 1 | ||||
-rw-r--r-- | noncore/tools/clock/clock.pro | 2 |
3 files changed, 20 insertions, 7 deletions
diff --git a/noncore/tools/clock/clock.cpp b/noncore/tools/clock/clock.cpp index a21a061..ea8e8ca 100644 --- a/noncore/tools/clock/clock.cpp +++ b/noncore/tools/clock/clock.cpp | |||
@@ -18,32 +18,34 @@ | |||
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include "clock.h" | 21 | #include "clock.h" |
22 | #include "setAlarm.h" | 22 | #include "setAlarm.h" |
23 | 23 | ||
24 | #include <qpe/qpeapplication.h> | 24 | #include <qpe/qpeapplication.h> |
25 | #include <qpe/qcopenvelope_qws.h> | 25 | #include <qpe/qcopenvelope_qws.h> |
26 | #include <qpe/config.h> | 26 | #include <qpe/config.h> |
27 | #include <qpe/timestring.h> | 27 | #include <qpe/timestring.h> |
28 | #include <qpe/alarmserver.h> | 28 | #include <qpe/alarmserver.h> |
29 | #include <qpe/sound.h> | 29 | #include <qpe/sound.h> |
30 | #include <qpe/resource.h> | 30 | #include <qpe/resource.h> |
31 | #include <qsound.h> | 31 | #include <qsound.h> |
32 | #include <qtimer.h> | 32 | #include <qtimer.h> |
33 | 33 | ||
34 | #include <opie/oclickablelabel.h> | ||
35 | |||
34 | #include <qlcdnumber.h> | 36 | #include <qlcdnumber.h> |
35 | #include <qslider.h> | 37 | #include <qslider.h> |
36 | #include <qlabel.h> | 38 | #include <qlabel.h> |
37 | #include <qlayout.h> | 39 | #include <qlayout.h> |
38 | #include <qtimer.h> | 40 | #include <qtimer.h> |
39 | #include <qpushbutton.h> | 41 | #include <qpushbutton.h> |
40 | #include <qradiobutton.h> | 42 | #include <qradiobutton.h> |
41 | #include <qbuttongroup.h> | 43 | #include <qbuttongroup.h> |
42 | #include <qpainter.h> | 44 | #include <qpainter.h> |
43 | #include <qmessagebox.h> | 45 | #include <qmessagebox.h> |
44 | #include <qdatetime.h> | 46 | #include <qdatetime.h> |
45 | 47 | ||
46 | #include <math.h> | 48 | #include <math.h> |
47 | 49 | ||
48 | const double deg2rad = 0.017453292519943295769; // pi/180 | 50 | const double deg2rad = 0.017453292519943295769; // pi/180 |
49 | const int sw_prec = 2; | 51 | const int sw_prec = 2; |
@@ -79,33 +81,33 @@ Clock::Clock( QWidget * parent, const char * name, WFlags f ) | |||
79 | lcd->setFrameStyle( QFrame::NoFrame ); | 81 | lcd->setFrameStyle( QFrame::NoFrame ); |
80 | lcd->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ) ); | 82 | lcd->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ) ); |
81 | lcd->setFixedHeight( 23 ); | 83 | lcd->setFixedHeight( 23 ); |
82 | 84 | ||
83 | ampmLabel = new QLabel( tr("PM"), hb ); | 85 | ampmLabel = new QLabel( tr("PM"), hb ); |
84 | ampmLabel->setFont( QFont( "Helvetica", 14, QFont::Bold ) ); | 86 | ampmLabel->setFont( QFont( "Helvetica", 14, QFont::Bold ) ); |
85 | ampmLabel->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Preferred ) ); | 87 | ampmLabel->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Preferred ) ); |
86 | ampmLabel->setAlignment( AlignLeft | AlignBottom ); | 88 | ampmLabel->setAlignment( AlignLeft | AlignBottom ); |
87 | space = new QWidget( hb ); | 89 | space = new QWidget( hb ); |
88 | 90 | ||
89 | date = new QLabel( this ); | 91 | date = new QLabel( this ); |
90 | date->setAlignment( AlignHCenter | AlignVCenter ); | 92 | date->setAlignment( AlignHCenter | AlignVCenter ); |
91 | date->setFont( QFont( "Helvetica", 14, QFont::Bold ) ); | 93 | date->setFont( QFont( "Helvetica", 14, QFont::Bold ) ); |
92 | date->setText( TimeString::longDateString( QDate::currentDate() ) ); | 94 | date->setText( TimeString::longDateString( QDate::currentDate() ) ); |
93 | 95 | ||
94 | QWidget *controls = new QWidget( this ); | 96 | QWidget *controls = new QWidget( this ); |
95 | QGridLayout *gl = new QGridLayout( controls, 2, 2, 6, 4 ); | 97 | QGridLayout *gl = new QGridLayout( controls, 3, 2, 6, 4 ); |
96 | 98 | ||
97 | QButtonGroup *grp = new QButtonGroup( controls ); | 99 | QButtonGroup *grp = new QButtonGroup( controls ); |
98 | grp->setRadioButtonExclusive( true ); | 100 | grp->setRadioButtonExclusive( true ); |
99 | grp->hide(); | 101 | grp->hide(); |
100 | 102 | ||
101 | clockRB = new QRadioButton ( tr( "Clock" ), controls ); | 103 | clockRB = new QRadioButton ( tr( "Clock" ), controls ); |
102 | gl->addWidget( clockRB, 0, 0 ); | 104 | gl->addWidget( clockRB, 0, 0 ); |
103 | grp->insert( clockRB ); | 105 | grp->insert( clockRB ); |
104 | 106 | ||
105 | swatchRB = new QRadioButton ( tr( "Stopwatch" ), controls ); | 107 | swatchRB = new QRadioButton ( tr( "Stopwatch" ), controls ); |
106 | gl->addWidget( swatchRB, 1, 0 ); | 108 | gl->addWidget( swatchRB, 1, 0 ); |
107 | grp->insert( swatchRB ); | 109 | grp->insert( swatchRB ); |
108 | 110 | ||
109 | connect( grp, SIGNAL(clicked(int)), this, SLOT(modeSelect(int)) ); | 111 | connect( grp, SIGNAL(clicked(int)), this, SLOT(modeSelect(int)) ); |
110 | grp->setButton( 0 ); | 112 | grp->setButton( 0 ); |
111 | 113 | ||
@@ -118,32 +120,37 @@ Clock::Clock( QWidget * parent, const char * name, WFlags f ) | |||
118 | 120 | ||
119 | reset = new QPushButton ( controls ); | 121 | reset = new QPushButton ( controls ); |
120 | gl->addWidget( reset, 1, 1 ); | 122 | gl->addWidget( reset, 1, 1 ); |
121 | reset->setText( tr( "Reset" ) ); | 123 | reset->setText( tr( "Reset" ) ); |
122 | reset->setEnabled( FALSE ); | 124 | reset->setEnabled( FALSE ); |
123 | grp->insert( reset ); | 125 | grp->insert( reset ); |
124 | 126 | ||
125 | alarmOffBtn = new QPushButton ( controls ); | 127 | alarmOffBtn = new QPushButton ( controls ); |
126 | // alarmOffBtn->setMaximumSize(60,30); | 128 | // alarmOffBtn->setMaximumSize(60,30); |
127 | gl->addWidget( alarmOffBtn, 0, 2 ); | 129 | gl->addWidget( alarmOffBtn, 0, 2 ); |
128 | 130 | ||
129 | alarmBtn = new QPushButton ( controls ); | 131 | alarmBtn = new QPushButton ( controls ); |
130 | // alarmBtn->setMaximumSize(60,30); | 132 | // alarmBtn->setMaximumSize(60,30); |
131 | gl->addWidget( alarmBtn, 1, 2 ); | 133 | gl->addWidget( alarmBtn, 1, 2 ); |
132 | alarmBtn->setText( tr( "Set Alarm" ) ); | 134 | alarmBtn->setText( tr( "Set Alarm" ) ); |
133 | 135 | ||
136 | OClickableLabel *click = new OClickableLabel(controls, "label" ); | ||
137 | click->setText(tr("Set date and time." ) ); | ||
138 | gl->addMultiCellWidget( click, 3, 3, 0, 2, AlignHCenter); | ||
139 | connect( click, SIGNAL(clicked() ), this, SLOT(slotAdjustTime() ) ); | ||
140 | |||
134 | connect( set, SIGNAL( pressed() ), SLOT( slotSet() ) ); | 141 | connect( set, SIGNAL( pressed() ), SLOT( slotSet() ) ); |
135 | connect( reset, SIGNAL( clicked() ), SLOT( slotReset() ) ); | 142 | connect( reset, SIGNAL( clicked() ), SLOT( slotReset() ) ); |
136 | 143 | ||
137 | connect( alarmBtn, SIGNAL( clicked() ), SLOT( slotSetAlarm() ) ); | 144 | connect( alarmBtn, SIGNAL( clicked() ), SLOT( slotSetAlarm() ) ); |
138 | connect( snoozeBtn, SIGNAL( clicked() ), SLOT( slotSnooze() ) ); | 145 | connect( snoozeBtn, SIGNAL( clicked() ), SLOT( slotSnooze() ) ); |
139 | connect( alarmOffBtn, SIGNAL( clicked() ), SLOT( slotToggleAlarm() ) ); | 146 | connect( alarmOffBtn, SIGNAL( clicked() ), SLOT( slotToggleAlarm() ) ); |
140 | 147 | ||
141 | connect( qApp, SIGNAL(appMessage(const QCString&, const QByteArray&)), | 148 | connect( qApp, SIGNAL(appMessage(const QCString&, const QByteArray&)), |
142 | this, SLOT(appMessage(const QCString&, const QByteArray&)) ); | 149 | this, SLOT(appMessage(const QCString&, const QByteArray&)) ); |
143 | 150 | ||
144 | t = new QTimer( this ); | 151 | t = new QTimer( this ); |
145 | connect( t, SIGNAL( timeout() ), SLOT( updateClock() ) ); | 152 | connect( t, SIGNAL( timeout() ), SLOT( updateClock() ) ); |
146 | t->start( 1000 ); | 153 | t->start( 1000 ); |
147 | 154 | ||
148 | connect( qApp, SIGNAL( timeChanged() ), SLOT( updateClock() ) ); | 155 | connect( qApp, SIGNAL( timeChanged() ), SLOT( updateClock() ) ); |
149 | 156 | ||
@@ -154,50 +161,50 @@ Clock::Clock( QWidget * parent, const char * name, WFlags f ) | |||
154 | 161 | ||
155 | QString tmp = config.readEntry("clockAlarmHour", ""); | 162 | QString tmp = config.readEntry("clockAlarmHour", ""); |
156 | bool ok; | 163 | bool ok; |
157 | hour = tmp.toInt(&ok,10); | 164 | hour = tmp.toInt(&ok,10); |
158 | tmp = config.readEntry("clockAlarmMinute",""); | 165 | tmp = config.readEntry("clockAlarmMinute",""); |
159 | minute = tmp.toInt(&ok,10); | 166 | minute = tmp.toInt(&ok,10); |
160 | 167 | ||
161 | if( config.readEntry("clockAlarmSet","FALSE") == "TRUE") { | 168 | if( config.readEntry("clockAlarmSet","FALSE") == "TRUE") { |
162 | alarmOffBtn->setText( tr( "Alarm Is On" ) ); | 169 | alarmOffBtn->setText( tr( "Alarm Is On" ) ); |
163 | alarmBool=TRUE; | 170 | alarmBool=TRUE; |
164 | snoozeBtn->show(); | 171 | snoozeBtn->show(); |
165 | } else { | 172 | } else { |
166 | alarmOffBtn->setText( tr( "Alarm Is Off" ) ); | 173 | alarmOffBtn->setText( tr( "Alarm Is Off" ) ); |
167 | alarmBool=FALSE; | 174 | alarmBool=FALSE; |
168 | snoozeBtn->hide(); | 175 | snoozeBtn->hide(); |
169 | } | 176 | } |
170 | 177 | ||
171 | QTimer::singleShot( 0, this, SLOT(updateClock()) ); | 178 | QTimer::singleShot( 0, this, SLOT(updateClock()) ); |
172 | modeSelect(0); | 179 | modeSelect(0); |
173 | } | 180 | } |
174 | 181 | ||
175 | Clock::~Clock() | 182 | Clock::~Clock() |
176 | { | 183 | { |
177 | toggleScreenSaver( true ); | 184 | toggleScreenSaver( true ); |
178 | } | 185 | } |
179 | 186 | ||
180 | void Clock::updateClock() | 187 | void Clock::updateClock() |
181 | { | 188 | { |
182 | if ( clockRB->isChecked() ) { | 189 | if ( clockRB->isChecked() ) { |
183 | QTime tm = QDateTime::currentDateTime().time(); | 190 | QTime tm = QDateTime::currentDateTime().time(); |
184 | QString s; | 191 | QString s; |
185 | if ( ampm ) { | 192 | if ( ampm ) { |
186 | int hour = tm.hour(); | 193 | int hour = tm.hour(); |
187 | if (hour == 0) | 194 | if (hour == 0) |
188 | hour = 12; | 195 | hour = 12; |
189 | if (hour > 12) | 196 | if (hour > 12) |
190 | hour -= 12; | 197 | hour -= 12; |
191 | s.sprintf( "%2d%c%02d", hour, ':', tm.minute() ); | 198 | s.sprintf( "%2d%c%02d", hour, ':', tm.minute() ); |
192 | ampmLabel->setText( (tm.hour() >= 12) ? "PM" : "AM" ); | 199 | ampmLabel->setText( (tm.hour() >= 12) ? "PM" : "AM" ); |
193 | ampmLabel->show(); | 200 | ampmLabel->show(); |
194 | } else { | 201 | } else { |
195 | s.sprintf( "%2d%c%02d", tm.hour(), ':', tm.minute() ); | 202 | s.sprintf( "%2d%c%02d", tm.hour(), ':', tm.minute() ); |
196 | ampmLabel->hide(); | 203 | ampmLabel->hide(); |
197 | } | 204 | } |
198 | lcd->display( s ); | 205 | lcd->display( s ); |
199 | lcd->repaint( FALSE ); | 206 | lcd->repaint( FALSE ); |
200 | aclock->display( QTime::currentTime() ); | 207 | aclock->display( QTime::currentTime() ); |
201 | date->setText( TimeString::longDateString( QDate::currentDate() ) ); | 208 | date->setText( TimeString::longDateString( QDate::currentDate() ) ); |
202 | } else { | 209 | } else { |
203 | QTime swatch_time; | 210 | QTime swatch_time; |
@@ -268,72 +275,72 @@ void Clock::modeSelect( int m ) | |||
268 | reset->setEnabled( TRUE ); | 275 | reset->setEnabled( TRUE ); |
269 | ampmLabel->hide(); | 276 | ampmLabel->hide(); |
270 | 277 | ||
271 | if ( !swatch_running ) | 278 | if ( !swatch_running ) |
272 | t->stop(); | 279 | t->stop(); |
273 | } else { | 280 | } else { |
274 | lcd->setNumDigits( 5 ); | 281 | lcd->setNumDigits( 5 ); |
275 | lcd->setMinimumWidth( lcd->sizeHint().width() ); | 282 | lcd->setMinimumWidth( lcd->sizeHint().width() ); |
276 | set->setEnabled( FALSE ); | 283 | set->setEnabled( FALSE ); |
277 | reset->setEnabled( FALSE ); | 284 | reset->setEnabled( FALSE ); |
278 | t->start(1000); | 285 | t->start(1000); |
279 | } | 286 | } |
280 | updateClock(); | 287 | updateClock(); |
281 | } | 288 | } |
282 | 289 | ||
283 | //this sets the alarm time | 290 | //this sets the alarm time |
284 | void Clock::slotSetAlarm() | 291 | void Clock::slotSetAlarm() |
285 | { | 292 | { |
286 | if( !snoozeBtn->isHidden()) | 293 | if( !snoozeBtn->isHidden()) |
287 | slotToggleAlarm(); | 294 | slotToggleAlarm(); |
288 | Set_Alarm *setAlarmDlg; | 295 | Set_Alarm *setAlarmDlg; |
289 | setAlarmDlg = new Set_Alarm(this,"SetAlarm", TRUE); | 296 | setAlarmDlg = new Set_Alarm(this,"SetAlarm", TRUE); |
290 | int result = setAlarmDlg->exec(); | 297 | int result = setAlarmDlg->exec(); |
291 | if(result == 1) { | 298 | if(result == 1) { |
292 | Config config( "qpe" ); | 299 | Config config( "qpe" ); |
293 | config.setGroup("Time"); | 300 | config.setGroup("Time"); |
294 | QString tmp; | 301 | QString tmp; |
295 | hour = setAlarmDlg->Hour_Slider->value(); | 302 | hour = setAlarmDlg->Hour_Slider->value(); |
296 | minute = setAlarmDlg->Minute_Slider->value(); | 303 | minute = setAlarmDlg->Minute_Slider->value(); |
297 | snoozeTime=setAlarmDlg->SnoozeSlider->value(); | 304 | snoozeTime=setAlarmDlg->SnoozeSlider->value(); |
298 | if(ampm) { | 305 | if(ampm) { |
299 | if(setAlarmDlg->Pm_RadioButton->isChecked() && hour < 12 ) | 306 | if(setAlarmDlg->Pm_RadioButton->isChecked() && hour < 12 ) |
300 | hour+=12; | 307 | hour+=12; |
301 | } | 308 | } |
302 | config.writeEntry("clockAlarmHour", tmp.setNum( hour ),10); | 309 | config.writeEntry("clockAlarmHour", tmp.setNum( hour ),10); |
303 | config.writeEntry("clockAlarmMinute",tmp.setNum( minute ),10); | 310 | config.writeEntry("clockAlarmMinute",tmp.setNum( minute ),10); |
304 | config.writeEntry("clockAlarmSnooze",tmp.setNum( snoozeTime ),10); | 311 | config.writeEntry("clockAlarmSnooze",tmp.setNum( snoozeTime ),10); |
305 | config.write(); | 312 | config.write(); |
306 | } | 313 | } |
307 | } | 314 | } |
308 | 315 | ||
309 | void Clock::slotSnooze() | 316 | void Clock::slotSnooze() |
310 | { | 317 | { |
311 | bSound=FALSE; | 318 | bSound=FALSE; |
312 | int warn; | 319 | int warn; |
313 | QTime t = QTime::currentTime(); | 320 | QTime t = QTime::currentTime(); |
314 | QDateTime whenl( when.date(), t.addSecs( snoozeTime*60)); | 321 | QDateTime whenl( when.date(), t.addSecs( snoozeTime*60)); |
315 | when=whenl; | 322 | when=whenl; |
316 | AlarmServer::addAlarm( when, | 323 | AlarmServer::addAlarm( when, |
317 | "QPE/Application/clock", | 324 | "QPE/Application/clock", |
318 | "alarm(QDateTime,int)", warn ); | 325 | "alarm(QDateTime,int)", warn ); |
319 | 326 | ||
320 | } | 327 | } |
321 | 328 | ||
322 | //toggles alarm on/off | 329 | //toggles alarm on/off |
323 | void Clock::slotToggleAlarm() | 330 | void Clock::slotToggleAlarm() |
324 | { | 331 | { |
325 | Config config( "qpe" ); | 332 | Config config( "qpe" ); |
326 | config.setGroup("Time"); | 333 | config.setGroup("Time"); |
327 | if(alarmBool) { | 334 | if(alarmBool) { |
328 | config.writeEntry("clockAlarmSet","FALSE"); | 335 | config.writeEntry("clockAlarmSet","FALSE"); |
329 | alarmOffBtn->setText( tr( "Alarm Is Off" ) ); | 336 | alarmOffBtn->setText( tr( "Alarm Is Off" ) ); |
330 | snoozeBtn->hide(); | 337 | snoozeBtn->hide(); |
331 | alarmBool=FALSE; | 338 | alarmBool=FALSE; |
332 | alarmOff(); | 339 | alarmOff(); |
333 | } else { | 340 | } else { |
334 | config.writeEntry("clockAlarmSet","TRUE"); | 341 | config.writeEntry("clockAlarmSet","TRUE"); |
335 | alarmOffBtn->setText( tr( "Alarm Is On" ) ); | 342 | alarmOffBtn->setText( tr( "Alarm Is On" ) ); |
336 | snoozeBtn->show(); | 343 | snoozeBtn->show(); |
337 | alarmBool=TRUE; | 344 | alarmBool=TRUE; |
338 | alarmOn(); | 345 | alarmOn(); |
339 | } | 346 | } |
@@ -461,16 +468,21 @@ void AnalogClock::display( const QTime& t ) | |||
461 | currTime = t; | 468 | currTime = t; |
462 | clear = true; | 469 | clear = true; |
463 | repaint( false ); | 470 | repaint( false ); |
464 | clear = false; | 471 | clear = false; |
465 | repaint( false ); | 472 | repaint( false ); |
466 | } | 473 | } |
467 | 474 | ||
468 | QPoint AnalogClock::rotate( QPoint c, QPoint p, int a ) | 475 | QPoint AnalogClock::rotate( QPoint c, QPoint p, int a ) |
469 | { | 476 | { |
470 | double angle = deg2rad * ( - a + 180 ); | 477 | double angle = deg2rad * ( - a + 180 ); |
471 | double nx = c.x() - ( p.x() - c.x() ) * cos( angle ) - | 478 | double nx = c.x() - ( p.x() - c.x() ) * cos( angle ) - |
472 | ( p.y() - c.y() ) * sin( angle ); | 479 | ( p.y() - c.y() ) * sin( angle ); |
473 | double ny = c.y() - ( p.y() - c.y() ) * cos( angle ) + | 480 | double ny = c.y() - ( p.y() - c.y() ) * cos( angle ) + |
474 | ( p.x() - c.x() ) * sin( angle ); | 481 | ( p.x() - c.x() ) * sin( angle ); |
475 | return QPoint( nx, ny ); | 482 | return QPoint( nx, ny ); |
476 | } | 483 | } |
484 | void Clock::slotAdjustTime() | ||
485 | { | ||
486 | QCopEnvelope e("QPE/System", "execute(QString)"); | ||
487 | e << QString("systemtime"); | ||
488 | } | ||
diff --git a/noncore/tools/clock/clock.h b/noncore/tools/clock/clock.h index 9b756b5..024dd28 100644 --- a/noncore/tools/clock/clock.h +++ b/noncore/tools/clock/clock.h | |||
@@ -63,32 +63,33 @@ public: | |||
63 | QDateTime when; | 63 | QDateTime when; |
64 | bool bSound; | 64 | bool bSound; |
65 | int hour, minute, snoozeTime; | 65 | int hour, minute, snoozeTime; |
66 | private slots: | 66 | private slots: |
67 | void slotSet(); | 67 | void slotSet(); |
68 | void slotReset(); | 68 | void slotReset(); |
69 | void modeSelect(int); | 69 | void modeSelect(int); |
70 | void updateClock(); | 70 | void updateClock(); |
71 | void changeClock( bool ); | 71 | void changeClock( bool ); |
72 | void slotSetAlarm(); | 72 | void slotSetAlarm(); |
73 | void slotSnooze(); | 73 | void slotSnooze(); |
74 | void slotToggleAlarm(); | 74 | void slotToggleAlarm(); |
75 | void alarmOn(); | 75 | void alarmOn(); |
76 | void alarmOff(); | 76 | void alarmOff(); |
77 | void appMessage(const QCString& msg, const QByteArray& data); | 77 | void appMessage(const QCString& msg, const QByteArray& data); |
78 | void timerEvent( QTimerEvent *e ); | 78 | void timerEvent( QTimerEvent *e ); |
79 | void slotAdjustTime(); | ||
79 | 80 | ||
80 | private: | 81 | private: |
81 | void clearClock(); | 82 | void clearClock(); |
82 | 83 | ||
83 | bool alarmBool; | 84 | bool alarmBool; |
84 | QTimer *t; | 85 | QTimer *t; |
85 | QLCDNumber *lcd; | 86 | QLCDNumber *lcd; |
86 | QLabel *date; | 87 | QLabel *date; |
87 | QLabel *ampmLabel; | 88 | QLabel *ampmLabel; |
88 | QPushButton *set, *reset, *alarmBtn, *snoozeBtn, *alarmOffBtn; | 89 | QPushButton *set, *reset, *alarmBtn, *snoozeBtn, *alarmOffBtn; |
89 | QRadioButton *clockRB, *swatchRB; | 90 | QRadioButton *clockRB, *swatchRB; |
90 | AnalogClock *aclock; | 91 | AnalogClock *aclock; |
91 | QTime swatch_start; | 92 | QTime swatch_start; |
92 | int swatch_totalms; | 93 | int swatch_totalms; |
93 | bool swatch_running; | 94 | bool swatch_running; |
94 | bool ampm; | 95 | bool ampm; |
diff --git a/noncore/tools/clock/clock.pro b/noncore/tools/clock/clock.pro index 5373515..7eecce1 100644 --- a/noncore/tools/clock/clock.pro +++ b/noncore/tools/clock/clock.pro | |||
@@ -1,24 +1,24 @@ | |||
1 | TEMPLATE = app | 1 | TEMPLATE = app |
2 | CONFIG = qt warn_on release | 2 | CONFIG = qt warn_on release |
3 | DESTDIR = $(OPIEDIR)/bin | 3 | DESTDIR = $(OPIEDIR)/bin |
4 | HEADERS = clock.h setAlarm.h | 4 | HEADERS = clock.h setAlarm.h |
5 | SOURCES = clock.cpp setAlarm.cpp \ | 5 | SOURCES = clock.cpp setAlarm.cpp \ |
6 | main.cpp | 6 | main.cpp |
7 | INCLUDEPATH += $(OPIEDIR)/include | 7 | INCLUDEPATH += $(OPIEDIR)/include |
8 | DEPENDPATH += $(OPIEDIR)/include | 8 | DEPENDPATH += $(OPIEDIR)/include |
9 | LIBS += -lqpe | 9 | LIBS += -lqpe -lopie |
10 | INTERFACES = | 10 | INTERFACES = |
11 | TARGET = clock | 11 | TARGET = clock |
12 | 12 | ||
13 | TRANSLATIONS = ../i18n/de/clock.ts | 13 | TRANSLATIONS = ../i18n/de/clock.ts |
14 | TRANSLATIONS += ../i18n/pt_BR/clock.ts | 14 | TRANSLATIONS += ../i18n/pt_BR/clock.ts |
15 | TRANSLATIONS += ../i18n/en/clock.ts | 15 | TRANSLATIONS += ../i18n/en/clock.ts |
16 | TRANSLATIONS += ../i18n/hu/clock.ts | 16 | TRANSLATIONS += ../i18n/hu/clock.ts |
17 | TRANSLATIONS += ../i18n/sl/clock.ts | 17 | TRANSLATIONS += ../i18n/sl/clock.ts |
18 | TRANSLATIONS += ../i18n/ja/clock.ts | 18 | TRANSLATIONS += ../i18n/ja/clock.ts |
19 | TRANSLATIONS += ../i18n/ko/clock.ts | 19 | TRANSLATIONS += ../i18n/ko/clock.ts |
20 | TRANSLATIONS += ../i18n/fr/clock.ts | 20 | TRANSLATIONS += ../i18n/fr/clock.ts |
21 | TRANSLATIONS += ../i18n/pl/clock.ts | 21 | TRANSLATIONS += ../i18n/pl/clock.ts |
22 | TRANSLATIONS += ../i18n/no/clock.ts | 22 | TRANSLATIONS += ../i18n/no/clock.ts |
23 | TRANSLATIONS += ../i18n/zh_CN/clock.ts | 23 | TRANSLATIONS += ../i18n/zh_CN/clock.ts |
24 | TRANSLATIONS += ../i18n/zh_TW/clock.ts | 24 | TRANSLATIONS += ../i18n/zh_TW/clock.ts |