summaryrefslogtreecommitdiffabout
path: root/kalarmd/alarmdialog.cpp
Unidiff
Diffstat (limited to 'kalarmd/alarmdialog.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kalarmd/alarmdialog.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/kalarmd/alarmdialog.cpp b/kalarmd/alarmdialog.cpp
index ddb125a..18ce9da 100644
--- a/kalarmd/alarmdialog.cpp
+++ b/kalarmd/alarmdialog.cpp
@@ -230,70 +230,74 @@ bool AlarmDialog::eventNotification( QString mess, int replay , QString fn, boo
230 if ( mess.left( 9) != "Suspended" ) 230 if ( mess.left( 9) != "Suspended" )
231 mSuspendCounter = suspendtimes; 231 mSuspendCounter = suspendtimes;
232 mPauseCount = pause; 232 mPauseCount = pause;
233 mFileName = fn; 233 mFileName = fn;
234 mPlayWav = playwav; 234 mPlayWav = playwav;
235 if ( !QFile::exists( fn ) ) 235 if ( !QFile::exists( fn ) )
236 mFileName = ""; 236 mFileName = "";
237 alarmCounter = 0 ; 237 alarmCounter = 0 ;
238 maxAlarmReplay = replay ; 238 maxAlarmReplay = replay ;
239 mStopAlarm = false; 239 mStopAlarm = false;
240 mSilent = false; 240 mSilent = false;
241 if ( !mMessage->text().stripWhiteSpace().isEmpty() ) { 241 if ( !mMessage->text().stripWhiteSpace().isEmpty() ) {
242 mMissedAlarmsCombo->show(); 242 mMissedAlarmsCombo->show();
243 QString newItem = mMessage->text().stripWhiteSpace(); 243 QString newItem = mMessage->text().stripWhiteSpace();
244 newItem.replace( QRegExp("\n"), QString(" ") ); 244 newItem.replace( QRegExp("\n"), QString(" ") );
245 mMissedAlarmsCombo->insertItem( newItem ); 245 mMissedAlarmsCombo->insertItem( newItem );
246 mMissedAlarms->setText( "Missed alarms:"); 246 mMissedAlarms->setText( "Missed alarms:");
247 } else 247 } else
248 mMissedAlarmsCombo->hide(); 248 mMissedAlarmsCombo->hide();
249 mMessage->setText(mess); 249 mMessage->setText(mess);
250 int w = minimumSizeHint().width() ; 250 int w = minimumSizeHint().width() ;
251 int h = minimumSizeHint().height() ; 251 int h = minimumSizeHint().height() ;
252 int dw = QApplication::desktop()->width(); 252 int dw = QApplication::desktop()->width();
253 int dh = QApplication::desktop()->height(); 253 int dh = QApplication::desktop()->height();
254 if ( w < 220 ) w = 220;
255 if ( h < 220 ) h = 220;
254 setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 256 setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
255 hide(); 257 showNormal();
258 setActiveWindow();
259 raise();
260 setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
261 //hide();
256 262
257#ifndef _WIN32_ 263#ifndef _WIN32_
258 if ( fd_led > 0 ) { 264 if ( fd_led > 0 ) {
259 statusLED.status = LED_SALARM_ON ; 265 statusLED.status = LED_SALARM_ON ;
260 ioctl (fd_led, SHARP_LED_SETSTATUS, &statusLED); 266 ioctl (fd_led, SHARP_LED_SETSTATUS, &statusLED);
261 } 267 }
262#endif 268#endif
263 okbut->setDefault( true ); 269 okbut->setDefault( true );
264 QTimer::singleShot( 1, this, SLOT ( forceRepaint() ) ); 270 QTimer::singleShot( 1, this, SLOT ( forceRepaint() ) );
265 // playSoundTimer->start( 1000, true ); 271 // playSoundTimer->start( 1000, true );
266 return true; 272 return true;
267 273
268} 274}
269 275
270void AlarmDialog::forceRepaint() 276void AlarmDialog::forceRepaint()
271{ 277{
272
273 showNormal();
274 setActiveWindow(); 278 setActiveWindow();
275 raise(); 279 repaint();
276 mSuspendSpin->setFocus(); 280 mSuspendSpin->setFocus();
277 playSoundTimer->start( 1000, true ); 281 playSoundTimer->start( 1000, true );
278 282
279} 283}
280void AlarmDialog::spinBoxChanged( int v ) 284void AlarmDialog::spinBoxChanged( int v )
281{ 285{
282 okbut->setDefault( false ); 286 okbut->setDefault( false );
283 mSilent = true; 287 mSilent = true;
284} 288}
285 289
286void AlarmDialog::playSound () 290void AlarmDialog::playSound ()
287{ 291{
288 292
289 if (mStopAlarm ) 293 if (mStopAlarm )
290 return; 294 return;
291 if ( mSilent ) 295 if ( mSilent )
292 return; 296 return;
293 //showNormal(); 297 //showNormal();
294 setActiveWindow(); 298 setActiveWindow();
295 //raise(); 299 //raise();
296 mSuspendSpin->setFocus(); 300 mSuspendSpin->setFocus();
297 if ( alarmCounter < maxAlarmReplay && ! mSilent) { 301 if ( alarmCounter < maxAlarmReplay && ! mSilent) {
298 ++alarmCounter; 302 ++alarmCounter;
299#ifdef DESKTOP_VERSION 303#ifdef DESKTOP_VERSION