summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/tools/clock/clock.cpp13
-rw-r--r--noncore/tools/clock/setAlarm.cpp35
-rw-r--r--noncore/tools/clock/setAlarm.h4
3 files changed, 46 insertions, 6 deletions
diff --git a/noncore/tools/clock/clock.cpp b/noncore/tools/clock/clock.cpp
index a47793b..69d8214 100644
--- a/noncore/tools/clock/clock.cpp
+++ b/noncore/tools/clock/clock.cpp
@@ -307,4 +307,4 @@ void Clock::slotSetAlarm()
307 if(ampm) { 307 if(ampm) {
308 if ( hour == 12 ) 308 if ( hour == 12 )
309 hour = 0; 309 hour = 0;
310 310
@@ -389,4 +389,13 @@ void Clock::appMessage(const QCString& msg, const QByteArray& data)
389 if ( msg == "alarm(QDateTime,int)" ) { 389 if ( msg == "alarm(QDateTime,int)" ) {
390 Config config( "qpe" );
391 config.setGroup("Time");
392 if(config.readBoolEntry("mp3Alarm",0)){
393
394 QCopEnvelope e("QPE/Application/opieplayer","setDocument(QString)");
395 e<<config.readEntry("mp3File","");
396 } else {
397
390 Sound::soundAlarm(); 398 Sound::soundAlarm();
391 stopTimer = startTimer( timerStay); 399 stopTimer = startTimer( timerStay);
400 }
392 } 401 }
diff --git a/noncore/tools/clock/setAlarm.cpp b/noncore/tools/clock/setAlarm.cpp
index 990ff81..38de396 100644
--- a/noncore/tools/clock/setAlarm.cpp
+++ b/noncore/tools/clock/setAlarm.cpp
@@ -16,4 +16,6 @@
16 16
17#include <qpe/config.h> 17#include <opie/ofileselector.h>
18#include <opie/ofiledialog.h>
18 19
20#include <qpe/config.h>
19#include <qpe/qpeapplication.h> 21#include <qpe/qpeapplication.h>
@@ -30,2 +32,3 @@
30#include <qbuttongroup.h> 32#include <qbuttongroup.h>
33#include <qcheckbox.h>
31 34
@@ -38,3 +41,3 @@ Set_Alarm::Set_Alarm( QWidget* parent, const char* name, bool modal, WFlags fl
38 setMaximumSize( QSize( 240, 320 ) ); 41 setMaximumSize( QSize( 240, 320 ) );
39 move(0,48); 42 move(0,45);
40 setCaption( tr( "Set Alarm" ) ); 43 setCaption( tr( "Set Alarm" ) );
@@ -99,2 +102,8 @@ Set_Alarm::Set_Alarm( QWidget* parent, const char* name, bool modal, WFlags fl
99 102
103 useMp3Check = new QCheckBox ( tr( "mp3 alarm" ), this );
104 useMp3Check-> setFocusPolicy ( QWidget::NoFocus );
105 Set_AlarmLayout->addMultiCellWidget( useMp3Check, 2, 3, 3, 4 );
106
107
108
100 TextLabel3 = new QLabel( this, "TextLabel3" ); 109 TextLabel3 = new QLabel( this, "TextLabel3" );
@@ -116,3 +125,3 @@ Set_Alarm::Set_Alarm( QWidget* parent, const char* name, bool modal, WFlags fl
116 125
117 Set_AlarmLayout->addMultiCellWidget( SnoozeSlider, 3, 3, 3, 4 ); 126 Set_AlarmLayout->addMultiCellWidget( SnoozeSlider, 4, 4, 1, 2 );
118 127
@@ -150,3 +159,7 @@ Set_Alarm::Set_Alarm( QWidget* parent, const char* name, bool modal, WFlags fl
150 } 159 }
160 if( config.readBoolEntry("mp3Alarm") )
161 useMp3Check->setChecked(true);
162
151 // signals and slots connections 163 // signals and slots connections
164 connect(useMp3Check,SIGNAL(toggled(bool)),this,SLOT(slotChangemp3CkeckBox(bool)));
152} 165}
@@ -188 +201,17 @@ void Set_Alarm::cleanUp()
188} 201}
202
203void Set_Alarm::slotChangemp3CkeckBox(bool b) {
204 Config config( "qpe" );
205 config.setGroup("Time");
206 if(b) {
207 QString str = OFileDialog::getOpenFileName( 2,"/");//,"", "*", this );
208 if(!str.isEmpty() ) {
209 qDebug(str);
210 config.writeEntry("mp3Alarm",1);
211 config.writeEntry("mp3File",str);
212 }
213 } else {
214 config.writeEntry("mp3Alarm",0);
215 config.writeEntry("mp3File","");
216 }
217}
diff --git a/noncore/tools/clock/setAlarm.h b/noncore/tools/clock/setAlarm.h
index 7d63237..a21af05 100644
--- a/noncore/tools/clock/setAlarm.h
+++ b/noncore/tools/clock/setAlarm.h
@@ -28,3 +28,3 @@ class QSlider;
28class QButtonGroup; 28class QButtonGroup;
29 29class QCheckBox;
30class Set_Alarm : public QDialog 30class Set_Alarm : public QDialog
@@ -45,3 +45,5 @@ public:
45 QButtonGroup *ButtonGroup1; 45 QButtonGroup *ButtonGroup1;
46 QCheckBox *useMp3Check;
46protected slots: 47protected slots:
48 void slotChangemp3CkeckBox(bool);
47 void slotChangeHour(int); 49 void slotChangeHour(int);