summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-04-09 10:16:08 (UTC)
committer zautrix <zautrix>2005-04-09 10:16:08 (UTC)
commitab7957df1a71a392d71cb898b59a35c32461ec6a (patch) (side-by-side diff)
treef25cfbfdd831f98de0f3a63d63f657064a71f68e
parentd17feddd8fb61dc68c4c3ea57daaee6b8bb4d1fe (diff)
downloadkdepimpi-ab7957df1a71a392d71cb898b59a35c32461ec6a.zip
kdepimpi-ab7957df1a71a392d71cb898b59a35c32461ec6a.tar.gz
kdepimpi-ab7957df1a71a392d71cb898b59a35c32461ec6a.tar.bz2
rec rule dialog fixes
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koeditorrecurrence.cpp77
-rw-r--r--microkde/kdialog.cpp12
2 files changed, 29 insertions, 60 deletions
diff --git a/korganizer/koeditorrecurrence.cpp b/korganizer/koeditorrecurrence.cpp
index bedc75a..bf81b01 100644
--- a/korganizer/koeditorrecurrence.cpp
+++ b/korganizer/koeditorrecurrence.cpp
@@ -83,6 +83,7 @@ RecurDaily::RecurDaily( QWidget *parent, const char *name ) :
{
QBoxLayout *topLayout = new QHBoxLayout( this );
topLayout->setSpacing( KDialog::spacingHint() );
+ topLayout->setMargin( KDialog::marginHintSmall() );
QLabel *preLabel = new QLabel( i18n("Recur every"), this );
topLayout->addWidget( preLabel );
@@ -101,8 +102,9 @@ RecurWeekly::RecurWeekly( QWidget *parent, const char *name ) :
{
QBoxLayout *topLayout = new QVBoxLayout( this );
topLayout->setSpacing( KDialog::spacingHint() );
+ topLayout->setMargin( KDialog::marginHintSmall() );
- topLayout->addStretch( 1 );
+ //topLayout->addStretch( 1 );
QBoxLayout *weeksLayout = new QHBoxLayout( topLayout );
@@ -119,13 +121,16 @@ RecurWeekly::RecurWeekly( QWidget *parent, const char *name ) :
// TODO: Respect start of week setting
for ( int i = 0; i < 7; ++i ) {
QString weekDayName = KGlobal::locale()->weekDayName( i + 1, true );
- if ( KOPrefs::instance()->mCompactDialogs ) {
- weekDayName = weekDayName.left( 1 );
+ int left = 1;
+ if ( QApplication::desktop()->width() > 480 ) {
+ ++left;
+ if ( QApplication::desktop()->width() > 640 )
+ ++left;
}
- mDayBoxes[ i ] = new QCheckBox( weekDayName, dayBox );
+ mDayBoxes[ i ] = new QCheckBox( weekDayName.left( left ), dayBox );
}
- topLayout->addStretch( 1 );
+ topLayout->addStretch( );
}
void RecurWeekly::setDays( const QBitArray &days )
@@ -153,6 +158,7 @@ RecurMonthly::RecurMonthly( QWidget *parent, const char *name ) :
{
QBoxLayout *topLayout = new QVBoxLayout( this );
topLayout->setSpacing( KDialog::spacingHint() );
+ topLayout->setMargin( KDialog::marginHintSmall() );
QBoxLayout *freqLayout = new QHBoxLayout( topLayout );
@@ -172,10 +178,11 @@ RecurMonthly::RecurMonthly( QWidget *parent, const char *name ) :
QGridLayout *buttonLayout = new QGridLayout( buttonGroup, 3, 2 );
buttonLayout->setSpacing( KDialog::spacingHint() );
+ buttonLayout->setMargin( KDialog::marginHintSmall() );
QString recurOnText;
- if ( !KOPrefs::instance()->mCompactDialogs ) {
+ if ( QApplication::desktop()->width() > 320 ) {
recurOnText = i18n("Recur on the");
}
@@ -288,6 +295,7 @@ RecurYearly::RecurYearly( QWidget *parent, const char *name ) :
{
QBoxLayout *topLayout = new QVBoxLayout( this );
topLayout->setSpacing( KDialog::spacingHint() );
+ topLayout->setMargin( KDialog::marginHintSmall() );
QBoxLayout *freqLayout = new QHBoxLayout( topLayout );
@@ -505,6 +513,7 @@ RecurrenceRangeWidget::RecurrenceRangeWidget( QWidget *parent,
QWidget *rangeBox = new QWidget( mRangeGroupBox );
QVBoxLayout *rangeLayout = new QVBoxLayout( rangeBox );
rangeLayout->setSpacing( KDialog::spacingHint() );
+ rangeLayout->setMargin( KDialog::marginHintSmall() );
mStartDateLabel = new QLabel( i18n("Begin on:"), rangeBox );
rangeLayout->addWidget( mStartDateLabel );
@@ -538,7 +547,7 @@ RecurrenceRangeWidget::RecurrenceRangeWidget( QWidget *parent,
mEndDateEdit = new KDateEdit( rangeBox );
endDateLayout->addWidget( mEndDateEdit );
- endDateLayout->addStretch( 1 );
+ //endDateLayout->addStretch( 1 );
connect( mNoEndDateButton, SIGNAL( toggled( bool ) ),
SLOT( showCurrentRange() ) );
@@ -653,7 +662,6 @@ RecurrenceChooser::RecurrenceChooser( QWidget *parent, const char *name ) :
{
QBoxLayout *topLayout = new QVBoxLayout( this );
- if ( KOPrefs::instance()->mCompactDialogs ) {
mTypeCombo = new QComboBox( this );
mTypeCombo->insertItem( i18n("Daily") );
mTypeCombo->insertItem( i18n("Weekly") );
@@ -663,27 +671,7 @@ RecurrenceChooser::RecurrenceChooser( QWidget *parent, const char *name ) :
topLayout->addWidget( mTypeCombo );
connect( mTypeCombo, SIGNAL( activated( int ) ), SLOT( emitChoice() ) );
- } else {
- mTypeCombo = 0;
-
- QButtonGroup *ruleButtonGroup = new QButtonGroup( 1, Horizontal, this );
- ruleButtonGroup->setFrameStyle( QFrame::NoFrame );
- topLayout->addWidget( ruleButtonGroup );
- mDailyButton = new QRadioButton( i18n("Daily"), ruleButtonGroup );
- mWeeklyButton = new QRadioButton( i18n("Weekly"), ruleButtonGroup );
- mMonthlyButton = new QRadioButton( i18n("Monthly"), ruleButtonGroup );
- mYearlyButton = new QRadioButton( i18n("Yearly"), ruleButtonGroup );
-
- connect( mDailyButton, SIGNAL( toggled( bool ) ),
- SLOT( emitChoice() ) );
- connect( mWeeklyButton, SIGNAL( toggled( bool ) ),
- SLOT( emitChoice() ) );
- connect( mMonthlyButton, SIGNAL( toggled( bool ) ),
- SLOT( emitChoice() ) );
- connect( mYearlyButton, SIGNAL( toggled( bool ) ),
- SLOT( emitChoice() ) );
- }
}
int RecurrenceChooser::type()
@@ -733,6 +721,7 @@ KOEditorRecurrence::KOEditorRecurrence( QWidget* parent, const char *name ) :
{
QGridLayout *topLayout = new QGridLayout( this, 2,2 );
topLayout->setSpacing( KDialog::spacingHint() );
+ topLayout->setMargin( KDialog::marginHintSmall() );
mEnabledCheck = new QCheckBox( i18n("Enable Recurrence"), this );
connect( mEnabledCheck, SIGNAL( toggled( bool ) ),
@@ -744,7 +733,7 @@ KOEditorRecurrence::KOEditorRecurrence( QWidget* parent, const char *name ) :
this );
topLayout->addMultiCellWidget( mTimeGroupBox, 1, 1 , 0 , 1 );
- if ( KOPrefs::instance()->mCompactDialogs ) {
+ if ( QApplication::desktop()->width() <= 320) {
mTimeGroupBox->hide();
}
@@ -756,25 +745,13 @@ KOEditorRecurrence::KOEditorRecurrence( QWidget* parent, const char *name ) :
// mDateTimeLabel = new QLabel( timeFrame );
// layoutTimeFrame->addWidget( mDateTimeLabel );
- Qt::Orientation orientation;
- if ( KOPrefs::instance()->mCompactDialogs ) orientation = Horizontal;
- else orientation = Vertical;
- mRuleBox = new QGroupBox( 1, orientation, i18n("Recurrence Rule"), this );
- if ( KOPrefs::instance()->mCompactDialogs ) {
+ mRuleBox = new QGroupBox( 1, Horizontal, i18n("Recurrence Rule"), this );
topLayout->addMultiCellWidget( mRuleBox, 2, 2, 0, 1 );
- } else {
- topLayout->addMultiCellWidget( mRuleBox, 2, 2, 0, 1 );
- }
-
mRecurrenceChooser = new RecurrenceChooser( mRuleBox );
connect( mRecurrenceChooser, SIGNAL( chosen( int ) ),
SLOT( showCurrentRule( int ) ) );
- if ( !KOPrefs::instance()->mCompactDialogs ) {
- QFrame *ruleSepFrame = new QFrame( mRuleBox );
- ruleSepFrame->setFrameStyle( QFrame::VLine | QFrame::Sunken );
- }
mRuleStack = new QWidgetStack( mRuleBox );
@@ -791,8 +768,6 @@ KOEditorRecurrence::KOEditorRecurrence( QWidget* parent, const char *name ) :
mRuleStack->addWidget( mYearly, 0 );
showCurrentRule( mRecurrenceChooser->type() );
-
- if ( KOPrefs::instance()->mCompactDialogs ) {
mRecurrenceRangeWidget = 0;
mRecurrenceRangeDialog = new RecurrenceRangeDialog( this );
mRecurrenceRange = mRecurrenceRangeDialog;
@@ -815,20 +790,6 @@ KOEditorRecurrence::KOEditorRecurrence( QWidget* parent, const char *name ) :
}
connect( mExceptionsButton, SIGNAL( clicked() ),
SLOT( showExceptionsDialog() ) );
-
- } else {
- mRecurrenceRangeWidget = new RecurrenceRangeWidget( this );
- mRecurrenceRangeDialog = 0;
- mRecurrenceRange = mRecurrenceRangeWidget;
- mRecurrenceRangeButton = 0;
- topLayout->addWidget( mRecurrenceRangeWidget, 3, 0 );
-
- mExceptionsWidget = new ExceptionsWidget( this );
- mExceptionsDialog = 0;
- mExceptions = mExceptionsWidget;
- mExceptionsButton = 0;
- topLayout->addWidget( mExceptionsWidget, 3, 1 );
- }
}
KOEditorRecurrence::~KOEditorRecurrence()
diff --git a/microkde/kdialog.cpp b/microkde/kdialog.cpp
index 3d62cdd..961631e 100644
--- a/microkde/kdialog.cpp
+++ b/microkde/kdialog.cpp
@@ -9,9 +9,17 @@ KDialog::KDialog( QWidget *parent, const char *name, bool modal ) :
;
}
+#ifdef DESKTOP_VERSION
+int KDialog::spacingHint() { return 7; }
+int KDialog::marginHint() { return 7; }
+int KDialog::spacingHintSmall() { return 4; }
+int KDialog::marginHintSmall() { return 4; }
+
+#else
int KDialog::spacingHint() { return 3; }
int KDialog::marginHint() { return 3; }
-int KDialog::spacingHintSmall() { if (QApplication::desktop()->width() < 700 ) return 1;else return 3; }
-int KDialog::marginHintSmall() { if (QApplication::desktop()->width() < 700 ) return 1;else return 3; }
+int KDialog::spacingHintSmall() { return 1; }
+int KDialog::marginHintSmall() { return 1; }
+#endif