summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-06-27 17:43:22 (UTC)
committer llornkcor <llornkcor>2002-06-27 17:43:22 (UTC)
commitc2d32ceea75df8ad2e81c676acd8234597a89635 (patch) (side-by-side diff)
treefbf407510d7e2540cbe0d0452def6d21146d389d
parent63d7fd9b233a5b6a9e3670b6ef1c09a2e87ffa42 (diff)
downloadopie-c2d32ceea75df8ad2e81c676acd8234597a89635.zip
opie-c2d32ceea75df8ad2e81c676acd8234597a89635.tar.gz
opie-c2d32ceea75df8ad2e81c676acd8234597a89635.tar.bz2
added mp3 alarm.. will refine later
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/tools/clock/clock.cpp9
-rw-r--r--noncore/tools/clock/setAlarm.cpp35
-rw-r--r--noncore/tools/clock/setAlarm.h4
3 files changed, 44 insertions, 4 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
@@ -389,2 +389,10 @@ void Clock::appMessage(const QCString& msg, const QByteArray& data)
if ( msg == "alarm(QDateTime,int)" ) {
+ Config config( "qpe" );
+ config.setGroup("Time");
+ if(config.readBoolEntry("mp3Alarm",0)){
+
+ QCopEnvelope e("QPE/Application/opieplayer","setDocument(QString)");
+ e<<config.readEntry("mp3File","");
+ } else {
+
Sound::soundAlarm();
@@ -392,2 +400,3 @@ void Clock::appMessage(const QCString& msg, const QByteArray& data)
}
+ }
show();
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 @@
-#include <qpe/config.h>
+#include <opie/ofileselector.h>
+#include <opie/ofiledialog.h>
+#include <qpe/config.h>
#include <qpe/qpeapplication.h>
@@ -30,2 +32,3 @@
#include <qbuttongroup.h>
+#include <qcheckbox.h>
@@ -38,3 +41,3 @@ Set_Alarm::Set_Alarm( QWidget* parent, const char* name, bool modal, WFlags fl
setMaximumSize( QSize( 240, 320 ) );
- move(0,48);
+ move(0,45);
setCaption( tr( "Set Alarm" ) );
@@ -99,2 +102,8 @@ Set_Alarm::Set_Alarm( QWidget* parent, const char* name, bool modal, WFlags fl
+ useMp3Check = new QCheckBox ( tr( "mp3 alarm" ), this );
+ useMp3Check-> setFocusPolicy ( QWidget::NoFocus );
+ Set_AlarmLayout->addMultiCellWidget( useMp3Check, 2, 3, 3, 4 );
+
+
+
TextLabel3 = new QLabel( this, "TextLabel3" );
@@ -116,3 +125,3 @@ Set_Alarm::Set_Alarm( QWidget* parent, const char* name, bool modal, WFlags fl
- Set_AlarmLayout->addMultiCellWidget( SnoozeSlider, 3, 3, 3, 4 );
+ Set_AlarmLayout->addMultiCellWidget( SnoozeSlider, 4, 4, 1, 2 );
@@ -150,3 +159,7 @@ Set_Alarm::Set_Alarm( QWidget* parent, const char* name, bool modal, WFlags fl
}
+ if( config.readBoolEntry("mp3Alarm") )
+ useMp3Check->setChecked(true);
+
// signals and slots connections
+ connect(useMp3Check,SIGNAL(toggled(bool)),this,SLOT(slotChangemp3CkeckBox(bool)));
}
@@ -188 +201,17 @@ void Set_Alarm::cleanUp()
}
+
+void Set_Alarm::slotChangemp3CkeckBox(bool b) {
+ Config config( "qpe" );
+ config.setGroup("Time");
+ if(b) {
+ QString str = OFileDialog::getOpenFileName( 2,"/");//,"", "*", this );
+ if(!str.isEmpty() ) {
+ qDebug(str);
+ config.writeEntry("mp3Alarm",1);
+ config.writeEntry("mp3File",str);
+ }
+ } else {
+ config.writeEntry("mp3Alarm",0);
+ config.writeEntry("mp3File","");
+ }
+}
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;
class QButtonGroup;
-
+class QCheckBox;
class Set_Alarm : public QDialog
@@ -45,3 +45,5 @@ public:
QButtonGroup *ButtonGroup1;
+ QCheckBox *useMp3Check;
protected slots:
+ void slotChangemp3CkeckBox(bool);
void slotChangeHour(int);