-rw-r--r-- | noncore/tools/clock/clock.h | 3 | ||||
-rw-r--r-- | noncore/tools/clock/clock.pro | 5 | ||||
-rw-r--r-- | noncore/tools/clock/main.cpp | 11 |
3 files changed, 6 insertions, 13 deletions
diff --git a/noncore/tools/clock/clock.h b/noncore/tools/clock/clock.h index fa12b61..00d097d 100644 --- a/noncore/tools/clock/clock.h +++ b/noncore/tools/clock/clock.h | |||
@@ -21,73 +21,76 @@ | |||
21 | #define CLOCK_H | 21 | #define CLOCK_H |
22 | 22 | ||
23 | #include <qdatetime.h> | 23 | #include <qdatetime.h> |
24 | #include <qvbox.h> | 24 | #include <qvbox.h> |
25 | #include <qpixmap.h> | 25 | #include <qpixmap.h> |
26 | 26 | ||
27 | class QLCDNumber; | 27 | class QLCDNumber; |
28 | class QLabel; | 28 | class QLabel; |
29 | class QTimer; | 29 | class QTimer; |
30 | class QRadioButton; | 30 | class QRadioButton; |
31 | class QPushButton; | 31 | class QPushButton; |
32 | class QDateTime; | 32 | class QDateTime; |
33 | 33 | ||
34 | class AnalogClock : public QFrame | 34 | class AnalogClock : public QFrame |
35 | { | 35 | { |
36 | Q_OBJECT | 36 | Q_OBJECT |
37 | 37 | ||
38 | public: | 38 | public: |
39 | AnalogClock( QWidget * parent = 0, const char * name = 0 ); | 39 | AnalogClock( QWidget * parent = 0, const char * name = 0 ); |
40 | 40 | ||
41 | QSizePolicy sizePolicy() const; | 41 | QSizePolicy sizePolicy() const; |
42 | 42 | ||
43 | void display( const QTime& time ); | 43 | void display( const QTime& time ); |
44 | 44 | ||
45 | |||
45 | protected: | 46 | protected: |
46 | void drawContents( QPainter *p ); | 47 | void drawContents( QPainter *p ); |
47 | 48 | ||
48 | private: | 49 | private: |
49 | 50 | ||
50 | QPixmap bg; | 51 | QPixmap bg; |
51 | QTime currTime; | 52 | QTime currTime; |
52 | QTime prevTime; | 53 | QTime prevTime; |
53 | bool clear; | 54 | bool clear; |
54 | 55 | ||
55 | QPoint rotate( QPoint center, QPoint p, int angle ); | 56 | QPoint rotate( QPoint center, QPoint p, int angle ); |
56 | void drawPointers ( QPainter *, const QRect &r, const QColor &c, const QTime &t, const QTime *t2 = 0 ); | 57 | void drawPointers ( QPainter *, const QRect &r, const QColor &c, const QTime &t, const QTime *t2 = 0 ); |
57 | 58 | ||
58 | }; | 59 | }; |
59 | 60 | ||
60 | class Clock : public QVBox | 61 | class Clock : public QVBox |
61 | { | 62 | { |
62 | Q_OBJECT | 63 | Q_OBJECT |
63 | 64 | ||
64 | public: | 65 | public: |
65 | Clock( QWidget * parent = 0, const char * name = 0, WFlags f=0 ); | 66 | Clock( QWidget * parent = 0, const char * name = 0, WFlags f=0 ); |
66 | ~Clock(); | 67 | ~Clock(); |
67 | QDateTime when; | 68 | QDateTime when; |
68 | bool bSound; | 69 | bool bSound; |
69 | int hour, minute, snoozeTime; | 70 | int hour, minute, snoozeTime; |
71 | static QString appName() { return QString::fromLatin1("clock"); } | ||
72 | |||
70 | private slots: | 73 | private slots: |
71 | void slotSet(); | 74 | void slotSet(); |
72 | void slotReset(); | 75 | void slotReset(); |
73 | void modeSelect(int); | 76 | void modeSelect(int); |
74 | void updateClock(); | 77 | void updateClock(); |
75 | void changeClock( bool ); | 78 | void changeClock( bool ); |
76 | void slotSetAlarm(); | 79 | void slotSetAlarm(); |
77 | void slotSnooze(); | 80 | void slotSnooze(); |
78 | void slotToggleAlarm(); | 81 | void slotToggleAlarm(); |
79 | void alarmOn(); | 82 | void alarmOn(); |
80 | void alarmOff(); | 83 | void alarmOff(); |
81 | void appMessage(const QCString& msg, const QByteArray& data); | 84 | void appMessage(const QCString& msg, const QByteArray& data); |
82 | void timerEvent( QTimerEvent *e ); | 85 | void timerEvent( QTimerEvent *e ); |
83 | void slotAdjustTime(); | 86 | void slotAdjustTime(); |
84 | 87 | ||
85 | void slotStartTimer(); | 88 | void slotStartTimer(); |
86 | void slotStopTimer(); | 89 | void slotStopTimer(); |
87 | void slotResetTimer(); | 90 | void slotResetTimer(); |
88 | void setSwatchMode( int ); | 91 | void setSwatchMode( int ); |
89 | private: | 92 | private: |
90 | bool alarmBool; | 93 | bool alarmBool; |
91 | QTimer *t; | 94 | QTimer *t; |
92 | QLCDNumber *lcd; | 95 | QLCDNumber *lcd; |
93 | QLabel *date; | 96 | QLabel *date; |
diff --git a/noncore/tools/clock/clock.pro b/noncore/tools/clock/clock.pro index 38ce2f8..9890b3a 100644 --- a/noncore/tools/clock/clock.pro +++ b/noncore/tools/clock/clock.pro | |||
@@ -1,33 +1,30 @@ | |||
1 | TEMPLATE = app | 1 | CONFIG = qt warn_on release quick-app |
2 | CONFIG = qt warn_on release | ||
3 | DESTDIR = $(OPIEDIR)/bin | ||
4 | HEADERS = clock.h setAlarm.h | 2 | HEADERS = clock.h setAlarm.h |
5 | SOURCES = clock.cpp setAlarm.cpp \ | 3 | SOURCES = clock.cpp setAlarm.cpp \ |
6 | main.cpp | 4 | main.cpp |
7 | INCLUDEPATH += $(OPIEDIR)/include | 5 | INCLUDEPATH += $(OPIEDIR)/include |
8 | DEPENDPATH += $(OPIEDIR)/include | 6 | DEPENDPATH += $(OPIEDIR)/include |
9 | LIBS += -lqpe -lopie -lpthread | 7 | LIBS += -lqpe -lopie -lpthread |
10 | INTERFACES = | ||
11 | TARGET = clock | 8 | TARGET = clock |
12 | 9 | ||
13 | TRANSLATIONS = ../../../i18n/de/clock.ts \ | 10 | TRANSLATIONS = ../../../i18n/de/clock.ts \ |
14 | ../../../i18n/nl/clock.ts \ | 11 | ../../../i18n/nl/clock.ts \ |
15 | ../../../i18n/xx/clock.ts \ | 12 | ../../../i18n/xx/clock.ts \ |
16 | ../../../i18n/en/clock.ts \ | 13 | ../../../i18n/en/clock.ts \ |
17 | ../../../i18n/es/clock.ts \ | 14 | ../../../i18n/es/clock.ts \ |
18 | ../../../i18n/fr/clock.ts \ | 15 | ../../../i18n/fr/clock.ts \ |
19 | ../../../i18n/hu/clock.ts \ | 16 | ../../../i18n/hu/clock.ts \ |
20 | ../../../i18n/ja/clock.ts \ | 17 | ../../../i18n/ja/clock.ts \ |
21 | ../../../i18n/ko/clock.ts \ | 18 | ../../../i18n/ko/clock.ts \ |
22 | ../../../i18n/no/clock.ts \ | 19 | ../../../i18n/no/clock.ts \ |
23 | ../../../i18n/pl/clock.ts \ | 20 | ../../../i18n/pl/clock.ts \ |
24 | ../../../i18n/pt/clock.ts \ | 21 | ../../../i18n/pt/clock.ts \ |
25 | ../../../i18n/pt_BR/clock.ts \ | 22 | ../../../i18n/pt_BR/clock.ts \ |
26 | ../../../i18n/sl/clock.ts \ | 23 | ../../../i18n/sl/clock.ts \ |
27 | ../../../i18n/zh_CN/clock.ts \ | 24 | ../../../i18n/zh_CN/clock.ts \ |
28 | ../../../i18n/zh_TW/clock.ts \ | 25 | ../../../i18n/zh_TW/clock.ts \ |
29 | ../../../i18n/da/clock.ts | 26 | ../../../i18n/da/clock.ts |
30 | 27 | ||
31 | 28 | ||
32 | 29 | ||
33 | include ( $(OPIEDIR)/include.pro ) | 30 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/noncore/tools/clock/main.cpp b/noncore/tools/clock/main.cpp index cbfb73b..4a5e523 100644 --- a/noncore/tools/clock/main.cpp +++ b/noncore/tools/clock/main.cpp | |||
@@ -1,34 +1,27 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
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 | 20 | ||
21 | #include "clock.h" | 21 | #include "clock.h" |
22 | 22 | ||
23 | #include <qpe/qpeapplication.h> | 23 | #include <qpe/qpeapplication.h> |
24 | #include <opie/oapplicationfactory.h> | ||
24 | 25 | ||
25 | int main( int argc, char ** argv ) | ||
26 | { | ||
27 | QPEApplication a( argc, argv ); | ||
28 | 26 | ||
29 | Clock mw; | 27 | OPIE_EXPORT_APP( OApplicationFactory<Clock> ) |
30 | mw.setCaption( Clock::tr("Clock") ); | ||
31 | a.showMainWidget( &mw ); | ||
32 | |||
33 | return a.exec(); | ||
34 | } | ||