Diffstat (limited to 'noncore/tools/clock/setAlarm.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/tools/clock/setAlarm.cpp | 35 |
1 files changed, 32 insertions, 3 deletions
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 | |||
@@ -15,6 +15,8 @@ | |||
15 | #include "setAlarm.h" | 15 | #include "setAlarm.h" |
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> |
20 | #include <qstring.h> | 22 | #include <qstring.h> |
@@ -29,4 +31,5 @@ | |||
29 | #include <qwhatsthis.h> | 31 | #include <qwhatsthis.h> |
30 | #include <qbuttongroup.h> | 32 | #include <qbuttongroup.h> |
33 | #include <qcheckbox.h> | ||
31 | 34 | ||
32 | Set_Alarm::Set_Alarm( QWidget* parent, const char* name, bool modal, WFlags fl ) | 35 | Set_Alarm::Set_Alarm( QWidget* parent, const char* name, bool modal, WFlags fl ) |
@@ -37,5 +40,5 @@ Set_Alarm::Set_Alarm( QWidget* parent, const char* name, bool modal, WFlags fl | |||
37 | resize( 240, 101 ); | 40 | resize( 240, 101 ); |
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" ) ); |
41 | connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); | 44 | connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); |
@@ -98,4 +101,10 @@ Set_Alarm::Set_Alarm( QWidget* parent, const char* name, bool modal, WFlags fl | |||
98 | Set_AlarmLayout->addMultiCellWidget(Pm_RadioButton, 1, 2, 3, 4 ); | 101 | Set_AlarmLayout->addMultiCellWidget(Pm_RadioButton, 1, 2, 3, 4 ); |
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" ); |
101 | TextLabel3->setText( tr( "Snooze Delay\n(minutes)" ) ); | 110 | TextLabel3->setText( tr( "Snooze Delay\n(minutes)" ) ); |
@@ -115,5 +124,5 @@ Set_Alarm::Set_Alarm( QWidget* parent, const char* name, bool modal, WFlags fl | |||
115 | connect(SnoozeSlider, SIGNAL( valueChanged(int)),this,SLOT(slotChangeSnooze(int))); | 124 | connect(SnoozeSlider, SIGNAL( valueChanged(int)),this,SLOT(slotChangeSnooze(int))); |
116 | 125 | ||
117 | Set_AlarmLayout->addMultiCellWidget( SnoozeSlider, 3, 3, 3, 4 ); | 126 | Set_AlarmLayout->addMultiCellWidget( SnoozeSlider, 4, 4, 1, 2 ); |
118 | 127 | ||
119 | Config config( "qpe" ); | 128 | Config config( "qpe" ); |
@@ -149,5 +158,9 @@ Set_Alarm::Set_Alarm( QWidget* parent, const char* name, bool modal, WFlags fl | |||
149 | Pm_RadioButton->hide(); | 158 | Pm_RadioButton->hide(); |
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 | } |
153 | 166 | ||
@@ -187,2 +200,18 @@ void Set_Alarm::cleanUp() | |||
187 | { | 200 | { |
188 | } | 201 | } |
202 | |||
203 | void 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 | } | ||