-rw-r--r-- | noncore/tools/clock/clock.cpp | 21 | ||||
-rw-r--r-- | noncore/tools/clock/clock.h | 2 |
2 files changed, 17 insertions, 6 deletions
diff --git a/noncore/tools/clock/clock.cpp b/noncore/tools/clock/clock.cpp index a85cc19..0a21146 100644 --- a/noncore/tools/clock/clock.cpp +++ b/noncore/tools/clock/clock.cpp | |||
@@ -17,7 +17,6 @@ | |||
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | // code added and Copyright (C) by L. J. Potter <ljp@llornkcor.com> 2002 | ||
21 | 20 | ||
22 | #include "clock.h" | 21 | #include "clock.h" |
23 | #include "setAlarm.h" | 22 | #include "setAlarm.h" |
@@ -32,6 +31,8 @@ | |||
32 | #include <qsound.h> | 31 | #include <qsound.h> |
33 | #include <qtimer.h> | 32 | #include <qtimer.h> |
34 | 33 | ||
34 | #include <opie/oclickablelabel.h> | ||
35 | |||
35 | #include <qlcdnumber.h> | 36 | #include <qlcdnumber.h> |
36 | #include <qslider.h> | 37 | #include <qslider.h> |
37 | #include <qlabel.h> | 38 | #include <qlabel.h> |
@@ -93,7 +94,7 @@ Clock::Clock( QWidget * parent, const char * name, WFlags f ) | |||
93 | date->setText( TimeString::longDateString( QDate::currentDate() ) ); | 94 | date->setText( TimeString::longDateString( QDate::currentDate() ) ); |
94 | 95 | ||
95 | QWidget *controls = new QWidget( this ); | 96 | QWidget *controls = new QWidget( this ); |
96 | QGridLayout *gl = new QGridLayout( controls, 2, 2, 6, 4 ); | 97 | QGridLayout *gl = new QGridLayout( controls, 3, 2, 6, 4 ); |
97 | 98 | ||
98 | QButtonGroup *grp = new QButtonGroup( controls ); | 99 | QButtonGroup *grp = new QButtonGroup( controls ); |
99 | grp->setRadioButtonExclusive( true ); | 100 | grp->setRadioButtonExclusive( true ); |
@@ -132,6 +133,11 @@ Clock::Clock( QWidget * parent, const char * name, WFlags f ) | |||
132 | gl->addWidget( alarmBtn, 1, 2 ); | 133 | gl->addWidget( alarmBtn, 1, 2 ); |
133 | alarmBtn->setText( tr( "Set Alarm" ) ); | 134 | alarmBtn->setText( tr( "Set Alarm" ) ); |
134 | 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 | |||
135 | connect( set, SIGNAL( pressed() ), SLOT( slotSet() ) ); | 141 | connect( set, SIGNAL( pressed() ), SLOT( slotSet() ) ); |
136 | connect( reset, SIGNAL( clicked() ), SLOT( slotReset() ) ); | 142 | connect( reset, SIGNAL( clicked() ), SLOT( slotReset() ) ); |
137 | 143 | ||
@@ -310,7 +316,7 @@ void Clock::slotSetAlarm() | |||
310 | void Clock::slotSnooze() | 316 | void Clock::slotSnooze() |
311 | { | 317 | { |
312 | bSound=FALSE; | 318 | bSound=FALSE; |
313 | int warn; | 319 | int warn = 0; |
314 | QTime t = QTime::currentTime(); | 320 | QTime t = QTime::currentTime(); |
315 | QDateTime whenl( when.date(), t.addSecs( snoozeTime*60)); | 321 | QDateTime whenl( when.date(), t.addSecs( snoozeTime*60)); |
316 | when=whenl; | 322 | when=whenl; |
@@ -349,7 +355,7 @@ void Clock::alarmOn() | |||
349 | QTime t = QTime::currentTime(); | 355 | QTime t = QTime::currentTime(); |
350 | if( t > tm) | 356 | if( t > tm) |
351 | d = d.addDays(1); | 357 | d = d.addDays(1); |
352 | int warn; | 358 | int warn = 0; |
353 | QDateTime whenl(d,tm); | 359 | QDateTime whenl(d,tm); |
354 | when=whenl; | 360 | when=whenl; |
355 | AlarmServer::addAlarm( when, | 361 | AlarmServer::addAlarm( when, |
@@ -360,7 +366,7 @@ void Clock::alarmOn() | |||
360 | 366 | ||
361 | void Clock::alarmOff() | 367 | void Clock::alarmOff() |
362 | { | 368 | { |
363 | int warn; | 369 | int warn = 0; |
364 | bSound=FALSE; | 370 | bSound=FALSE; |
365 | AlarmServer::deleteAlarm( when, | 371 | AlarmServer::deleteAlarm( when, |
366 | "QPE/Application/clock", | 372 | "QPE/Application/clock", |
@@ -479,3 +485,8 @@ QPoint AnalogClock::rotate( QPoint c, QPoint p, int a ) | |||
479 | ( p.x() - c.x() ) * sin( angle ); | 485 | ( p.x() - c.x() ) * sin( angle ); |
480 | return QPoint( nx, ny ); | 486 | return QPoint( nx, ny ); |
481 | } | 487 | } |
488 | void Clock::slotAdjustTime() | ||
489 | { | ||
490 | QCopEnvelope e("QPE/System", "execute(QString)"); | ||
491 | e << QString("systemtime"); | ||
492 | } | ||
diff --git a/noncore/tools/clock/clock.h b/noncore/tools/clock/clock.h index e5ed13c..024dd28 100644 --- a/noncore/tools/clock/clock.h +++ b/noncore/tools/clock/clock.h | |||
@@ -76,7 +76,7 @@ private slots: | |||
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 | void slotAdjustTime(); |
80 | 80 | ||
81 | private: | 81 | private: |
82 | void clearClock(); | 82 | void clearClock(); |