-rw-r--r-- | noncore/tools/clock/clock.cpp | 3 | ||||
-rw-r--r-- | noncore/tools/clock/main.cpp | 2 | ||||
-rw-r--r-- | noncore/tools/clock/setAlarm.cpp | 3 |
3 files changed, 6 insertions, 2 deletions
diff --git a/noncore/tools/clock/clock.cpp b/noncore/tools/clock/clock.cpp index b780675..485354b 100644 --- a/noncore/tools/clock/clock.cpp +++ b/noncore/tools/clock/clock.cpp | |||
@@ -47,24 +47,25 @@ | |||
47 | #include <qdatetime.h> | 47 | #include <qdatetime.h> |
48 | 48 | ||
49 | #include <math.h> | 49 | #include <math.h> |
50 | #include <unistd.h> | 50 | #include <unistd.h> |
51 | #include <sys/types.h> | 51 | #include <sys/types.h> |
52 | 52 | ||
53 | #include <pthread.h> | 53 | #include <pthread.h> |
54 | 54 | ||
55 | 55 | ||
56 | const double deg2rad = 0.017453292519943295769; // pi/180 | 56 | const double deg2rad = 0.017453292519943295769; // pi/180 |
57 | const int sw_prec = 2; | 57 | const int sw_prec = 2; |
58 | 58 | ||
59 | using namespace Opie::Ui; | ||
59 | void startPlayer() | 60 | void startPlayer() |
60 | { | 61 | { |
61 | Config config( "qpe" ); | 62 | Config config( "qpe" ); |
62 | config.setGroup( "Time" ); | 63 | config.setGroup( "Time" ); |
63 | sleep(15); | 64 | sleep(15); |
64 | QCopEnvelope e( "QPE/Application/opieplayer", "setDocument(QString)" ); | 65 | QCopEnvelope e( "QPE/Application/opieplayer", "setDocument(QString)" ); |
65 | e << config.readEntry( "mp3File", "" ); | 66 | e << config.readEntry( "mp3File", "" ); |
66 | } | 67 | } |
67 | 68 | ||
68 | 69 | ||
69 | static void toggleScreenSaver( bool on ) | 70 | static void toggleScreenSaver( bool on ) |
70 | { | 71 | { |
@@ -136,25 +137,25 @@ Clock::Clock( QWidget * parent, const char * name, WFlags f ) | |||
136 | reset->setText( tr( "Reset" ) ); | 137 | reset->setText( tr( "Reset" ) ); |
137 | reset->setEnabled( FALSE ); | 138 | reset->setEnabled( FALSE ); |
138 | grp->insert( reset ); | 139 | grp->insert( reset ); |
139 | 140 | ||
140 | alarmOffBtn = new QPushButton ( controls ); | 141 | alarmOffBtn = new QPushButton ( controls ); |
141 | gl->addWidget( alarmOffBtn, 0, 2 ); | 142 | gl->addWidget( alarmOffBtn, 0, 2 ); |
142 | 143 | ||
143 | alarmBtn = new QPushButton ( controls ); | 144 | alarmBtn = new QPushButton ( controls ); |
144 | gl->addWidget( alarmBtn, 1, 2 ); | 145 | gl->addWidget( alarmBtn, 1, 2 ); |
145 | 146 | ||
146 | alarmBtn->setText( tr( "Set Alarm" ) ); | 147 | alarmBtn->setText( tr( "Set Alarm" ) ); |
147 | 148 | ||
148 | Opie::OClickableLabel *click = new Opie::OClickableLabel( controls, "label" ); | 149 | OClickableLabel *click = new Opie::Ui::OClickableLabel( controls, "label" ); |
149 | click->setText( tr( "Set date and time." ) ); | 150 | click->setText( tr( "Set date and time." ) ); |
150 | gl->addMultiCellWidget( click, 3, 3, 0, 2, AlignHCenter ); | 151 | gl->addMultiCellWidget( click, 3, 3, 0, 2, AlignHCenter ); |
151 | connect( click, SIGNAL( clicked() ), this, SLOT( slotAdjustTime() ) ); | 152 | connect( click, SIGNAL( clicked() ), this, SLOT( slotAdjustTime() ) ); |
152 | 153 | ||
153 | connect( set , SIGNAL( pressed() ), SLOT( slotSet() ) ); | 154 | connect( set , SIGNAL( pressed() ), SLOT( slotSet() ) ); |
154 | connect( reset, SIGNAL( clicked() ), SLOT( slotReset() ) ); | 155 | connect( reset, SIGNAL( clicked() ), SLOT( slotReset() ) ); |
155 | 156 | ||
156 | connect( alarmBtn, SIGNAL( clicked() ), SLOT( slotSetAlarm() ) ); | 157 | connect( alarmBtn, SIGNAL( clicked() ), SLOT( slotSetAlarm() ) ); |
157 | connect( snoozeBtn, SIGNAL( clicked() ), SLOT( slotSnooze() ) ); | 158 | connect( snoozeBtn, SIGNAL( clicked() ), SLOT( slotSnooze() ) ); |
158 | connect( alarmOffBtn, SIGNAL( clicked() ), SLOT( slotToggleAlarm() ) ); | 159 | connect( alarmOffBtn, SIGNAL( clicked() ), SLOT( slotToggleAlarm() ) ); |
159 | 160 | ||
160 | connect( qApp, SIGNAL( appMessage(const QCString&,const QByteArray&) ), | 161 | connect( qApp, SIGNAL( appMessage(const QCString&,const QByteArray&) ), |
diff --git a/noncore/tools/clock/main.cpp b/noncore/tools/clock/main.cpp index 89dd1bd..237d9f0 100644 --- a/noncore/tools/clock/main.cpp +++ b/noncore/tools/clock/main.cpp | |||
@@ -14,13 +14,15 @@ | |||
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 <opie2/oapplicationfactory.h> | 23 | #include <opie2/oapplicationfactory.h> |
24 | 24 | ||
25 | 25 | ||
26 | using namespace Opie::Core; | ||
27 | using namespace Opie::Core; | ||
26 | OPIE_EXPORT_APP( OApplicationFactory<Clock> ) | 28 | OPIE_EXPORT_APP( OApplicationFactory<Clock> ) |
diff --git a/noncore/tools/clock/setAlarm.cpp b/noncore/tools/clock/setAlarm.cpp index 6fec5a0..9d5fc49 100644 --- a/noncore/tools/clock/setAlarm.cpp +++ b/noncore/tools/clock/setAlarm.cpp | |||
@@ -23,24 +23,25 @@ | |||
23 | #include <qlabel.h> | 23 | #include <qlabel.h> |
24 | #include <qlcdnumber.h> | 24 | #include <qlcdnumber.h> |
25 | #include <qpushbutton.h> | 25 | #include <qpushbutton.h> |
26 | #include <qradiobutton.h> | 26 | #include <qradiobutton.h> |
27 | #include <qslider.h> | 27 | #include <qslider.h> |
28 | #include <qlayout.h> | 28 | #include <qlayout.h> |
29 | #include <qvariant.h> | 29 | #include <qvariant.h> |
30 | #include <qtooltip.h> | 30 | #include <qtooltip.h> |
31 | #include <qwhatsthis.h> | 31 | #include <qwhatsthis.h> |
32 | #include <qbuttongroup.h> | 32 | #include <qbuttongroup.h> |
33 | #include <qcheckbox.h> | 33 | #include <qcheckbox.h> |
34 | 34 | ||
35 | using namespace Opie::Ui; | ||
35 | Set_Alarm::Set_Alarm( QWidget* parent, const char* name, bool modal, WFlags fl ) | 36 | Set_Alarm::Set_Alarm( QWidget* parent, const char* name, bool modal, WFlags fl ) |
36 | : QDialog( parent, name, modal, fl ) | 37 | : QDialog( parent, name, modal, fl ) |
37 | { | 38 | { |
38 | if ( !name ) | 39 | if ( !name ) |
39 | setName( "Set_Alarm" ); | 40 | setName( "Set_Alarm" ); |
40 | resize( 240, 101 ); | 41 | resize( 240, 101 ); |
41 | setMaximumSize( QSize( 240, 320 ) ); | 42 | setMaximumSize( QSize( 240, 320 ) ); |
42 | move(0,45); | 43 | move(0,45); |
43 | setCaption( tr( "Set Alarm" ) ); | 44 | setCaption( tr( "Set Alarm" ) ); |
44 | connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); | 45 | connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); |
45 | 46 | ||
46 | Set_AlarmLayout = new QGridLayout( this ); | 47 | Set_AlarmLayout = new QGridLayout( this ); |
@@ -200,24 +201,24 @@ void Set_Alarm::cleanUp() | |||
200 | { | 201 | { |
201 | } | 202 | } |
202 | 203 | ||
203 | void Set_Alarm::slotChangemp3CkeckBox(bool b) { | 204 | void Set_Alarm::slotChangemp3CkeckBox(bool b) { |
204 | Config config( "qpe" ); | 205 | Config config( "qpe" ); |
205 | config.setGroup("Time"); | 206 | config.setGroup("Time"); |
206 | if(b) { | 207 | if(b) { |
207 | QMap<QString, QStringList> map; | 208 | QMap<QString, QStringList> map; |
208 | map.insert(tr("All"), QStringList() ); | 209 | map.insert(tr("All"), QStringList() ); |
209 | QStringList text; | 210 | QStringList text; |
210 | text << "audio/*"; | 211 | text << "audio/*"; |
211 | map.insert(tr("Audio"), text ); | 212 | map.insert(tr("Audio"), text ); |
212 | QString str = Opie::OFileDialog::getOpenFileName( 2,"/", QString::null, map);//,"", "*", this ); | 213 | QString str = OFileDialog::getOpenFileName( 2,"/", QString::null, map);//,"", "*", this ); |
213 | // QString str = Opie::OFileDialog::getOpenFileName( 2,"/");//,"", "*", this ); | 214 | // QString str = Opie::OFileDialog::getOpenFileName( 2,"/");//,"", "*", this ); |
214 | if(!str.isEmpty() ) { | 215 | if(!str.isEmpty() ) { |
215 | qDebug(str); | 216 | qDebug(str); |
216 | config.writeEntry("mp3Alarm",1); | 217 | config.writeEntry("mp3Alarm",1); |
217 | config.writeEntry("mp3File",str); | 218 | config.writeEntry("mp3File",str); |
218 | } | 219 | } |
219 | } else { | 220 | } else { |
220 | config.writeEntry("mp3Alarm",0); | 221 | config.writeEntry("mp3Alarm",0); |
221 | config.writeEntry("mp3File",""); | 222 | config.writeEntry("mp3File",""); |
222 | } | 223 | } |
223 | } | 224 | } |