-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 @@ #define CLOCK_H #include <qdatetime.h> #include <qvbox.h> #include <qpixmap.h> class QLCDNumber; class QLabel; class QTimer; class QRadioButton; class QPushButton; class QDateTime; class AnalogClock : public QFrame { Q_OBJECT public: AnalogClock( QWidget * parent = 0, const char * name = 0 ); QSizePolicy sizePolicy() const; void display( const QTime& time ); + protected: void drawContents( QPainter *p ); private: QPixmap bg; QTime currTime; QTime prevTime; bool clear; QPoint rotate( QPoint center, QPoint p, int angle ); void drawPointers ( QPainter *, const QRect &r, const QColor &c, const QTime &t, const QTime *t2 = 0 ); }; class Clock : public QVBox { Q_OBJECT public: Clock( QWidget * parent = 0, const char * name = 0, WFlags f=0 ); ~Clock(); QDateTime when; bool bSound; int hour, minute, snoozeTime; + static QString appName() { return QString::fromLatin1("clock"); } + private slots: void slotSet(); void slotReset(); void modeSelect(int); void updateClock(); void changeClock( bool ); void slotSetAlarm(); void slotSnooze(); void slotToggleAlarm(); void alarmOn(); void alarmOff(); void appMessage(const QCString& msg, const QByteArray& data); void timerEvent( QTimerEvent *e ); void slotAdjustTime(); void slotStartTimer(); void slotStopTimer(); void slotResetTimer(); void setSwatchMode( int ); private: bool alarmBool; QTimer *t; QLCDNumber *lcd; 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 @@ -TEMPLATE = app -CONFIG = qt warn_on release -DESTDIR = $(OPIEDIR)/bin +CONFIG = qt warn_on release quick-app HEADERS = clock.h setAlarm.h SOURCES = clock.cpp setAlarm.cpp \ main.cpp INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include LIBS += -lqpe -lopie -lpthread -INTERFACES = TARGET = clock TRANSLATIONS = ../../../i18n/de/clock.ts \ ../../../i18n/nl/clock.ts \ ../../../i18n/xx/clock.ts \ ../../../i18n/en/clock.ts \ ../../../i18n/es/clock.ts \ ../../../i18n/fr/clock.ts \ ../../../i18n/hu/clock.ts \ ../../../i18n/ja/clock.ts \ ../../../i18n/ko/clock.ts \ ../../../i18n/no/clock.ts \ ../../../i18n/pl/clock.ts \ ../../../i18n/pt/clock.ts \ ../../../i18n/pt_BR/clock.ts \ ../../../i18n/sl/clock.ts \ ../../../i18n/zh_CN/clock.ts \ ../../../i18n/zh_TW/clock.ts \ ../../../i18n/da/clock.ts 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 @@ /********************************************************************** ** Copyright (C) 2000 Trolltech AS. All rights reserved. ** ** This file is part of Qtopia Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** 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. ** **********************************************************************/ #include "clock.h" #include <qpe/qpeapplication.h> +#include <opie/oapplicationfactory.h> -int main( int argc, char ** argv ) -{ - QPEApplication a( argc, argv ); - Clock mw; - mw.setCaption( Clock::tr("Clock") ); - a.showMainWidget( &mw ); - - return a.exec(); -} +OPIE_EXPORT_APP( OApplicationFactory<Clock> ) |