summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-05-31 13:00:05 (UTC)
committer llornkcor <llornkcor>2002-05-31 13:00:05 (UTC)
commit075f2ae74f328581ec0db05d633961f3baa5ed36 (patch) (unidiff)
tree370eb2838813a9fa2aaf47e32f6e711dd2a8f36e
parentdd08e7fa2ccbcc0489c17ed305b20a9a7d187161 (diff)
downloadopie-075f2ae74f328581ec0db05d633961f3baa5ed36.zip
opie-075f2ae74f328581ec0db05d633961f3baa5ed36.tar.gz
opie-075f2ae74f328581ec0db05d633961f3baa5ed36.tar.bz2
added clock to popup if closed before app gets alarm message
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/tools/clock/clock.cpp11
-rw-r--r--noncore/tools/clock/clock.h1
2 files changed, 9 insertions, 3 deletions
diff --git a/noncore/tools/clock/clock.cpp b/noncore/tools/clock/clock.cpp
index 0a21146..9b9e644 100644
--- a/noncore/tools/clock/clock.cpp
+++ b/noncore/tools/clock/clock.cpp
@@ -16,8 +16,9 @@
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20// changes 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"
23 24
@@ -65,8 +66,9 @@ Clock::Clock( QWidget * parent, const char * name, WFlags f )
65 Config config( "qpe" ); 66 Config config( "qpe" );
66 config.setGroup("Time"); 67 config.setGroup("Time");
67 ampm = config.readBoolEntry( "AMPM", TRUE ); 68 ampm = config.readBoolEntry( "AMPM", TRUE );
68 69
70
69 snoozeBtn = new QPushButton ( this); 71 snoozeBtn = new QPushButton ( this);
70 snoozeBtn->setText( tr( "Snooze" ) ); 72 snoozeBtn->setText( tr( "Snooze" ) );
71 73
72 aclock = new AnalogClock( this ); 74 aclock = new AnalogClock( this );
@@ -379,12 +381,17 @@ void Clock::appMessage(const QCString& msg, const QByteArray& data)
379{ 381{
380 int stopTimer = 0; 382 int stopTimer = 0;
381 int timerStay = 5000; 383 int timerStay = 5000;
382 bSound=TRUE; 384 bSound=TRUE;
385 qDebug("Message received in clock");
383 if ( msg == "alarm(QDateTime,int)" ) { 386 if ( msg == "alarm(QDateTime,int)" ) {
384 Sound::soundAlarm(); 387 Sound::soundAlarm();
385 stopTimer = startTimer( timerStay); 388 stopTimer = startTimer( timerStay);
386 } 389 }
390 show();
391 raise();
392 QPEApplication::setKeepRunning();
393 setActiveWindow();
387} 394}
388 395
389void Clock::timerEvent( QTimerEvent *e ) 396void Clock::timerEvent( QTimerEvent *e )
390{ 397{
@@ -484,9 +491,9 @@ QPoint AnalogClock::rotate( QPoint c, QPoint p, int a )
484 double ny = c.y() - ( p.y() - c.y() ) * cos( angle ) + 491 double ny = c.y() - ( p.y() - c.y() ) * cos( angle ) +
485 ( p.x() - c.x() ) * sin( angle ); 492 ( p.x() - c.x() ) * sin( angle );
486 return QPoint( nx, ny ); 493 return QPoint( nx, ny );
487} 494}
488void Clock::slotAdjustTime() 495
489{ 496void Clock::slotAdjustTime() {
490 QCopEnvelope e("QPE/System", "execute(QString)"); 497 QCopEnvelope e("QPE/System", "execute(QString)");
491 e << QString("systemtime"); 498 e << QString("systemtime");
492} 499}
diff --git a/noncore/tools/clock/clock.h b/noncore/tools/clock/clock.h
index 024dd28..be71b9d 100644
--- a/noncore/tools/clock/clock.h
+++ b/noncore/tools/clock/clock.h
@@ -76,9 +76,8 @@ 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
81private: 80private:
82 void clearClock(); 81 void clearClock();
83 82
84 bool alarmBool; 83 bool alarmBool;