summaryrefslogtreecommitdiff
authorzecke <zecke>2004-04-03 20:10:15 (UTC)
committer zecke <zecke>2004-04-03 20:10:15 (UTC)
commit1f03371e4c5d9db806e941bf3687b4bf340aa4fa (patch) (unidiff)
tree08d4855e6babf252493ad677f30e5e35ba7a5751
parent93aeaa0de75ba89bd565c845e79e470a80816b0a (diff)
downloadopie-1f03371e4c5d9db806e941bf3687b4bf340aa4fa.zip
opie-1f03371e4c5d9db806e941bf3687b4bf340aa4fa.tar.gz
opie-1f03371e4c5d9db806e941bf3687b4bf340aa4fa.tar.bz2
This is the merged Qtopia Clock with our changes included
-Seperate Clock, StopWatch, Alarm -Allow starting stopping the stop watch by QCOP -Allow Daily alarms -Call OpiePlayer on resume
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/tools/clock/analogclock.cpp2
-rw-r--r--noncore/tools/clock/clock.cpp1156
-rw-r--r--noncore/tools/clock/clock.h112
-rw-r--r--noncore/tools/clock/clock.pro9
-rw-r--r--noncore/tools/clock/clockbase.ui111
-rw-r--r--noncore/tools/clock/main.cpp8
6 files changed, 823 insertions, 575 deletions
diff --git a/noncore/tools/clock/analogclock.cpp b/noncore/tools/clock/analogclock.cpp
index bf358e2..c5f0155 100644
--- a/noncore/tools/clock/analogclock.cpp
+++ b/noncore/tools/clock/analogclock.cpp
@@ -1,143 +1,143 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of the Qtopia Environment. 4** This file is part of the 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 "analogclock.h" 21#include "analogclock.h"
22 22
23#include <qlayout.h> 23#include <qlayout.h>
24#include <qpainter.h> 24#include <qpainter.h>
25#include <qtopia/global.h> 25#include <qtopia/global.h>
26 26
27#include <math.h> 27#include <math.h>
28 28
29 const double deg2rad = 0.017453292519943295769;// pi/180 29 const double deg2rad = 0.017453292519943295769;// pi/180
30 30
31AnalogClock::AnalogClock( QWidget *parent, const char *name ) 31AnalogClock::AnalogClock( QWidget *parent, const char *name )
32 : QFrame( parent, name ), clear(false) 32 : QFrame( parent, name ), clear(false)
33{ 33{
34 setMinimumSize(50,50); 34 setMinimumSize(50,50);
35} 35}
36 36
37QSizePolicy AnalogClock::sizePolicy() const 37QSizePolicy AnalogClock::sizePolicy() const
38{ 38{
39 return QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); 39 return QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
40} 40}
41 41
42void AnalogClock::drawContents( QPainter *p ) 42void AnalogClock::drawContents( QPainter *p )
43{ 43{
44#if !defined(NO_DEBUG) 44#if !defined(NO_DEBUG)
45 static bool first = true; 45 static bool first = true;
46 if ( first ) { 46 if ( first ) {
47 QTOPIA_PROFILE("first paint event"); 47 //QTOPIA_PROFILE("first paint event");
48 first = false; 48 first = false;
49 } 49 }
50#endif 50#endif
51 51
52 QRect r = contentsRect(); 52 QRect r = contentsRect();
53 53
54 if ( r.width() < r.height() ) { 54 if ( r.width() < r.height() ) {
55 r.setY( (r.height() - r.width())/2 ); 55 r.setY( (r.height() - r.width())/2 );
56 r.setHeight( r.width() ); 56 r.setHeight( r.width() );
57 } 57 }
58 58
59 QPoint center( r.x() + r.width() / 2, r.y() + r.height() / 2 ); 59 QPoint center( r.x() + r.width() / 2, r.y() + r.height() / 2 );
60 60
61 const int w_tick = r.width()/300+1; 61 const int w_tick = r.width()/300+1;
62 const int w_sec = r.width()/400+1; 62 const int w_sec = r.width()/400+1;
63 const int w_hour = r.width()/80+1; 63 const int w_hour = r.width()/80+1;
64 64
65 QPoint l1( r.x() + r.width() / 2, r.y() + 2 ); 65 QPoint l1( r.x() + r.width() / 2, r.y() + 2 );
66 QPoint l2( r.x() + r.width() / 2, r.y() + 8 ); 66 QPoint l2( r.x() + r.width() / 2, r.y() + 8 );
67 67
68 QPoint h1( r.x() + r.width() / 2, r.y() + r.height() / 4 ); 68 QPoint h1( r.x() + r.width() / 2, r.y() + r.height() / 4 );
69 QPoint h2( r.x() + r.width() / 2, r.y() + r.height() / 2 ); 69 QPoint h2( r.x() + r.width() / 2, r.y() + r.height() / 2 );
70 70
71 QPoint m1( r.x() + r.width() / 2, r.y() + r.height() / 9 ); 71 QPoint m1( r.x() + r.width() / 2, r.y() + r.height() / 9 );
72 QPoint m2( r.x() + r.width() / 2, r.y() + r.height() / 2 ); 72 QPoint m2( r.x() + r.width() / 2, r.y() + r.height() / 2 );
73 73
74 QPoint s1( r.x() + r.width() / 2, r.y() + 8 ); 74 QPoint s1( r.x() + r.width() / 2, r.y() + 8 );
75 QPoint s2( r.x() + r.width() / 2, r.y() + r.height() / 2 ); 75 QPoint s2( r.x() + r.width() / 2, r.y() + r.height() / 2 );
76 76
77 QColor color( clear ? backgroundColor() : black ); 77 QColor color( clear ? backgroundColor() : black );
78 QTime time = clear ? prevTime : currTime; 78 QTime time = clear ? prevTime : currTime;
79 79
80 if ( clear && prevTime.secsTo(currTime) > 1 ) { 80 if ( clear && prevTime.secsTo(currTime) > 1 ) {
81 p->eraseRect( rect() ); 81 p->eraseRect( rect() );
82 return; 82 return;
83 } 83 }
84 84
85 if ( !clear ) { 85 if ( !clear ) {
86 // draw ticks 86 // draw ticks
87 p->setPen( QPen( color, w_tick ) ); 87 p->setPen( QPen( color, w_tick ) );
88 for ( int i = 0; i < 12; i++ ) 88 for ( int i = 0; i < 12; i++ )
89 p->drawLine( rotate( center, l1, i * 30 ), rotate( center, l2, i * 30 ) ); 89 p->drawLine( rotate( center, l1, i * 30 ), rotate( center, l2, i * 30 ) );
90 } 90 }
91 91
92 if ( !clear || prevTime.minute() != currTime.minute() || 92 if ( !clear || prevTime.minute() != currTime.minute() ||
93 prevTime.hour() != currTime.hour() ) { 93 prevTime.hour() != currTime.hour() ) {
94 // draw hour pointer 94 // draw hour pointer
95 h1 = rotate( center, h1, 30 * ( time.hour() % 12 ) + time.minute() / 2 ); 95 h1 = rotate( center, h1, 30 * ( time.hour() % 12 ) + time.minute() / 2 );
96 h2 = rotate( center, h2, 30 * ( time.hour() % 12 ) + time.minute() / 2 ); 96 h2 = rotate( center, h2, 30 * ( time.hour() % 12 ) + time.minute() / 2 );
97 p->setPen( color ); 97 p->setPen( color );
98 p->setBrush( color ); 98 p->setBrush( color );
99 drawHand( p, h1, h2 ); 99 drawHand( p, h1, h2 );
100 } 100 }
101 101
102 if ( !clear || prevTime.minute() != currTime.minute() ) { 102 if ( !clear || prevTime.minute() != currTime.minute() ) {
103 // draw minute pointer 103 // draw minute pointer
104 m1 = rotate( center, m1, time.minute() * 6 ); 104 m1 = rotate( center, m1, time.minute() * 6 );
105 m2 = rotate( center, m2, time.minute() * 6 ); 105 m2 = rotate( center, m2, time.minute() * 6 );
106 p->setPen( color ); 106 p->setPen( color );
107 p->setBrush( color ); 107 p->setBrush( color );
108 drawHand( p, m1, m2 ); 108 drawHand( p, m1, m2 );
109 } 109 }
110 110
111 // draw second pointer 111 // draw second pointer
112 s1 = rotate( center, s1, time.second() * 6 ); 112 s1 = rotate( center, s1, time.second() * 6 );
113 s2 = rotate( center, s2, time.second() * 6 ); 113 s2 = rotate( center, s2, time.second() * 6 );
114 p->setPen( QPen( color, w_sec ) ); 114 p->setPen( QPen( color, w_sec ) );
115 p->drawLine( s1, s2 ); 115 p->drawLine( s1, s2 );
116 116
117 // cap 117 // cap
118 p->setBrush(color); 118 p->setBrush(color);
119 p->drawEllipse( center.x()-w_hour/2, center.y()-w_hour/2, w_hour, w_hour ); 119 p->drawEllipse( center.x()-w_hour/2, center.y()-w_hour/2, w_hour, w_hour );
120 120
121 if ( !clear ) 121 if ( !clear )
122 prevTime = currTime; 122 prevTime = currTime;
123} 123}
124 124
125// Dijkstra's bisection algorithm to find the square root as an integer. 125// Dijkstra's bisection algorithm to find the square root as an integer.
126 126
127static uint int_sqrt(uint n) 127static uint int_sqrt(uint n)
128{ 128{
129 if ( n >= UINT_MAX>>2 ) // n must be in the range 0...UINT_MAX/2-1 129 if ( n >= UINT_MAX>>2 ) // n must be in the range 0...UINT_MAX/2-1
130 return 2*int_sqrt( n/4 ); 130 return 2*int_sqrt( n/4 );
131 uint h, p= 0, q= 1, r= n; 131 uint h, p= 0, q= 1, r= n;
132 while ( q <= n ) 132 while ( q <= n )
133 q <<= 2; 133 q <<= 2;
134 while ( q != 1 ) { 134 while ( q != 1 ) {
135 q >>= 2; 135 q >>= 2;
136 h= p + q; 136 h= p + q;
137 p >>= 1; 137 p >>= 1;
138 if ( r >= h ) { 138 if ( r >= h ) {
139 p += q; 139 p += q;
140 r -= h; 140 r -= h;
141 } 141 }
142 } 142 }
143 return p; 143 return p;
diff --git a/noncore/tools/clock/clock.cpp b/noncore/tools/clock/clock.cpp
index 485354b..ad422a6 100644
--- a/noncore/tools/clock/clock.cpp
+++ b/noncore/tools/clock/clock.cpp
@@ -1,664 +1,806 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of the 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// changes added and Copyright (C) by L. J. Potter <ljp@llornkcor.com> 2002 20// changes added and Copyright (C) by L. J. Potter <ljp@llornkcor.com> 2002
21// changes added and Copyright (C) by Holger Freyther 2004
21 22
22#include "clock.h" 23#include "clock.h"
23#include "setAlarm.h" 24
25#include "analogclock.h"
26
27#include <qtabwidget.h>
28
29#include <opie2/ofiledialog.h>
24 30
25#include <qpe/qpeapplication.h> 31#include <qpe/qpeapplication.h>
26#include <qpe/qcopenvelope_qws.h> 32#include <qpe/qcopenvelope_qws.h>
27#include <qpe/config.h> 33#include <qpe/config.h>
28#include <qpe/timestring.h> 34#include <qpe/timestring.h>
29#include <qpe/alarmserver.h> 35#include <qpe/alarmserver.h>
30#include <qpe/sound.h> 36#include <qpe/sound.h>
31#include <qpe/resource.h> 37#include <qpe/resource.h>
32#include <qsound.h> 38#include <qsound.h>
33#include <qtimer.h> 39#include <qtimer.h>
34 40
35#include <opie2/oclickablelabel.h> 41
36 42
37#include <qlcdnumber.h> 43#include <qlcdnumber.h>
38#include <qslider.h> 44#include <qslider.h>
39#include <qlabel.h> 45#include <qlabel.h>
40#include <qlayout.h>
41#include <qtimer.h> 46#include <qtimer.h>
42#include <qpushbutton.h> 47#include <qpushbutton.h>
43#include <qradiobutton.h> 48#include <qtoolbutton.h>
44#include <qbuttongroup.h>
45#include <qpainter.h> 49#include <qpainter.h>
46#include <qmessagebox.h> 50#include <qmessagebox.h>
47#include <qdatetime.h> 51#include <qdatetime.h>
52#include <qspinbox.h>
53#include <qcombobox.h>
54#include <qcheckbox.h>
55#include <qgroupbox.h>
56#include <qlayout.h>
57#include <qhbox.h>
58#include <qlineedit.h>
59
60static const int sw_prec = 2;
61static const int magic_daily = 2292922;
62static const int magic_countdown = 2292923;
63static const int magic_snooze = 2292924;
64static const int magic_playmp = 2292925;
48 65
49#include <math.h> 66#include <math.h>
50#include <unistd.h> 67#include <unistd.h>
51#include <sys/types.h> 68#include <sys/types.h>
52 69
53#include <pthread.h> 70#include <pthread.h>
54 71
55 72
56const double deg2rad = 0.017453292519943295769; // pi/180 73static void toggleScreenSaver( bool on )
57const int sw_prec = 2;
58
59using namespace Opie::Ui;
60void startPlayer()
61{ 74{
62 Config config( "qpe" ); 75 QCopEnvelope e( "QPE/System", "setScreenSaverMode(int)" );
63 config.setGroup( "Time" ); 76 e << ( on ? QPEApplication::Enable : QPEApplication::DisableSuspend );
64 sleep(15);
65 QCopEnvelope e( "QPE/Application/opieplayer", "setDocument(QString)" );
66 e << config.readEntry( "mp3File", "" );
67} 77}
68 78
69 79static void startPlayer()
70static void toggleScreenSaver( bool on )
71{ 80{
72 QCopEnvelope e( "QPE/System", "setScreenSaverMode(int)" ); 81 Config config( "qpe" );
73 e << ( on ? QPEApplication::Enable : QPEApplication::DisableSuspend ); 82 config.setGroup( "Time" );
83 sleep(15);
84 QCopEnvelope e( "QPE/Application/opieplayer", "setDocument(QString)" );
85 e << config.readEntry( "mp3File", "" );
74} 86}
75 87
76Clock::Clock( QWidget * parent, const char * name, WFlags f ) 88class MySpinBox : public QSpinBox
77 : QVBox( parent, name , f )
78{ 89{
79 setSpacing( 4 ); 90public:
80 setMargin( 1 ); 91 QLineEdit *lineEdit() const {
81 92 return editor();
82 93 }
83 snoozeBtn = new QPushButton ( this ); 94};
84 snoozeBtn->setText( tr( "Snooze" ) ); 95
85 96//
86 aclock = new AnalogClock( this ); 97//
87 aclock->display( QTime::currentTime() ); 98//
88 aclock->setLineWidth( 2 ); 99AlarmDlg::AlarmDlg(QWidget *parent, const char *name, bool modal,
89 100 const QString &txt) :
90 QHBox *hb = new QHBox( this ); 101 AlarmDlgBase(parent, name, modal)
91 hb->setMargin( 0 ); 102{
92 QWidget *space = new QWidget( hb ); 103 setCaption( tr("Clock") );
93 lcd = new QLCDNumber( hb ); 104 pixmap->setPixmap( Resource::loadPixmap("alarmbell") );
94 lcd->setSegmentStyle( QLCDNumber::Flat ); 105 alarmDlgLabel->setText(txt);
95 lcd->setFrameStyle( QFrame::NoFrame );
96 lcd->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ) );
97 lcd->setFixedHeight( 23 );
98
99 ampmLabel = new QLabel( tr( "PM" ), hb );
100 ampmLabel->setFont( QFont( "Helvetica", 14, QFont::Bold ) );
101 ampmLabel->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Preferred ) );
102 ampmLabel->setAlignment( AlignLeft | AlignBottom );
103 space = new QWidget( hb );
104
105 date = new QLabel( this );
106 date->setAlignment( AlignHCenter | AlignVCenter );
107 date->setFont( QFont( "Helvetica", 14, QFont::Bold ) );
108 date->setText( TimeString::longDateString( QDate::currentDate() ) );
109
110 QWidget *controls = new QWidget( this );
111 QGridLayout *gl = new QGridLayout( controls, 3, 2, 6, 4 );
112 106
113 QButtonGroup *grp = new QButtonGroup( controls ); 107 connect(snoozeTime, SIGNAL(valueChanged(int)), this,
114 grp->setRadioButtonExclusive( true ); 108 SLOT(changePrompt(int)));
115 grp->hide(); 109 connect(cmdOk, SIGNAL(clicked()), this, SLOT(checkSnooze()));
110}
116 111
117 clockRB = new QRadioButton ( tr( "Clock" ), controls ); 112//
118 gl->addWidget( clockRB, 0, 0 ); 113//
119 grp->insert( clockRB ); 114//
115void
116AlarmDlg::setText(const QString &txt)
117{
118 alarmDlgLabel->setText(txt);
119}
120 120
121 swatchRB = new QRadioButton ( tr( "Stopwatch" ), controls ); 121//
122 gl->addWidget( swatchRB, 1, 0 ); 122//
123 grp->insert( swatchRB ); 123//
124void
125AlarmDlg::checkSnooze(void)
126{
127 //
128 // Ensure we have only one snooze alarm.
129 //
130 AlarmServer::deleteAlarm(QDateTime(), "QPE/Application/clock",
131 "alarm(QDateTime,int)", magic_snooze);
132
133 if (snoozeTime->value() > 0) {
134 QDateTime wake = QDateTime::currentDateTime();
135 wake = wake.addSecs(snoozeTime->value() * 60); // snoozeTime in minutes
136
137 AlarmServer::addAlarm(wake, "QPE/Application/clock",
138 "alarm(QDateTime,int)", magic_snooze);
139 }
140 accept();
141}
124 142
125 connect( grp, SIGNAL( clicked(int) ), this, SLOT( modeSelect(int) ) );
126 grp->setButton( 0 );
127 143
128 set = new QPushButton ( controls );
129 set->setMaximumSize( 50, 30 );
130 gl->addWidget( set , 0, 1 );
131 set->setText( tr( "Start" ) );
132 set->setEnabled( FALSE );
133 grp->insert( set );
134 144
135 reset = new QPushButton ( controls ); 145void
136 gl->addWidget( reset, 1, 1 ); 146AlarmDlg::changePrompt(int mins)
137 reset->setText( tr( "Reset" ) ); 147{
138 reset->setEnabled( FALSE ); 148 cmdOk->setText(mins > 0 ? tr("Snooze") : tr("Close") );
139 grp->insert( reset ); 149}
140 150
141 alarmOffBtn = new QPushButton ( controls );
142 gl->addWidget( alarmOffBtn, 0, 2 );
143 151
144 alarmBtn = new QPushButton ( controls );
145 gl->addWidget( alarmBtn, 1, 2 );
146 152
147 alarmBtn->setText( tr( "Set Alarm" ) ); 153Clock::Clock( QWidget * parent, const char *, WFlags f )
154 : ClockBase( parent, "clock", f ), swatch_splitms(99), init(FALSE) // No tr
155{
156 alarmDlg = 0;
157 swLayout = 0;
158 dayBtn = new QToolButton * [7];
148 159
149 OClickableLabel *click = new Opie::Ui::OClickableLabel( controls, "label" ); 160 Config config( "qpe" );
150 click->setText( tr( "Set date and time." ) ); 161 config.setGroup("Time");
151 gl->addMultiCellWidget( click, 3, 3, 0, 2, AlignHCenter ); 162 ampm = config.readBoolEntry( "AMPM", TRUE );
152 connect( click, SIGNAL( clicked() ), this, SLOT( slotAdjustTime() ) ); 163 onMonday = config.readBoolEntry( "MONDAY" );
164
165 connect( tabs, SIGNAL(currentChanged(QWidget*)),
166 this, SLOT(tabChanged(QWidget*)) );
167
168 analogStopwatch = new AnalogClock( swFrame );
169 stopwatchLcd = new QLCDNumber( swFrame );
170 stopwatchLcd->setFrameStyle( QFrame::NoFrame );
171 stopwatchLcd->setSegmentStyle( QLCDNumber::Flat );
172 stopwatchLcd->setSizePolicy( QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred) );
173
174 analogClock->display( QTime::currentTime() );
175 clockLcd->setNumDigits( 5 );
176 clockLcd->setFixedWidth( clockLcd->sizeHint().width() );
177 date->setText( TimeString::dateString( QDate::currentDate(), TimeString::currentDateFormat() ) );
178 if ( qApp->desktop()->width() < 200 )
179 date->setFont( QFont(date->font().family(), 14, QFont::Bold) );
180 if ( qApp->desktop()->height() > 240 ) {
181 clockLcd->setFixedHeight( 30 );
182 stopwatchLcd->setFixedHeight( 30 );
183 }
153 184
154 connect( set , SIGNAL( pressed() ), SLOT( slotSet() ) ); 185 connect( stopStart, SIGNAL(pressed()), SLOT(stopStartStopWatch()) );
155 connect( reset, SIGNAL( clicked() ), SLOT( slotReset() ) ); 186 connect( reset, SIGNAL(pressed()), SLOT(resetStopWatch()) );
156 187
157 connect( alarmBtn, SIGNAL( clicked() ), SLOT( slotSetAlarm() ) ); 188 t = new QTimer( this );
158 connect( snoozeBtn, SIGNAL( clicked() ), SLOT( slotSnooze() ) ); 189 connect( t, SIGNAL(timeout()), SLOT(updateClock()) );
159 connect( alarmOffBtn, SIGNAL( clicked() ), SLOT( slotToggleAlarm() ) ); 190 t->start( 1000 );
160 191
161 connect( qApp, SIGNAL( appMessage(const QCString&,const QByteArray&) ), 192 applyAlarmTimer = new QTimer( this );
162 this, SLOT( appMessage(const QCString&,const QByteArray&) ) ); 193 connect( applyAlarmTimer, SIGNAL(timeout()),
194 this, SLOT(applyDailyAlarm()) );
163 195
164 t = new QTimer( this ); 196 alarmt = new QTimer( this );
165 connect( t, SIGNAL( timeout() ), SLOT( updateClock() ) ); 197 connect( alarmt, SIGNAL(timeout()), SLOT(alarmTimeout()) );
166 t->start( 1000 );
167 198
168 connect( qApp, SIGNAL( timeChanged() ), SLOT( updateClock() ) ); 199 connect( qApp, SIGNAL(timeChanged()), SLOT(updateClock()) );
200 connect( qApp, SIGNAL(timeChanged()), SLOT(applyDailyAlarm()) );
169 201
170 swatch_running = FALSE; 202 swatch_running = FALSE;
171 swatch_totalms = 0; 203 swatch_totalms = 0;
204 swatch_currLap = 0;
205 swatch_dispLap = 0;
206 stopwatchLcd->setNumDigits( 8+1+sw_prec );
207 stopwatchLcd->display( "00:00:00.00" );
208
209 QVBoxLayout *lvb = new QVBoxLayout( lapFrame );
210 nextLapBtn = new QToolButton( UpArrow, lapFrame );
211 connect( nextLapBtn, SIGNAL(clicked()), this, SLOT(nextLap()) );
212 nextLapBtn->setAccel( Key_Up );
213 lvb->addWidget( nextLapBtn );
214 prevLapBtn = new QToolButton( DownArrow, lapFrame );
215 connect( prevLapBtn, SIGNAL(clicked()), this, SLOT(prevLap()) );
216 prevLapBtn->setAccel( Key_Down );
217 prevLapBtn->setMinimumWidth( 15 );
218 lvb->addWidget( prevLapBtn );
219 prevLapBtn->setEnabled( FALSE );
220 nextLapBtn->setEnabled( FALSE );
221
222 reset->setEnabled( FALSE );
223
224 lapLcd->setNumDigits( 8+1+sw_prec );
225 lapLcd->display( "00:00:00.00" );
226
227 splitLcd->setNumDigits( 8+1+sw_prec );
228 splitLcd->display( "00:00:00.00" );
229
230 lapNumLcd->display( 1 );
231
232 lapTimer = new QTimer( this );
233 connect( lapTimer, SIGNAL(timeout()), this, SLOT(lapTimeout()) );
234
235 for (uint s = 0; s < swatch_splitms.count(); s++ )
236 swatch_splitms[(int)s] = 0;
237
238 connect( qApp, SIGNAL(clockChanged(bool)), this, SLOT(changeClock(bool)) );
239
240 cdGroup->hide(); // XXX implement countdown timer.
241
242 connect( dailyHour, SIGNAL(valueChanged(int)), this, SLOT(scheduleApplyDailyAlarm()) );
243 connect( dailyMinute, SIGNAL(valueChanged(int)), this, SLOT(setDailyMinute(int)) );
244 connect( dailyAmPm, SIGNAL(activated(int)), this, SLOT(setDailyAmPm(int)) );
245 connect( dailyEnabled, SIGNAL(toggled(bool)), this, SLOT(enableDaily(bool)) );
246 cdLcd->display( "00:00" );
247
248 dailyMinute->setValidator(0);
249
250 Config cConfig( "Clock" ); // No tr
251 cConfig.setGroup( "Daily Alarm" );
252
253 QStringList days;
254 days.append( tr("Mon", "Monday") );
255 days.append( tr("Tue", "Tuesday") );
256 days.append( tr("Wed", "Wednesday") );
257 days.append( tr("Thu", "Thursday") );
258 days.append( tr("Fri", "Friday") );
259 days.append( tr("Sat", "Saturday") );
260 days.append( tr("Sun", "Sunday") );
261
262 int i;
263 QHBoxLayout *hb = new QHBoxLayout( daysFrame );
264 for ( i = 0; i < 7; i++ ) {
265 dayBtn[i] = new QToolButton( daysFrame );
266 hb->addWidget( dayBtn[i] );
267 dayBtn[i]->setToggleButton( TRUE );
268 dayBtn[i]->setOn( TRUE );
269 dayBtn[i]->setFocusPolicy( StrongFocus );
270 connect( dayBtn[i], SIGNAL(toggled(bool)), this, SLOT(scheduleApplyDailyAlarm()) );
271 }
172 272
173 connect( qApp, SIGNAL( clockChanged(bool) ), this, SLOT( changeClock(bool) ) ); 273 for ( i = 0; i < 7; i++ )
274 dayBtn[dayBtnIdx(i+1)]->setText( days[i] );
174 275
276 QStringList exclDays = cConfig.readListEntry( "ExcludeDays", ',' );
277 QStringList::Iterator it;
278 for ( it = exclDays.begin(); it != exclDays.end(); ++it ) {
279 int d = (*it).toInt();
280 if ( d >= 1 && d <= 7 )
281 dayBtn[dayBtnIdx(d)]->setOn( FALSE );
282 }
175 283
176 Config config( "qpe" ); 284 bool alarm = cConfig.readBoolEntry("Enabled", FALSE);
177 config.setGroup( "Time" ); 285 bool sound = cConfig.readBoolEntry("SoundEnabled", FALSE );
178 ampm = config.readBoolEntry( "AMPM", TRUE ); 286 dailyEnabled->setChecked( alarm );
287 sndGroup->setEnabled( alarm );
288 sndCheck->setChecked( sound );
289 sndChoose->setEnabled( sound );
290 sndFileName->setEnabled( sound );
291
292 // FIXME ODP migrate to own config class.. merge config options
293 Config cfg_qpe( "qpe" );
294 cfg_qpe.setGroup( "Time" );
295 sndFileName->setText( cfg_qpe.readEntry( "mp3File" ) );
296 //
297
298 int m = cConfig.readNumEntry( "Minute", 0 );
299 dailyMinute->setValue( m );
300// dailyMinute->setPrefix( m <= 9 ? "0" : "" );
301 int h = cConfig.readNumEntry( "Hour", 7 );
302 if ( ampm ) {
303 if (h > 12) {
304 h -= 12;
305 dailyAmPm->setCurrentItem( 1 );
306 }
307 if (h == 0) h = 12;
308 dailyHour->setMinValue( 1 );
309 dailyHour->setMaxValue( 12 );
310 } else {
311 dailyAmPm->hide();
312 }
313 dailyHour->setValue( h );
179 314
180 QString tmp = config.readEntry( "clockAlarmHour", "" ); 315 connect( ((MySpinBox*)dailyHour)->lineEdit(), SIGNAL(textChanged(const QString&)),
181 bool ok; 316 this, SLOT(dailyEdited()) );
182 hour = tmp.toInt( &ok, 10 ); 317 connect( ((MySpinBox*)dailyMinute)->lineEdit(), SIGNAL(textChanged(const QString&)),
183 tmp = config.readEntry( "clockAlarmMinute", "" ); 318 this, SLOT(dailyEdited()) );
184 minute = tmp.toInt( &ok, 10 );
185 319
186 if ( config.readEntry( "clockAlarmSet", "FALSE" ) == "TRUE" ) 320#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
187 { 321 connect( qApp, SIGNAL(appMessage(const QCString&,const QByteArray&)),
188 alarmOffBtn->setText( tr( "Alarm Is On" ) ); 322 this, SLOT(appMessage(const QCString&,const QByteArray&)) );
189 alarmBool = TRUE; 323#endif
190 snoozeBtn->show();
191 }
192 else
193 {
194 alarmOffBtn->setText( tr( "Alarm Is Off" ) );
195 alarmBool = FALSE;
196 snoozeBtn->hide();
197 }
198 324
199 QTimer::singleShot( 0, this, SLOT( updateClock() ) ); 325 QTimer::singleShot( 0, this, SLOT(updateClock()) );
326 swFrame->installEventFilter( this );
200 327
201 Config cfg( "Clock" ); 328 init = TRUE;
202 cfg.setGroup( "Mode" );
203 int mode = cfg.readBoolEntry( "clockMode");
204 setSwatchMode( mode);
205 modeSelect( mode);
206} 329}
207 330
208Clock::~Clock() 331Clock::~Clock()
209{ 332{
210 toggleScreenSaver( true ); 333 toggleScreenSaver( true );
334 delete [] dayBtn;
211} 335}
212 336
213void Clock::updateClock() 337void Clock::updateClock()
214{ 338{
215 if ( clockRB->isChecked() ) 339 if ( tabs->currentPageIndex() == 0 ) {
216 { 340 QTime tm = QDateTime::currentDateTime().time();
217 QTime tm = QDateTime::currentDateTime().time(); 341 QString s;
218 QString s; 342 if ( ampm ) {
219 if ( ampm ) 343 int hour = tm.hour();
220 { 344 if (hour == 0)
221 int hour = tm.hour(); 345 hour = 12;
222 if ( hour == 0 ) 346 if (hour > 12)
223 hour = 12; 347 hour -= 12;
224 if ( hour > 12 ) 348 s.sprintf( "%2d%c%02d", hour, ':', tm.minute() );
225 hour -= 12; 349 clockAmPm->setText( (tm.hour() >= 12) ? "PM" : "AM" );
226 s.sprintf( "%2d%c%02d", hour, ':', tm.minute() ); 350 clockAmPm->show();
227 ampmLabel->setText( ( tm.hour() >= 12 ) ? "PM" : "AM" ); 351 } else {
228 ampmLabel->show(); 352 s.sprintf( "%2d%c%02d", tm.hour(), ':', tm.minute() );
229 } 353 clockAmPm->hide();
230 else 354 }
231 { 355 clockLcd->display( s );
232 s.sprintf( "%2d%c%02d", tm.hour(), ':', tm.minute() ); 356 clockLcd->repaint( FALSE );
233 ampmLabel->hide(); 357 analogClock->display( QTime::currentTime() );
234 } 358 date->setText( TimeString::dateString( QDate::currentDate(), TimeString::currentDateFormat() ) );
235 lcd->display( s ); 359 } else if ( tabs->currentPageIndex() == 1 ) {
236 lcd->repaint( FALSE ); 360 int totalms = swatch_totalms;
237 aclock->display( QTime::currentTime() ); 361 if ( swatch_running )
238 date->setText( TimeString::longDateString( QDate::currentDate() ) ); 362 totalms += swatch_start.elapsed();
239 } 363 setSwatchLcd( stopwatchLcd, totalms, !swatch_running );
240 else 364 QTime swatch_time = QTime(0,0,0).addMSecs(totalms);
241 { 365 analogStopwatch->display( swatch_time );
242 QTime swatch_time; 366 if ( swatch_dispLap == swatch_currLap ) {
243 QString lcdtext; 367 swatch_splitms[swatch_currLap] = swatch_totalms;
244 int totalms = swatch_totalms; 368 if ( swatch_running )
245 if ( swatch_running ) 369 swatch_splitms[swatch_currLap] += swatch_start.elapsed();
246 totalms += swatch_start.elapsed(); 370 updateLap();
247 swatch_time = QTime( 0, 0, 0 ).addMSecs( totalms ); 371 }
248 QString d = swatch_running ? QString( " " ) 372 } else if ( tabs->currentPageIndex() == 2 ) {
249 : QString::number( totalms % 1000 + 1000 ); 373 // nothing.
250 lcdtext = swatch_time.toString() + "." + d.right( 3 ).left( sw_prec );
251 lcd->display( lcdtext );
252 lcd->repaint( FALSE );
253 aclock->display( swatch_time );
254 date->setText( TimeString::longDateString( QDate::currentDate() ) );
255 } 374 }
256} 375}
257 376
258void Clock::changeClock( bool a ) 377void Clock::changeClock( bool a )
259{ 378{
260 ampm = a; 379 if ( ampm != a ) {
261 updateClock(); 380 int minute = dailyMinute->value();
381 int hour = dailyHour->value();
382 if ( ampm ) {
383 if (hour == 12)
384 hour = 0;
385 if (dailyAmPm->currentItem() == 1 )
386 hour += 12;
387 dailyHour->setMinValue( 0 );
388 dailyHour->setMaxValue( 23 );
389 dailyAmPm->hide();
390 } else {
391 if (hour > 12) {
392 hour -= 12;
393 dailyAmPm->setCurrentItem( 1 );
394 }
395 if (hour == 0) hour = 12;
396 dailyHour->setMinValue( 1 );
397 dailyHour->setMaxValue( 12 );
398 dailyAmPm->show();
399 }
400 dailyMinute->setValue( minute );
401 dailyHour->setValue( hour );
402 }
403 ampm = a;
404 updateClock();
262} 405}
263 406
264void Clock::clearClock( void ) 407void Clock::stopStartStopWatch()
265{ 408{
266 lcd->display( QTime( 0, 0, 0 ).toString() ); 409 if ( swatch_running ) {
267 aclock->display( QTime( 0, 0, 0 ) ); 410 swatch_totalms += swatch_start.elapsed();
411 swatch_splitms[swatch_currLap] = swatch_totalms;
412 stopStart->setText( tr("Start") );
413 reset->setText( tr("Reset") );
414 reset->setEnabled( TRUE );
415 t->stop();
416 swatch_running = FALSE;
417 toggleScreenSaver( TRUE );
418 updateClock();
419 } else {
420 swatch_start.start();
421 stopStart->setText( tr("Stop") );
422 reset->setText( tr("Lap/Split") );
423 reset->setEnabled( swatch_currLap < 98 );
424 t->start( 1000 );
425 swatch_running = TRUE;
426 // disable screensaver while stop watch is running
427 toggleScreenSaver( FALSE );
428 }
429 swatch_dispLap = swatch_currLap;
430 updateLap();
431 prevLapBtn->setEnabled( swatch_dispLap );
432 nextLapBtn->setEnabled( swatch_dispLap < swatch_currLap );
433 stopStart->setAccel( Key_Return );
268} 434}
269 435
270void Clock::startSWatch() 436void Clock::resetStopWatch()
271{ 437{
272 if(swatch_running) { 438 if ( swatch_running ) {
273 stopSWatch(); 439 swatch_splitms[swatch_currLap] = swatch_totalms+swatch_start.elapsed();
274 return; 440 swatch_dispLap = swatch_currLap;
275 } 441 if ( swatch_currLap < 98 ) // allow up to 99 laps
276 qDebug("startSWatch()"); 442 swatch_currLap++;
277 swatch_start.start(); 443 reset->setEnabled( swatch_currLap < 98 );
278 set->setText( tr( "Stop" ) ); 444 updateLap();
279 t->start( 1000 ); 445 lapTimer->start( 2000, TRUE );
280 swatch_running = TRUE; 446 } else {
281 // disable screensaver while stop watch is running 447 swatch_start.start();
282 toggleScreenSaver( FALSE ); 448 swatch_totalms = 0;
449 swatch_currLap = 0;
450 swatch_dispLap = 0;
451 for ( uint i = 0; i < swatch_splitms.count(); i++ )
452 swatch_splitms[(int)i] = 0;
453 updateLap();
454 updateClock();
455 reset->setText( tr("Lap/Split") );
456 reset->setEnabled( FALSE );
457 }
458 prevLapBtn->setEnabled( swatch_dispLap );
459 nextLapBtn->setEnabled( swatch_dispLap < swatch_currLap );
283} 460}
284 461
285void Clock::stopSWatch() 462void Clock::prevLap()
286{ 463{
287 qDebug("stopSWatch()"); 464 if ( swatch_dispLap > 0 ) {
288 swatch_totalms += swatch_start.elapsed(); 465 swatch_dispLap--;
289 set->setText( tr( "Start" ) ); 466 updateLap();
290 t->stop(); 467 prevLapBtn->setEnabled( swatch_dispLap );
291 swatch_running = FALSE; 468 nextLapBtn->setEnabled( swatch_dispLap < swatch_currLap );
292 toggleScreenSaver( TRUE ); 469 }
293 updateClock();
294} 470}
295 471
296 472void Clock::nextLap()
297void Clock::slotSet()
298{ 473{
299 if ( t->isActive() ) 474 if ( swatch_dispLap < swatch_currLap ) {
300 { 475 swatch_dispLap++;
301 startSWatch(); 476 updateLap();
302 } 477 prevLapBtn->setEnabled( swatch_dispLap );
303 else 478 nextLapBtn->setEnabled( swatch_dispLap < swatch_currLap );
304 {
305 stopSWatch();
306 } 479 }
307} 480}
308 481
309void Clock::slotReset() 482void Clock::lapTimeout()
310{ 483{
311 t->stop(); 484 swatch_dispLap = swatch_currLap;
312 swatch_start.start(); 485 updateLap();
313 swatch_totalms = 0; 486 prevLapBtn->setEnabled( swatch_dispLap );
314 487 nextLapBtn->setEnabled( swatch_dispLap < swatch_currLap );
315 if ( swatch_running )
316 t->start( 1000 );
317
318 updateClock();
319}
320
321void Clock::modeSelect( int m )
322{
323 qDebug("Clock::modeSelect( %d) ", m);
324 if ( m != 0 )
325 {
326 lcd->setNumDigits( 8 + 1 + sw_prec );
327 lcd->setMinimumWidth( lcd->sizeHint().width() );
328 set->setEnabled( TRUE );
329 reset->setEnabled( TRUE );
330 ampmLabel->hide();
331
332// if(m == 2) {
333 if ( !swatch_running ) {
334 t->start( 1000 );
335 }
336// else
337// {
338// stopSWatch();
339// }
340// }
341 }
342 else //clock mode
343 {
344 lcd->setNumDigits( 5 );
345 lcd->setMinimumWidth( lcd->sizeHint().width() );
346 set->setEnabled( FALSE );
347 reset->setEnabled( FALSE );
348 t->start( 1000 );
349 }
350
351 Config config( "Clock" );
352 config.setGroup( "Mode" );
353 config.writeEntry( "clockMode", m );
354 updateClock();
355} 488}
356 489
357//this sets the alarm time 490void Clock::updateLap()
358void Clock::slotSetAlarm()
359{ 491{
360 if ( !snoozeBtn->isHidden() ) 492 if ( swatch_running && swatch_currLap == swatch_dispLap ) {
361 slotToggleAlarm(); 493 swatch_splitms[swatch_currLap] = swatch_totalms;
362 Set_Alarm *setAlarmDlg; 494 swatch_splitms[swatch_currLap] += swatch_start.elapsed();
363 setAlarmDlg = new Set_Alarm( this, "SetAlarm", TRUE );
364 int result = setAlarmDlg->exec();
365 if ( result == 1 ) {
366 Config config( "qpe" );
367 config.setGroup( "Time" );
368 QString tmp;
369 hour = setAlarmDlg->Hour_Slider->value();
370 minute = setAlarmDlg->Minute_Slider->value();
371 snoozeTime = setAlarmDlg->SnoozeSlider->value();
372 if ( ampm ) {
373 if ( hour == 12 )
374 hour = 0;
375
376 if ( setAlarmDlg->Pm_RadioButton->isChecked() && hour < 12 )
377 hour += 12;
378 } 495 }
379 config.writeEntry( "clockAlarmHour", tmp.setNum( hour ), 10 ); 496 int split = swatch_splitms[swatch_dispLap];
380 config.writeEntry( "clockAlarmMinute", tmp.setNum( minute ), 10 ); 497 int lap;
381 config.writeEntry( "clockAlarmSnooze", tmp.setNum( snoozeTime ), 10 ); 498 if ( swatch_dispLap > 0 )
382 config.write(); 499 lap = swatch_splitms[swatch_dispLap] - swatch_splitms[swatch_dispLap-1];
383 } 500 else
384} 501 lap = swatch_splitms[swatch_dispLap];
385 502
386void Clock::slotSnooze() 503 lapNumLcd->display( swatch_dispLap+1 );
387{ 504 bool showMs = !swatch_running || swatch_dispLap!=swatch_currLap;
388 bSound = FALSE; 505 setSwatchLcd( lapLcd, lap, showMs );
389 int warn = 0; 506 setSwatchLcd( splitLcd, split, showMs );
390 QTime t = QTime::currentTime(); 507}
391 QDateTime whenl( when.date(), t.addSecs( snoozeTime * 60 ) );
392 when = whenl;
393 AlarmServer::addAlarm( when,
394 "QPE/Application/clock",
395 "alarm(QDateTime,int)", warn );
396
397}
398
399//toggles alarm on/off
400void Clock::slotToggleAlarm()
401{
402 Config config( "qpe" );
403 config.setGroup( "Time" );
404 if ( alarmBool )
405 {
406 config.writeEntry( "clockAlarmSet", "FALSE" );
407 alarmOffBtn->setText( tr( "Alarm Is Off" ) );
408 snoozeBtn->hide();
409 alarmBool = FALSE;
410 alarmOff();
411 }
412 else
413 {
414 config.writeEntry( "clockAlarmSet", "TRUE" );
415 alarmOffBtn->setText( tr( "Alarm Is On" ) );
416 snoozeBtn->show();
417 alarmBool = TRUE;
418 alarmOn();
419 }
420 config.write();
421}
422
423void Clock::alarmOn()
424{
425 QDate d = QDate::currentDate();
426 QTime tm( ( int ) hour, ( int ) minute, 0 );
427 qDebug( "Time set " + tm.toString() );
428 QTime t = QTime::currentTime();
429 if ( t > tm )
430 d = d.addDays( 1 );
431 int warn = 0;
432 QDateTime whenl( d, tm );
433 when = whenl;
434 AlarmServer::addAlarm( when,
435 "QPE/Application/clock",
436 "alarm(QDateTime,int)", warn );
437// setCaption( "Alarm set: " + whenl.toString() );
438 setCaption( tr("Alarm set: %1" ).arg(whenl.toString()) );
439}
440
441void Clock::alarmOff()
442{
443 int warn = 0;
444 bSound = FALSE;
445 AlarmServer::deleteAlarm( when,
446 "QPE/Application/clock",
447 "alarm(QDateTime,int)", warn );
448 qDebug( "Alarm Off " + when.toString() );
449 setCaption( tr("Clock") );
450}
451
452void Clock::clearTimer()
453{
454 alarmOffBtn->setText( tr( "Alarm Is Off" ) );
455 alarmBool = FALSE;
456 snoozeBtn->hide();
457 setCaption( tr("Clock") );
458}
459
460void Clock::appMessage( const QCString& msg, const QByteArray& /*data*/ )
461{
462 int stopTimer = 0;
463 int timerStay = 5000;
464 bSound = TRUE;
465 qDebug( "Message received in clock" );
466 if ( msg == "alarm(QDateTime,int)" )
467 {
468 Config config( "qpe" );
469 config.setGroup( "Time" );
470 if ( config.readBoolEntry( "mp3Alarm", 0 ) )
471 {
472 clearTimer();
473 pthread_t thread;
474 pthread_create(&thread, NULL, (void * (*) (void *))startPlayer, NULL/* &*/);
475
476 }
477 else
478 {
479 508
480 Sound::soundAlarm(); 509void Clock::setSwatchLcd( QLCDNumber *lcd, int ms, bool showMs )
481 stopTimer = startTimer( timerStay ); 510{
482 } 511 QTime swatch_time = QTime(0,0,0).addMSecs(ms);
483 } 512 QString d = showMs ? QString::number(ms%1000+1000) : QString(" ");
513 QString lcdtext = swatch_time.toString() + "." + d.right(3).left(sw_prec);
514 lcd->display( lcdtext );
515 lcd->repaint( FALSE );
516}
484 517
485 if ( msg == "timerStart()" ) 518bool Clock::eventFilter( QObject *o, QEvent *e )
486 { 519{
487 slotStartTimer(); 520 if ( o == swFrame && e->type() == QEvent::Resize ) {
488 } 521 QResizeEvent *re = (QResizeEvent *)e;
489 if ( msg == "timerStop()" ) 522 delete swLayout;
490 { 523 if ( re->size().height() < 80 || re->size().height()*3 < re->size().width() )
491 slotStopTimer(); 524 swLayout = new QHBoxLayout( swFrame );
492 } 525 else
493 if ( msg == "timerReset()" ) 526 swLayout = new QVBoxLayout( swFrame );
494 { 527 swLayout->addWidget( analogStopwatch );
495 slotResetTimer(); 528 swLayout->addWidget( stopwatchLcd );
529 swLayout->activate();
496 } 530 }
497 531
498 show(); 532 return FALSE;
499 raise();
500 QPEApplication::setKeepRunning();
501 setActiveWindow();
502} 533}
503 534
504void Clock::timerEvent( QTimerEvent *e ) 535void Clock::tabChanged( QWidget * )
505{ 536{
506 static int stop = 0; 537 if ( tabs->currentPageIndex() == 0 ) {
507 if ( stop < 120 && bSound ) 538 t->start(1000);
508 { 539 } else if ( tabs->currentPageIndex() == 1 ) {
509 Sound::soundAlarm(); 540 if ( !swatch_running )
510 stop++; 541 t->stop();
511 } 542 stopStart->setAccel( Key_Return );
512 else 543 } else if ( tabs->currentPageIndex() == 2 ) {
513 { 544 t->start(1000);
514 stop = 0;
515 killTimer( e->timerId() );
516 clearTimer();
517 setCaption( tr( "Clock: Alarm was missed." ) );
518 } 545 }
546 updateClock();
519} 547}
520 548
521AnalogClock::AnalogClock(QWidget * parent, const char * name) : QFrame( parent, name ), clear(true) 549void Clock::setDailyAmPm(int)
522{ 550{
523 QWidget *d = QApplication::desktop(); 551 scheduleApplyDailyAlarm();
524 if(d->width() <= 240)
525 bg = Resource::loadPixmap("clock/bg");
526} 552}
527 553
528QSizePolicy AnalogClock::sizePolicy() const 554void Clock::setDailyMinute( int m )
529{ 555{
530 return QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); 556 dailyMinute->setPrefix( m <= 9 ? "0" : "" );
531} 557}
532 558
533void AnalogClock::drawContents( QPainter *p ) 559void Clock::dailyEdited()
534{ 560{
535 QRect r = contentsRect(); 561 if ( spinBoxValid(dailyMinute) && spinBoxValid(dailyHour) )
536 QRect fr; 562 scheduleApplyDailyAlarm();
537 563 else
538 p->drawPixmap(QPoint(0, 0), bg, r); 564 applyAlarmTimer->stop();
539 565}
540 if ( r. width ( ) > r. height ( ))
541 fr. setRect (( r. width ( ) - r. height ( )) / 2, r. y ( ), r. height ( ), r. height ( ));
542 else
543 fr. setRect ( r. x ( ), ( r. height ( ) - r. width ( )) / 2, r. width ( ), r. width ( ));
544
545 QPoint center = fr. center ( ); // ( fr.x() + fr.width() / 2, fr.y() + fr.height() / 2 );
546 QPoint l1 ( center. x ( ), fr. y ( ) + 2 );
547 QPoint l2 ( center. x ( ), fr. y ( ) + 8 );
548
549
550 566
551 if ( clear ) 567void Clock::enableDaily( bool )
552 { 568{
553 erase ( r ); 569 scheduleApplyDailyAlarm();
554 p-> setPen ( NoPen ); 570}
555 p-> setBrush ( colorGroup ( ). color ( QColorGroup::Base ));
556 p-> drawEllipse ( fr );
557 p-> setBrush ( NoBrush );
558 571
559 // draw ticks 572void Clock::appMessage( const QCString &msg, const QByteArray &data )
560 p->setPen( QPen( colorGroup ( ). color ( QColorGroup::Text ), 1 ) ); 573{
561 for ( int i = 0; i < 12; i++ ) 574 if ( msg == "alarm(QDateTime,int)" ) {
562 p->drawLine( rotate( center, l1, i * 30 ), rotate( center, l2, i * 30 ) ); 575 QDataStream ds(data,IO_ReadOnly);
563 } 576 QDateTime when;
564 else 577 int t;
565 { 578 ds >> when >> t;
566 drawPointers ( p, fr, colorGroup ( ). color ( QColorGroup::Base ), prevTime, &currTime ); 579 QTime theTime( when.time() );
580 if ( t == magic_daily || t == magic_snooze ||
581 t == magic_playmp ) {
582 QString msg = tr("<b>Daily Alarm:</b><p>");
583 QString ts;
584 if ( ampm ) {
585 bool pm = FALSE;
586 int h = theTime.hour();
587 if (h > 12) {
588 h -= 12;
589 pm = TRUE;
590 }
591 if (h == 0) h = 12;
592 ts.sprintf( "%02d:%02d %s", h, theTime.minute(), pm?"PM":"AM" );
593 } else {
594 ts.sprintf( "%02d:%02d", theTime.hour(), theTime.minute() );
595 }
596 msg += ts;
597
598 if (t == magic_playmp ) {
599 pthread_t thread;
600 pthread_create(&thread,NULL, (void * (*) (void *))startPlayer, NULL/* &*/ );
601 }else {
602 Sound::soundAlarm();
603 alarmCount = 0;
604 alarmt->start( 5000 );
605 }
606 if ( !alarmDlg ) {
607 alarmDlg = new AlarmDlg(this);
608 }
609 alarmDlg->setText(msg);
610
611 // Set for tomorrow, so user wakes up every day, even if they
612 // don't confirm the dialog. Don't set it again when snoozing.
613 if (t != magic_snooze) {
614 applyDailyAlarm();
615 }
616
617
618 if ( !alarmDlg->isVisible() ) {
619 QPEApplication::execDialog(alarmDlg);
620 alarmt->stop();
621 }
622 } else if ( t == magic_countdown ) {
623 // countdown
624 Sound::soundAlarm();
625 }
626 } else if ( msg == "setDailyEnabled(int)" ) {
627 QDataStream ds(data,IO_ReadOnly);
628 int enableDaily;
629 ds >> enableDaily;
630 dailyEnabled->setChecked( enableDaily );
631 applyDailyAlarm();
632 } else if ( msg == "editDailyAlarm()" ) {
633 tabs->setCurrentPage(2);
634 QPEApplication::setKeepRunning();
635 } else if (msg == "showClock()") {
636 tabs->setCurrentPage(0);
637 QPEApplication::setKeepRunning();
638 } else if (msg == "timerStart()" ) {
639 if ( !swatch_running )
640 stopStartStopWatch();
641 tabs->setCurrentPage(1);
642 QPEApplication::setKeepRunning();
643 } else if (msg == "timerStop()" ) {
644 if ( swatch_running )
645 stopStartStopWatch();
646 tabs->setCurrentPage(1);
647 QPEApplication::setKeepRunning();
648 } else if (msg == "timerReset()" ) {
649 resetStopWatch();
650 tabs->setCurrentPage(1);
651 QPEApplication::setKeepRunning();
567 } 652 }
568
569 drawPointers ( p, fr, colorGroup ( ). color ( QColorGroup::Text ), currTime );
570
571 prevTime = currTime;
572} 653}
573 654
574void AnalogClock::drawPointers ( QPainter *p, const QRect &r, const QColor &c, const QTime &t, const QTime *t2 ) 655void Clock::alarmTimeout()
575{ 656{
576 QPoint center = r. center ( ); 657 if ( alarmCount < 10 ) {
577 658 Sound::soundAlarm();
578 QPoint h1( center. x ( ), r. y ( ) + r. height ( ) / 4 ); 659 alarmCount++;
579 QPoint h2( center. x ( ), center. y ( ) ); 660 } else {
580 661 alarmCount = 0;
581 QPoint m1( center. x ( ), r.y() + r.height() / 8 ); 662 alarmt->stop();
582 QPoint m2( center. x ( ), center. y ( ) ); 663 }
583 664}
584 QPoint s1( center. x ( ), r. y ( ) + 8 );
585 QPoint s2( center. x ( ), center. y ( ) );
586
587
588 if ( !t2 || ( t. minute ( ) != t2-> minute ( ) || t. hour ( ) != t2-> hour ( ))) {
589 // draw hour pointer
590 h1 = rotate( center, h1, 30 * ( t.hour() % 12 ) + t.minute() / 2 );
591 h2 = rotate( center, h2, 30 * ( t.hour() % 12 ) + t.minute() / 2 );
592 p-> setPen ( QPen ( c, 3 ));
593 p-> drawLine ( h1, h2 );
594 }
595 665
596 if ( !t2 || ( t. minute ( ) != t2-> minute ( ))) { 666QDateTime Clock::nextAlarm( int h, int m )
597 // draw minute pointer 667{
598 m1 = rotate( center, m1, t.minute() * 6 ); 668 QDateTime now = QDateTime::currentDateTime();
599 m2 = rotate( center, m2, t.minute() * 6 ); 669 QTime at( h, m );
600 p-> setPen ( QPen ( c, 2 )); 670 QDateTime when( now.date(), at );
601 p-> drawLine ( m1, m2 ); 671 int count = 0;
602 } 672 int dow = when.date().dayOfWeek();
673 while ( when < now || !dayBtn[dayBtnIdx(dow)]->isOn() ) {
674 when = when.addDays( 1 );
675 dow = when.date().dayOfWeek();
676 if ( ++count > 7 )
677 return QDateTime();
678 }
603 679
604 if ( !t2 || ( t. second ( ) != t2-> second ( ))) { 680 return when;
605 // draw second pointer
606 s1 = rotate( center, s1, t.second() * 6 );
607 s2 = rotate( center, s2, t.second() * 6 );
608 p-> setPen ( QPen ( c, 1 ));
609 p-> drawLine ( s1, s2 );
610 }
611} 681}
612 682
613void AnalogClock::display( const QTime& t ) 683int Clock::dayBtnIdx( int d ) const
614{ 684{
615 currTime = t; 685 if ( onMonday )
616 clear = false; 686 return d-1;
617 repaint( false ); 687 else if ( d == 7 )
618 clear = true; 688 return 0;
689 else
690 return d;
619} 691}
620 692
621QPoint AnalogClock::rotate( QPoint c, QPoint p, int a ) 693void Clock::scheduleApplyDailyAlarm()
622{ 694{
623 double angle = deg2rad * ( - a + 180 ); 695 applyAlarmTimer->start( 5000, TRUE );
624 double nx = c.x() - ( p.x() - c.x() ) * cos( angle ) -
625 ( p.y() - c.y() ) * sin( angle );
626 double ny = c.y() - ( p.y() - c.y() ) * cos( angle ) +
627 ( p.x() - c.x() ) * sin( angle );
628 return QPoint( nx, ny );
629} 696}
630 697
631void Clock::slotAdjustTime() 698void Clock::applyDailyAlarm()
632{ 699{
633 QCopEnvelope e( "QPE/System", "execute(QString)" ); 700 if ( !init )
634 e << QString( "systemtime" ); 701 return;
702
703 applyAlarmTimer->stop();
704 int minute = dailyMinute->value();
705 int hour = dailyHour->value();
706 if ( ampm ) {
707 if (hour == 12)
708 hour = 0;
709 if (dailyAmPm->currentItem() == 1 )
710 hour += 12;
711 }
712
713 Config config( "Clock" );
714 config.setGroup( "Daily Alarm" );
715 config.writeEntry( "Hour", hour );
716 config.writeEntry( "Minute", minute );
717
718 bool enableDaily = dailyEnabled->isChecked();
719 bool wasSound = config.readEntry( "SoundEnabled" );
720 bool isSound = sndCheck->isChecked();
721 int oldMagic = wasSound ? magic_playmp : magic_daily;
722 int isMagic = isSound ? magic_playmp : magic_daily;
723 config.writeEntry( "Enabled", enableDaily );
724 config.writeEntry( "SoundEnabled", isSound );
725
726 QString exclDays;
727 int exclCount = 0;
728 for ( int i = 1; i <= 7; i++ ) {
729 if ( !dayBtn[dayBtnIdx(i)]->isOn() ) {
730 if ( !exclDays.isEmpty() )
731 exclDays += ",";
732 exclDays += QString::number( i );
733 exclCount++;
734 }
735 }
736 config.writeEntry( "ExcludeDays", exclDays );
737
738 /* try to delete both */
739 AlarmServer::deleteAlarm(QDateTime(), "QPE/Application/clock",
740 "alarm(QDateTime,int)", oldMagic);
741 if ( enableDaily && exclCount < 7 ) {
742 QDateTime when = nextAlarm( hour, minute );
743 AlarmServer::addAlarm(when, "QPE/Application/clock",
744 "alarm(QDateTime,int)", isMagic);
745 }
635} 746}
636 747
637void Clock::slotStartTimer() 748bool Clock::validDaysSelected(void)
638{ 749{
639 if ( clockRB->isChecked() ) 750 for ( int i = 1; i <= 7; i++ ) {
640 setSwatchMode( 1); 751 if ( dayBtn[dayBtnIdx(i)]->isOn() ) {
641 startSWatch(); 752 return TRUE;
753 }
754 }
755 return FALSE;
642} 756}
643 757
644void Clock::slotStopTimer() 758void Clock::closeEvent( QCloseEvent *e )
645{ 759{
646 if ( clockRB->isChecked() ) 760 if (dailyEnabled->isChecked()) {
647 setSwatchMode( 1); 761 if (!validDaysSelected()) {
648 stopSWatch(); 762 QMessageBox::warning(this, tr("Select Day"),
763 tr("Daily alarm requires at least\none day to be selected."));
764 return;
765 }
766 }
767
768 applyDailyAlarm();
769 ClockBase::closeEvent(e);
649} 770}
650 771
651void Clock::slotResetTimer() 772bool Clock::spinBoxValid( QSpinBox *sb )
652{ 773{
653 if ( clockRB->isChecked() ) 774 bool valid = TRUE;
654 setSwatchMode( 1); 775 QString tv = sb->text();
655slotReset(); 776 for ( uint i = 0; i < tv.length(); i++ ) {
777 if ( !tv[0].isDigit() )
778 valid = FALSE;
779 }
780 bool ok = FALSE;
781 int v = tv.toInt( &ok );
782 if ( !ok )
783 valid = FALSE;
784 if ( v < sb->minValue() || v > sb->maxValue() )
785 valid = FALSE;
786
787 return valid;
656} 788}
657 789
658void Clock::setSwatchMode(int mode) 790void Clock::slotBrowseMp3File() {
659{ 791 Config config( "qpe" );
660 qDebug("Clock::setSwatchMode( %d)", mode); 792 config.setGroup("Time");
661 swatchRB->setChecked( mode); 793
662 clearClock( ); 794 QMap<QString, QStringList> map;
663 modeSelect( mode ); 795 map.insert(tr("All"), QStringList() );
796 QStringList text;
797 text << "audio/*";
798 map.insert(tr("Audio"), text );
799 QString str = Opie::Ui::OFileDialog::getOpenFileName( 2,"/", QString::null, map);
800 if(!str.isEmpty() ) {
801 config.writeEntry("mp3Alarm",1);
802 config.writeEntry("mp3File",str);
803 sndFileName->setText( str );
804 scheduleApplyDailyAlarm();
805 }
664} 806}
diff --git a/noncore/tools/clock/clock.h b/noncore/tools/clock/clock.h
index 00d097d..c063a9b 100644
--- a/noncore/tools/clock/clock.h
+++ b/noncore/tools/clock/clock.h
@@ -1,112 +1,116 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of the 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#ifndef CLOCK_H 20#ifndef CLOCK_H
21#define CLOCK_H 21#define CLOCK_H
22 22
23#include "clockbase.h"
24#include "alarmdlgbase.h"
23#include <qdatetime.h> 25#include <qdatetime.h>
24#include <qvbox.h>
25#include <qpixmap.h>
26 26
27class QLCDNumber;
28class QLabel;
29class QTimer; 27class QTimer;
30class QRadioButton; 28class QLabel;
31class QPushButton; 29class QDialog;
32class QDateTime; 30class AnalogClock;
31class QBoxLayout;
32class QToolButton;
33 33
34class AnalogClock : public QFrame 34class AlarmDlg: public AlarmDlgBase
35{ 35{
36 Q_OBJECT 36 Q_OBJECT
37 37
38public: 38public:
39 AnalogClock( QWidget * parent = 0, const char * name = 0 ); 39 AlarmDlg(QWidget *parent = 0, const char *name = 0, bool modal = TRUE,
40 40 const QString &txt = "Alarm");
41 QSizePolicy sizePolicy() const;
42
43 void display( const QTime& time );
44
45
46protected:
47 void drawContents( QPainter *p );
48
49private:
50 41
51 QPixmap bg; 42 void setText(const QString &txt);
52 QTime currTime;
53 QTime prevTime;
54 bool clear;
55 43
56 QPoint rotate( QPoint center, QPoint p, int angle );
57 void drawPointers ( QPainter *, const QRect &r, const QColor &c, const QTime &t, const QTime *t2 = 0 );
58 44
45private slots:
46 void checkSnooze(void);
47 void changePrompt(int minutes);
59}; 48};
60 49
61class Clock : public QVBox 50class Clock : public ClockBase
62{ 51{
63 Q_OBJECT 52 Q_OBJECT
64 53
65public: 54public:
66 Clock( QWidget * parent = 0, const char * name = 0, WFlags f=0 ); 55 Clock( QWidget *parent=0, const char *name=0, WFlags fl=0 );
67 ~Clock(); 56 ~Clock();
68 QDateTime when; 57 QDateTime when;
69 bool bSound; 58 bool bSound;
70 int hour, minute, snoozeTime; 59 int hour, minute, snoozeTime;
71 static QString appName() { return QString::fromLatin1("clock"); } 60 static QString appName() { return QString::fromLatin1("clock"); }
72 61
73private slots: 62private slots:
74 void slotSet(); 63 void stopStartStopWatch();
75 void slotReset(); 64 void resetStopWatch();
76 void modeSelect(int); 65 void prevLap();
66 void nextLap();
67 void lapTimeout();
68 void tabChanged(QWidget*);
77 void updateClock(); 69 void updateClock();
78 void changeClock( bool ); 70 void changeClock( bool );
79 void slotSetAlarm(); 71 void setDailyAmPm( int );
80 void slotSnooze(); 72 void setDailyMinute( int );
81 void slotToggleAlarm(); 73 void dailyEdited();
82 void alarmOn(); 74 void enableDaily( bool );
83 void alarmOff();
84 void appMessage(const QCString& msg, const QByteArray& data); 75 void appMessage(const QCString& msg, const QByteArray& data);
85 void timerEvent( QTimerEvent *e ); 76 void alarmTimeout();
86 void slotAdjustTime(); 77 void applyDailyAlarm();
78 void scheduleApplyDailyAlarm();
79 void slotBrowseMp3File();
80
81protected:
82 QDateTime nextAlarm( int h, int m );
83 int dayBtnIdx( int ) const;
84 void closeEvent( QCloseEvent *e );
85 void updateLap();
86 void setSwatchLcd( QLCDNumber *lcd, int ms, bool showMs );
87 bool eventFilter( QObject *, QEvent * );
88 bool spinBoxValid( QSpinBox *sb );
89 bool validDaysSelected(void);
87 90
88 void slotStartTimer();
89 void slotStopTimer();
90 void slotResetTimer();
91 void setSwatchMode( int );
92private: 91private:
93 bool alarmBool;
94 QTimer *t; 92 QTimer *t;
95 QLCDNumber *lcd; 93 QTimer *alarmt;
96 QLabel *date;
97 QLabel *ampmLabel;
98 QPushButton *set, *reset, *alarmBtn, *snoozeBtn, *alarmOffBtn;
99 QRadioButton *clockRB, *swatchRB;
100 AnalogClock *aclock;
101 QTime swatch_start; 94 QTime swatch_start;
102 int swatch_totalms; 95 int swatch_totalms;
96 QArray<int> swatch_splitms;
103 bool swatch_running; 97 bool swatch_running;
98 int swatch_currLap;
99 int swatch_dispLap;
100 QToolButton *prevLapBtn;
101 QToolButton *nextLapBtn;
102 QTimer *lapTimer;
103 AnalogClock* analogStopwatch;
104 QLCDNumber* stopwatchLcd;
105 QBoxLayout *swLayout;
104 bool ampm; 106 bool ampm;
105 void clearClock(); 107 bool onMonday;
106 void clearTimer(); 108 int alarmCount;
107 void startSWatch(); 109 AlarmDlg* alarmDlg;
108 void stopSWatch(); 110 QToolButton **dayBtn;
111 bool init;
112 QTimer *applyAlarmTimer;
109}; 113};
110 114
111#endif 115#endif
112 116
diff --git a/noncore/tools/clock/clock.pro b/noncore/tools/clock/clock.pro
index ad5c205..90a8d29 100644
--- a/noncore/tools/clock/clock.pro
+++ b/noncore/tools/clock/clock.pro
@@ -1,10 +1,15 @@
1CONFIG = qt warn_on quick-app 1CONFIG = qt warn_on quick-app
2HEADERS = clock.h setAlarm.h 2HEADERS = clock.h analogclock.h
3SOURCES = clock.cpp setAlarm.cpp \ 3SOURCES = clock.cpp analogclock.cpp \
4 main.cpp 4 main.cpp
5
5INCLUDEPATH += $(OPIEDIR)/include 6INCLUDEPATH += $(OPIEDIR)/include
6DEPENDPATH += $(OPIEDIR)/include 7DEPENDPATH += $(OPIEDIR)/include
7LIBS += -lqpe -lopiecore2 -lopieui2 -lpthread 8LIBS += -lqpe -lopiecore2 -lopieui2 -lpthread
8TARGET = clock 9TARGET = clock
9 10
11
12 INTERFACES= clockbase.ui \
13 alarmdlgbase.ui
14
10include ( $(OPIEDIR)/include.pro ) 15include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/tools/clock/clockbase.ui b/noncore/tools/clock/clockbase.ui
index 91d0da0..0e1a90e 100644
--- a/noncore/tools/clock/clockbase.ui
+++ b/noncore/tools/clock/clockbase.ui
@@ -1,111 +1,111 @@
1<!DOCTYPE UI><UI> 1<!DOCTYPE UI><UI>
2<class>ClockBase</class> 2<class>ClockBase</class>
3<widget> 3<widget>
4 <class>QWidget</class> 4 <class>QWidget</class>
5 <property stdset="1"> 5 <property stdset="1">
6 <name>name</name> 6 <name>name</name>
7 <cstring>ClockBase</cstring> 7 <cstring>ClockBase</cstring>
8 </property> 8 </property>
9 <property stdset="1"> 9 <property stdset="1">
10 <name>geometry</name> 10 <name>geometry</name>
11 <rect> 11 <rect>
12 <x>0</x> 12 <x>0</x>
13 <y>0</y> 13 <y>0</y>
14 <width>220</width> 14 <width>287</width>
15 <height>337</height> 15 <height>389</height>
16 </rect> 16 </rect>
17 </property> 17 </property>
18 <property stdset="1"> 18 <property stdset="1">
19 <name>caption</name> 19 <name>caption</name>
20 <string>Clock</string> 20 <string>Clock</string>
21 </property> 21 </property>
22 <property> 22 <property>
23 <name>layoutMargin</name> 23 <name>layoutMargin</name>
24 </property> 24 </property>
25 <vbox> 25 <vbox>
26 <property stdset="1"> 26 <property stdset="1">
27 <name>margin</name> 27 <name>margin</name>
28 <number>6</number> 28 <number>6</number>
29 </property> 29 </property>
30 <property stdset="1"> 30 <property stdset="1">
31 <name>spacing</name> 31 <name>spacing</name>
32 <number>6</number> 32 <number>6</number>
33 </property> 33 </property>
34 <widget> 34 <widget>
35 <class>QTabWidget</class> 35 <class>QTabWidget</class>
36 <property stdset="1"> 36 <property stdset="1">
37 <name>name</name> 37 <name>name</name>
38 <cstring>tabs</cstring> 38 <cstring>tabs</cstring>
39 </property> 39 </property>
40 <property> 40 <property>
41 <name>layoutMargin</name> 41 <name>layoutMargin</name>
42 </property> 42 </property>
43 <property> 43 <property>
44 <name>layoutSpacing</name> 44 <name>layoutSpacing</name>
45 </property> 45 </property>
46 <widget> 46 <widget>
47 <class>QWidget</class> 47 <class>QWidget</class>
48 <property stdset="1"> 48 <property stdset="1">
49 <name>name</name> 49 <name>name</name>
50 <cstring>tab</cstring> 50 <cstring>tab</cstring>
51 </property> 51 </property>
52 <attribute> 52 <attribute>
53 <name>title</name> 53 <name>title</name>
54 <string>Clock</string> 54 <string>Clock</string>
55 </attribute> 55 </attribute>
56 <vbox> 56 <vbox>
57 <property stdset="1"> 57 <property stdset="1">
58 <name>margin</name> 58 <name>margin</name>
59 <number>4</number> 59 <number>4</number>
60 </property> 60 </property>
61 <property stdset="1"> 61 <property stdset="1">
62 <name>spacing</name> 62 <name>spacing</name>
63 <number>4</number> 63 <number>4</number>
64 </property> 64 </property>
65 <widget> 65 <widget>
66 <class>AnalogClock</class> 66 <class>AnalogClock</class>
67 <property stdset="1"> 67 <property stdset="1">
68 <name>name</name> 68 <name>name</name>
69 <cstring>analogClock</cstring> 69 <cstring>analogClock</cstring>
70 </property> 70 </property>
71 </widget> 71 </widget>
72 <widget> 72 <widget>
73 <class>QLayoutWidget</class> 73 <class>QLayoutWidget</class>
74 <property stdset="1"> 74 <property stdset="1">
75 <name>name</name> 75 <name>name</name>
76 <cstring>Layout3</cstring> 76 <cstring>Layout3</cstring>
77 </property> 77 </property>
78 <hbox> 78 <hbox>
79 <property stdset="1"> 79 <property stdset="1">
80 <name>margin</name> 80 <name>margin</name>
81 <number>0</number> 81 <number>0</number>
82 </property> 82 </property>
83 <property stdset="1"> 83 <property stdset="1">
84 <name>spacing</name> 84 <name>spacing</name>
85 <number>6</number> 85 <number>6</number>
86 </property> 86 </property>
87 <widget> 87 <widget>
88 <class>QFrame</class> 88 <class>QFrame</class>
89 <property stdset="1"> 89 <property stdset="1">
90 <name>name</name> 90 <name>name</name>
91 <cstring>Frame3</cstring> 91 <cstring>Frame3</cstring>
92 </property> 92 </property>
93 <property stdset="1"> 93 <property stdset="1">
94 <name>sizePolicy</name> 94 <name>sizePolicy</name>
95 <sizepolicy> 95 <sizepolicy>
96 <hsizetype>7</hsizetype> 96 <hsizetype>7</hsizetype>
97 <vsizetype>5</vsizetype> 97 <vsizetype>5</vsizetype>
98 </sizepolicy> 98 </sizepolicy>
99 </property> 99 </property>
100 <property stdset="1"> 100 <property stdset="1">
101 <name>frameShape</name> 101 <name>frameShape</name>
102 <enum>NoFrame</enum> 102 <enum>NoFrame</enum>
103 </property> 103 </property>
104 <property stdset="1"> 104 <property stdset="1">
105 <name>frameShadow</name> 105 <name>frameShadow</name>
106 <enum>Plain</enum> 106 <enum>Plain</enum>
107 </property> 107 </property>
108 <property stdset="1"> 108 <property stdset="1">
109 <name>lineWidth</name> 109 <name>lineWidth</name>
110 <number>0</number> 110 <number>0</number>
111 </property> 111 </property>
@@ -423,197 +423,197 @@
423 <name>name</name> 423 <name>name</name>
424 <cstring>TextLabel3_2</cstring> 424 <cstring>TextLabel3_2</cstring>
425 </property> 425 </property>
426 <property stdset="1"> 426 <property stdset="1">
427 <name>text</name> 427 <name>text</name>
428 <string>Lap</string> 428 <string>Lap</string>
429 </property> 429 </property>
430 <property stdset="1"> 430 <property stdset="1">
431 <name>alignment</name> 431 <name>alignment</name>
432 <set>AlignTop|AlignRight</set> 432 <set>AlignTop|AlignRight</set>
433 </property> 433 </property>
434 <property> 434 <property>
435 <name>hAlign</name> 435 <name>hAlign</name>
436 </property> 436 </property>
437 <property> 437 <property>
438 <name>vAlign</name> 438 <name>vAlign</name>
439 </property> 439 </property>
440 </widget> 440 </widget>
441 </grid> 441 </grid>
442 </widget> 442 </widget>
443 <widget> 443 <widget>
444 <class>QLayoutWidget</class> 444 <class>QLayoutWidget</class>
445 <property stdset="1"> 445 <property stdset="1">
446 <name>name</name> 446 <name>name</name>
447 <cstring>Layout5</cstring> 447 <cstring>Layout5</cstring>
448 </property> 448 </property>
449 <hbox> 449 <hbox>
450 <property stdset="1"> 450 <property stdset="1">
451 <name>margin</name> 451 <name>margin</name>
452 <number>0</number> 452 <number>0</number>
453 </property> 453 </property>
454 <property stdset="1"> 454 <property stdset="1">
455 <name>spacing</name> 455 <name>spacing</name>
456 <number>6</number> 456 <number>6</number>
457 </property> 457 </property>
458 <widget> 458 <widget>
459 <class>QPushButton</class> 459 <class>QPushButton</class>
460 <property stdset="1"> 460 <property stdset="1">
461 <name>name</name> 461 <name>name</name>
462 <cstring>stopStart</cstring> 462 <cstring>stopStart</cstring>
463 </property> 463 </property>
464 <property stdset="1"> 464 <property stdset="1">
465 <name>font</name> 465 <name>font</name>
466 <font> 466 <font>
467 <pointsize>14</pointsize> 467 <pointsize>14</pointsize>
468 <bold>1</bold> 468 <bold>1</bold>
469 </font> 469 </font>
470 </property> 470 </property>
471 <property stdset="1"> 471 <property stdset="1">
472 <name>text</name> 472 <name>text</name>
473 <string>Start</string> 473 <string>Start</string>
474 </property> 474 </property>
475 <property> 475 <property>
476 <name>whatsThis</name> 476 <name>whatsThis</name>
477 <string>Starts and stops the stopwatch.</string> 477 <string>Starts and stops the stopwatch.</string>
478 </property> 478 </property>
479 </widget> 479 </widget>
480 <widget> 480 <widget>
481 <class>QPushButton</class> 481 <class>QPushButton</class>
482 <property stdset="1"> 482 <property stdset="1">
483 <name>name</name> 483 <name>name</name>
484 <cstring>reset</cstring> 484 <cstring>reset</cstring>
485 </property> 485 </property>
486 <property stdset="1"> 486 <property stdset="1">
487 <name>font</name> 487 <name>font</name>
488 <font> 488 <font>
489 <pointsize>14</pointsize> 489 <pointsize>14</pointsize>
490 <bold>1</bold> 490 <bold>1</bold>
491 </font> 491 </font>
492 </property> 492 </property>
493 <property stdset="1"> 493 <property stdset="1">
494 <name>text</name> 494 <name>text</name>
495 <string>Lap/Split</string> 495 <string>Lap/Split</string>
496 </property> 496 </property>
497 <property> 497 <property>
498 <name>whatsThis</name> 498 <name>whatsThis</name>
499 <string>Resets the stopwatch.</string> 499 <string>Resets the stopwatch.</string>
500 </property> 500 </property>
501 </widget> 501 </widget>
502 </hbox> 502 </hbox>
503 </widget> 503 </widget>
504 </vbox> 504 </vbox>
505 </widget> 505 </widget>
506 <widget> 506 <widget>
507 <class>QWidget</class> 507 <class>QWidget</class>
508 <property stdset="1"> 508 <property stdset="1">
509 <name>name</name> 509 <name>name</name>
510 <cstring>tab</cstring> 510 <cstring>tab</cstring>
511 </property> 511 </property>
512 <attribute> 512 <attribute>
513 <name>title</name> 513 <name>title</name>
514 <string>Alarm</string> 514 <string>Alarm</string>
515 </attribute> 515 </attribute>
516 <vbox> 516 <vbox>
517 <property stdset="1"> 517 <property stdset="1">
518 <name>margin</name> 518 <name>margin</name>
519 <number>6</number> 519 <number>-1</number>
520 </property> 520 </property>
521 <property stdset="1"> 521 <property stdset="1">
522 <name>spacing</name> 522 <name>spacing</name>
523 <number>4</number> 523 <number>-1</number>
524 </property> 524 </property>
525 <widget> 525 <widget>
526 <class>QGroupBox</class> 526 <class>QGroupBox</class>
527 <property stdset="1"> 527 <property stdset="1">
528 <name>name</name> 528 <name>name</name>
529 <cstring>dailyGroup</cstring> 529 <cstring>dailyGroup</cstring>
530 </property> 530 </property>
531 <property stdset="1"> 531 <property stdset="1">
532 <name>title</name> 532 <name>title</name>
533 <string>Daily Alarm</string> 533 <string>Daily Alarm</string>
534 </property> 534 </property>
535 <property> 535 <property>
536 <name>layoutMargin</name> 536 <name>layoutMargin</name>
537 </property> 537 </property>
538 <vbox> 538 <vbox>
539 <property stdset="1"> 539 <property stdset="1">
540 <name>margin</name> 540 <name>margin</name>
541 <number>6</number> 541 <number>6</number>
542 </property> 542 </property>
543 <property stdset="1"> 543 <property stdset="1">
544 <name>spacing</name> 544 <name>spacing</name>
545 <number>6</number> 545 <number>6</number>
546 </property> 546 </property>
547 <widget> 547 <widget>
548 <class>QCheckBox</class> 548 <class>QCheckBox</class>
549 <property stdset="1"> 549 <property stdset="1">
550 <name>name</name> 550 <name>name</name>
551 <cstring>dailyEnabled</cstring> 551 <cstring>dailyEnabled</cstring>
552 </property> 552 </property>
553 <property stdset="1"> 553 <property stdset="1">
554 <name>text</name> 554 <name>text</name>
555 <string>Enabled</string> 555 <string>Enabled</string>
556 </property> 556 </property>
557 <property> 557 <property>
558 <name>whatsThis</name> 558 <name>whatsThis</name>
559 <string>Check to enable the daily alarm</string> 559 <string>Check to enable the daily alarm</string>
560 </property> 560 </property>
561 </widget> 561 </widget>
562 <widget> 562 <widget>
563 <class>QLayoutWidget</class> 563 <class>QLayoutWidget</class>
564 <property stdset="1"> 564 <property stdset="1">
565 <name>name</name> 565 <name>name</name>
566 <cstring>Layout4</cstring> 566 <cstring>Layout4</cstring>
567 </property> 567 </property>
568 <hbox> 568 <hbox>
569 <property stdset="1"> 569 <property stdset="1">
570 <name>margin</name> 570 <name>margin</name>
571 <number>0</number> 571 <number>0</number>
572 </property> 572 </property>
573 <property stdset="1"> 573 <property stdset="1">
574 <name>spacing</name> 574 <name>spacing</name>
575 <number>6</number> 575 <number>6</number>
576 </property> 576 </property>
577 <widget> 577 <widget>
578 <class>QSpinBox</class> 578 <class>QSpinBox</class>
579 <property stdset="1"> 579 <property stdset="1">
580 <name>name</name> 580 <name>name</name>
581 <cstring>dailyHour</cstring> 581 <cstring>dailyHour</cstring>
582 </property> 582 </property>
583 <property stdset="1"> 583 <property stdset="1">
584 <name>minimumSize</name> 584 <name>minimumSize</name>
585 <size> 585 <size>
586 <width>40</width> 586 <width>40</width>
587 <height>0</height> 587 <height>0</height>
588 </size> 588 </size>
589 </property> 589 </property>
590 <property stdset="1"> 590 <property stdset="1">
591 <name>wrapping</name> 591 <name>wrapping</name>
592 <bool>true</bool> 592 <bool>true</bool>
593 </property> 593 </property>
594 <property stdset="1"> 594 <property stdset="1">
595 <name>maxValue</name> 595 <name>maxValue</name>
596 <number>23</number> 596 <number>23</number>
597 </property> 597 </property>
598 <property> 598 <property>
599 <name>whatsThis</name> 599 <name>whatsThis</name>
600 <string>Set the hour the alarm will sound.</string> 600 <string>Set the hour the alarm will sound.</string>
601 </property> 601 </property>
602 </widget> 602 </widget>
603 <widget> 603 <widget>
604 <class>QLabel</class> 604 <class>QLabel</class>
605 <property stdset="1"> 605 <property stdset="1">
606 <name>name</name> 606 <name>name</name>
607 <cstring>TextLabel2</cstring> 607 <cstring>TextLabel2</cstring>
608 </property> 608 </property>
609 <property stdset="1"> 609 <property stdset="1">
610 <name>sizePolicy</name> 610 <name>sizePolicy</name>
611 <sizepolicy> 611 <sizepolicy>
612 <hsizetype>4</hsizetype> 612 <hsizetype>4</hsizetype>
613 <vsizetype>1</vsizetype> 613 <vsizetype>1</vsizetype>
614 </sizepolicy> 614 </sizepolicy>
615 </property> 615 </property>
616 <property stdset="1"> 616 <property stdset="1">
617 <name>minimumSize</name> 617 <name>minimumSize</name>
618 <size> 618 <size>
619 <width>5</width> 619 <width>5</width>
@@ -777,145 +777,246 @@
777 <class>QLayoutWidget</class> 777 <class>QLayoutWidget</class>
778 <property stdset="1"> 778 <property stdset="1">
779 <name>name</name> 779 <name>name</name>
780 <cstring>Layout5</cstring> 780 <cstring>Layout5</cstring>
781 </property> 781 </property>
782 <hbox> 782 <hbox>
783 <property stdset="1"> 783 <property stdset="1">
784 <name>margin</name> 784 <name>margin</name>
785 <number>0</number> 785 <number>0</number>
786 </property> 786 </property>
787 <property stdset="1"> 787 <property stdset="1">
788 <name>spacing</name> 788 <name>spacing</name>
789 <number>6</number> 789 <number>6</number>
790 </property> 790 </property>
791 <widget> 791 <widget>
792 <class>QSpinBox</class> 792 <class>QSpinBox</class>
793 <property stdset="1"> 793 <property stdset="1">
794 <name>name</name> 794 <name>name</name>
795 <cstring>cdHour</cstring> 795 <cstring>cdHour</cstring>
796 </property> 796 </property>
797 <property stdset="1"> 797 <property stdset="1">
798 <name>minimumSize</name> 798 <name>minimumSize</name>
799 <size> 799 <size>
800 <width>40</width> 800 <width>40</width>
801 <height>0</height> 801 <height>0</height>
802 </size> 802 </size>
803 </property> 803 </property>
804 <property stdset="1"> 804 <property stdset="1">
805 <name>maxValue</name> 805 <name>maxValue</name>
806 <number>999</number> 806 <number>999</number>
807 </property> 807 </property>
808 <property stdset="1"> 808 <property stdset="1">
809 <name>lineStep</name> 809 <name>lineStep</name>
810 <number>1</number> 810 <number>1</number>
811 </property> 811 </property>
812 </widget> 812 </widget>
813 <widget> 813 <widget>
814 <class>QSpinBox</class> 814 <class>QSpinBox</class>
815 <property stdset="1"> 815 <property stdset="1">
816 <name>name</name> 816 <name>name</name>
817 <cstring>cdMinute</cstring> 817 <cstring>cdMinute</cstring>
818 </property> 818 </property>
819 <property stdset="1"> 819 <property stdset="1">
820 <name>minimumSize</name> 820 <name>minimumSize</name>
821 <size> 821 <size>
822 <width>40</width> 822 <width>40</width>
823 <height>0</height> 823 <height>0</height>
824 </size> 824 </size>
825 </property> 825 </property>
826 <property stdset="1"> 826 <property stdset="1">
827 <name>wrapping</name> 827 <name>wrapping</name>
828 <bool>true</bool> 828 <bool>true</bool>
829 </property> 829 </property>
830 <property stdset="1"> 830 <property stdset="1">
831 <name>maxValue</name> 831 <name>maxValue</name>
832 <number>55</number> 832 <number>55</number>
833 </property> 833 </property>
834 <property stdset="1"> 834 <property stdset="1">
835 <name>lineStep</name> 835 <name>lineStep</name>
836 <number>5</number> 836 <number>5</number>
837 </property> 837 </property>
838 </widget> 838 </widget>
839 <widget> 839 <widget>
840 <class>QPushButton</class> 840 <class>QPushButton</class>
841 <property stdset="1"> 841 <property stdset="1">
842 <name>name</name> 842 <name>name</name>
843 <cstring>cdStartStop</cstring> 843 <cstring>cdStartStop</cstring>
844 </property> 844 </property>
845 <property stdset="1"> 845 <property stdset="1">
846 <name>text</name> 846 <name>text</name>
847 <string>Start</string> 847 <string>Start</string>
848 </property> 848 </property>
849 </widget> 849 </widget>
850 </hbox> 850 </hbox>
851 </widget> 851 </widget>
852 <widget row="1" column="0" > 852 <widget row="1" column="0" >
853 <class>QLCDNumber</class> 853 <class>QLCDNumber</class>
854 <property stdset="1"> 854 <property stdset="1">
855 <name>name</name> 855 <name>name</name>
856 <cstring>cdLcd</cstring> 856 <cstring>cdLcd</cstring>
857 </property> 857 </property>
858 <property stdset="1"> 858 <property stdset="1">
859 <name>frameShape</name> 859 <name>frameShape</name>
860 <enum>NoFrame</enum> 860 <enum>NoFrame</enum>
861 </property> 861 </property>
862 <property stdset="1"> 862 <property stdset="1">
863 <name>frameShadow</name> 863 <name>frameShadow</name>
864 <enum>Plain</enum> 864 <enum>Plain</enum>
865 </property> 865 </property>
866 <property stdset="1"> 866 <property stdset="1">
867 <name>segmentStyle</name> 867 <name>segmentStyle</name>
868 <enum>Flat</enum> 868 <enum>Flat</enum>
869 </property> 869 </property>
870 </widget> 870 </widget>
871 </grid> 871 </grid>
872 </widget> 872 </widget>
873 <widget>
874 <class>QGroupBox</class>
875 <property stdset="1">
876 <name>name</name>
877 <cstring>sndGroup</cstring>
878 </property>
879 <property stdset="1">
880 <name>title</name>
881 <string>Play Sound</string>
882 </property>
883 <vbox>
884 <property stdset="1">
885 <name>margin</name>
886 <number>11</number>
887 </property>
888 <property stdset="1">
889 <name>spacing</name>
890 <number>6</number>
891 </property>
892 <widget>
893 <class>QCheckBox</class>
894 <property stdset="1">
895 <name>name</name>
896 <cstring>sndCheck</cstring>
897 </property>
898 <property stdset="1">
899 <name>text</name>
900 <string>Play File</string>
901 </property>
902 </widget>
903 <widget>
904 <class>QLayoutWidget</class>
905 <property stdset="1">
906 <name>name</name>
907 <cstring>Layout6</cstring>
908 </property>
909 <hbox>
910 <property stdset="1">
911 <name>margin</name>
912 <number>0</number>
913 </property>
914 <property stdset="1">
915 <name>spacing</name>
916 <number>6</number>
917 </property>
918 <widget>
919 <class>QLineEdit</class>
920 <property stdset="1">
921 <name>name</name>
922 <cstring>sndFileName</cstring>
923 </property>
924 </widget>
925 <widget>
926 <class>QToolButton</class>
927 <property stdset="1">
928 <name>name</name>
929 <cstring>sndChoose</cstring>
930 </property>
931 <property stdset="1">
932 <name>text</name>
933 <string>...</string>
934 </property>
935 </widget>
936 </hbox>
937 </widget>
938 </vbox>
939 </widget>
873 <spacer> 940 <spacer>
874 <property> 941 <property>
875 <name>name</name> 942 <name>name</name>
876 <cstring>Spacer1</cstring> 943 <cstring>Spacer3</cstring>
877 </property> 944 </property>
878 <property stdset="1"> 945 <property stdset="1">
879 <name>orientation</name> 946 <name>orientation</name>
880 <enum>Vertical</enum> 947 <enum>Vertical</enum>
881 </property> 948 </property>
882 <property stdset="1"> 949 <property stdset="1">
883 <name>sizeType</name> 950 <name>sizeType</name>
884 <enum>Expanding</enum> 951 <enum>Expanding</enum>
885 </property> 952 </property>
886 <property> 953 <property>
887 <name>sizeHint</name> 954 <name>sizeHint</name>
888 <size> 955 <size>
889 <width>20</width> 956 <width>20</width>
890 <height>20</height> 957 <height>20</height>
891 </size> 958 </size>
892 </property> 959 </property>
893 </spacer> 960 </spacer>
894 </vbox> 961 </vbox>
895 </widget> 962 </widget>
896 </widget> 963 </widget>
897 </vbox> 964 </vbox>
898</widget> 965</widget>
899<customwidgets> 966<customwidgets>
900 <customwidget> 967 <customwidget>
901 <class>AnalogClock</class> 968 <class>AnalogClock</class>
902 <header location="local">analogclock.h</header> 969 <header location="local">analogclock.h</header>
903 <sizehint> 970 <sizehint>
904 <width>50</width> 971 <width>50</width>
905 <height>50</height> 972 <height>50</height>
906 </sizehint> 973 </sizehint>
907 <container>0</container> 974 <container>0</container>
908 <sizepolicy> 975 <sizepolicy>
909 <hordata>3</hordata> 976 <hordata>3</hordata>
910 <verdata>3</verdata> 977 <verdata>3</verdata>
911 </sizepolicy> 978 </sizepolicy>
912 <pixmap>image0</pixmap> 979 <pixmap>image0</pixmap>
913 </customwidget> 980 </customwidget>
914</customwidgets> 981</customwidgets>
915<images> 982<images>
916 <image> 983 <image>
917 <name>image0</name> 984 <name>image0</name>
918 <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data> 985 <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data>
919 </image> 986 </image>
920</images> 987</images>
988<connections>
989 <connection>
990 <sender>dailyEnabled</sender>
991 <signal>toggled(bool)</signal>
992 <receiver>sndGroup</receiver>
993 <slot>setEnabled(bool)</slot>
994 </connection>
995 <connection>
996 <sender>sndCheck</sender>
997 <signal>toggled(bool)</signal>
998 <receiver>sndFileName</receiver>
999 <slot>setEnabled(bool)</slot>
1000 </connection>
1001 <connection>
1002 <sender>sndCheck</sender>
1003 <signal>toggled(bool)</signal>
1004 <receiver>sndChoose</receiver>
1005 <slot>setEnabled(bool)</slot>
1006 </connection>
1007 <connection>
1008 <sender>sndChoose</sender>
1009 <signal>clicked()</signal>
1010 <receiver>ClockBase</receiver>
1011 <slot>slotBrowseMp3File()</slot>
1012 </connection>
1013 <connection>
1014 <sender>sndCheck</sender>
1015 <signal>stateChanged(int)</signal>
1016 <receiver>ClockBase</receiver>
1017 <slot>scheduleApplyDailyAlarm()</slot>
1018 </connection>
1019 <slot access="public">scheduleApplyDailyAlarm()</slot>
1020 <slot access="protected">slotBrowseMp3File()</slot>
1021</connections>
921</UI> 1022</UI>
diff --git a/noncore/tools/clock/main.cpp b/noncore/tools/clock/main.cpp
index 237d9f0..380bfeb 100644
--- a/noncore/tools/clock/main.cpp
+++ b/noncore/tools/clock/main.cpp
@@ -1,28 +1,24 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of the 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
23#include <opie2/oapplicationfactory.h> 22#include <opie2/oapplicationfactory.h>
24
25
26using namespace Opie::Core;
27using namespace Opie::Core; 23using namespace Opie::Core;
28OPIE_EXPORT_APP( OApplicationFactory<Clock> ) 24OPIE_EXPORT_APP( OApplicationFactory<Clock> )