author | zautrix <zautrix> | 2005-10-08 23:49:13 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-10-08 23:49:13 (UTC) |
commit | c0b255e16d45fed73185fac431169284cc1431e8 (patch) (unidiff) | |
tree | 365e84041692e131a5c5518acdd6d786af3dc09c /kalarmd/simplealarmdaemonimpl.cpp | |
parent | 4fb9beb1ec26f37a18f98af9d3b6b59acf8c56d2 (diff) | |
download | kdepimpi-c0b255e16d45fed73185fac431169284cc1431e8.zip kdepimpi-c0b255e16d45fed73185fac431169284cc1431e8.tar.gz kdepimpi-c0b255e16d45fed73185fac431169284cc1431e8.tar.bz2 |
added mess for timer start
Diffstat (limited to 'kalarmd/simplealarmdaemonimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kalarmd/simplealarmdaemonimpl.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/kalarmd/simplealarmdaemonimpl.cpp b/kalarmd/simplealarmdaemonimpl.cpp index 8ea8a73..04b8b21 100644 --- a/kalarmd/simplealarmdaemonimpl.cpp +++ b/kalarmd/simplealarmdaemonimpl.cpp | |||
@@ -147,15 +147,24 @@ SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent ) | |||
147 | wavAlarm = true; | 147 | wavAlarm = true; |
148 | mSoundPopUp->setItemChecked ( 1, true ); | 148 | mSoundPopUp->setItemChecked ( 1, true ); |
149 | } | 149 | } |
150 | saveSlot( 1 ); | 150 | saveSlot( 1 ); |
151 | mTimerStartLabel = new QLabel( 0 ); | ||
152 | mTimerStartLabel->setCaption( "Timer started!"); | ||
153 | fon = mTimerPopUp->font(); | ||
154 | fon.setBold( true ); | ||
155 | points = (fon.pointSize()*2); | ||
156 | fon.setPointSize( points ); | ||
157 | mTimerStartLabel->setFont( fon ); | ||
151 | } | 158 | } |
152 | 159 | ||
153 | SimpleAlarmDaemonImpl::~SimpleAlarmDaemonImpl() | 160 | SimpleAlarmDaemonImpl::~SimpleAlarmDaemonImpl() |
154 | { | 161 | { |
155 | //delete mPopUp; | 162 | //delete mPopUp; |
156 | delete mAlarmDialog; | 163 | delete mAlarmDialog; |
164 | delete mTimerStartLabel; | ||
157 | } | 165 | } |
166 | |||
158 | void SimpleAlarmDaemonImpl::saveSlot( int load ) | 167 | void SimpleAlarmDaemonImpl::saveSlot( int load ) |
159 | { | 168 | { |
160 | QString fileName = QDir::homeDirPath() +"/.kopialarmrc"; | 169 | QString fileName = QDir::homeDirPath() +"/.kopialarmrc"; |
161 | //qDebug("save %d ", load ); | 170 | //qDebug("save %d ", load ); |
@@ -401,10 +410,10 @@ void SimpleAlarmDaemonImpl::fillTimerPopUp() | |||
401 | QString configString ; | 410 | QString configString ; |
402 | configString += "#config file for kopi alarm timer\n"; | 411 | configString += "#config file for kopi alarm timer\n"; |
403 | configString += "#format: <Text for popup menu>;<timer countdown in minutes>\n"; | 412 | configString += "#format: <Text for popup menu>;<timer countdown in minutes>\n"; |
404 | configString += "24 hours; 1440\n"; | 413 | configString += "24 hours; 1440\n"; |
414 | configString += "9 hours; 540\n"; | ||
405 | configString += "8 hours; 480\n"; | 415 | configString += "8 hours; 480\n"; |
406 | configString += "5 hours; 300\n"; | ||
407 | configString += "1 hour; 60\n"; | 416 | configString += "1 hour; 60\n"; |
408 | configString += "30 min; 30\n"; | 417 | configString += "30 min; 30\n"; |
409 | configString += "15 min; 15\n"; | 418 | configString += "15 min; 15\n"; |
410 | configString += "SEPARATOR\n"; | 419 | configString += "SEPARATOR\n"; |
@@ -512,15 +521,17 @@ void SimpleAlarmDaemonImpl::confTimer( int time ) | |||
512 | if ( minutes == 1 ) { | 521 | if ( minutes == 1 ) { |
513 | return; | 522 | return; |
514 | } | 523 | } |
515 | QString mess = "timer_alarm"; | 524 | QString mess = "timer_alarm"; |
525 | QString disp; | ||
516 | mess += ("Timer Alarm!\n"); | 526 | mess += ("Timer Alarm!\n"); |
517 | if ( minutes == 3 ) { | 527 | if ( minutes == 3 ) { |
518 | mess += mCustomText; | 528 | mess += mCustomText; |
519 | minutes = mCustomMinutes ; | 529 | minutes = mCustomMinutes ; |
520 | mRunningTimerText = mCustomText.stripWhiteSpace (); | 530 | mRunningTimerText = mCustomText.stripWhiteSpace (); |
521 | int in = mRunningTimerText.find( " " ); | 531 | int in = mRunningTimerText.find( " " ); |
522 | mRunningTimerText = mRunningTimerText.left ( in ); | 532 | mRunningTimerText = mRunningTimerText.left ( in ); |
533 | disp = mCustomText; | ||
523 | } | 534 | } |
524 | else { | 535 | else { |
525 | if ( minutes == 2 ) { | 536 | if ( minutes == 2 ) { |
526 | // ask time | 537 | // ask time |
@@ -589,15 +600,17 @@ void SimpleAlarmDaemonImpl::confTimer( int time ) | |||
589 | mCustomMinutes = 1; | 600 | mCustomMinutes = 1; |
590 | if ( mCustomMinutes > 1440 ) | 601 | if ( mCustomMinutes > 1440 ) |
591 | mCustomMinutes = 1440; | 602 | mCustomMinutes = 1440; |
592 | mess += mCustomText; | 603 | mess += mCustomText; |
604 | disp = mCustomText; | ||
593 | minutes = mCustomMinutes; | 605 | minutes = mCustomMinutes; |
594 | mRunningTimerText = mCustomText.stripWhiteSpace (); | 606 | mRunningTimerText = mCustomText.stripWhiteSpace (); |
595 | int in = mRunningTimerText.find( " " ); | 607 | int in = mRunningTimerText.find( " " ); |
596 | mRunningTimerText = mRunningTimerText.left ( in ); | 608 | mRunningTimerText = mRunningTimerText.left ( in ); |
597 | } | 609 | } |
598 | else { | 610 | else { |
599 | mess += mTimerPopUp->text( minutes ); | 611 | mess += mTimerPopUp->text( minutes ); |
612 | disp = mTimerPopUp->text( minutes ); | ||
600 | mRunningTimerText = mTimerPopUp->text( minutes ); | 613 | mRunningTimerText = mTimerPopUp->text( minutes ); |
601 | minutes -= 10; | 614 | minutes -= 10; |
602 | } | 615 | } |
603 | } | 616 | } |
@@ -605,8 +618,16 @@ void SimpleAlarmDaemonImpl::confTimer( int time ) | |||
605 | 618 | ||
606 | mRunningTimer = QDateTime::currentDateTime().addSecs( minutes * 60 ); | 619 | mRunningTimer = QDateTime::currentDateTime().addSecs( minutes * 60 ); |
607 | timerMesssage = mess; | 620 | timerMesssage = mess; |
608 | AlarmServer::addAlarm ( mRunningTimer,"koalarm",timerMesssage.utf8()); | 621 | AlarmServer::addAlarm ( mRunningTimer,"koalarm",timerMesssage.utf8()); |
622 | mTimerStartLabel->setText( disp ); | ||
623 | int w = 200; | ||
624 | int h = mTimerStartLabel->sizeHint().height() ; | ||
625 | int dw = QApplication::desktop()->width(); | ||
626 | int dh = QApplication::desktop()->height(); | ||
627 | mTimerStartLabel->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | ||
628 | mTimerStartLabel->show(); | ||
629 | QTimer::singleShot( 3000, mTimerStartLabel, SLOT ( hide() ) ); | ||
609 | mTimerTime = 1; | 630 | mTimerTime = 1; |
610 | } | 631 | } |
611 | 632 | ||
612 | void SimpleAlarmDaemonImpl::writeFile() | 633 | void SimpleAlarmDaemonImpl::writeFile() |