author | zautrix <zautrix> | 2005-10-23 23:46:14 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-10-23 23:46:14 (UTC) |
commit | ae59704dc0643963d0ed648baf7186b741c3ecb2 (patch) (unidiff) | |
tree | 4a9791decd5dca230498408bec2d64f6c25ddb3e | |
parent | c1cb0653160e8e449d07a0df7b84b2398c0201fb (diff) | |
download | kdepimpi-ae59704dc0643963d0ed648baf7186b741c3ecb2.zip kdepimpi-ae59704dc0643963d0ed648baf7186b741c3ecb2.tar.gz kdepimpi-ae59704dc0643963d0ed648baf7186b741c3ecb2.tar.bz2 |
shorter delay
-rw-r--r-- | kalarmd/simplealarmdaemonimpl.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/kalarmd/simplealarmdaemonimpl.cpp b/kalarmd/simplealarmdaemonimpl.cpp index 553e377..82873e1 100644 --- a/kalarmd/simplealarmdaemonimpl.cpp +++ b/kalarmd/simplealarmdaemonimpl.cpp | |||
@@ -307,75 +307,75 @@ void SimpleAlarmDaemonImpl::recieve( const QCString& msg, const QByteArray& ) | |||
307 | if ( mess.left( 11 ) == "timer_alarm") { | 307 | if ( mess.left( 11 ) == "timer_alarm") { |
308 | mTimerTime = 0; | 308 | mTimerTime = 0; |
309 | startAlarm( mess.mid( 11 ), filename ); | 309 | startAlarm( mess.mid( 11 ), filename ); |
310 | return; | 310 | return; |
311 | } | 311 | } |
312 | if ( mess.left( 10 ) == "proc_alarm") { | 312 | if ( mess.left( 10 ) == "proc_alarm") { |
313 | bool error = false; | 313 | bool error = false; |
314 | int len = mess.mid( 10 ).find("+++"); | 314 | int len = mess.mid( 10 ).find("+++"); |
315 | if ( len < 2 ) | 315 | if ( len < 2 ) |
316 | error = true; | 316 | error = true; |
317 | else { | 317 | else { |
318 | tempfilename = mess.mid( 10, len ); | 318 | tempfilename = mess.mid( 10, len ); |
319 | if ( !QFile::exists( tempfilename ) ) | 319 | if ( !QFile::exists( tempfilename ) ) |
320 | error = true; | 320 | error = true; |
321 | } | 321 | } |
322 | if ( error ) { | 322 | if ( error ) { |
323 | mAlarmMessage = "Procedure Alarm\nError - File not found\n"; | 323 | mAlarmMessage = "Procedure Alarm\nError - File not found\n"; |
324 | mAlarmMessage += mess.mid( 10+len+3+9 ); | 324 | mAlarmMessage += mess.mid( 10+len+3+9 ); |
325 | } else { | 325 | } else { |
326 | //qDebug("-----system command %s ",tempfilename.latin1() ); | 326 | //qDebug("-----system command %s ",tempfilename.latin1() ); |
327 | if ( vfork () == 0 ) { | 327 | if ( vfork () == 0 ) { |
328 | execl ( tempfilename.latin1(), 0 ); | 328 | execl ( tempfilename.latin1(), 0 ); |
329 | return; | 329 | return; |
330 | } | 330 | } |
331 | QTimer::singleShot( 5000, this, SLOT ( writeFile() ) ); | 331 | QTimer::singleShot( 2000, this, SLOT ( writeFile() ) ); |
332 | return; | 332 | return; |
333 | } | 333 | } |
334 | 334 | ||
335 | //qDebug("+++++++system command %s ",tempfilename.latin1() ); | 335 | //qDebug("+++++++system command %s ",tempfilename.latin1() ); |
336 | } | 336 | } |
337 | if ( mess.left( 11 ) == "audio_alarm") { | 337 | if ( mess.left( 11 ) == "audio_alarm") { |
338 | bool error = false; | 338 | bool error = false; |
339 | int len = mess.mid( 11 ).find("+++"); | 339 | int len = mess.mid( 11 ).find("+++"); |
340 | if ( len < 2 ) | 340 | if ( len < 2 ) |
341 | error = true; | 341 | error = true; |
342 | else { | 342 | else { |
343 | tempfilename = mess.mid( 11, len ); | 343 | tempfilename = mess.mid( 11, len ); |
344 | if ( !QFile::exists( tempfilename ) ) | 344 | if ( !QFile::exists( tempfilename ) ) |
345 | error = true; | 345 | error = true; |
346 | } | 346 | } |
347 | if ( ! error ) { | 347 | if ( ! error ) { |
348 | filename = tempfilename; | 348 | filename = tempfilename; |
349 | } | 349 | } |
350 | mAlarmMessage = mess.mid( 11+len+3+9 ); | 350 | mAlarmMessage = mess.mid( 11+len+3+9 ); |
351 | //qDebug("audio file command %s ",tempfilename.latin1() ); | 351 | //qDebug("audio file command %s ",tempfilename.latin1() ); |
352 | } | 352 | } |
353 | if ( mess.left( 9 ) == "cal_alarm") { | 353 | if ( mess.left( 9 ) == "cal_alarm") { |
354 | mAlarmMessage = mess.mid( 9 ) ; | 354 | mAlarmMessage = mess.mid( 9 ) ; |
355 | } | 355 | } |
356 | 356 | ||
357 | QTimer::singleShot( 5000, this, SLOT ( writeFile() ) ); | 357 | QTimer::singleShot( 2000, this, SLOT ( writeFile() ) ); |
358 | startAlarm( mAlarmMessage, filename ); | 358 | startAlarm( mAlarmMessage, filename ); |
359 | 359 | ||
360 | } | 360 | } |
361 | 361 | ||
362 | int SimpleAlarmDaemonImpl::getFileNameLen( QString mess ) | 362 | int SimpleAlarmDaemonImpl::getFileNameLen( QString mess ) |
363 | { | 363 | { |
364 | return 0; | 364 | return 0; |
365 | } | 365 | } |
366 | void SimpleAlarmDaemonImpl::startAlarm( QString mess, QString filename ) | 366 | void SimpleAlarmDaemonImpl::startAlarm( QString mess, QString filename ) |
367 | { | 367 | { |
368 | //mAlarmDialog->show(); | 368 | //mAlarmDialog->show(); |
369 | //mAlarmDialog->raise(); | 369 | //mAlarmDialog->raise(); |
370 | mAlarmDialog->eventNotification( mess, mPlayBeeps, filename, wavAlarm,mPausePlay ,mSuspend ); | 370 | mAlarmDialog->eventNotification( mess, mPlayBeeps, filename, wavAlarm,mPausePlay ,mSuspend ); |
371 | } | 371 | } |
372 | 372 | ||
373 | 373 | ||
374 | void SimpleAlarmDaemonImpl::fillTimerPopUp() | 374 | void SimpleAlarmDaemonImpl::fillTimerPopUp() |
375 | { | 375 | { |
376 | 376 | ||
377 | // qDebug(" timer %d %d ",mTimerPopupConf, mTimerTime ); | 377 | // qDebug(" timer %d %d ",mTimerPopupConf, mTimerTime ); |
378 | if ( mTimerPopupConf == mTimerTime ) { | 378 | if ( mTimerPopupConf == mTimerTime ) { |
379 | if ( mTimerTime ) { | 379 | if ( mTimerTime ) { |
380 | int secs = QDateTime::currentDateTime().secsTo ( mRunningTimer ); | 380 | int secs = QDateTime::currentDateTime().secsTo ( mRunningTimer ); |
381 | QTime t ( secs/3600, (secs/60)%60, secs%60 ); | 381 | QTime t ( secs/3600, (secs/60)%60, secs%60 ); |
@@ -606,91 +606,91 @@ void SimpleAlarmDaemonImpl::confTimer( int time ) | |||
606 | minutes = mCustomMinutes; | 606 | minutes = mCustomMinutes; |
607 | mRunningTimerText = mCustomText.stripWhiteSpace (); | 607 | mRunningTimerText = mCustomText.stripWhiteSpace (); |
608 | int in = mRunningTimerText.find( " " ); | 608 | int in = mRunningTimerText.find( " " ); |
609 | mRunningTimerText = mRunningTimerText.left ( in ); | 609 | mRunningTimerText = mRunningTimerText.left ( in ); |
610 | } | 610 | } |
611 | else { | 611 | else { |
612 | mess += mTimerPopUp->text( minutes ); | 612 | mess += mTimerPopUp->text( minutes ); |
613 | disp = mTimerPopUp->text( minutes ); | 613 | disp = mTimerPopUp->text( minutes ); |
614 | mRunningTimerText = mTimerPopUp->text( minutes ); | 614 | mRunningTimerText = mTimerPopUp->text( minutes ); |
615 | minutes -= 10; | 615 | minutes -= 10; |
616 | } | 616 | } |
617 | } | 617 | } |
618 | //minutes = 1; | 618 | //minutes = 1; |
619 | 619 | ||
620 | mRunningTimer = QDateTime::currentDateTime().addSecs( minutes * 60 ); | 620 | mRunningTimer = QDateTime::currentDateTime().addSecs( minutes * 60 ); |
621 | timerMesssage = mess; | 621 | timerMesssage = mess; |
622 | AlarmServer::addAlarm ( mRunningTimer,"koalarm",timerMesssage.utf8()); | 622 | AlarmServer::addAlarm ( mRunningTimer,"koalarm",timerMesssage.utf8()); |
623 | mTimerStartLabel->setText( disp + "\n\nTimer started!" ); | 623 | mTimerStartLabel->setText( disp + "\n\nTimer started!" ); |
624 | int w = mTimerStartLabel->sizeHint().width()+20; | 624 | int w = mTimerStartLabel->sizeHint().width()+20; |
625 | int h = mTimerStartLabel->sizeHint().height()+40 ; | 625 | int h = mTimerStartLabel->sizeHint().height()+40 ; |
626 | int dw = QApplication::desktop()->width(); | 626 | int dw = QApplication::desktop()->width(); |
627 | int dh = QApplication::desktop()->height(); | 627 | int dh = QApplication::desktop()->height(); |
628 | mTimerStartLabel->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 628 | mTimerStartLabel->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
629 | mTimerStartLabel->show(); | 629 | mTimerStartLabel->show(); |
630 | QTimer::singleShot( 3000, mTimerStartLabel, SLOT ( hide() ) ); | 630 | QTimer::singleShot( 5000, mTimerStartLabel, SLOT ( hide() ) ); |
631 | mTimerTime = 1; | 631 | mTimerTime = 1; |
632 | } | 632 | } |
633 | 633 | ||
634 | void SimpleAlarmDaemonImpl::writeFile() | 634 | void SimpleAlarmDaemonImpl::writeFile() |
635 | { | 635 | { |
636 | QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent"); | 636 | QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent"); |
637 | //QCopEnvelope e("QPE/Application/kopi", "-writeFile"); | 637 | //QCopEnvelope e("QPE/Application/kopi", "-writeFile"); |
638 | } | 638 | } |
639 | void SimpleAlarmDaemonImpl::showWN() | 639 | void SimpleAlarmDaemonImpl::showWN() |
640 | { | 640 | { |
641 | QCopEnvelope e("QPE/Application/kopi", "-showWN"); | 641 | QCopEnvelope e("QPE/Application/kopi", "-showWN"); |
642 | } | 642 | } |
643 | void SimpleAlarmDaemonImpl::newTodo() | 643 | void SimpleAlarmDaemonImpl::newTodo() |
644 | { | 644 | { |
645 | QCopEnvelope e("QPE/Application/kopi", "-newTodo"); | 645 | QCopEnvelope e("QPE/Application/kopi", "-newTodo"); |
646 | } | 646 | } |
647 | 647 | ||
648 | void SimpleAlarmDaemonImpl::newEvent() | 648 | void SimpleAlarmDaemonImpl::newEvent() |
649 | { | 649 | { |
650 | QCopEnvelope e("QPE/Application/kopi", "-newEvent"); | 650 | QCopEnvelope e("QPE/Application/kopi", "-newEvent"); |
651 | 651 | ||
652 | } | 652 | } |
653 | void SimpleAlarmDaemonImpl::newMail() | 653 | void SimpleAlarmDaemonImpl::newMail() |
654 | { | 654 | { |
655 | QCopEnvelope e("QPE/Application/ompi", "newMail()"); | 655 | QCopEnvelope e("QPE/Application/ompi", "newMail()"); |
656 | } | 656 | } |
657 | void SimpleAlarmDaemonImpl::showAdd() | 657 | void SimpleAlarmDaemonImpl::showAdd() |
658 | { | 658 | { |
659 | QCopEnvelope e("QPE/Application/kapi", "raise()"); | 659 | QCopEnvelope e("QPE/Application/kapi", "raise()"); |
660 | } | 660 | } |
661 | void SimpleAlarmDaemonImpl::ringSync() | 661 | void SimpleAlarmDaemonImpl::ringSync() |
662 | { | 662 | { |
663 | QCopEnvelope e("QPE/Application/kopi", "-ringSync"); | 663 | QCopEnvelope e("QPE/Application/kopi", "-ringSync"); |
664 | 664 | ||
665 | } | 665 | } |
666 | void SimpleAlarmDaemonImpl::newCountdown() | 666 | void SimpleAlarmDaemonImpl::newCountdown() |
667 | { | 667 | { |
668 | //recieve("cal_alarm", 10 ); | 668 | //recieve("cal_alarm", 10 ); |
669 | } | 669 | } |
670 | void SimpleAlarmDaemonImpl::simulate() | 670 | void SimpleAlarmDaemonImpl::simulate() |
671 | { | 671 | { |
672 | QTimer::singleShot( 5000, this, SLOT ( writeFile() ) ); | 672 | QTimer::singleShot( 2000, this, SLOT ( writeFile() ) ); |
673 | QString filename = getenv("QPEDIR") ; | 673 | QString filename = getenv("QPEDIR") ; |
674 | filename += "/pics/kdepim/korganizer/koalarm.wav"; | 674 | filename += "/pics/kdepim/korganizer/koalarm.wav"; |
675 | startAlarm("Alarm simulation", filename ); | 675 | startAlarm("Alarm simulation", filename ); |
676 | } | 676 | } |
677 | void SimpleAlarmDaemonImpl::showKO() | 677 | void SimpleAlarmDaemonImpl::showKO() |
678 | { | 678 | { |
679 | QCopEnvelope e("QPE/Application/kopi", "-showKO"); | 679 | QCopEnvelope e("QPE/Application/kopi", "-showKO"); |
680 | // testing only | 680 | // testing only |
681 | //QCopEnvelope e("QPE/Application/kopi", "nextView()"); | 681 | //QCopEnvelope e("QPE/Application/kopi", "nextView()"); |
682 | 682 | ||
683 | } | 683 | } |
684 | void SimpleAlarmDaemonImpl::showTodo() | 684 | void SimpleAlarmDaemonImpl::showTodo() |
685 | { | 685 | { |
686 | QCopEnvelope e("QPE/Application/kopi", "-showTodo"); | 686 | QCopEnvelope e("QPE/Application/kopi", "-showTodo"); |
687 | 687 | ||
688 | } | 688 | } |
689 | void SimpleAlarmDaemonImpl::writeJournal() | 689 | void SimpleAlarmDaemonImpl::writeJournal() |
690 | { | 690 | { |
691 | QCopEnvelope e("QPE/Application/kopi", "-showJournal"); | 691 | QCopEnvelope e("QPE/Application/kopi", "-showJournal"); |
692 | 692 | ||
693 | } | 693 | } |
694 | 694 | ||
695 | void SimpleAlarmDaemonImpl::mousePressEvent( QMouseEvent * ) | 695 | void SimpleAlarmDaemonImpl::mousePressEvent( QMouseEvent * ) |
696 | { | 696 | { |