-rw-r--r-- | libkdepim/kcmconfigs/kdepimconfigwidget.cpp | 28 | ||||
-rw-r--r-- | libkdepim/kpimglobalprefs.cpp | 6 | ||||
-rw-r--r-- | libkdepim/kpimprefs.cpp | 3 | ||||
-rw-r--r-- | libkdepim/kpimprefs.h | 1 |
4 files changed, 32 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 | |||
@@ -131,16 +131,17 @@ void KDEPIMConfigWidget::setupBackupTab() | |||
131 | topLayout->addWidget((bupFrame)); | 131 | topLayout->addWidget((bupFrame)); |
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); |
146 | new QLabel(i18n(" "),dummy); | 147 | new QLabel(i18n(" "),dummy); |
@@ -150,9 +151,17 @@ void KDEPIMConfigWidget::setupBackupTab() | |||
150 | new QLabel(i18n("Make backup every "),dummy); | 151 | new QLabel(i18n("Make backup every "),dummy); |
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() |
158 | { | 167 | { |
@@ -805,8 +814,15 @@ void KDEPIMConfigWidget::usrReadConfig() | |||
805 | 814 | ||
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; |
812 | mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") )); | 828 | mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") )); |
@@ -815,11 +831,8 @@ void KDEPIMConfigWidget::usrReadConfig() | |||
815 | mStartDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingStart-1)); | 831 | mStartDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingStart-1)); |
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; |
825 | mEmailOtherMessageParameters = prefs->mEmailOtherMessageParameters; | 838 | mEmailOtherMessageParameters = prefs->mEmailOtherMessageParameters; |
@@ -865,8 +878,11 @@ void KDEPIMConfigWidget::usrWriteConfig() | |||
865 | KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance(); | 878 | KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance(); |
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") ); |
872 | 888 | ||
diff --git a/libkdepim/kpimglobalprefs.cpp b/libkdepim/kpimglobalprefs.cpp index 90321b2..9c28425 100644 --- a/libkdepim/kpimglobalprefs.cpp +++ b/libkdepim/kpimglobalprefs.cpp | |||
@@ -199,8 +199,14 @@ void KPimGlobalPrefs::setGlobalConfig() | |||
199 | mDaylightsavingStart, | 199 | mDaylightsavingStart, |
200 | mDaylightsavingEnd ); | 200 | mDaylightsavingEnd ); |
201 | KGlobal::locale()->setTimezone( mTimeZoneId, mTimeZoneAdd30min ); | 201 | KGlobal::locale()->setTimezone( mTimeZoneId, mTimeZoneAdd30min ); |
202 | KGlobalSettings::setAlternateBackgroundColor(mAlternateColor); | 202 | KGlobalSettings::setAlternateBackgroundColor(mAlternateColor); |
203 | QString localKdeDir; | ||
204 | localKdeDir = readEnvPath("LOCALMICROKDEHOME"); | ||
205 | if ( ! localKdeDir.isEmpty() ) { | ||
206 | mBackupUseDefaultDir = true; | ||
207 | mBackupDatadir = KGlobalSettings::backupDataDir(); | ||
208 | } | ||
203 | 209 | ||
204 | } | 210 | } |
205 | KPimGlobalPrefs::~KPimGlobalPrefs() | 211 | KPimGlobalPrefs::~KPimGlobalPrefs() |
206 | { | 212 | { |
diff --git a/libkdepim/kpimprefs.cpp b/libkdepim/kpimprefs.cpp index d68ccb6..714d1b7 100644 --- a/libkdepim/kpimprefs.cpp +++ b/libkdepim/kpimprefs.cpp | |||
@@ -49,8 +49,11 @@ KPimPrefs::KPimPrefs( const QString &name ) : | |||
49 | addItemString("LastSyncedLocalFile", &mLastSyncedLocalFile ,hdp +"lastsync.ics" ); | 49 | addItemString("LastSyncedLocalFile", &mLastSyncedLocalFile ,hdp +"lastsync.ics" ); |
50 | addItemBool("PassiveSyncWithDesktop",&mPassiveSyncWithDesktop,false ); | 50 | addItemBool("PassiveSyncWithDesktop",&mPassiveSyncWithDesktop,false ); |
51 | addItemBool("PassiveSyncAutoStart",&mPassiveSyncAutoStart,false ); | 51 | addItemBool("PassiveSyncAutoStart",&mPassiveSyncAutoStart,false ); |
52 | addItemInt("RingSyncAlgoPrefs",&mRingSyncAlgoPrefs,3); | 52 | addItemInt("RingSyncAlgoPrefs",&mRingSyncAlgoPrefs,3); |
53 | |||
54 | setCurrentGroup("BackupDate"); | ||
55 | addItemInt("LastBackupDate",&mLastBackupDate,0); | ||
53 | } | 56 | } |
54 | 57 | ||
55 | KPimPrefs::~KPimPrefs() | 58 | KPimPrefs::~KPimPrefs() |
56 | { | 59 | { |
diff --git a/libkdepim/kpimprefs.h b/libkdepim/kpimprefs.h index c177bd6..bf80042 100644 --- a/libkdepim/kpimprefs.h +++ b/libkdepim/kpimprefs.h | |||
@@ -60,8 +60,9 @@ class KPimPrefs : public KPrefs | |||
60 | bool mPassiveSyncWithDesktop; | 60 | bool mPassiveSyncWithDesktop; |
61 | bool mPassiveSyncAutoStart; | 61 | bool mPassiveSyncAutoStart; |
62 | int mRingSyncAlgoPrefs; | 62 | int mRingSyncAlgoPrefs; |
63 | QString mLastSyncedLocalFile; | 63 | QString mLastSyncedLocalFile; |
64 | int mLastBackupDate; | ||
64 | 65 | ||
65 | 66 | ||
66 | protected: | 67 | protected: |
67 | virtual void setCategoryDefaults(); | 68 | virtual void setCategoryDefaults(); |