summaryrefslogtreecommitdiffabout
path: root/kalarmd
authorzautrix <zautrix>2005-04-08 23:49:56 (UTC)
committer zautrix <zautrix>2005-04-08 23:49:56 (UTC)
commit513bbc29c27d1988eee07f65afb80a6e222a48a4 (patch) (unidiff)
tree701c2fb304fe02a3fb3e90f286b05bb325ceb5a2 /kalarmd
parenta74c23d91e80343cd1ccfd1fe712958fad1d5891 (diff)
downloadkdepimpi-513bbc29c27d1988eee07f65afb80a6e222a48a4.zip
kdepimpi-513bbc29c27d1988eee07f65afb80a6e222a48a4.tar.gz
kdepimpi-513bbc29c27d1988eee07f65afb80a6e222a48a4.tar.bz2
wn
Diffstat (limited to 'kalarmd') (more/less context) (ignore whitespace changes)
-rw-r--r--kalarmd/alarmdialog.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/kalarmd/alarmdialog.cpp b/kalarmd/alarmdialog.cpp
index d72a8c2..1cda534 100644
--- a/kalarmd/alarmdialog.cpp
+++ b/kalarmd/alarmdialog.cpp
@@ -247,67 +247,68 @@ bool AlarmDialog::eventNotification( QString mess, int replay , QString fn, boo
247 int dw = QApplication::desktop()->width(); 247 int dw = QApplication::desktop()->width();
248 int dh = QApplication::desktop()->height(); 248 int dh = QApplication::desktop()->height();
249 setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 249 setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
250 hide(); 250 hide();
251 251
252#ifndef _WIN32_ 252#ifndef _WIN32_
253 if ( fd_led > 0 ) { 253 if ( fd_led > 0 ) {
254 statusLED.status = LED_SALARM_ON ; 254 statusLED.status = LED_SALARM_ON ;
255 ioctl (fd_led, SHARP_LED_SETSTATUS, &statusLED); 255 ioctl (fd_led, SHARP_LED_SETSTATUS, &statusLED);
256 } 256 }
257#endif 257#endif
258 okbut->setDefault( true ); 258 okbut->setDefault( true );
259 QTimer::singleShot( 1, this, SLOT ( forceRepaint() ) ); 259 QTimer::singleShot( 1, this, SLOT ( forceRepaint() ) );
260 // playSoundTimer->start( 1000, true ); 260 // playSoundTimer->start( 1000, true );
261 return true; 261 return true;
262 262
263} 263}
264 264
265void AlarmDialog::forceRepaint() 265void AlarmDialog::forceRepaint()
266{ 266{
267 267
268 showNormal(); 268 showNormal();
269 setActiveWindow(); 269 setActiveWindow();
270 raise(); 270 raise();
271 mSuspendSpin->setFocus();
271 playSoundTimer->start( 1000, true ); 272 playSoundTimer->start( 1000, true );
272 273
273} 274}
274void AlarmDialog::spinBoxChanged( int v ) 275void AlarmDialog::spinBoxChanged( int v )
275{ 276{
276 okbut->setDefault( false ); 277 okbut->setDefault( false );
277 mSilent = true; 278 mSilent = true;
278} 279}
279 280
280void AlarmDialog::playSound () 281void AlarmDialog::playSound ()
281{ 282{
282 283
283 if (mStopAlarm ) 284 if (mStopAlarm )
284 return; 285 return;
285 if ( mSilent ) 286 if ( mSilent )
286 return; 287 return;
287 showNormal(); 288 //showNormal();
288 setActiveWindow(); 289 setActiveWindow();
289 raise(); 290 //raise();
290 mSuspendSpin->setFocus(); 291 mSuspendSpin->setFocus();
291 if ( alarmCounter < maxAlarmReplay && ! mSilent) { 292 if ( alarmCounter < maxAlarmReplay && ! mSilent) {
292 ++alarmCounter; 293 ++alarmCounter;
293#ifdef DESKTOP_VERSION 294#ifdef DESKTOP_VERSION
294 mPlayWav = true; 295 mPlayWav = true;
295#endif 296#endif
296 if ( !mPlayWav || mFileName.length() < 2 ) { 297 if ( !mPlayWav || mFileName.length() < 2 ) {
297 298
298#ifdef DESKTOP_VERSION 299#ifdef DESKTOP_VERSION
299 qDebug("Sound play not possible - file not found"); 300 qDebug("Sound play not possible - file not found");
300#else 301#else
301 Sound::soundAlarm (); 302 Sound::soundAlarm ();
302#endif 303#endif
303 } else 304 } else
304 305
305 { 306 {
306#ifdef DESKTOP_VERSION 307#ifdef DESKTOP_VERSION
307#ifdef _WIN32_ 308#ifdef _WIN32_
308 QSound::play ( mFileName ); 309 QSound::play ( mFileName );
309#else 310#else
310 311
311 QString command = "playwave -r 22050 " + mFileName; 312 QString command = "playwave -r 22050 " + mFileName;
312 qDebug("KO: Playing file %s with 22kHz",mFileName.latin1() ); 313 qDebug("KO: Playing file %s with 22kHz",mFileName.latin1() );
313 int ret = system ( command.latin1() ); 314 int ret = system ( command.latin1() );