-rw-r--r-- | noncore/tools/clock/clock.cpp | 11 | ||||
-rw-r--r-- | noncore/tools/clock/clock.h | 1 |
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 @@ -14,12 +14,13 @@ ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ +// changes added and Copyright (C) by L. J. Potter <ljp@llornkcor.com> 2002 #include "clock.h" #include "setAlarm.h" #include <qpe/qpeapplication.h> #include <qpe/qcopenvelope_qws.h> @@ -63,12 +64,13 @@ Clock::Clock( QWidget * parent, const char * name, WFlags f ) setMargin( 1 ); Config config( "qpe" ); config.setGroup("Time"); ampm = config.readBoolEntry( "AMPM", TRUE ); + snoozeBtn = new QPushButton ( this); snoozeBtn->setText( tr( "Snooze" ) ); aclock = new AnalogClock( this ); aclock->display( QTime::currentTime() ); aclock->setLineWidth( 2 ); @@ -377,16 +379,21 @@ void Clock::alarmOff() void Clock::appMessage(const QCString& msg, const QByteArray& data) { int stopTimer = 0; int timerStay = 5000; bSound=TRUE; + qDebug("Message received in clock"); if ( msg == "alarm(QDateTime,int)" ) { Sound::soundAlarm(); stopTimer = startTimer( timerStay); } + show(); + raise(); + QPEApplication::setKeepRunning(); + setActiveWindow(); } void Clock::timerEvent( QTimerEvent *e ) { static int stop = 0; if ( stop < 120 && bSound) { @@ -482,11 +489,11 @@ QPoint AnalogClock::rotate( QPoint c, QPoint p, int a ) double nx = c.x() - ( p.x() - c.x() ) * cos( angle ) - ( p.y() - c.y() ) * sin( angle ); double ny = c.y() - ( p.y() - c.y() ) * cos( angle ) + ( p.x() - c.x() ) * sin( angle ); return QPoint( nx, ny ); } -void Clock::slotAdjustTime() -{ + +void Clock::slotAdjustTime() { QCopEnvelope e("QPE/System", "execute(QString)"); e << QString("systemtime"); } 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 @@ -74,13 +74,12 @@ private slots: void slotToggleAlarm(); void alarmOn(); void alarmOff(); void appMessage(const QCString& msg, const QByteArray& data); void timerEvent( QTimerEvent *e ); void slotAdjustTime(); - private: void clearClock(); bool alarmBool; QTimer *t; QLCDNumber *lcd; |