author | zecke <zecke> | 2002-05-21 14:21:59 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-05-21 14:21:59 (UTC) |
commit | d65dc25caec62d4c554c99fbc151bf4d07c63b72 (patch) (unidiff) | |
tree | 37485591f8cd642df0177ea77b860f8d4432e9ef /noncore/tools | |
parent | 3eb1e88e5915c9dbd521a150cc5dd7eb7dbb3663 (diff) | |
download | opie-d65dc25caec62d4c554c99fbc151bf4d07c63b72.zip opie-d65dc25caec62d4c554c99fbc151bf4d07c63b72.tar.gz opie-d65dc25caec62d4c554c99fbc151bf4d07c63b72.tar.bz2 |
usbaility updates a clock should be able to set the time
-rw-r--r-- | noncore/tools/clock/clock.cpp | 14 | ||||
-rw-r--r-- | noncore/tools/clock/clock.h | 1 | ||||
-rw-r--r-- | noncore/tools/clock/clock.pro | 2 |
3 files changed, 15 insertions, 2 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 | |||
@@ -28,12 +28,14 @@ | |||
28 | #include <qpe/alarmserver.h> | 28 | #include <qpe/alarmserver.h> |
29 | #include <qpe/sound.h> | 29 | #include <qpe/sound.h> |
30 | #include <qpe/resource.h> | 30 | #include <qpe/resource.h> |
31 | #include <qsound.h> | 31 | #include <qsound.h> |
32 | #include <qtimer.h> | 32 | #include <qtimer.h> |
33 | 33 | ||
34 | #include <opie/oclickablelabel.h> | ||
35 | |||
34 | #include <qlcdnumber.h> | 36 | #include <qlcdnumber.h> |
35 | #include <qslider.h> | 37 | #include <qslider.h> |
36 | #include <qlabel.h> | 38 | #include <qlabel.h> |
37 | #include <qlayout.h> | 39 | #include <qlayout.h> |
38 | #include <qtimer.h> | 40 | #include <qtimer.h> |
39 | #include <qpushbutton.h> | 41 | #include <qpushbutton.h> |
@@ -89,13 +91,13 @@ Clock::Clock( QWidget * parent, const char * name, WFlags f ) | |||
89 | date = new QLabel( this ); | 91 | date = new QLabel( this ); |
90 | date->setAlignment( AlignHCenter | AlignVCenter ); | 92 | date->setAlignment( AlignHCenter | AlignVCenter ); |
91 | date->setFont( QFont( "Helvetica", 14, QFont::Bold ) ); | 93 | date->setFont( QFont( "Helvetica", 14, QFont::Bold ) ); |
92 | date->setText( TimeString::longDateString( QDate::currentDate() ) ); | 94 | date->setText( TimeString::longDateString( QDate::currentDate() ) ); |
93 | 95 | ||
94 | QWidget *controls = new QWidget( this ); | 96 | QWidget *controls = new QWidget( this ); |
95 | QGridLayout *gl = new QGridLayout( controls, 2, 2, 6, 4 ); | 97 | QGridLayout *gl = new QGridLayout( controls, 3, 2, 6, 4 ); |
96 | 98 | ||
97 | QButtonGroup *grp = new QButtonGroup( controls ); | 99 | QButtonGroup *grp = new QButtonGroup( controls ); |
98 | grp->setRadioButtonExclusive( true ); | 100 | grp->setRadioButtonExclusive( true ); |
99 | grp->hide(); | 101 | grp->hide(); |
100 | 102 | ||
101 | clockRB = new QRadioButton ( tr( "Clock" ), controls ); | 103 | clockRB = new QRadioButton ( tr( "Clock" ), controls ); |
@@ -128,12 +130,17 @@ Clock::Clock( QWidget * parent, const char * name, WFlags f ) | |||
128 | 130 | ||
129 | alarmBtn = new QPushButton ( controls ); | 131 | alarmBtn = new QPushButton ( controls ); |
130 | // alarmBtn->setMaximumSize(60,30); | 132 | // alarmBtn->setMaximumSize(60,30); |
131 | gl->addWidget( alarmBtn, 1, 2 ); | 133 | gl->addWidget( alarmBtn, 1, 2 ); |
132 | alarmBtn->setText( tr( "Set Alarm" ) ); | 134 | alarmBtn->setText( tr( "Set Alarm" ) ); |
133 | 135 | ||
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 | |||
134 | connect( set, SIGNAL( pressed() ), SLOT( slotSet() ) ); | 141 | connect( set, SIGNAL( pressed() ), SLOT( slotSet() ) ); |
135 | connect( reset, SIGNAL( clicked() ), SLOT( slotReset() ) ); | 142 | connect( reset, SIGNAL( clicked() ), SLOT( slotReset() ) ); |
136 | 143 | ||
137 | connect( alarmBtn, SIGNAL( clicked() ), SLOT( slotSetAlarm() ) ); | 144 | connect( alarmBtn, SIGNAL( clicked() ), SLOT( slotSetAlarm() ) ); |
138 | connect( snoozeBtn, SIGNAL( clicked() ), SLOT( slotSnooze() ) ); | 145 | connect( snoozeBtn, SIGNAL( clicked() ), SLOT( slotSnooze() ) ); |
139 | connect( alarmOffBtn, SIGNAL( clicked() ), SLOT( slotToggleAlarm() ) ); | 146 | connect( alarmOffBtn, SIGNAL( clicked() ), SLOT( slotToggleAlarm() ) ); |
@@ -471,6 +478,11 @@ QPoint AnalogClock::rotate( QPoint c, QPoint p, int a ) | |||
471 | double nx = c.x() - ( p.x() - c.x() ) * cos( angle ) - | 478 | double nx = c.x() - ( p.x() - c.x() ) * cos( angle ) - |
472 | ( p.y() - c.y() ) * sin( angle ); | 479 | ( p.y() - c.y() ) * sin( angle ); |
473 | double ny = c.y() - ( p.y() - c.y() ) * cos( angle ) + | 480 | double ny = c.y() - ( p.y() - c.y() ) * cos( angle ) + |
474 | ( p.x() - c.x() ) * sin( angle ); | 481 | ( p.x() - c.x() ) * sin( angle ); |
475 | return QPoint( nx, ny ); | 482 | return QPoint( nx, ny ); |
476 | } | 483 | } |
484 | void Clock::slotAdjustTime() | ||
485 | { | ||
486 | QCopEnvelope e("QPE/System", "execute(QString)"); | ||
487 | e << QString("systemtime"); | ||
488 | } | ||
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 | |||
@@ -73,12 +73,13 @@ private slots: | |||
73 | void slotSnooze(); | 73 | void slotSnooze(); |
74 | void slotToggleAlarm(); | 74 | void slotToggleAlarm(); |
75 | void alarmOn(); | 75 | void alarmOn(); |
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 | 80 | ||
80 | private: | 81 | private: |
81 | void clearClock(); | 82 | void clearClock(); |
82 | 83 | ||
83 | bool alarmBool; | 84 | bool alarmBool; |
84 | QTimer *t; | 85 | QTimer *t; |
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 | |||
@@ -3,13 +3,13 @@ CONFIG = qt warn_on release | |||
3 | DESTDIR = $(OPIEDIR)/bin | 3 | DESTDIR = $(OPIEDIR)/bin |
4 | HEADERS = clock.h setAlarm.h | 4 | HEADERS = clock.h setAlarm.h |
5 | SOURCES = clock.cpp setAlarm.cpp \ | 5 | SOURCES = clock.cpp setAlarm.cpp \ |
6 | main.cpp | 6 | main.cpp |
7 | INCLUDEPATH += $(OPIEDIR)/include | 7 | INCLUDEPATH += $(OPIEDIR)/include |
8 | DEPENDPATH += $(OPIEDIR)/include | 8 | DEPENDPATH += $(OPIEDIR)/include |
9 | LIBS += -lqpe | 9 | LIBS += -lqpe -lopie |
10 | INTERFACES = | 10 | INTERFACES = |
11 | TARGET = clock | 11 | TARGET = clock |
12 | 12 | ||
13 | TRANSLATIONS = ../i18n/de/clock.ts | 13 | TRANSLATIONS = ../i18n/de/clock.ts |
14 | TRANSLATIONS += ../i18n/pt_BR/clock.ts | 14 | TRANSLATIONS += ../i18n/pt_BR/clock.ts |
15 | TRANSLATIONS += ../i18n/en/clock.ts | 15 | TRANSLATIONS += ../i18n/en/clock.ts |