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 | |||
@@ -119,71 +119,80 @@ SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent ) | |||
119 | mPopUp->insertItem( "Timer", mTimerPopUp ); | 119 | mPopUp->insertItem( "Timer", mTimerPopUp ); |
120 | //mPopUp->insertSeparator(); | 120 | //mPopUp->insertSeparator(); |
121 | //mPopUp->insertItem( "Simulate", this, SLOT ( simulate() ) ); | 121 | //mPopUp->insertItem( "Simulate", this, SLOT ( simulate() ) ); |
122 | 122 | ||
123 | mPopUp->resize( mPopUp->sizeHint() ); | 123 | mPopUp->resize( mPopUp->sizeHint() ); |
124 | mPlayBeeps = 60; | 124 | mPlayBeeps = 60; |
125 | mBeepPopUp->setItemChecked ( mPlayBeeps, true ); | 125 | mBeepPopUp->setItemChecked ( mPlayBeeps, true ); |
126 | connect ( mBeepPopUp, SIGNAL( activated ( int ) ), this, SLOT (slotPlayBeep( int ) ) ); | 126 | connect ( mBeepPopUp, SIGNAL( activated ( int ) ), this, SLOT (slotPlayBeep( int ) ) ); |
127 | connect ( mTimerPopUp, SIGNAL( activated ( int ) ), this, SLOT (confTimer( int ) ) ); | 127 | connect ( mTimerPopUp, SIGNAL( activated ( int ) ), this, SLOT (confTimer( int ) ) ); |
128 | connect ( mTimerPopUp, SIGNAL(aboutToShow() ), this, SLOT ( showTimer( ) ) ); | 128 | connect ( mTimerPopUp, SIGNAL(aboutToShow() ), this, SLOT ( showTimer( ) ) ); |
129 | connect ( mSoundPopUp, SIGNAL( activated ( int ) ), this, SLOT (confSound( int ) ) ); | 129 | connect ( mSoundPopUp, SIGNAL( activated ( int ) ), this, SLOT (confSound( int ) ) ); |
130 | connect ( mPausePopUp, SIGNAL( activated ( int ) ), this, SLOT (confPause( int ) ) ); | 130 | connect ( mPausePopUp, SIGNAL( activated ( int ) ), this, SLOT (confPause( int ) ) ); |
131 | connect ( mSuspendPopUp, SIGNAL( activated ( int ) ), this, SLOT (confSuspend( int ) ) ); | 131 | connect ( mSuspendPopUp, SIGNAL( activated ( int ) ), this, SLOT (confSuspend( int ) ) ); |
132 | connect ( savePopUp, SIGNAL( activated ( int ) ), this, SLOT (saveSlot( int ) ) ); | 132 | connect ( savePopUp, SIGNAL( activated ( int ) ), this, SLOT (saveSlot( int ) ) ); |
133 | mTimerTime = 0; | 133 | mTimerTime = 0; |
134 | mCustomText = "Custom Text"; | 134 | mCustomText = "Custom Text"; |
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 ); | ||
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 ); |
162 | QFile file( fileName ); | 171 | QFile file( fileName ); |
163 | if ( load ) { | 172 | if ( load ) { |
164 | if( !QFile::exists( fileName) ) | 173 | if( !QFile::exists( fileName) ) |
165 | return; | 174 | return; |
166 | if (!file.open( IO_ReadOnly ) ) { | 175 | if (!file.open( IO_ReadOnly ) ) { |
167 | return ; | 176 | return ; |
168 | } | 177 | } |
169 | QString line; | 178 | QString line; |
170 | bool ok; | 179 | bool ok; |
171 | int val; | 180 | int val; |
172 | int len; | 181 | int len; |
173 | while ( file.readLine( line, 1024 ) > 0 ) { | 182 | while ( file.readLine( line, 1024 ) > 0 ) { |
174 | //qDebug("read %s ", line.latin1()); | 183 | //qDebug("read %s ", line.latin1()); |
175 | len = line.length(); | 184 | len = line.length(); |
176 | if ( line.left(4 ) == "PPAU" ) { | 185 | if ( line.left(4 ) == "PPAU" ) { |
177 | val = line.mid( 4,len-5).toInt( &ok ); | 186 | val = line.mid( 4,len-5).toInt( &ok ); |
178 | if ( ok ) { | 187 | if ( ok ) { |
179 | confPause( val ); | 188 | confPause( val ); |
180 | } | 189 | } |
181 | } | 190 | } |
182 | if ( line.left(4 ) == "SUCO" ) { | 191 | if ( line.left(4 ) == "SUCO" ) { |
183 | val = line.mid( 4,len-5).toInt( &ok ); | 192 | val = line.mid( 4,len-5).toInt( &ok ); |
184 | if ( ok ) | 193 | if ( ok ) |
185 | confSuspend ( val ); | 194 | confSuspend ( val ); |
186 | } | 195 | } |
187 | if ( line.left(4 ) == "WAAL" ) { | 196 | if ( line.left(4 ) == "WAAL" ) { |
188 | val = line.mid( 4,len-5).toInt( &ok ); | 197 | val = line.mid( 4,len-5).toInt( &ok ); |
189 | if ( ok ) | 198 | if ( ok ) |
@@ -373,66 +382,66 @@ void SimpleAlarmDaemonImpl::fillTimerPopUp() | |||
373 | } | 382 | } |
374 | else { | 383 | else { |
375 | QString text = mCustomText.stripWhiteSpace (); | 384 | QString text = mCustomText.stripWhiteSpace (); |
376 | int in = text.find( " " ); | 385 | int in = text.find( " " ); |
377 | text = text.left ( in ); | 386 | text = text.left ( in ); |
378 | mTimerPopUp->changeItem ( 3, text ); | 387 | mTimerPopUp->changeItem ( 3, text ); |
379 | } | 388 | } |
380 | return; | 389 | return; |
381 | } | 390 | } |
382 | mTimerPopupConf = mTimerTime; | 391 | mTimerPopupConf = mTimerTime; |
383 | mTimerPopUp->clear(); | 392 | mTimerPopUp->clear(); |
384 | if ( mTimerTime ) { | 393 | if ( mTimerTime ) { |
385 | int secs = QDateTime::currentDateTime().secsTo ( mRunningTimer ); | 394 | int secs = QDateTime::currentDateTime().secsTo ( mRunningTimer ); |
386 | QTime t ( secs/3600, (secs/60)%60, secs%60 ); | 395 | QTime t ( secs/3600, (secs/60)%60, secs%60 ); |
387 | 396 | ||
388 | 397 | ||
389 | mTimerPopUp->insertItem( "Stop timer "+ mRunningTimerText , 0 ); | 398 | mTimerPopUp->insertItem( "Stop timer "+ mRunningTimerText , 0 ); |
390 | mTimerPopUp->insertItem( t.toString() + " (countdown)",1); | 399 | mTimerPopUp->insertItem( t.toString() + " (countdown)",1); |
391 | mTimerPopUp->insertItem( mRunningTimer.time().toString() + " (alarm)",2); | 400 | mTimerPopUp->insertItem( mRunningTimer.time().toString() + " (alarm)",2); |
392 | } else { | 401 | } else { |
393 | 402 | ||
394 | QString fileName = QDir::homeDirPath() +"/.kopialarmtimerrc"; | 403 | QString fileName = QDir::homeDirPath() +"/.kopialarmtimerrc"; |
395 | QFile file( fileName ); | 404 | QFile file( fileName ); |
396 | if( !QFile::exists( fileName) ) { | 405 | if( !QFile::exists( fileName) ) { |
397 | // write defaults | 406 | // write defaults |
398 | if (!file.open( IO_WriteOnly ) ) { | 407 | if (!file.open( IO_WriteOnly ) ) { |
399 | return; | 408 | return; |
400 | } | 409 | } |
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"; |
411 | configString += "Pizza; 22\n"; | 420 | configString += "Pizza; 22\n"; |
412 | configString += "Nap; 45\n"; | 421 | configString += "Nap; 45\n"; |
413 | configString += "Tea; 5\n"; | 422 | configString += "Tea; 5\n"; |
414 | QTextStream ts( &file ); | 423 | QTextStream ts( &file ); |
415 | ts << configString ; | 424 | ts << configString ; |
416 | file.close(); | 425 | file.close(); |
417 | } | 426 | } |
418 | 427 | ||
419 | if (!file.open( IO_ReadOnly ) ) { | 428 | if (!file.open( IO_ReadOnly ) ) { |
420 | return ; | 429 | return ; |
421 | } | 430 | } |
422 | QString line; | 431 | QString line; |
423 | bool ok; | 432 | bool ok; |
424 | while ( file.readLine( line, 1024 ) > 0 ) { | 433 | while ( file.readLine( line, 1024 ) > 0 ) { |
425 | //qDebug("read %s ", line.latin1()); | 434 | //qDebug("read %s ", line.latin1()); |
426 | if ( line.left(1 ) != "#" ) { | 435 | if ( line.left(1 ) != "#" ) { |
427 | // no comment | 436 | // no comment |
428 | if ( line.left(9 ) == "SEPARATOR" ) { | 437 | if ( line.left(9 ) == "SEPARATOR" ) { |
429 | mTimerPopUp->insertSeparator(); | 438 | mTimerPopUp->insertSeparator(); |
430 | } else { | 439 | } else { |
431 | QStringList li = QStringList::split(";",line); | 440 | QStringList li = QStringList::split(";",line); |
432 | ok = false; | 441 | ok = false; |
433 | if ( li.count() == 2 ) { | 442 | if ( li.count() == 2 ) { |
434 | int val = li[1].toInt( &ok ); | 443 | int val = li[1].toInt( &ok ); |
435 | if ( ok && val > 0 ) { | 444 | if ( ok && val > 0 ) { |
436 | mTimerPopUp->insertItem( li[0], val+10); | 445 | mTimerPopUp->insertItem( li[0], val+10); |
437 | } | 446 | } |
438 | } | 447 | } |
@@ -484,71 +493,73 @@ void SimpleAlarmDaemonImpl::confTimer( int time ) | |||
484 | lab.setAlignment( AlignCenter ); | 493 | lab.setAlignment( AlignCenter ); |
485 | dia.setCaption(("KO/Pi Timer Stop" )); | 494 | dia.setCaption(("KO/Pi Timer Stop" )); |
486 | QVBoxLayout lay( &dia ); | 495 | QVBoxLayout lay( &dia ); |
487 | lay.addWidget( &lab); | 496 | lay.addWidget( &lab); |
488 | QPushButton ok ( "Stop timer!", &dia); | 497 | QPushButton ok ( "Stop timer!", &dia); |
489 | QFont fo = dia.font(); | 498 | QFont fo = dia.font(); |
490 | fo.setPointSize( 36 ); | 499 | fo.setPointSize( 36 ); |
491 | ok.setFont( fo ); | 500 | ok.setFont( fo ); |
492 | lay.addWidget( &ok); | 501 | lay.addWidget( &ok); |
493 | connect ( &ok, SIGNAL (clicked()), &dia, SLOT ( accept() ) ); | 502 | connect ( &ok, SIGNAL (clicked()), &dia, SLOT ( accept() ) ); |
494 | QPushButton con ( "Continue timer!", &dia); | 503 | QPushButton con ( "Continue timer!", &dia); |
495 | fo.setPointSize( 36 ); | 504 | fo.setPointSize( 36 ); |
496 | con.setFont( fo ); | 505 | con.setFont( fo ); |
497 | lay.addWidget( &con); | 506 | lay.addWidget( &con); |
498 | connect ( &con, SIGNAL (clicked()), &dia, SLOT ( reject() ) ); | 507 | connect ( &con, SIGNAL (clicked()), &dia, SLOT ( reject() ) ); |
499 | lay.setMargin(5); | 508 | lay.setMargin(5); |
500 | lay.setSpacing(5); | 509 | lay.setSpacing(5); |
501 | dia.resize(dia.sizeHint() ); | 510 | dia.resize(dia.sizeHint() ); |
502 | 511 | ||
503 | if ( !dia.exec() ) | 512 | if ( !dia.exec() ) |
504 | return; | 513 | return; |
505 | 514 | ||
506 | AlarmServer::deleteAlarm ( mRunningTimer,"koalarm" , timerMesssage.utf8() ); | 515 | AlarmServer::deleteAlarm ( mRunningTimer,"koalarm" , timerMesssage.utf8() ); |
507 | mTimerTime = 0; | 516 | mTimerTime = 0; |
508 | return; | 517 | return; |
509 | } | 518 | } |
510 | if ( mTimerTime ) | 519 | if ( mTimerTime ) |
511 | return; | 520 | return; |
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 |
527 | QDialog dia ( 0, ("Customize Timer" ), true ); | 538 | QDialog dia ( 0, ("Customize Timer" ), true ); |
528 | QLabel lab (("Message Text:"), &dia ); | 539 | QLabel lab (("Message Text:"), &dia ); |
529 | dia.setCaption(("KO/Pi Timer" )); | 540 | dia.setCaption(("KO/Pi Timer" )); |
530 | QVBoxLayout lay( &dia ); | 541 | QVBoxLayout lay( &dia ); |
531 | lay.setMargin(5); | 542 | lay.setMargin(5); |
532 | lay.setSpacing(5); | 543 | lay.setSpacing(5); |
533 | lay.addWidget( &lab); | 544 | lay.addWidget( &lab); |
534 | QLineEdit lEdit( mCustomText, &dia ); | 545 | QLineEdit lEdit( mCustomText, &dia ); |
535 | lay.addWidget( &lEdit); | 546 | lay.addWidget( &lEdit); |
536 | QLabel lab2 (("Countdown time (1 min - 24 h):"), &dia ); | 547 | QLabel lab2 (("Countdown time (1 min - 24 h):"), &dia ); |
537 | lay.addWidget( &lab2); | 548 | lay.addWidget( &lab2); |
538 | QHBox hbox1 ( &dia ); | 549 | QHBox hbox1 ( &dia ); |
539 | lay.addWidget( &hbox1); | 550 | lay.addWidget( &hbox1); |
540 | QLabel lab3 (("Hours"), &hbox1 ); | 551 | QLabel lab3 (("Hours"), &hbox1 ); |
541 | QLabel lab4 (("Minutes"), &hbox1 ); | 552 | QLabel lab4 (("Minutes"), &hbox1 ); |
542 | QHBox hbox ( &dia ); | 553 | QHBox hbox ( &dia ); |
543 | QSpinBox spinh( 0, 24, 1,& hbox ); | 554 | QSpinBox spinh( 0, 24, 1,& hbox ); |
544 | QFont fo = dia.font(); | 555 | QFont fo = dia.font(); |
545 | fo.setPointSize( 36 ); | 556 | fo.setPointSize( 36 ); |
546 | QSpinBox spinm( 0, 59, 1,&hbox ); | 557 | QSpinBox spinm( 0, 59, 1,&hbox ); |
547 | spinm.setFont( fo ); | 558 | spinm.setFont( fo ); |
548 | spinh.setFont( fo ); | 559 | spinh.setFont( fo ); |
549 | spinh.setButtonSymbols( QSpinBox::PlusMinus ); | 560 | spinh.setButtonSymbols( QSpinBox::PlusMinus ); |
550 | spinm.setButtonSymbols( QSpinBox::PlusMinus ); | 561 | spinm.setButtonSymbols( QSpinBox::PlusMinus ); |
551 | spinh.upButton ()->setFixedSize( QSize( 48, 30 )); | 562 | spinh.upButton ()->setFixedSize( QSize( 48, 30 )); |
552 | spinh.downButton ()->setFixedSize( QSize( 48, 30 )); | 563 | spinh.downButton ()->setFixedSize( QSize( 48, 30 )); |
553 | //spinh.editor ()->setFixedSize( QSize( 50, 100 )); | 564 | //spinh.editor ()->setFixedSize( QSize( 50, 100 )); |
554 | spinh.setFixedSize( 100,62 ); | 565 | spinh.setFixedSize( 100,62 ); |
@@ -561,80 +572,90 @@ void SimpleAlarmDaemonImpl::confTimer( int time ) | |||
561 | //spinm.editor ()->setFixedSize( QSize( 50, 100 )); | 572 | //spinm.editor ()->setFixedSize( QSize( 50, 100 )); |
562 | spinm.setLineStep( 1 ); | 573 | spinm.setLineStep( 1 ); |
563 | spinm.setFixedSize( 110,62 ); | 574 | spinm.setFixedSize( 110,62 ); |
564 | lay.addWidget( &hbox); | 575 | lay.addWidget( &hbox); |
565 | QLabel lab5 ("Timer fires at:", &dia ); | 576 | QLabel lab5 ("Timer fires at:", &dia ); |
566 | lab5.setAlignment( AlignCenter ); | 577 | lab5.setAlignment( AlignCenter ); |
567 | lay.addWidget( &lab5); | 578 | lay.addWidget( &lab5); |
568 | KODateLabel dl ( &dia ); | 579 | KODateLabel dl ( &dia ); |
569 | dl.setAlignment( AlignCenter ); | 580 | dl.setAlignment( AlignCenter ); |
570 | dl.setFont( fo ); | 581 | dl.setFont( fo ); |
571 | connect ( &spinh, SIGNAL ( valueChanged (int)), &dl, SLOT ( slot_hours( int ) ) ); | 582 | connect ( &spinh, SIGNAL ( valueChanged (int)), &dl, SLOT ( slot_hours( int ) ) ); |
572 | connect ( &spinm, SIGNAL ( valueChanged (int)), &dl, SLOT ( slot_minutes( int ) ) ); | 583 | connect ( &spinm, SIGNAL ( valueChanged (int)), &dl, SLOT ( slot_minutes( int ) ) ); |
573 | lay.addWidget( &dl); | 584 | lay.addWidget( &dl); |
574 | spinh.setValue( mCustomMinutes/60 ); | 585 | spinh.setValue( mCustomMinutes/60 ); |
575 | spinm.setValue( mCustomMinutes%60 ); | 586 | spinm.setValue( mCustomMinutes%60 ); |
576 | QPushButton ok ( "Start timer", &dia); | 587 | QPushButton ok ( "Start timer", &dia); |
577 | ok.setDefault( true ); | 588 | ok.setDefault( true ); |
578 | ok.setFont( fo ); | 589 | ok.setFont( fo ); |
579 | spinh.setFocus(); | 590 | spinh.setFocus(); |
580 | lay.addWidget( &ok); | 591 | lay.addWidget( &ok); |
581 | connect ( &ok, SIGNAL (clicked()), &dia, SLOT ( accept() ) ); | 592 | connect ( &ok, SIGNAL (clicked()), &dia, SLOT ( accept() ) ); |
582 | dia.resize( dia.sizeHint().width(), dia.sizeHint().height() ); | 593 | dia.resize( dia.sizeHint().width(), dia.sizeHint().height() ); |
583 | 594 | ||
584 | if ( !dia.exec() ) | 595 | if ( !dia.exec() ) |
585 | return; | 596 | return; |
586 | mCustomText = lEdit.text(); | 597 | mCustomText = lEdit.text(); |
587 | mCustomMinutes = spinh.value()*60+spinm.value(); | 598 | mCustomMinutes = spinh.value()*60+spinm.value(); |
588 | if ( mCustomMinutes == 0 ) | 599 | if ( mCustomMinutes == 0 ) |
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 | } |
604 | //minutes = 1; | 617 | //minutes = 1; |
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() |
613 | { | 634 | { |
614 | QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent"); | 635 | QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent"); |
615 | //QCopEnvelope e("QPE/Application/kopi", "-writeFile"); | 636 | //QCopEnvelope e("QPE/Application/kopi", "-writeFile"); |
616 | } | 637 | } |
617 | void SimpleAlarmDaemonImpl::showWN() | 638 | void SimpleAlarmDaemonImpl::showWN() |
618 | { | 639 | { |
619 | QCopEnvelope e("QPE/Application/kopi", "-showWN"); | 640 | QCopEnvelope e("QPE/Application/kopi", "-showWN"); |
620 | } | 641 | } |
621 | void SimpleAlarmDaemonImpl::newTodo() | 642 | void SimpleAlarmDaemonImpl::newTodo() |
622 | { | 643 | { |
623 | QCopEnvelope e("QPE/Application/kopi", "-newTodo"); | 644 | QCopEnvelope e("QPE/Application/kopi", "-newTodo"); |
624 | } | 645 | } |
625 | 646 | ||
626 | void SimpleAlarmDaemonImpl::newEvent() | 647 | void SimpleAlarmDaemonImpl::newEvent() |
627 | { | 648 | { |
628 | QCopEnvelope e("QPE/Application/kopi", "-newEvent"); | 649 | QCopEnvelope e("QPE/Application/kopi", "-newEvent"); |
629 | 650 | ||
630 | } | 651 | } |
631 | void SimpleAlarmDaemonImpl::newMail() | 652 | void SimpleAlarmDaemonImpl::newMail() |
632 | { | 653 | { |
633 | QCopEnvelope e("QPE/Application/ompi", "newMail()"); | 654 | QCopEnvelope e("QPE/Application/ompi", "newMail()"); |
634 | } | 655 | } |
635 | void SimpleAlarmDaemonImpl::showAdd() | 656 | void SimpleAlarmDaemonImpl::showAdd() |
636 | { | 657 | { |
637 | QCopEnvelope e("QPE/Application/kapi", "raise()"); | 658 | QCopEnvelope e("QPE/Application/kapi", "raise()"); |
638 | } | 659 | } |
639 | void SimpleAlarmDaemonImpl::ringSync() | 660 | void SimpleAlarmDaemonImpl::ringSync() |
640 | { | 661 | { |