Diffstat (limited to 'libkdepim/kcmconfigs/kdepimconfigwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libkdepim/kcmconfigs/kdepimconfigwidget.cpp | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp index fbfbc45..93538ec 100644 --- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp +++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp | |||
@@ -132,14 +132,15 @@ void KDEPIMConfigWidget::setupBackupTab() | |||
132 | QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), bupFrame, SLOT ( setEnabled( bool ) ) ); | 132 | QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), bupFrame, SLOT ( setEnabled( bool ) ) ); |
133 | QVBoxLayout *bupLayout = new QVBoxLayout(bupFrame); | 133 | QVBoxLayout *bupLayout = new QVBoxLayout(bupFrame); |
134 | sb = addWidBool(i18n("Use standard backup dir"), | 134 | sb = addWidBool(i18n("Use standard backup dir"), |
135 | &(KPimGlobalPrefs::instance()->mBackupEnabled),bupFrame); | 135 | &(KPimGlobalPrefs::instance()->mBackupUseDefaultDir),bupFrame); |
136 | bupLayout->addWidget((QWidget*)sb->checkBox()); | 136 | bupLayout->addWidget((QWidget*)sb->checkBox()); |
137 | mBackupUrl = new KURLRequester( bupFrame ); | 137 | mBackupUrl = new KURLRequester( bupFrame ); |
138 | mBackupUrl->setURL( KGlobalSettings::backupDataDir() ); | 138 | mBackupUrl->setURL( KGlobalSettings::backupDataDir() ); |
139 | QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), mBackupUrl ,SLOT ( setDisabled( bool ) ) ); | 139 | QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), mBackupUrl ,SLOT ( setDisabled( bool ) ) ); |
140 | bupLayout->addWidget( mBackupUrl ); | 140 | bupLayout->addWidget( mBackupUrl ); |
141 | 141 | ||
142 | 142 | mBackupUrl->setEnabled( !KPimGlobalPrefs::instance()->mBackupUseDefaultDir ); | |
143 | bupFrame->setEnabled( KPimGlobalPrefs::instance()->mBackupEnabled ); | ||
143 | QHBox *dummy = new QHBox(bupFrame); | 144 | QHBox *dummy = new QHBox(bupFrame); |
144 | new QLabel(i18n("Number of Backups:"),dummy); | 145 | new QLabel(i18n("Number of Backups:"),dummy); |
145 | mBackupNumbersSpin = new QSpinBox(1,21,1,dummy); | 146 | mBackupNumbersSpin = new QSpinBox(1,21,1,dummy); |
@@ -151,7 +152,15 @@ void KDEPIMConfigWidget::setupBackupTab() | |||
151 | mBackupDayCountSpin = new QSpinBox(1,28,1,dummy); | 152 | mBackupDayCountSpin = new QSpinBox(1,28,1,dummy); |
152 | new QLabel(i18n(" days"),dummy); | 153 | new QLabel(i18n(" days"),dummy); |
153 | new QLabel(i18n(" "),dummy); | 154 | new QLabel(i18n(" "),dummy); |
154 | bupLayout->addWidget( dummy ); | 155 | bupLayout->addWidget( dummy ); |
156 | QString localKdeDir; | ||
157 | localKdeDir = readEnvPath("LOCALMICROKDEHOME"); | ||
158 | if ( ! localKdeDir.isEmpty() ) { | ||
159 | sb->checkBox()->setEnabled( false ); | ||
160 | sb->checkBox()->setChecked( true ); | ||
161 | mBackupUrl->setEnabled( false ); | ||
162 | KPimGlobalPrefs::instance()->mBackupUseDefaultDir = true; | ||
163 | } | ||
155 | 164 | ||
156 | } | 165 | } |
157 | void KDEPIMConfigWidget::setupStoreTab() | 166 | void KDEPIMConfigWidget::setupStoreTab() |
@@ -806,6 +815,13 @@ void KDEPIMConfigWidget::usrReadConfig() | |||
806 | bool blocked = signalsBlocked(); | 815 | bool blocked = signalsBlocked(); |
807 | blockSignals( true ); | 816 | blockSignals( true ); |
808 | 817 | ||
818 | if (KPimGlobalPrefs::instance()->mBackupUseDefaultDir ) | ||
819 | mBackupUrl->setURL( KGlobalSettings::backupDataDir() ); | ||
820 | else | ||
821 | mBackupUrl->setURL(prefs->mBackupDatadir); | ||
822 | mBackupNumbersSpin->setValue( prefs->mBackupNumbers ); | ||
823 | mBackupDayCountSpin->setValue( prefs->mBackupDayCount); | ||
824 | |||
809 | QString dummy = prefs->mUserDateFormatLong; | 825 | QString dummy = prefs->mUserDateFormatLong; |
810 | mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") )); | 826 | mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") )); |
811 | dummy = prefs->mUserDateFormatShort; | 827 | dummy = prefs->mUserDateFormatShort; |
@@ -816,9 +832,6 @@ void KDEPIMConfigWidget::usrReadConfig() | |||
816 | mEndDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingEnd-1)); | 832 | mEndDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingEnd-1)); |
817 | setCombo(mTimeZoneCombo,i18n(prefs->mTimeZoneId)); | 833 | setCombo(mTimeZoneCombo,i18n(prefs->mTimeZoneId)); |
818 | 834 | ||
819 | |||
820 | |||
821 | |||
822 | mEmailClient = prefs->mEmailClient; | 835 | mEmailClient = prefs->mEmailClient; |
823 | mEmailOtherChannel = prefs->mEmailOtherChannel; | 836 | mEmailOtherChannel = prefs->mEmailOtherChannel; |
824 | mEmailOtherMessage = prefs->mEmailOtherMessage; | 837 | mEmailOtherMessage = prefs->mEmailOtherMessage; |
@@ -866,6 +879,9 @@ void KDEPIMConfigWidget::usrWriteConfig() | |||
866 | 879 | ||
867 | saveEditFieldSettings(); | 880 | saveEditFieldSettings(); |
868 | 881 | ||
882 | prefs->mBackupNumbers = mBackupNumbersSpin->value(); | ||
883 | prefs->mBackupDayCount = mBackupDayCountSpin->value(); | ||
884 | prefs->mBackupDatadir = mBackupUrl->url(); | ||
869 | 885 | ||
870 | prefs->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") ); | 886 | prefs->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") ); |
871 | prefs->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") ); | 887 | prefs->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") ); |