author | llornkcor <llornkcor> | 2002-05-31 12:12:02 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-05-31 12:12:02 (UTC) |
commit | dd08e7fa2ccbcc0489c17ed305b20a9a7d187161 (patch) (side-by-side diff) | |
tree | 59399ddb7c89ad178c85e576018db9471d292b52 /noncore | |
parent | 40eac37ff82dd4499a95adb786eb063fd0b81584 (diff) | |
download | opie-dd08e7fa2ccbcc0489c17ed305b20a9a7d187161.zip opie-dd08e7fa2ccbcc0489c17ed305b20a9a7d187161.tar.gz opie-dd08e7fa2ccbcc0489c17ed305b20a9a7d187161.tar.bz2 |
add zeckes change in again *DOH*, and initialize some silly int's to get rid of silly compiler warnings
-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 @@ ** not clear to you. ** **********************************************************************/ -// code added and Copyright (C) by L. J. Potter <ljp@llornkcor.com> 2002 #include "clock.h" #include "setAlarm.h" @@ -32,6 +31,8 @@ #include <qsound.h> #include <qtimer.h> +#include <opie/oclickablelabel.h> + #include <qlcdnumber.h> #include <qslider.h> #include <qlabel.h> @@ -93,7 +94,7 @@ Clock::Clock( QWidget * parent, const char * name, WFlags f ) date->setText( TimeString::longDateString( QDate::currentDate() ) ); QWidget *controls = new QWidget( this ); - QGridLayout *gl = new QGridLayout( controls, 2, 2, 6, 4 ); + QGridLayout *gl = new QGridLayout( controls, 3, 2, 6, 4 ); QButtonGroup *grp = new QButtonGroup( controls ); grp->setRadioButtonExclusive( true ); @@ -132,6 +133,11 @@ Clock::Clock( QWidget * parent, const char * name, WFlags f ) gl->addWidget( alarmBtn, 1, 2 ); alarmBtn->setText( tr( "Set Alarm" ) ); + OClickableLabel *click = new OClickableLabel(controls, "label" ); + click->setText(tr("Set date and time." ) ); + gl->addMultiCellWidget( click, 3, 3, 0, 2, AlignHCenter); + connect( click, SIGNAL(clicked() ), this, SLOT(slotAdjustTime() ) ); + connect( set, SIGNAL( pressed() ), SLOT( slotSet() ) ); connect( reset, SIGNAL( clicked() ), SLOT( slotReset() ) ); @@ -310,7 +316,7 @@ void Clock::slotSetAlarm() void Clock::slotSnooze() { bSound=FALSE; - int warn; + int warn = 0; QTime t = QTime::currentTime(); QDateTime whenl( when.date(), t.addSecs( snoozeTime*60)); when=whenl; @@ -349,7 +355,7 @@ void Clock::alarmOn() QTime t = QTime::currentTime(); if( t > tm) d = d.addDays(1); - int warn; + int warn = 0; QDateTime whenl(d,tm); when=whenl; AlarmServer::addAlarm( when, @@ -360,7 +366,7 @@ void Clock::alarmOn() void Clock::alarmOff() { - int warn; + int warn = 0; bSound=FALSE; AlarmServer::deleteAlarm( when, "QPE/Application/clock", @@ -479,3 +485,8 @@ QPoint AnalogClock::rotate( QPoint c, QPoint p, int a ) ( p.x() - c.x() ) * sin( angle ); return QPoint( nx, ny ); } +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 e5ed13c..024dd28 100644 --- a/noncore/tools/clock/clock.h +++ b/noncore/tools/clock/clock.h @@ -76,7 +76,7 @@ private slots: void alarmOff(); void appMessage(const QCString& msg, const QByteArray& data); void timerEvent( QTimerEvent *e ); -// void slotAdjustTime(); + void slotAdjustTime(); private: void clearClock(); |