author | llornkcor <llornkcor> | 2002-05-31 00:54:13 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-05-31 00:54:13 (UTC) |
commit | 460454a3a117afafde6094da6a4e12625f880908 (patch) (unidiff) | |
tree | 3a362f6eb5dbeec3f92e9a5e1c65e0c0ea94b012 | |
parent | 294fecd1c15c4940bdab8566e5afaee9f305abb6 (diff) | |
download | opie-460454a3a117afafde6094da6a4e12625f880908.zip opie-460454a3a117afafde6094da6a4e12625f880908.tar.gz opie-460454a3a117afafde6094da6a4e12625f880908.tar.bz2 |
lengthened time of alarm sounding, removed nag screen and put alarm info into caption
-rw-r--r-- | noncore/tools/clock/clock.cpp | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/noncore/tools/clock/clock.cpp b/noncore/tools/clock/clock.cpp index ea8e8ca..a85cc19 100644 --- a/noncore/tools/clock/clock.cpp +++ b/noncore/tools/clock/clock.cpp | |||
@@ -17,6 +17,7 @@ | |||
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 | ||
20 | 21 | ||
21 | #include "clock.h" | 22 | #include "clock.h" |
22 | #include "setAlarm.h" | 23 | #include "setAlarm.h" |
@@ -31,8 +32,6 @@ | |||
31 | #include <qsound.h> | 32 | #include <qsound.h> |
32 | #include <qtimer.h> | 33 | #include <qtimer.h> |
33 | 34 | ||
34 | #include <opie/oclickablelabel.h> | ||
35 | |||
36 | #include <qlcdnumber.h> | 35 | #include <qlcdnumber.h> |
37 | #include <qslider.h> | 36 | #include <qslider.h> |
38 | #include <qlabel.h> | 37 | #include <qlabel.h> |
@@ -94,7 +93,7 @@ Clock::Clock( QWidget * parent, const char * name, WFlags f ) | |||
94 | date->setText( TimeString::longDateString( QDate::currentDate() ) ); | 93 | date->setText( TimeString::longDateString( QDate::currentDate() ) ); |
95 | 94 | ||
96 | QWidget *controls = new QWidget( this ); | 95 | QWidget *controls = new QWidget( this ); |
97 | QGridLayout *gl = new QGridLayout( controls, 3, 2, 6, 4 ); | 96 | QGridLayout *gl = new QGridLayout( controls, 2, 2, 6, 4 ); |
98 | 97 | ||
99 | QButtonGroup *grp = new QButtonGroup( controls ); | 98 | QButtonGroup *grp = new QButtonGroup( controls ); |
100 | grp->setRadioButtonExclusive( true ); | 99 | grp->setRadioButtonExclusive( true ); |
@@ -133,11 +132,6 @@ Clock::Clock( QWidget * parent, const char * name, WFlags f ) | |||
133 | gl->addWidget( alarmBtn, 1, 2 ); | 132 | gl->addWidget( alarmBtn, 1, 2 ); |
134 | alarmBtn->setText( tr( "Set Alarm" ) ); | 133 | alarmBtn->setText( tr( "Set Alarm" ) ); |
135 | 134 | ||
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 | |||
141 | connect( set, SIGNAL( pressed() ), SLOT( slotSet() ) ); | 135 | connect( set, SIGNAL( pressed() ), SLOT( slotSet() ) ); |
142 | connect( reset, SIGNAL( clicked() ), SLOT( slotReset() ) ); | 136 | connect( reset, SIGNAL( clicked() ), SLOT( slotReset() ) ); |
143 | 137 | ||
@@ -361,7 +355,7 @@ void Clock::alarmOn() | |||
361 | AlarmServer::addAlarm( when, | 355 | AlarmServer::addAlarm( when, |
362 | "QPE/Application/clock", | 356 | "QPE/Application/clock", |
363 | "alarm(QDateTime,int)", warn ); | 357 | "alarm(QDateTime,int)", warn ); |
364 | QMessageBox::message("Note","Alarm is set for:\n"+ whenl.toString()); | 358 | setCaption("Alarm set: "+ whenl.toString()); |
365 | } | 359 | } |
366 | 360 | ||
367 | void Clock::alarmOff() | 361 | void Clock::alarmOff() |
@@ -372,7 +366,7 @@ void Clock::alarmOff() | |||
372 | "QPE/Application/clock", | 366 | "QPE/Application/clock", |
373 | "alarm(QDateTime,int)", warn ); | 367 | "alarm(QDateTime,int)", warn ); |
374 | qDebug("Alarm Off "+ when.toString()); | 368 | qDebug("Alarm Off "+ when.toString()); |
375 | 369 | setCaption("Clock"); | |
376 | } | 370 | } |
377 | 371 | ||
378 | void Clock::appMessage(const QCString& msg, const QByteArray& data) | 372 | void Clock::appMessage(const QCString& msg, const QByteArray& data) |
@@ -389,12 +383,16 @@ void Clock::appMessage(const QCString& msg, const QByteArray& data) | |||
389 | void Clock::timerEvent( QTimerEvent *e ) | 383 | void Clock::timerEvent( QTimerEvent *e ) |
390 | { | 384 | { |
391 | static int stop = 0; | 385 | static int stop = 0; |
392 | if ( stop < 10 && bSound) { | 386 | if ( stop < 120 && bSound) { |
393 | Sound::soundAlarm(); | 387 | Sound::soundAlarm(); |
394 | stop++; | 388 | stop++; |
395 | } else { | 389 | } else { |
396 | stop = 0; | 390 | stop = 0; |
397 | killTimer( e->timerId() ); | 391 | killTimer( e->timerId() ); |
392 | alarmOffBtn->setText( tr( "Alarm Is Off" ) ); | ||
393 | alarmBool=FALSE; | ||
394 | snoozeBtn->hide(); | ||
395 | setCaption("Clock: Alarm was missed."); | ||
398 | } | 396 | } |
399 | } | 397 | } |
400 | 398 | ||
@@ -481,8 +479,3 @@ QPoint AnalogClock::rotate( QPoint c, QPoint p, int a ) | |||
481 | ( p.x() - c.x() ) * sin( angle ); | 479 | ( p.x() - c.x() ) * sin( angle ); |
482 | return QPoint( nx, ny ); | 480 | return QPoint( nx, ny ); |
483 | } | 481 | } |
484 | void Clock::slotAdjustTime() | ||
485 | { | ||
486 | QCopEnvelope e("QPE/System", "execute(QString)"); | ||
487 | e << QString("systemtime"); | ||
488 | } | ||