Diffstat (limited to 'noncore/tools/clock/clock.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/tools/clock/clock.cpp | 13 |
1 files changed, 11 insertions, 2 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 | |||
@@ -296,26 +296,26 @@ void Clock::slotSetAlarm() | |||
296 | slotToggleAlarm(); | 296 | slotToggleAlarm(); |
297 | Set_Alarm *setAlarmDlg; | 297 | Set_Alarm *setAlarmDlg; |
298 | setAlarmDlg = new Set_Alarm(this,"SetAlarm", TRUE); | 298 | setAlarmDlg = new Set_Alarm(this,"SetAlarm", TRUE); |
299 | int result = setAlarmDlg->exec(); | 299 | int result = setAlarmDlg->exec(); |
300 | if(result == 1) { | 300 | if(result == 1) { |
301 | Config config( "qpe" ); | 301 | Config config( "qpe" ); |
302 | config.setGroup("Time"); | 302 | config.setGroup("Time"); |
303 | QString tmp; | 303 | QString tmp; |
304 | hour = setAlarmDlg->Hour_Slider->value(); | 304 | hour = setAlarmDlg->Hour_Slider->value(); |
305 | minute = setAlarmDlg->Minute_Slider->value(); | 305 | minute = setAlarmDlg->Minute_Slider->value(); |
306 | snoozeTime=setAlarmDlg->SnoozeSlider->value(); | 306 | snoozeTime=setAlarmDlg->SnoozeSlider->value(); |
307 | if(ampm) { | 307 | if(ampm) { |
308 | if ( hour == 12 ) | 308 | if ( hour == 12 ) |
309 | hour = 0; | 309 | hour = 0; |
310 | 310 | ||
311 | if(setAlarmDlg->Pm_RadioButton->isChecked() && hour < 12 ) | 311 | if(setAlarmDlg->Pm_RadioButton->isChecked() && hour < 12 ) |
312 | hour+=12; | 312 | hour+=12; |
313 | } | 313 | } |
314 | config.writeEntry("clockAlarmHour", tmp.setNum( hour ),10); | 314 | config.writeEntry("clockAlarmHour", tmp.setNum( hour ),10); |
315 | config.writeEntry("clockAlarmMinute",tmp.setNum( minute ),10); | 315 | config.writeEntry("clockAlarmMinute",tmp.setNum( minute ),10); |
316 | config.writeEntry("clockAlarmSnooze",tmp.setNum( snoozeTime ),10); | 316 | config.writeEntry("clockAlarmSnooze",tmp.setNum( snoozeTime ),10); |
317 | config.write(); | 317 | config.write(); |
318 | } | 318 | } |
319 | } | 319 | } |
320 | 320 | ||
321 | void Clock::slotSnooze() | 321 | void Clock::slotSnooze() |
@@ -378,26 +378,35 @@ void Clock::alarmOff() | |||
378 | "alarm(QDateTime,int)", warn ); | 378 | "alarm(QDateTime,int)", warn ); |
379 | qDebug("Alarm Off "+ when.toString()); | 379 | qDebug("Alarm Off "+ when.toString()); |
380 | setCaption("Clock"); | 380 | setCaption("Clock"); |
381 | } | 381 | } |
382 | 382 | ||
383 | void Clock::appMessage(const QCString& msg, const QByteArray& data) | 383 | void Clock::appMessage(const QCString& msg, const QByteArray& data) |
384 | { | 384 | { |
385 | int stopTimer = 0; | 385 | int stopTimer = 0; |
386 | int timerStay = 5000; | 386 | int timerStay = 5000; |
387 | bSound=TRUE; | 387 | bSound=TRUE; |
388 | qDebug("Message received in clock"); | 388 | qDebug("Message received in clock"); |
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 | } |
393 | show(); | 402 | show(); |
394 | raise(); | 403 | raise(); |
395 | QPEApplication::setKeepRunning(); | 404 | QPEApplication::setKeepRunning(); |
396 | setActiveWindow(); | 405 | setActiveWindow(); |
397 | } | 406 | } |
398 | 407 | ||
399 | void Clock::timerEvent( QTimerEvent *e ) | 408 | void Clock::timerEvent( QTimerEvent *e ) |
400 | { | 409 | { |
401 | static int stop = 0; | 410 | static int stop = 0; |
402 | if ( stop < 120 && bSound) { | 411 | if ( stop < 120 && bSound) { |
403 | Sound::soundAlarm(); | 412 | Sound::soundAlarm(); |