-rw-r--r-- | noncore/tools/clock/clock.cpp | 24 | ||||
-rw-r--r-- | noncore/tools/clock/clock.h | 1 | ||||
-rw-r--r-- | noncore/tools/clock/clock.pro | 2 |
3 files changed, 20 insertions, 7 deletions
diff --git a/noncore/tools/clock/clock.cpp b/noncore/tools/clock/clock.cpp index a21a061..ea8e8ca 100644 --- a/noncore/tools/clock/clock.cpp +++ b/noncore/tools/clock/clock.cpp @@ -32,4 +32,6 @@ #include <qtimer.h> +#include <opie/oclickablelabel.h> + #include <qlcdnumber.h> #include <qslider.h> @@ -93,5 +95,5 @@ Clock::Clock( QWidget * parent, const char * name, WFlags f ) 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 ); @@ -132,4 +134,9 @@ Clock::Clock( QWidget * parent, const char * name, WFlags f ) 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() ) ); @@ -168,5 +175,5 @@ Clock::Clock( QWidget * parent, const char * name, WFlags f ) snoozeBtn->hide(); } - + QTimer::singleShot( 0, this, SLOT(updateClock()) ); modeSelect(0); @@ -185,5 +192,5 @@ void Clock::updateClock() if ( ampm ) { int hour = tm.hour(); - if (hour == 0) + if (hour == 0) hour = 12; if (hour > 12) @@ -282,5 +289,5 @@ void Clock::modeSelect( int m ) //this sets the alarm time -void Clock::slotSetAlarm() +void Clock::slotSetAlarm() { if( !snoozeBtn->isHidden()) @@ -304,5 +311,5 @@ void Clock::slotSetAlarm() config.writeEntry("clockAlarmSnooze",tmp.setNum( snoozeTime ),10); config.write(); - } + } } @@ -321,5 +328,5 @@ void Clock::slotSnooze() //toggles alarm on/off -void Clock::slotToggleAlarm() +void Clock::slotToggleAlarm() { Config config( "qpe" ); @@ -475,2 +482,7 @@ QPoint AnalogClock::rotate( QPoint c, QPoint p, int a ) 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 9b756b5..024dd28 100644 --- a/noncore/tools/clock/clock.h +++ b/noncore/tools/clock/clock.h @@ -77,4 +77,5 @@ private slots: void appMessage(const QCString& msg, const QByteArray& data); void timerEvent( QTimerEvent *e ); + void slotAdjustTime(); private: diff --git a/noncore/tools/clock/clock.pro b/noncore/tools/clock/clock.pro index 5373515..7eecce1 100644 --- a/noncore/tools/clock/clock.pro +++ b/noncore/tools/clock/clock.pro @@ -7,5 +7,5 @@ SOURCES = clock.cpp setAlarm.cpp \ INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include -LIBS += -lqpe +LIBS += -lqpe -lopie INTERFACES = TARGET = clock |