summaryrefslogtreecommitdiffabout
path: root/kalarmd/alarmdialog.cpp
Side-by-side diff
Diffstat (limited to 'kalarmd/alarmdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kalarmd/alarmdialog.cpp36
1 files changed, 21 insertions, 15 deletions
diff --git a/kalarmd/alarmdialog.cpp b/kalarmd/alarmdialog.cpp
index 65073f6..d72a8c2 100644
--- a/kalarmd/alarmdialog.cpp
+++ b/kalarmd/alarmdialog.cpp
@@ -97,9 +97,9 @@ AlarmDialog::AlarmDialog(QWidget *parent,const char *name)
mMissedAlarmsCombo = new QComboBox ( this );
layout->addWidget ( mMissedAlarmsCombo );
- QLabel* labb = new QLabel("Suspend duration (minutes):",this);
+ QLabel* labb = new QLabel("Suspend\nduration\n(minutes):",this);
labb->setAlignment(AlignCenter);
- layout->addWidget ( labb );
+ //layout->addWidget ( labb );
fo = font();
int pointSize = 36;
if ( QApplication::desktop()->width() <= 320 )
@@ -119,6 +119,7 @@ AlarmDialog::AlarmDialog(QWidget *parent,const char *name)
mSuspendSpin->setButtonSymbols( QSpinBox::PlusMinus );
QHBoxLayout* layoutSpin = new QHBoxLayout( layout );
layoutSpin->addStretch ();
+ layoutSpin->addWidget ( labb );
layoutSpin->addWidget ( mSuspendSpin );
layoutSpin->addStretch ();
@@ -129,7 +130,7 @@ AlarmDialog::AlarmDialog(QWidget *parent,const char *name)
labb->setAlignment(AlignCenter);
mSuspendButton = new QPushButton( "Suspend", bbox);
QPushButton* silen = new QPushButton( " Stop sound ", bbox);
- QPushButton* okbut = new QPushButton( "Ok", bbox);
+ okbut = new QPushButton( "Ok", bbox);
mSuspendButton->setFont( fo );
silen->setFont( fo );
okbut->setFont( fo );
@@ -241,16 +242,12 @@ bool AlarmDialog::eventNotification( QString mess, int replay , QString fn, boo
} else
mMissedAlarmsCombo->hide();
mMessage->setText(mess);
- int w =sizeHint().width() ;
- int h = sizeHint().height() ;
+ int w = minimumSizeHint().width() ;
+ int h = minimumSizeHint().height() ;
int dw = QApplication::desktop()->width();
int dh = QApplication::desktop()->height();
setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
- show();
- raise();
- //qApp->processEvents();
- //repaint();
- qApp->processEvents();
+ hide();
#ifndef _WIN32_
if ( fd_led > 0 ) {
@@ -258,13 +255,25 @@ bool AlarmDialog::eventNotification( QString mess, int replay , QString fn, boo
ioctl (fd_led, SHARP_LED_SETSTATUS, &statusLED);
}
#endif
- playSoundTimer->start( 1000, true );
+ okbut->setDefault( true );
+ QTimer::singleShot( 1, this, SLOT ( forceRepaint() ) );
+ // playSoundTimer->start( 1000, true );
return true;
}
-void AlarmDialog::spinBoxChanged( int )
+void AlarmDialog::forceRepaint()
{
+
+ showNormal();
+ setActiveWindow();
+ raise();
+ playSoundTimer->start( 1000, true );
+
+}
+void AlarmDialog::spinBoxChanged( int v )
+{
+ okbut->setDefault( false );
mSilent = true;
}
@@ -279,9 +288,6 @@ void AlarmDialog::playSound ()
setActiveWindow();
raise();
mSuspendSpin->setFocus();
-
-
- qApp->processEvents();
if ( alarmCounter < maxAlarmReplay && ! mSilent) {
++alarmCounter;
#ifdef DESKTOP_VERSION