-rw-r--r-- | korganizer/koeditorrecurrence.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/korganizer/koeditorrecurrence.cpp b/korganizer/koeditorrecurrence.cpp index 47e73dd..e165017 100644 --- a/korganizer/koeditorrecurrence.cpp +++ b/korganizer/koeditorrecurrence.cpp | |||
@@ -640,193 +640,193 @@ int RecurrenceRangeDialog::duration() | |||
640 | } | 640 | } |
641 | 641 | ||
642 | void RecurrenceRangeDialog::setEndDate( const QDate &date ) | 642 | void RecurrenceRangeDialog::setEndDate( const QDate &date ) |
643 | { | 643 | { |
644 | mRecurrenceRangeWidget->setEndDate( date ); | 644 | mRecurrenceRangeWidget->setEndDate( date ); |
645 | } | 645 | } |
646 | 646 | ||
647 | QDate RecurrenceRangeDialog::endDate() | 647 | QDate RecurrenceRangeDialog::endDate() |
648 | { | 648 | { |
649 | return mRecurrenceRangeWidget->endDate(); | 649 | return mRecurrenceRangeWidget->endDate(); |
650 | } | 650 | } |
651 | 651 | ||
652 | void RecurrenceRangeDialog::setDateTimes( const QDateTime &start, | 652 | void RecurrenceRangeDialog::setDateTimes( const QDateTime &start, |
653 | const QDateTime &end ) | 653 | const QDateTime &end ) |
654 | { | 654 | { |
655 | mRecurrenceRangeWidget->setDateTimes( start, end ); | 655 | mRecurrenceRangeWidget->setDateTimes( start, end ); |
656 | } | 656 | } |
657 | 657 | ||
658 | //////////////////////////// RecurrenceChooser //////////////////////// | 658 | //////////////////////////// RecurrenceChooser //////////////////////// |
659 | 659 | ||
660 | RecurrenceChooser::RecurrenceChooser( QWidget *parent, const char *name ) : | 660 | RecurrenceChooser::RecurrenceChooser( QWidget *parent, const char *name ) : |
661 | QWidget( parent, name ) | 661 | QWidget( parent, name ) |
662 | { | 662 | { |
663 | QBoxLayout *topLayout = new QVBoxLayout( this ); | 663 | QBoxLayout *topLayout = new QVBoxLayout( this ); |
664 | 664 | ||
665 | mTypeCombo = new QComboBox( this ); | 665 | mTypeCombo = new QComboBox( this ); |
666 | mTypeCombo->insertItem( i18n("Daily") ); | 666 | mTypeCombo->insertItem( i18n("Daily") ); |
667 | mTypeCombo->insertItem( i18n("Weekly") ); | 667 | mTypeCombo->insertItem( i18n("Weekly") ); |
668 | mTypeCombo->insertItem( i18n("Monthly") ); | 668 | mTypeCombo->insertItem( i18n("Monthly") ); |
669 | mTypeCombo->insertItem( i18n("Yearly") ); | 669 | mTypeCombo->insertItem( i18n("Yearly") ); |
670 | 670 | ||
671 | topLayout->addWidget( mTypeCombo ); | 671 | topLayout->addWidget( mTypeCombo ); |
672 | 672 | ||
673 | connect( mTypeCombo, SIGNAL( activated( int ) ), SLOT( emitChoice() ) ); | 673 | connect( mTypeCombo, SIGNAL( activated( int ) ), SLOT( emitChoice() ) ); |
674 | 674 | ||
675 | } | 675 | } |
676 | 676 | ||
677 | int RecurrenceChooser::type() | 677 | int RecurrenceChooser::type() |
678 | { | 678 | { |
679 | if ( mTypeCombo ) { | 679 | if ( mTypeCombo ) { |
680 | return mTypeCombo->currentItem(); | 680 | return mTypeCombo->currentItem(); |
681 | } else { | 681 | } else { |
682 | if ( mDailyButton->isChecked() ) return Daily; | 682 | if ( mDailyButton->isChecked() ) return Daily; |
683 | else if ( mWeeklyButton->isChecked() ) return Weekly; | 683 | else if ( mWeeklyButton->isChecked() ) return Weekly; |
684 | else if ( mMonthlyButton->isChecked() ) return Monthly; | 684 | else if ( mMonthlyButton->isChecked() ) return Monthly; |
685 | else return Yearly; | 685 | else return Yearly; |
686 | } | 686 | } |
687 | } | 687 | } |
688 | 688 | ||
689 | void RecurrenceChooser::setType( int type ) | 689 | void RecurrenceChooser::setType( int type ) |
690 | { | 690 | { |
691 | if ( mTypeCombo ) { | 691 | if ( mTypeCombo ) { |
692 | mTypeCombo->setCurrentItem( type ); | 692 | mTypeCombo->setCurrentItem( type ); |
693 | } else { | 693 | } else { |
694 | switch ( type ) { | 694 | switch ( type ) { |
695 | case Daily: | 695 | case Daily: |
696 | mDailyButton->setChecked( true ); | 696 | mDailyButton->setChecked( true ); |
697 | break; | 697 | break; |
698 | case Weekly: | 698 | case Weekly: |
699 | mWeeklyButton->setChecked( true ); | 699 | mWeeklyButton->setChecked( true ); |
700 | break; | 700 | break; |
701 | case Monthly: | 701 | case Monthly: |
702 | mMonthlyButton->setChecked( true ); | 702 | mMonthlyButton->setChecked( true ); |
703 | break; | 703 | break; |
704 | case Yearly: | 704 | case Yearly: |
705 | default: | 705 | default: |
706 | mYearlyButton->setChecked( true ); | 706 | mYearlyButton->setChecked( true ); |
707 | break; | 707 | break; |
708 | } | 708 | } |
709 | } | 709 | } |
710 | } | 710 | } |
711 | 711 | ||
712 | void RecurrenceChooser::emitChoice() | 712 | void RecurrenceChooser::emitChoice() |
713 | { | 713 | { |
714 | emit chosen ( type() ); | 714 | emit chosen ( type() ); |
715 | } | 715 | } |
716 | 716 | ||
717 | /////////////////////////////// Main Widget ///////////////////////////// | 717 | /////////////////////////////// Main Widget ///////////////////////////// |
718 | 718 | ||
719 | KOEditorRecurrence::KOEditorRecurrence( QWidget* parent, const char *name ) : | 719 | KOEditorRecurrence::KOEditorRecurrence( QWidget* parent, const char *name ) : |
720 | QWidget( parent, name ) | 720 | QWidget( parent, name ) |
721 | { | 721 | { |
722 | QGridLayout *topLayout = new QGridLayout( this, 2,2 ); | 722 | QGridLayout *topLayout = new QGridLayout( this, 2,2 ); |
723 | topLayout->setSpacing( KDialog::spacingHint() ); | 723 | topLayout->setSpacing( KDialog::spacingHint() ); |
724 | topLayout->setMargin( KDialog::marginHintSmall() ); | 724 | topLayout->setMargin( KDialog::marginHintSmall() ); |
725 | 725 | ||
726 | mEnabledCheck = new QCheckBox( i18n("Enable Recurrence"), this ); | 726 | mEnabledCheck = new QCheckBox( i18n("Enable Recurrence"), this ); |
727 | connect( mEnabledCheck, SIGNAL( toggled( bool ) ), | 727 | connect( mEnabledCheck, SIGNAL( toggled( bool ) ), |
728 | SLOT( setEnabled( bool ) ) ); | 728 | SLOT( setEnabled( bool ) ) ); |
729 | topLayout->addMultiCellWidget( mEnabledCheck, 0, 0, 0, 1 ); | 729 | topLayout->addMultiCellWidget( mEnabledCheck, 0, 0, 0, 1 ); |
730 | 730 | ||
731 | 731 | ||
732 | mTimeGroupBox = new QGroupBox( 1, Horizontal, i18n("Time"), | 732 | mTimeGroupBox = new QGroupBox( 1, Horizontal, i18n("Time"), |
733 | this ); | 733 | this ); |
734 | topLayout->addMultiCellWidget( mTimeGroupBox, 1, 1 , 0 , 1 ); | 734 | topLayout->addMultiCellWidget( mTimeGroupBox, 1, 1 , 0 , 1 ); |
735 | 735 | ||
736 | if ( QApplication::desktop()->width() <= 320) { | 736 | if ( QApplication::desktop()->width() <= 640 ) { |
737 | mTimeGroupBox->hide(); | 737 | mTimeGroupBox->hide(); |
738 | } | 738 | } |
739 | 739 | ||
740 | // QFrame *timeFrame = new QFrame( mTimeGroupBox ); | 740 | // QFrame *timeFrame = new QFrame( mTimeGroupBox ); |
741 | // QBoxLayout *layoutTimeFrame = new QHBoxLayout( timeFrame ); | 741 | // QBoxLayout *layoutTimeFrame = new QHBoxLayout( timeFrame ); |
742 | // layoutTimeFrame->setSpacing( KDialog::spacingHint() ); | 742 | // layoutTimeFrame->setSpacing( KDialog::spacingHint() ); |
743 | 743 | ||
744 | mDateTimeLabel = new QLabel( mTimeGroupBox ); | 744 | mDateTimeLabel = new QLabel( mTimeGroupBox ); |
745 | // mDateTimeLabel = new QLabel( timeFrame ); | 745 | // mDateTimeLabel = new QLabel( timeFrame ); |
746 | // layoutTimeFrame->addWidget( mDateTimeLabel ); | 746 | // layoutTimeFrame->addWidget( mDateTimeLabel ); |
747 | //mTimeGroupBox->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Maximum ) ); | 747 | //mTimeGroupBox->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Maximum ) ); |
748 | //mDateTimeLabel->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Maximum) ); | 748 | //mDateTimeLabel->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Maximum) ); |
749 | mRuleBox = new QGroupBox( 1, Horizontal, i18n("Recurrence Rule"), this ); | 749 | mRuleBox = new QGroupBox( 1, Horizontal, i18n("Recurrence Rule"), this ); |
750 | topLayout->addMultiCellWidget( mRuleBox, 2, 2, 0, 1 ); | 750 | topLayout->addMultiCellWidget( mRuleBox, 2, 2, 0, 1 ); |
751 | mRecurrenceChooser = new RecurrenceChooser( mRuleBox ); | 751 | mRecurrenceChooser = new RecurrenceChooser( mRuleBox ); |
752 | connect( mRecurrenceChooser, SIGNAL( chosen( int ) ), | 752 | connect( mRecurrenceChooser, SIGNAL( chosen( int ) ), |
753 | SLOT( showCurrentRule( int ) ) ); | 753 | SLOT( showCurrentRule( int ) ) ); |
754 | 754 | ||
755 | 755 | ||
756 | mRuleStack = new QWidgetStack( mRuleBox ); | 756 | mRuleStack = new QWidgetStack( mRuleBox ); |
757 | 757 | ||
758 | mDaily = new RecurDaily( mRuleStack ); | 758 | mDaily = new RecurDaily( mRuleStack ); |
759 | mRuleStack->addWidget( mDaily, 0 ); | 759 | mRuleStack->addWidget( mDaily, 0 ); |
760 | 760 | ||
761 | mWeekly = new RecurWeekly( mRuleStack ); | 761 | mWeekly = new RecurWeekly( mRuleStack ); |
762 | mRuleStack->addWidget( mWeekly, 0 ); | 762 | mRuleStack->addWidget( mWeekly, 0 ); |
763 | 763 | ||
764 | mMonthly = new RecurMonthly( mRuleStack ); | 764 | mMonthly = new RecurMonthly( mRuleStack ); |
765 | mRuleStack->addWidget( mMonthly, 0 ); | 765 | mRuleStack->addWidget( mMonthly, 0 ); |
766 | 766 | ||
767 | mYearly = new RecurYearly( mRuleStack ); | 767 | mYearly = new RecurYearly( mRuleStack ); |
768 | mRuleStack->addWidget( mYearly, 0 ); | 768 | mRuleStack->addWidget( mYearly, 0 ); |
769 | 769 | ||
770 | showCurrentRule( mRecurrenceChooser->type() ); | 770 | showCurrentRule( mRecurrenceChooser->type() ); |
771 | mRecurrenceRangeWidget = 0; | 771 | mRecurrenceRangeWidget = 0; |
772 | mRecurrenceRangeDialog = new RecurrenceRangeDialog( this ); | 772 | mRecurrenceRangeDialog = new RecurrenceRangeDialog( this ); |
773 | mRecurrenceRange = mRecurrenceRangeDialog; | 773 | mRecurrenceRange = mRecurrenceRangeDialog; |
774 | mRecurrenceRangeButton = new QPushButton( i18n("Recurrence Range..."), | 774 | mRecurrenceRangeButton = new QPushButton( i18n("Recurrence Range..."), |
775 | this ); | 775 | this ); |
776 | 776 | ||
777 | connect( mRecurrenceRangeButton, SIGNAL( clicked() ), | 777 | connect( mRecurrenceRangeButton, SIGNAL( clicked() ), |
778 | SLOT( showRecurrenceRangeDialog() ) ); | 778 | SLOT( showRecurrenceRangeDialog() ) ); |
779 | 779 | ||
780 | mExceptionsWidget = 0; | 780 | mExceptionsWidget = 0; |
781 | mExceptionsDialog = new ExceptionsDialog( this ); | 781 | mExceptionsDialog = new ExceptionsDialog( this ); |
782 | mExceptions = mExceptionsDialog; | 782 | mExceptions = mExceptionsDialog; |
783 | mExceptionsButton = new QPushButton( i18n("Exceptions..."), this ); | 783 | mExceptionsButton = new QPushButton( i18n("Exceptions..."), this ); |
784 | if ( QApplication::desktop()->width() < 320 ) { | 784 | if ( QApplication::desktop()->width() < 320 ) { |
785 | topLayout->addMultiCellWidget( mRecurrenceRangeButton, 3, 3, 0, 1 ); | 785 | topLayout->addMultiCellWidget( mRecurrenceRangeButton, 3, 3, 0, 1 ); |
786 | topLayout->addMultiCellWidget( mExceptionsButton, 4, 4, 0, 1 ); | 786 | topLayout->addMultiCellWidget( mExceptionsButton, 4, 4, 0, 1 ); |
787 | } else { | 787 | } else { |
788 | topLayout->addWidget( mRecurrenceRangeButton, 3, 0 ); | 788 | topLayout->addWidget( mRecurrenceRangeButton, 3, 0 ); |
789 | topLayout->addWidget( mExceptionsButton, 3, 1 ); | 789 | topLayout->addWidget( mExceptionsButton, 3, 1 ); |
790 | } | 790 | } |
791 | connect( mExceptionsButton, SIGNAL( clicked() ), | 791 | connect( mExceptionsButton, SIGNAL( clicked() ), |
792 | SLOT( showExceptionsDialog() ) ); | 792 | SLOT( showExceptionsDialog() ) ); |
793 | } | 793 | } |
794 | 794 | ||
795 | KOEditorRecurrence::~KOEditorRecurrence() | 795 | KOEditorRecurrence::~KOEditorRecurrence() |
796 | { | 796 | { |
797 | } | 797 | } |
798 | 798 | ||
799 | void KOEditorRecurrence::setEnabled( bool enabled ) | 799 | void KOEditorRecurrence::setEnabled( bool enabled ) |
800 | { | 800 | { |
801 | // kdDebug() << "KOEditorRecurrence::setEnabled(): " << (enabled ? "on" : "off") << endl; | 801 | // kdDebug() << "KOEditorRecurrence::setEnabled(): " << (enabled ? "on" : "off") << endl; |
802 | 802 | ||
803 | mTimeGroupBox->setEnabled( enabled ); | 803 | mTimeGroupBox->setEnabled( enabled ); |
804 | if ( mRecurrenceRangeWidget ) mRecurrenceRangeWidget->setEnabled( enabled ); | 804 | if ( mRecurrenceRangeWidget ) mRecurrenceRangeWidget->setEnabled( enabled ); |
805 | if ( mRecurrenceRangeButton ) mRecurrenceRangeButton->setEnabled( enabled ); | 805 | if ( mRecurrenceRangeButton ) mRecurrenceRangeButton->setEnabled( enabled ); |
806 | if ( mExceptionsWidget ) mExceptionsWidget->setEnabled( enabled ); | 806 | if ( mExceptionsWidget ) mExceptionsWidget->setEnabled( enabled ); |
807 | if ( mExceptionsButton ) mExceptionsButton->setEnabled( enabled ); | 807 | if ( mExceptionsButton ) mExceptionsButton->setEnabled( enabled ); |
808 | mRuleBox->setEnabled( enabled ); | 808 | mRuleBox->setEnabled( enabled ); |
809 | } | 809 | } |
810 | 810 | ||
811 | void KOEditorRecurrence::showCurrentRule( int current ) | 811 | void KOEditorRecurrence::showCurrentRule( int current ) |
812 | { | 812 | { |
813 | switch ( current ) { | 813 | switch ( current ) { |
814 | case Daily: | 814 | case Daily: |
815 | mRuleStack->raiseWidget( mDaily ); | 815 | mRuleStack->raiseWidget( mDaily ); |
816 | break; | 816 | break; |
817 | case Weekly: | 817 | case Weekly: |
818 | mRuleStack->raiseWidget( mWeekly ); | 818 | mRuleStack->raiseWidget( mWeekly ); |
819 | break; | 819 | break; |
820 | case Monthly: | 820 | case Monthly: |
821 | mRuleStack->raiseWidget( mMonthly ); | 821 | mRuleStack->raiseWidget( mMonthly ); |
822 | break; | 822 | break; |
823 | default: | 823 | default: |
824 | case Yearly: | 824 | case Yearly: |
825 | mRuleStack->raiseWidget( mYearly ); | 825 | mRuleStack->raiseWidget( mYearly ); |
826 | break; | 826 | break; |
827 | } | 827 | } |
828 | } | 828 | } |
829 | 829 | ||
830 | void KOEditorRecurrence::setDateTimes( QDateTime start, QDateTime end ) | 830 | void KOEditorRecurrence::setDateTimes( QDateTime start, QDateTime end ) |
831 | { | 831 | { |
832 | // kdDebug() << "KOEditorRecurrence::setDateTimes" << endl; | 832 | // kdDebug() << "KOEditorRecurrence::setDateTimes" << endl; |