-rw-r--r-- | libkdepim/kcmconfigs/kdepimconfigwidget.cpp | 41 | ||||
-rw-r--r-- | libkdepim/kcmconfigs/kdepimconfigwidget.h | 4 | ||||
-rw-r--r-- | libkdepim/kpimglobalprefs.cpp | 7 | ||||
-rw-r--r-- | libkdepim/kpimglobalprefs.h | 6 | ||||
-rw-r--r-- | libkdepim/kprefsdialog.cpp | 2 | ||||
-rw-r--r-- | libkdepim/kprefsdialog.h | 7 |
6 files changed, 60 insertions, 7 deletions
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp index 753d90a..fbfbc45 100644 --- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp +++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp @@ -37,2 +37,3 @@ $Id$ #include <qbuttongroup.h> +#include <qcheckbox.h> #include <qfile.h> @@ -41,2 +42,3 @@ $Id$ #include <qregexp.h> +#include <qspinbox.h> @@ -45,2 +47,3 @@ $Id$ #include <klocale.h> +#include <kglobalsettings.h> #include <kdateedit.h> @@ -111,3 +114,3 @@ KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, setupStoreTab(); - + setupBackupTab(); } @@ -117,2 +120,38 @@ void KDEPIMConfigWidget::showTimeZoneTab() } +void KDEPIMConfigWidget::setupBackupTab() +{ + QVBox *colorPage = new QVBox( this ); + tabWidget->addTab( colorPage, i18n( "Backup" ) ); + QWidget* topFrame = new QWidget( colorPage ); + QVBoxLayout *topLayout = new QVBoxLayout(topFrame); + KPrefsWidBool *sb = addWidBool(i18n("Backup enabled"), + &(KPimGlobalPrefs::instance()->mBackupEnabled),topFrame); + topLayout->addWidget((QWidget*)sb->checkBox()); + QWidget* bupFrame = new QWidget( topFrame ); + topLayout->addWidget((bupFrame)); + QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), bupFrame, SLOT ( setEnabled( bool ) ) ); + QVBoxLayout *bupLayout = new QVBoxLayout(bupFrame); + sb = addWidBool(i18n("Use standard backup dir"), + &(KPimGlobalPrefs::instance()->mBackupEnabled),bupFrame); + bupLayout->addWidget((QWidget*)sb->checkBox()); + mBackupUrl = new KURLRequester( bupFrame ); + mBackupUrl->setURL( KGlobalSettings::backupDataDir() ); + QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), mBackupUrl ,SLOT ( setDisabled( bool ) ) ); + bupLayout->addWidget( mBackupUrl ); + + + QHBox *dummy = new QHBox(bupFrame); + new QLabel(i18n("Number of Backups:"),dummy); + mBackupNumbersSpin = new QSpinBox(1,21,1,dummy); + new QLabel(i18n(" "),dummy); + bupLayout->addWidget( dummy ); + + dummy = new QHBox(bupFrame); + new QLabel(i18n("Make backup every "),dummy); + mBackupDayCountSpin = new QSpinBox(1,28,1,dummy); + new QLabel(i18n(" days"),dummy); + new QLabel(i18n(" "),dummy); + bupLayout->addWidget( dummy ); + +} void KDEPIMConfigWidget::setupStoreTab() diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.h b/libkdepim/kcmconfigs/kdepimconfigwidget.h index 984e4e0..c0b92a9 100644 --- a/libkdepim/kcmconfigs/kdepimconfigwidget.h +++ b/libkdepim/kcmconfigs/kdepimconfigwidget.h @@ -81,2 +81,3 @@ class KDEPIMConfigWidget : public KPrefsWidget void setupStoreTab(); + void setupBackupTab(); KURLRequester* mStoreUrl; @@ -154,3 +155,4 @@ class KDEPIMConfigWidget : public KPrefsWidget - + KURLRequester* mBackupUrl; + QSpinBox* mBackupDayCountSpin, *mBackupNumbersSpin ; QMap<ExternalAppHandler::Types, QString> mExternalAppsMap; diff --git a/libkdepim/kpimglobalprefs.cpp b/libkdepim/kpimglobalprefs.cpp index 873f0eb..90321b2 100644 --- a/libkdepim/kpimglobalprefs.cpp +++ b/libkdepim/kpimglobalprefs.cpp @@ -113,2 +113,9 @@ KPimGlobalPrefs::KPimGlobalPrefs( const QString &name ) + KPrefs::setCurrentGroup( "BackupSettings" ); + addItemString("BackupDatadir",&mBackupDatadir,KGlobalSettings::backupDataDir()); + addItemInt( "BackupNumbers", &mBackupNumbers, 3 ); + addItemInt( "BackupDayCount", &mBackupDayCount, 2 ); + addItemBool( "BackupUseDefaultDir",&mBackupUseDefaultDir, true ); + addItemBool( "BackupEnabled",&mBackupEnabled, false ); + } diff --git a/libkdepim/kpimglobalprefs.h b/libkdepim/kpimglobalprefs.h index 36cc25a..94ac8ae 100644 --- a/libkdepim/kpimglobalprefs.h +++ b/libkdepim/kpimglobalprefs.h @@ -142,2 +142,8 @@ class KPimGlobalPrefs : public KPrefs + + bool mBackupEnabled; + QString mBackupDatadir; + bool mBackupUseDefaultDir; + int mBackupNumbers; + int mBackupDayCount; }; diff --git a/libkdepim/kprefsdialog.cpp b/libkdepim/kprefsdialog.cpp index dd9a602..b6ae775 100644 --- a/libkdepim/kprefsdialog.cpp +++ b/libkdepim/kprefsdialog.cpp @@ -282,3 +282,3 @@ KPrefsDialog::KPrefsDialog(KPrefs *prefs,QWidget *parent,char *name,bool modal) // This seems to cause a crash on exit. Investigate later. -// mPrefsWids.setAutoDelete(true); + mPrefsWids.setAutoDelete(true); diff --git a/libkdepim/kprefsdialog.h b/libkdepim/kprefsdialog.h index ad13b78..efcb86a 100644 --- a/libkdepim/kprefsdialog.h +++ b/libkdepim/kprefsdialog.h @@ -48,3 +48,3 @@ class QButtonGroup; */ -class KPrefsDialogWid +class KPrefsDialogWid : public QObject { @@ -138,5 +138,4 @@ class KPrefsDialogWidTime : public KPrefsDialogWid */ -class KPrefsDialogWidColor : public QObject, public KPrefsDialogWid +class KPrefsDialogWidColor : public KPrefsDialogWid { - Q_OBJECT public: @@ -181,3 +180,3 @@ class KPrefsDialogWidColor : public QObject, public KPrefsDialogWid */ -class KPrefsDialogWidFont : public QObject, public KPrefsDialogWid +class KPrefsDialogWidFont : public KPrefsDialogWid { |