author | zautrix <zautrix> | 2005-10-31 10:52:32 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-10-31 10:52:32 (UTC) |
commit | f8bb077d4016222ebd7a1cf3080010d5e5c65649 (patch) (side-by-side diff) | |
tree | c4b144edc001ed21adf8e15c87037ba6a3cfd480 /kalarmd/simplealarmdaemonimpl.cpp | |
parent | 760f042066478106b87a63d6aba1ac1473a58dae (diff) | |
download | kdepimpi-f8bb077d4016222ebd7a1cf3080010d5e5c65649.zip kdepimpi-f8bb077d4016222ebd7a1cf3080010d5e5c65649.tar.gz kdepimpi-f8bb077d4016222ebd7a1cf3080010d5e5c65649.tar.bz2 |
commit
Diffstat (limited to 'kalarmd/simplealarmdaemonimpl.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | kalarmd/simplealarmdaemonimpl.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/kalarmd/simplealarmdaemonimpl.cpp b/kalarmd/simplealarmdaemonimpl.cpp index 141a9ce..15eff28 100644 --- a/kalarmd/simplealarmdaemonimpl.cpp +++ b/kalarmd/simplealarmdaemonimpl.cpp @@ -635,14 +635,27 @@ void SimpleAlarmDaemonImpl::confTimer( int time ) } } //minutes = 1; mRunningTimer = QDateTime::currentDateTime().addSecs( minutes * 60 ); timerMesssage = mess; + QString timerDuration ; + if ( minutes < 60 ) { + timerDuration = QString::number( minutes ) + " min"; + } else { + if ( minutes % 60 ) { + timerDuration = QString::number( minutes/60 ) +":"; + minutes = minutes%60; + if ( minutes < 10 ) timerDuration += "0"; + timerDuration += QString::number( minutes ) + " h"; + } + else + timerDuration = QString::number( minutes / 60 )+ " hours"; + } AlarmServer::addAlarm ( mRunningTimer,"koalarm",timerMesssage.utf8()); - mTimerStartLabel->setText( disp + "\n\nTimer started!" ); + mTimerStartLabel->setText( disp + "\n\n" + timerDuration +"\n\nTimer started!" ); int w = mTimerStartLabel->sizeHint().width()+20; int h = mTimerStartLabel->sizeHint().height()+40 ; int dw = QApplication::desktop()->width(); int dh = QApplication::desktop()->height(); mTimerStartLabel->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); mTimerStartLabel->show(); |