summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-04-09 10:16:08 (UTC)
committer zautrix <zautrix>2005-04-09 10:16:08 (UTC)
commitab7957df1a71a392d71cb898b59a35c32461ec6a (patch) (unidiff)
treef25cfbfdd831f98de0f3a63d63f657064a71f68e
parentd17feddd8fb61dc68c4c3ea57daaee6b8bb4d1fe (diff)
downloadkdepimpi-ab7957df1a71a392d71cb898b59a35c32461ec6a.zip
kdepimpi-ab7957df1a71a392d71cb898b59a35c32461ec6a.tar.gz
kdepimpi-ab7957df1a71a392d71cb898b59a35c32461ec6a.tar.bz2
rec rule dialog fixes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koeditorrecurrence.cpp83
-rw-r--r--microkde/kdialog.cpp12
2 files changed, 32 insertions, 63 deletions
diff --git a/korganizer/koeditorrecurrence.cpp b/korganizer/koeditorrecurrence.cpp
index bedc75a..bf81b01 100644
--- a/korganizer/koeditorrecurrence.cpp
+++ b/korganizer/koeditorrecurrence.cpp
@@ -84,4 +84,5 @@ RecurDaily::RecurDaily( QWidget *parent, const char *name ) :
84 QBoxLayout *topLayout = new QHBoxLayout( this ); 84 QBoxLayout *topLayout = new QHBoxLayout( this );
85 topLayout->setSpacing( KDialog::spacingHint() ); 85 topLayout->setSpacing( KDialog::spacingHint() );
86 topLayout->setMargin( KDialog::marginHintSmall() );
86 87
87 QLabel *preLabel = new QLabel( i18n("Recur every"), this ); 88 QLabel *preLabel = new QLabel( i18n("Recur every"), this );
@@ -102,6 +103,7 @@ RecurWeekly::RecurWeekly( QWidget *parent, const char *name ) :
102 QBoxLayout *topLayout = new QVBoxLayout( this ); 103 QBoxLayout *topLayout = new QVBoxLayout( this );
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
107 QBoxLayout *weeksLayout = new QHBoxLayout( topLayout ); 109 QBoxLayout *weeksLayout = new QHBoxLayout( topLayout );
@@ -120,11 +122,14 @@ RecurWeekly::RecurWeekly( QWidget *parent, const char *name ) :
120 for ( int i = 0; i < 7; ++i ) { 122 for ( int i = 0; i < 7; ++i ) {
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}
130 135
@@ -154,4 +159,5 @@ RecurMonthly::RecurMonthly( QWidget *parent, const char *name ) :
154 QBoxLayout *topLayout = new QVBoxLayout( this ); 159 QBoxLayout *topLayout = new QVBoxLayout( this );
155 topLayout->setSpacing( KDialog::spacingHint() ); 160 topLayout->setSpacing( KDialog::spacingHint() );
161 topLayout->setMargin( KDialog::marginHintSmall() );
156 162
157 163
@@ -173,8 +179,9 @@ RecurMonthly::RecurMonthly( QWidget *parent, const char *name ) :
173 QGridLayout *buttonLayout = new QGridLayout( buttonGroup, 3, 2 ); 179 QGridLayout *buttonLayout = new QGridLayout( buttonGroup, 3, 2 );
174 buttonLayout->setSpacing( KDialog::spacingHint() ); 180 buttonLayout->setSpacing( KDialog::spacingHint() );
181 buttonLayout->setMargin( KDialog::marginHintSmall() );
175 182
176 183
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");
180 } 187 }
@@ -289,4 +296,5 @@ RecurYearly::RecurYearly( QWidget *parent, const char *name ) :
289 QBoxLayout *topLayout = new QVBoxLayout( this ); 296 QBoxLayout *topLayout = new QVBoxLayout( this );
290 topLayout->setSpacing( KDialog::spacingHint() ); 297 topLayout->setSpacing( KDialog::spacingHint() );
298 topLayout->setMargin( KDialog::marginHintSmall() );
291 299
292 300
@@ -506,4 +514,5 @@ RecurrenceRangeWidget::RecurrenceRangeWidget( QWidget *parent,
506 QVBoxLayout *rangeLayout = new QVBoxLayout( rangeBox ); 514 QVBoxLayout *rangeLayout = new QVBoxLayout( rangeBox );
507 rangeLayout->setSpacing( KDialog::spacingHint() ); 515 rangeLayout->setSpacing( KDialog::spacingHint() );
516 rangeLayout->setMargin( KDialog::marginHintSmall() );
508 517
509 mStartDateLabel = new QLabel( i18n("Begin on:"), rangeBox ); 518 mStartDateLabel = new QLabel( i18n("Begin on:"), rangeBox );
@@ -539,5 +548,5 @@ RecurrenceRangeWidget::RecurrenceRangeWidget( QWidget *parent,
539 endDateLayout->addWidget( mEndDateEdit ); 548 endDateLayout->addWidget( mEndDateEdit );
540 549
541 endDateLayout->addStretch( 1 ); 550 //endDateLayout->addStretch( 1 );
542 551
543 connect( mNoEndDateButton, SIGNAL( toggled( bool ) ), 552 connect( mNoEndDateButton, SIGNAL( toggled( bool ) ),
@@ -652,7 +661,6 @@ RecurrenceChooser::RecurrenceChooser( QWidget *parent, const char *name ) :
652 QWidget( parent, name ) 661 QWidget( parent, 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 );
658 mTypeCombo->insertItem( i18n("Daily") ); 666 mTypeCombo->insertItem( i18n("Daily") );
@@ -664,25 +672,5 @@ RecurrenceChooser::RecurrenceChooser( QWidget *parent, const char *name ) :
664 672
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}
688 676
@@ -734,4 +722,5 @@ KOEditorRecurrence::KOEditorRecurrence( QWidget* parent, const char *name ) :
734 QGridLayout *topLayout = new QGridLayout( this, 2,2 ); 722 QGridLayout *topLayout = new QGridLayout( this, 2,2 );
735 topLayout->setSpacing( KDialog::spacingHint() ); 723 topLayout->setSpacing( KDialog::spacingHint() );
724 topLayout->setMargin( KDialog::marginHintSmall() );
736 725
737 mEnabledCheck = new QCheckBox( i18n("Enable Recurrence"), this ); 726 mEnabledCheck = new QCheckBox( i18n("Enable Recurrence"), this );
@@ -745,5 +734,5 @@ KOEditorRecurrence::KOEditorRecurrence( QWidget* parent, const char *name ) :
745 topLayout->addMultiCellWidget( mTimeGroupBox, 1, 1 , 0 , 1 ); 734 topLayout->addMultiCellWidget( mTimeGroupBox, 1, 1 , 0 , 1 );
746 735
747 if ( KOPrefs::instance()->mCompactDialogs ) { 736 if ( QApplication::desktop()->width() <= 320) {
748 mTimeGroupBox->hide(); 737 mTimeGroupBox->hide();
749 } 738 }
@@ -757,23 +746,11 @@ KOEditorRecurrence::KOEditorRecurrence( QWidget* parent, const char *name ) :
757// layoutTimeFrame->addWidget( mDateTimeLabel ); 746// layoutTimeFrame->addWidget( mDateTimeLabel );
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 );
771 connect( mRecurrenceChooser, SIGNAL( chosen( int ) ), 752 connect( mRecurrenceChooser, SIGNAL( chosen( int ) ),
772 SLOT( showCurrentRule( int ) ) ); 753 SLOT( showCurrentRule( int ) ) );
773 754
774 if ( !KOPrefs::instance()->mCompactDialogs ) {
775 QFrame *ruleSepFrame = new QFrame( mRuleBox );
776 ruleSepFrame->setFrameStyle( QFrame::VLine | QFrame::Sunken );
777 }
778 755
779 mRuleStack = new QWidgetStack( mRuleBox ); 756 mRuleStack = new QWidgetStack( mRuleBox );
@@ -792,6 +769,4 @@ KOEditorRecurrence::KOEditorRecurrence( QWidget* parent, const char *name ) :
792 769
793 showCurrentRule( mRecurrenceChooser->type() ); 770 showCurrentRule( mRecurrenceChooser->type() );
794
795 if ( KOPrefs::instance()->mCompactDialogs ) {
796 mRecurrenceRangeWidget = 0; 771 mRecurrenceRangeWidget = 0;
797 mRecurrenceRangeDialog = new RecurrenceRangeDialog( this ); 772 mRecurrenceRangeDialog = new RecurrenceRangeDialog( this );
@@ -816,18 +791,4 @@ KOEditorRecurrence::KOEditorRecurrence( QWidget* parent, const char *name ) :
816 connect( mExceptionsButton, SIGNAL( clicked() ), 791 connect( mExceptionsButton, SIGNAL( clicked() ),
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}
833 794
diff --git a/microkde/kdialog.cpp b/microkde/kdialog.cpp
index 3d62cdd..961631e 100644
--- a/microkde/kdialog.cpp
+++ b/microkde/kdialog.cpp
@@ -10,8 +10,16 @@ KDialog::KDialog( QWidget *parent, const char *name, bool modal ) :
10 10
11} 11}
12#ifdef DESKTOP_VERSION
13int KDialog::spacingHint() { return 7; }
14int KDialog::marginHint() { return 7; }
12 15
16int KDialog::spacingHintSmall() { return 4; }
17int KDialog::marginHintSmall() { return 4; }
18
19#else
13int KDialog::spacingHint() { return 3; } 20int KDialog::spacingHint() { return 3; }
14int KDialog::marginHint() { return 3; } 21int KDialog::marginHint() { return 3; }
15 22
16int KDialog::spacingHintSmall() { if (QApplication::desktop()->width() < 700 ) return 1;else return 3; } 23int KDialog::spacingHintSmall() { return 1; }
17int KDialog::marginHintSmall() { if (QApplication::desktop()->width() < 700 ) return 1;else return 3; } 24int KDialog::marginHintSmall() { return 1; }
25#endif