author | zautrix <zautrix> | 2005-10-08 23:54:34 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-10-08 23:54:34 (UTC) |
commit | 6d084862c396f58c949e713e9b159ec20743fd8a (patch) (unidiff) | |
tree | 6e6f5166df3c2d4044362c385a177a3a76ebf32b | |
parent | c0b255e16d45fed73185fac431169284cc1431e8 (diff) | |
download | kdepimpi-6d084862c396f58c949e713e9b159ec20743fd8a.zip kdepimpi-6d084862c396f58c949e713e9b159ec20743fd8a.tar.gz kdepimpi-6d084862c396f58c949e713e9b159ec20743fd8a.tar.bz2 |
fixed time
-rw-r--r-- | kalarmd/simplealarmdaemonimpl.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kalarmd/simplealarmdaemonimpl.cpp b/kalarmd/simplealarmdaemonimpl.cpp index 04b8b21..c1e064c 100644 --- a/kalarmd/simplealarmdaemonimpl.cpp +++ b/kalarmd/simplealarmdaemonimpl.cpp | |||
@@ -533,168 +533,168 @@ void SimpleAlarmDaemonImpl::confTimer( int time ) | |||
533 | disp = mCustomText; | 533 | disp = mCustomText; |
534 | } | 534 | } |
535 | else { | 535 | else { |
536 | if ( minutes == 2 ) { | 536 | if ( minutes == 2 ) { |
537 | // ask time | 537 | // ask time |
538 | QDialog dia ( 0, ("Customize Timer" ), true ); | 538 | QDialog dia ( 0, ("Customize Timer" ), true ); |
539 | QLabel lab (("Message Text:"), &dia ); | 539 | QLabel lab (("Message Text:"), &dia ); |
540 | dia.setCaption(("KO/Pi Timer" )); | 540 | dia.setCaption(("KO/Pi Timer" )); |
541 | QVBoxLayout lay( &dia ); | 541 | QVBoxLayout lay( &dia ); |
542 | lay.setMargin(5); | 542 | lay.setMargin(5); |
543 | lay.setSpacing(5); | 543 | lay.setSpacing(5); |
544 | lay.addWidget( &lab); | 544 | lay.addWidget( &lab); |
545 | QLineEdit lEdit( mCustomText, &dia ); | 545 | QLineEdit lEdit( mCustomText, &dia ); |
546 | lay.addWidget( &lEdit); | 546 | lay.addWidget( &lEdit); |
547 | QLabel lab2 (("Countdown time (1 min - 24 h):"), &dia ); | 547 | QLabel lab2 (("Countdown time (1 min - 24 h):"), &dia ); |
548 | lay.addWidget( &lab2); | 548 | lay.addWidget( &lab2); |
549 | QHBox hbox1 ( &dia ); | 549 | QHBox hbox1 ( &dia ); |
550 | lay.addWidget( &hbox1); | 550 | lay.addWidget( &hbox1); |
551 | QLabel lab3 (("Hours"), &hbox1 ); | 551 | QLabel lab3 (("Hours"), &hbox1 ); |
552 | QLabel lab4 (("Minutes"), &hbox1 ); | 552 | QLabel lab4 (("Minutes"), &hbox1 ); |
553 | QHBox hbox ( &dia ); | 553 | QHBox hbox ( &dia ); |
554 | QSpinBox spinh( 0, 24, 1,& hbox ); | 554 | QSpinBox spinh( 0, 24, 1,& hbox ); |
555 | QFont fo = dia.font(); | 555 | QFont fo = dia.font(); |
556 | fo.setPointSize( 36 ); | 556 | fo.setPointSize( 36 ); |
557 | QSpinBox spinm( 0, 59, 1,&hbox ); | 557 | QSpinBox spinm( 0, 59, 1,&hbox ); |
558 | spinm.setFont( fo ); | 558 | spinm.setFont( fo ); |
559 | spinh.setFont( fo ); | 559 | spinh.setFont( fo ); |
560 | spinh.setButtonSymbols( QSpinBox::PlusMinus ); | 560 | spinh.setButtonSymbols( QSpinBox::PlusMinus ); |
561 | spinm.setButtonSymbols( QSpinBox::PlusMinus ); | 561 | spinm.setButtonSymbols( QSpinBox::PlusMinus ); |
562 | spinh.upButton ()->setFixedSize( QSize( 48, 30 )); | 562 | spinh.upButton ()->setFixedSize( QSize( 48, 30 )); |
563 | spinh.downButton ()->setFixedSize( QSize( 48, 30 )); | 563 | spinh.downButton ()->setFixedSize( QSize( 48, 30 )); |
564 | //spinh.editor ()->setFixedSize( QSize( 50, 100 )); | 564 | //spinh.editor ()->setFixedSize( QSize( 50, 100 )); |
565 | spinh.setFixedSize( 100,62 ); | 565 | spinh.setFixedSize( 100,62 ); |
566 | spinm.upButton ()->setFixedSize( QSize( 48, 30 )); | 566 | spinm.upButton ()->setFixedSize( QSize( 48, 30 )); |
567 | spinm.downButton ()->setFixedSize( QSize( 48, 30 )); | 567 | spinm.downButton ()->setFixedSize( QSize( 48, 30 )); |
568 | spinm.downButton ()->setGeometry( 50,50,50,50); | 568 | spinm.downButton ()->setGeometry( 50,50,50,50); |
569 | // spinm.setSuffix( " m" ); | 569 | // spinm.setSuffix( " m" ); |
570 | //spinh.setSuffix( " h" ); | 570 | //spinh.setSuffix( " h" ); |
571 | spinm.setWrapping ( true ); | 571 | spinm.setWrapping ( true ); |
572 | //spinm.editor ()->setFixedSize( QSize( 50, 100 )); | 572 | //spinm.editor ()->setFixedSize( QSize( 50, 100 )); |
573 | spinm.setLineStep( 1 ); | 573 | spinm.setLineStep( 1 ); |
574 | spinm.setFixedSize( 110,62 ); | 574 | spinm.setFixedSize( 110,62 ); |
575 | lay.addWidget( &hbox); | 575 | lay.addWidget( &hbox); |
576 | QLabel lab5 ("Timer fires at:", &dia ); | 576 | QLabel lab5 ("Timer fires at:", &dia ); |
577 | lab5.setAlignment( AlignCenter ); | 577 | lab5.setAlignment( AlignCenter ); |
578 | lay.addWidget( &lab5); | 578 | lay.addWidget( &lab5); |
579 | KODateLabel dl ( &dia ); | 579 | KODateLabel dl ( &dia ); |
580 | dl.setAlignment( AlignCenter ); | 580 | dl.setAlignment( AlignCenter ); |
581 | dl.setFont( fo ); | 581 | dl.setFont( fo ); |
582 | connect ( &spinh, SIGNAL ( valueChanged (int)), &dl, SLOT ( slot_hours( int ) ) ); | 582 | connect ( &spinh, SIGNAL ( valueChanged (int)), &dl, SLOT ( slot_hours( int ) ) ); |
583 | connect ( &spinm, SIGNAL ( valueChanged (int)), &dl, SLOT ( slot_minutes( int ) ) ); | 583 | connect ( &spinm, SIGNAL ( valueChanged (int)), &dl, SLOT ( slot_minutes( int ) ) ); |
584 | lay.addWidget( &dl); | 584 | lay.addWidget( &dl); |
585 | spinh.setValue( mCustomMinutes/60 ); | 585 | spinh.setValue( mCustomMinutes/60 ); |
586 | spinm.setValue( mCustomMinutes%60 ); | 586 | spinm.setValue( mCustomMinutes%60 ); |
587 | QPushButton ok ( "Start timer", &dia); | 587 | QPushButton ok ( "Start timer", &dia); |
588 | ok.setDefault( true ); | 588 | ok.setDefault( true ); |
589 | ok.setFont( fo ); | 589 | ok.setFont( fo ); |
590 | spinh.setFocus(); | 590 | spinh.setFocus(); |
591 | lay.addWidget( &ok); | 591 | lay.addWidget( &ok); |
592 | connect ( &ok, SIGNAL (clicked()), &dia, SLOT ( accept() ) ); | 592 | connect ( &ok, SIGNAL (clicked()), &dia, SLOT ( accept() ) ); |
593 | dia.resize( dia.sizeHint().width(), dia.sizeHint().height() ); | 593 | dia.resize( dia.sizeHint().width(), dia.sizeHint().height() ); |
594 | 594 | ||
595 | if ( !dia.exec() ) | 595 | if ( !dia.exec() ) |
596 | return; | 596 | return; |
597 | mCustomText = lEdit.text(); | 597 | mCustomText = lEdit.text(); |
598 | mCustomMinutes = spinh.value()*60+spinm.value(); | 598 | mCustomMinutes = spinh.value()*60+spinm.value(); |
599 | if ( mCustomMinutes == 0 ) | 599 | if ( mCustomMinutes == 0 ) |
600 | mCustomMinutes = 1; | 600 | mCustomMinutes = 1; |
601 | if ( mCustomMinutes > 1440 ) | 601 | if ( mCustomMinutes > 1440 ) |
602 | mCustomMinutes = 1440; | 602 | mCustomMinutes = 1440; |
603 | mess += mCustomText; | 603 | mess += mCustomText; |
604 | disp = mCustomText; | 604 | disp = mCustomText; |
605 | minutes = mCustomMinutes; | 605 | minutes = mCustomMinutes; |
606 | mRunningTimerText = mCustomText.stripWhiteSpace (); | 606 | mRunningTimerText = mCustomText.stripWhiteSpace (); |
607 | int in = mRunningTimerText.find( " " ); | 607 | int in = mRunningTimerText.find( " " ); |
608 | mRunningTimerText = mRunningTimerText.left ( in ); | 608 | mRunningTimerText = mRunningTimerText.left ( in ); |
609 | } | 609 | } |
610 | else { | 610 | else { |
611 | mess += mTimerPopUp->text( minutes ); | 611 | mess += mTimerPopUp->text( minutes ); |
612 | disp = mTimerPopUp->text( minutes ); | 612 | disp = mTimerPopUp->text( minutes ); |
613 | mRunningTimerText = mTimerPopUp->text( minutes ); | 613 | mRunningTimerText = mTimerPopUp->text( minutes ); |
614 | minutes -= 10; | 614 | minutes -= 10; |
615 | } | 615 | } |
616 | } | 616 | } |
617 | //minutes = 1; | 617 | //minutes = 1; |
618 | 618 | ||
619 | mRunningTimer = QDateTime::currentDateTime().addSecs( minutes * 60 ); | 619 | mRunningTimer = QDateTime::currentDateTime().addSecs( minutes * 60 ); |
620 | timerMesssage = mess; | 620 | timerMesssage = mess; |
621 | AlarmServer::addAlarm ( mRunningTimer,"koalarm",timerMesssage.utf8()); | 621 | AlarmServer::addAlarm ( mRunningTimer,"koalarm",timerMesssage.utf8()); |
622 | mTimerStartLabel->setText( disp ); | 622 | mTimerStartLabel->setText( disp ); |
623 | int w = 200; | 623 | int w = 200; |
624 | int h = mTimerStartLabel->sizeHint().height() ; | 624 | int h = mTimerStartLabel->sizeHint().height() ; |
625 | int dw = QApplication::desktop()->width(); | 625 | int dw = QApplication::desktop()->width(); |
626 | int dh = QApplication::desktop()->height(); | 626 | int dh = QApplication::desktop()->height(); |
627 | mTimerStartLabel->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 627 | mTimerStartLabel->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
628 | mTimerStartLabel->show(); | 628 | mTimerStartLabel->show(); |
629 | QTimer::singleShot( 3000, mTimerStartLabel, SLOT ( hide() ) ); | 629 | QTimer::singleShot( 2000, mTimerStartLabel, SLOT ( hide() ) ); |
630 | mTimerTime = 1; | 630 | mTimerTime = 1; |
631 | } | 631 | } |
632 | 632 | ||
633 | void SimpleAlarmDaemonImpl::writeFile() | 633 | void SimpleAlarmDaemonImpl::writeFile() |
634 | { | 634 | { |
635 | QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent"); | 635 | QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent"); |
636 | //QCopEnvelope e("QPE/Application/kopi", "-writeFile"); | 636 | //QCopEnvelope e("QPE/Application/kopi", "-writeFile"); |
637 | } | 637 | } |
638 | void SimpleAlarmDaemonImpl::showWN() | 638 | void SimpleAlarmDaemonImpl::showWN() |
639 | { | 639 | { |
640 | QCopEnvelope e("QPE/Application/kopi", "-showWN"); | 640 | QCopEnvelope e("QPE/Application/kopi", "-showWN"); |
641 | } | 641 | } |
642 | void SimpleAlarmDaemonImpl::newTodo() | 642 | void SimpleAlarmDaemonImpl::newTodo() |
643 | { | 643 | { |
644 | QCopEnvelope e("QPE/Application/kopi", "-newTodo"); | 644 | QCopEnvelope e("QPE/Application/kopi", "-newTodo"); |
645 | } | 645 | } |
646 | 646 | ||
647 | void SimpleAlarmDaemonImpl::newEvent() | 647 | void SimpleAlarmDaemonImpl::newEvent() |
648 | { | 648 | { |
649 | QCopEnvelope e("QPE/Application/kopi", "-newEvent"); | 649 | QCopEnvelope e("QPE/Application/kopi", "-newEvent"); |
650 | 650 | ||
651 | } | 651 | } |
652 | void SimpleAlarmDaemonImpl::newMail() | 652 | void SimpleAlarmDaemonImpl::newMail() |
653 | { | 653 | { |
654 | QCopEnvelope e("QPE/Application/ompi", "newMail()"); | 654 | QCopEnvelope e("QPE/Application/ompi", "newMail()"); |
655 | } | 655 | } |
656 | void SimpleAlarmDaemonImpl::showAdd() | 656 | void SimpleAlarmDaemonImpl::showAdd() |
657 | { | 657 | { |
658 | QCopEnvelope e("QPE/Application/kapi", "raise()"); | 658 | QCopEnvelope e("QPE/Application/kapi", "raise()"); |
659 | } | 659 | } |
660 | void SimpleAlarmDaemonImpl::ringSync() | 660 | void SimpleAlarmDaemonImpl::ringSync() |
661 | { | 661 | { |
662 | QCopEnvelope e("QPE/Application/kopi", "-ringSync"); | 662 | QCopEnvelope e("QPE/Application/kopi", "-ringSync"); |
663 | 663 | ||
664 | } | 664 | } |
665 | void SimpleAlarmDaemonImpl::newCountdown() | 665 | void SimpleAlarmDaemonImpl::newCountdown() |
666 | { | 666 | { |
667 | //recieve("cal_alarm", 10 ); | 667 | //recieve("cal_alarm", 10 ); |
668 | } | 668 | } |
669 | void SimpleAlarmDaemonImpl::simulate() | 669 | void SimpleAlarmDaemonImpl::simulate() |
670 | { | 670 | { |
671 | QTimer::singleShot( 5000, this, SLOT ( writeFile() ) ); | 671 | QTimer::singleShot( 5000, this, SLOT ( writeFile() ) ); |
672 | QString filename = getenv("QPEDIR") ; | 672 | QString filename = getenv("QPEDIR") ; |
673 | filename += "/pics/kdepim/korganizer/koalarm.wav"; | 673 | filename += "/pics/kdepim/korganizer/koalarm.wav"; |
674 | startAlarm("Alarm simulation", filename ); | 674 | startAlarm("Alarm simulation", filename ); |
675 | } | 675 | } |
676 | void SimpleAlarmDaemonImpl::showKO() | 676 | void SimpleAlarmDaemonImpl::showKO() |
677 | { | 677 | { |
678 | QCopEnvelope e("QPE/Application/kopi", "-showKO"); | 678 | QCopEnvelope e("QPE/Application/kopi", "-showKO"); |
679 | // testing only | 679 | // testing only |
680 | //QCopEnvelope e("QPE/Application/kopi", "nextView()"); | 680 | //QCopEnvelope e("QPE/Application/kopi", "nextView()"); |
681 | 681 | ||
682 | } | 682 | } |
683 | void SimpleAlarmDaemonImpl::showTodo() | 683 | void SimpleAlarmDaemonImpl::showTodo() |
684 | { | 684 | { |
685 | QCopEnvelope e("QPE/Application/kopi", "-showTodo"); | 685 | QCopEnvelope e("QPE/Application/kopi", "-showTodo"); |
686 | 686 | ||
687 | } | 687 | } |
688 | void SimpleAlarmDaemonImpl::writeJournal() | 688 | void SimpleAlarmDaemonImpl::writeJournal() |
689 | { | 689 | { |
690 | QCopEnvelope e("QPE/Application/kopi", "-showJournal"); | 690 | QCopEnvelope e("QPE/Application/kopi", "-showJournal"); |
691 | 691 | ||
692 | } | 692 | } |
693 | 693 | ||
694 | void SimpleAlarmDaemonImpl::mousePressEvent( QMouseEvent * ) | 694 | void SimpleAlarmDaemonImpl::mousePressEvent( QMouseEvent * ) |
695 | { | 695 | { |
696 | 696 | ||
697 | mPopUp->popup(mapToGlobal(QPoint (0, -mPopUp->height() ))); | 697 | mPopUp->popup(mapToGlobal(QPoint (0, -mPopUp->height() ))); |
698 | 698 | ||
699 | } | 699 | } |
700 | 700 | ||