Diffstat (limited to 'korganizer/koeditorrecurrence.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/koeditorrecurrence.cpp | 83 |
1 files changed, 22 insertions, 61 deletions
diff --git a/korganizer/koeditorrecurrence.cpp b/korganizer/koeditorrecurrence.cpp index bedc75a..bf81b01 100644 --- a/korganizer/koeditorrecurrence.cpp +++ b/korganizer/koeditorrecurrence.cpp | |||
@@ -85,2 +85,3 @@ RecurDaily::RecurDaily( QWidget *parent, const char *name ) : | |||
85 | topLayout->setSpacing( KDialog::spacingHint() ); | 85 | topLayout->setSpacing( KDialog::spacingHint() ); |
86 | topLayout->setMargin( KDialog::marginHintSmall() ); | ||
86 | 87 | ||
@@ -103,4 +104,5 @@ RecurWeekly::RecurWeekly( QWidget *parent, const char *name ) : | |||
103 | topLayout->setSpacing( KDialog::spacingHint() ); | 104 | topLayout->setSpacing( KDialog::spacingHint() ); |
105 | topLayout->setMargin( KDialog::marginHintSmall() ); | ||
104 | 106 | ||
105 | topLayout->addStretch( 1 ); | 107 | //topLayout->addStretch( 1 ); |
106 | 108 | ||
@@ -121,9 +123,12 @@ RecurWeekly::RecurWeekly( QWidget *parent, const char *name ) : | |||
121 | QString weekDayName = KGlobal::locale()->weekDayName( i + 1, true ); | 123 | QString weekDayName = KGlobal::locale()->weekDayName( i + 1, true ); |
122 | if ( KOPrefs::instance()->mCompactDialogs ) { | 124 | int left = 1; |
123 | weekDayName = weekDayName.left( 1 ); | 125 | if ( QApplication::desktop()->width() > 480 ) { |
126 | ++left; | ||
127 | if ( QApplication::desktop()->width() > 640 ) | ||
128 | ++left; | ||
124 | } | 129 | } |
125 | mDayBoxes[ i ] = new QCheckBox( weekDayName, dayBox ); | 130 | mDayBoxes[ i ] = new QCheckBox( weekDayName.left( left ), dayBox ); |
126 | } | 131 | } |
127 | 132 | ||
128 | topLayout->addStretch( 1 ); | 133 | topLayout->addStretch( ); |
129 | } | 134 | } |
@@ -155,2 +160,3 @@ RecurMonthly::RecurMonthly( QWidget *parent, const char *name ) : | |||
155 | topLayout->setSpacing( KDialog::spacingHint() ); | 160 | topLayout->setSpacing( KDialog::spacingHint() ); |
161 | topLayout->setMargin( KDialog::marginHintSmall() ); | ||
156 | 162 | ||
@@ -174,2 +180,3 @@ RecurMonthly::RecurMonthly( QWidget *parent, const char *name ) : | |||
174 | buttonLayout->setSpacing( KDialog::spacingHint() ); | 180 | buttonLayout->setSpacing( KDialog::spacingHint() ); |
181 | buttonLayout->setMargin( KDialog::marginHintSmall() ); | ||
175 | 182 | ||
@@ -177,3 +184,3 @@ RecurMonthly::RecurMonthly( QWidget *parent, const char *name ) : | |||
177 | QString recurOnText; | 184 | QString recurOnText; |
178 | if ( !KOPrefs::instance()->mCompactDialogs ) { | 185 | if ( QApplication::desktop()->width() > 320 ) { |
179 | recurOnText = i18n("Recur on the"); | 186 | recurOnText = i18n("Recur on the"); |
@@ -290,2 +297,3 @@ RecurYearly::RecurYearly( QWidget *parent, const char *name ) : | |||
290 | topLayout->setSpacing( KDialog::spacingHint() ); | 297 | topLayout->setSpacing( KDialog::spacingHint() ); |
298 | topLayout->setMargin( KDialog::marginHintSmall() ); | ||
291 | 299 | ||
@@ -507,2 +515,3 @@ RecurrenceRangeWidget::RecurrenceRangeWidget( QWidget *parent, | |||
507 | rangeLayout->setSpacing( KDialog::spacingHint() ); | 515 | rangeLayout->setSpacing( KDialog::spacingHint() ); |
516 | rangeLayout->setMargin( KDialog::marginHintSmall() ); | ||
508 | 517 | ||
@@ -540,3 +549,3 @@ RecurrenceRangeWidget::RecurrenceRangeWidget( QWidget *parent, | |||
540 | 549 | ||
541 | endDateLayout->addStretch( 1 ); | 550 | //endDateLayout->addStretch( 1 ); |
542 | 551 | ||
@@ -653,5 +662,4 @@ RecurrenceChooser::RecurrenceChooser( QWidget *parent, const char *name ) : | |||
653 | { | 662 | { |
654 | QBoxLayout *topLayout = new QVBoxLayout( this ); | 663 | QBoxLayout *topLayout = new QVBoxLayout( this ); |
655 | 664 | ||
656 | if ( KOPrefs::instance()->mCompactDialogs ) { | ||
657 | mTypeCombo = new QComboBox( this ); | 665 | mTypeCombo = new QComboBox( this ); |
@@ -665,23 +673,3 @@ RecurrenceChooser::RecurrenceChooser( QWidget *parent, const char *name ) : | |||
665 | connect( mTypeCombo, SIGNAL( activated( int ) ), SLOT( emitChoice() ) ); | 673 | connect( mTypeCombo, SIGNAL( activated( int ) ), SLOT( emitChoice() ) ); |
666 | } else { | 674 | |
667 | mTypeCombo = 0; | ||
668 | |||
669 | QButtonGroup *ruleButtonGroup = new QButtonGroup( 1, Horizontal, this ); | ||
670 | ruleButtonGroup->setFrameStyle( QFrame::NoFrame ); | ||
671 | topLayout->addWidget( ruleButtonGroup ); | ||
672 | |||
673 | mDailyButton = new QRadioButton( i18n("Daily"), ruleButtonGroup ); | ||
674 | mWeeklyButton = new QRadioButton( i18n("Weekly"), ruleButtonGroup ); | ||
675 | mMonthlyButton = new QRadioButton( i18n("Monthly"), ruleButtonGroup ); | ||
676 | mYearlyButton = new QRadioButton( i18n("Yearly"), ruleButtonGroup ); | ||
677 | |||
678 | connect( mDailyButton, SIGNAL( toggled( bool ) ), | ||
679 | SLOT( emitChoice() ) ); | ||
680 | connect( mWeeklyButton, SIGNAL( toggled( bool ) ), | ||
681 | SLOT( emitChoice() ) ); | ||
682 | connect( mMonthlyButton, SIGNAL( toggled( bool ) ), | ||
683 | SLOT( emitChoice() ) ); | ||
684 | connect( mYearlyButton, SIGNAL( toggled( bool ) ), | ||
685 | SLOT( emitChoice() ) ); | ||
686 | } | ||
687 | } | 675 | } |
@@ -735,2 +723,3 @@ KOEditorRecurrence::KOEditorRecurrence( QWidget* parent, const char *name ) : | |||
735 | topLayout->setSpacing( KDialog::spacingHint() ); | 723 | topLayout->setSpacing( KDialog::spacingHint() ); |
724 | topLayout->setMargin( KDialog::marginHintSmall() ); | ||
736 | 725 | ||
@@ -746,3 +735,3 @@ KOEditorRecurrence::KOEditorRecurrence( QWidget* parent, const char *name ) : | |||
746 | 735 | ||
747 | if ( KOPrefs::instance()->mCompactDialogs ) { | 736 | if ( QApplication::desktop()->width() <= 320) { |
748 | mTimeGroupBox->hide(); | 737 | mTimeGroupBox->hide(); |
@@ -758,13 +747,5 @@ KOEditorRecurrence::KOEditorRecurrence( QWidget* parent, const char *name ) : | |||
758 | 747 | ||
759 | Qt::Orientation orientation; | ||
760 | if ( KOPrefs::instance()->mCompactDialogs ) orientation = Horizontal; | ||
761 | else orientation = Vertical; | ||
762 | |||
763 | mRuleBox = new QGroupBox( 1, orientation, i18n("Recurrence Rule"), this ); | ||
764 | if ( KOPrefs::instance()->mCompactDialogs ) { | ||
765 | topLayout->addMultiCellWidget( mRuleBox, 2, 2, 0, 1 ); | ||
766 | } else { | ||
767 | topLayout->addMultiCellWidget( mRuleBox, 2, 2, 0, 1 ); | ||
768 | } | ||
769 | 748 | ||
749 | mRuleBox = new QGroupBox( 1, Horizontal, i18n("Recurrence Rule"), this ); | ||
750 | topLayout->addMultiCellWidget( mRuleBox, 2, 2, 0, 1 ); | ||
770 | mRecurrenceChooser = new RecurrenceChooser( mRuleBox ); | 751 | mRecurrenceChooser = new RecurrenceChooser( mRuleBox ); |
@@ -773,6 +754,2 @@ KOEditorRecurrence::KOEditorRecurrence( QWidget* parent, const char *name ) : | |||
773 | 754 | ||
774 | if ( !KOPrefs::instance()->mCompactDialogs ) { | ||
775 | QFrame *ruleSepFrame = new QFrame( mRuleBox ); | ||
776 | ruleSepFrame->setFrameStyle( QFrame::VLine | QFrame::Sunken ); | ||
777 | } | ||
778 | 755 | ||
@@ -793,4 +770,2 @@ KOEditorRecurrence::KOEditorRecurrence( QWidget* parent, const char *name ) : | |||
793 | showCurrentRule( mRecurrenceChooser->type() ); | 770 | showCurrentRule( mRecurrenceChooser->type() ); |
794 | |||
795 | if ( KOPrefs::instance()->mCompactDialogs ) { | ||
796 | mRecurrenceRangeWidget = 0; | 771 | mRecurrenceRangeWidget = 0; |
@@ -817,16 +792,2 @@ KOEditorRecurrence::KOEditorRecurrence( QWidget* parent, const char *name ) : | |||
817 | SLOT( showExceptionsDialog() ) ); | 792 | SLOT( showExceptionsDialog() ) ); |
818 | |||
819 | } else { | ||
820 | mRecurrenceRangeWidget = new RecurrenceRangeWidget( this ); | ||
821 | mRecurrenceRangeDialog = 0; | ||
822 | mRecurrenceRange = mRecurrenceRangeWidget; | ||
823 | mRecurrenceRangeButton = 0; | ||
824 | topLayout->addWidget( mRecurrenceRangeWidget, 3, 0 ); | ||
825 | |||
826 | mExceptionsWidget = new ExceptionsWidget( this ); | ||
827 | mExceptionsDialog = 0; | ||
828 | mExceptions = mExceptionsWidget; | ||
829 | mExceptionsButton = 0; | ||
830 | topLayout->addWidget( mExceptionsWidget, 3, 1 ); | ||
831 | } | ||
832 | } | 793 | } |