author | zautrix <zautrix> | 2005-10-09 23:48:12 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-10-09 23:48:12 (UTC) |
commit | dad8e8745591620c951cefd835ea7ea727db8925 (patch) (unidiff) | |
tree | c7352262bfc07f50b5b63b7ea034bdecdaa8732c | |
parent | 6d084862c396f58c949e713e9b159ec20743fd8a (diff) | |
download | kdepimpi-dad8e8745591620c951cefd835ea7ea727db8925.zip kdepimpi-dad8e8745591620c951cefd835ea7ea727db8925.tar.gz kdepimpi-dad8e8745591620c951cefd835ea7ea727db8925.tar.bz2 |
timer message
-rw-r--r-- | kalarmd/simplealarmdaemonimpl.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/kalarmd/simplealarmdaemonimpl.cpp b/kalarmd/simplealarmdaemonimpl.cpp index c1e064c..553e377 100644 --- a/kalarmd/simplealarmdaemonimpl.cpp +++ b/kalarmd/simplealarmdaemonimpl.cpp | |||
@@ -135,34 +135,35 @@ SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent ) | |||
135 | mCustomMinutes = 7; | 135 | mCustomMinutes = 7; |
136 | mTimerPopupConf = 1; | 136 | mTimerPopupConf = 1; |
137 | fillTimerPopUp(); | 137 | fillTimerPopUp(); |
138 | mPausePlay = 0; | 138 | mPausePlay = 0; |
139 | confPause( 1 ); | 139 | confPause( 1 ); |
140 | mSuspend = 0; | 140 | mSuspend = 0; |
141 | confSuspend( 0 ); | 141 | confSuspend( 0 ); |
142 | if ( QApplication::desktop()->width() < 480 ) { | 142 | if ( QApplication::desktop()->width() < 480 ) { |
143 | wavAlarm = false; | 143 | wavAlarm = false; |
144 | mSoundPopUp->setItemChecked ( 0, true ); | 144 | mSoundPopUp->setItemChecked ( 0, true ); |
145 | } | 145 | } |
146 | else { | 146 | else { |
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 ); | 151 | mTimerStartLabel = new QLabel( 0, 0, WType_Popup ); |
152 | mTimerStartLabel->setCaption( "Timer started!"); | 152 | //mTimerStartLabel->setCaption( "Timer started!"); |
153 | mTimerStartLabel->setAlignment ( Qt::AlignCenter ) ; | ||
153 | fon = mTimerPopUp->font(); | 154 | fon = mTimerPopUp->font(); |
154 | fon.setBold( true ); | 155 | fon.setBold( true ); |
155 | points = (fon.pointSize()*2); | 156 | points = (fon.pointSize()*2); |
156 | fon.setPointSize( points ); | 157 | fon.setPointSize( points ); |
157 | mTimerStartLabel->setFont( fon ); | 158 | mTimerStartLabel->setFont( fon ); |
158 | } | 159 | } |
159 | 160 | ||
160 | SimpleAlarmDaemonImpl::~SimpleAlarmDaemonImpl() | 161 | SimpleAlarmDaemonImpl::~SimpleAlarmDaemonImpl() |
161 | { | 162 | { |
162 | //delete mPopUp; | 163 | //delete mPopUp; |
163 | delete mAlarmDialog; | 164 | delete mAlarmDialog; |
164 | delete mTimerStartLabel; | 165 | delete mTimerStartLabel; |
165 | } | 166 | } |
166 | 167 | ||
167 | void SimpleAlarmDaemonImpl::saveSlot( int load ) | 168 | void SimpleAlarmDaemonImpl::saveSlot( int load ) |
168 | { | 169 | { |
@@ -606,40 +607,40 @@ void SimpleAlarmDaemonImpl::confTimer( int time ) | |||
606 | mRunningTimerText = mCustomText.stripWhiteSpace (); | 607 | mRunningTimerText = mCustomText.stripWhiteSpace (); |
607 | int in = mRunningTimerText.find( " " ); | 608 | int in = mRunningTimerText.find( " " ); |
608 | mRunningTimerText = mRunningTimerText.left ( in ); | 609 | mRunningTimerText = mRunningTimerText.left ( in ); |
609 | } | 610 | } |
610 | else { | 611 | else { |
611 | mess += mTimerPopUp->text( minutes ); | 612 | mess += mTimerPopUp->text( minutes ); |
612 | disp = mTimerPopUp->text( minutes ); | 613 | disp = mTimerPopUp->text( minutes ); |
613 | mRunningTimerText = mTimerPopUp->text( minutes ); | 614 | mRunningTimerText = mTimerPopUp->text( minutes ); |
614 | minutes -= 10; | 615 | minutes -= 10; |
615 | } | 616 | } |
616 | } | 617 | } |
617 | //minutes = 1; | 618 | //minutes = 1; |
618 | 619 | ||
619 | mRunningTimer = QDateTime::currentDateTime().addSecs( minutes * 60 ); | 620 | mRunningTimer = QDateTime::currentDateTime().addSecs( minutes * 60 ); |
620 | timerMesssage = mess; | 621 | timerMesssage = mess; |
621 | AlarmServer::addAlarm ( mRunningTimer,"koalarm",timerMesssage.utf8()); | 622 | AlarmServer::addAlarm ( mRunningTimer,"koalarm",timerMesssage.utf8()); |
622 | mTimerStartLabel->setText( disp ); | 623 | mTimerStartLabel->setText( disp + "\n\nTimer started!" ); |
623 | int w = 200; | 624 | int w = mTimerStartLabel->sizeHint().width()+20; |
624 | int h = mTimerStartLabel->sizeHint().height() ; | 625 | int h = mTimerStartLabel->sizeHint().height()+40 ; |
625 | int dw = QApplication::desktop()->width(); | 626 | int dw = QApplication::desktop()->width(); |
626 | int dh = QApplication::desktop()->height(); | 627 | int dh = QApplication::desktop()->height(); |
627 | mTimerStartLabel->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 628 | mTimerStartLabel->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
628 | mTimerStartLabel->show(); | 629 | mTimerStartLabel->show(); |
629 | QTimer::singleShot( 2000, mTimerStartLabel, SLOT ( hide() ) ); | 630 | QTimer::singleShot( 3000, mTimerStartLabel, SLOT ( hide() ) ); |
630 | mTimerTime = 1; | 631 | mTimerTime = 1; |
631 | } | 632 | } |
632 | 633 | ||
633 | void SimpleAlarmDaemonImpl::writeFile() | 634 | void SimpleAlarmDaemonImpl::writeFile() |
634 | { | 635 | { |
635 | QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent"); | 636 | QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent"); |
636 | //QCopEnvelope e("QPE/Application/kopi", "-writeFile"); | 637 | //QCopEnvelope e("QPE/Application/kopi", "-writeFile"); |
637 | } | 638 | } |
638 | void SimpleAlarmDaemonImpl::showWN() | 639 | void SimpleAlarmDaemonImpl::showWN() |
639 | { | 640 | { |
640 | QCopEnvelope e("QPE/Application/kopi", "-showWN"); | 641 | QCopEnvelope e("QPE/Application/kopi", "-showWN"); |
641 | } | 642 | } |
642 | void SimpleAlarmDaemonImpl::newTodo() | 643 | void SimpleAlarmDaemonImpl::newTodo() |
643 | { | 644 | { |
644 | QCopEnvelope e("QPE/Application/kopi", "-newTodo"); | 645 | QCopEnvelope e("QPE/Application/kopi", "-newTodo"); |
645 | } | 646 | } |