summaryrefslogtreecommitdiffabout
path: root/libkdepim
Unidiff
Diffstat (limited to 'libkdepim') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/kcmconfigs/kdepimconfigwidget.cpp41
-rw-r--r--libkdepim/kcmconfigs/kdepimconfigwidget.h4
-rw-r--r--libkdepim/kpimglobalprefs.cpp7
-rw-r--r--libkdepim/kpimglobalprefs.h6
-rw-r--r--libkdepim/kprefsdialog.cpp2
-rw-r--r--libkdepim/kprefsdialog.h7
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
@@ -35,14 +35,17 @@ $Id$
35#include <qlabel.h> 35#include <qlabel.h>
36#include <qlineedit.h> 36#include <qlineedit.h>
37#include <qbuttongroup.h> 37#include <qbuttongroup.h>
38#include <qcheckbox.h>
38#include <qfile.h> 39#include <qfile.h>
39#include <qvbox.h> 40#include <qvbox.h>
40#include <qdir.h> 41#include <qdir.h>
41#include <qregexp.h> 42#include <qregexp.h>
43#include <qspinbox.h>
42 44
43#include <kdialog.h> 45#include <kdialog.h>
44#include <kprefsdialog.h> 46#include <kprefsdialog.h>
45#include <klocale.h> 47#include <klocale.h>
48#include <kglobalsettings.h>
46#include <kdateedit.h> 49#include <kdateedit.h>
47#include <kglobal.h> 50#include <kglobal.h>
48#include <stdlib.h> 51#include <stdlib.h>
@@ -109,12 +112,48 @@ KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent,
109 setupTimeZoneTab(); 112 setupTimeZoneTab();
110 setupExternalAppTab(); 113 setupExternalAppTab();
111 setupStoreTab(); 114 setupStoreTab();
112 115 setupBackupTab();
113} 116}
114void KDEPIMConfigWidget::showTimeZoneTab() 117void KDEPIMConfigWidget::showTimeZoneTab()
115{ 118{
116 tabWidget->setCurrentPage ( 3 ) ; 119 tabWidget->setCurrentPage ( 3 ) ;
117} 120}
121void KDEPIMConfigWidget::setupBackupTab()
122{
123 QVBox *colorPage = new QVBox( this );
124 tabWidget->addTab( colorPage, i18n( "Backup" ) );
125 QWidget* topFrame = new QWidget( colorPage );
126 QVBoxLayout *topLayout = new QVBoxLayout(topFrame);
127 KPrefsWidBool *sb = addWidBool(i18n("Backup enabled"),
128 &(KPimGlobalPrefs::instance()->mBackupEnabled),topFrame);
129 topLayout->addWidget((QWidget*)sb->checkBox());
130 QWidget* bupFrame = new QWidget( topFrame );
131 topLayout->addWidget((bupFrame));
132 QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), bupFrame, SLOT ( setEnabled( bool ) ) );
133 QVBoxLayout *bupLayout = new QVBoxLayout(bupFrame);
134 sb = addWidBool(i18n("Use standard backup dir"),
135 &(KPimGlobalPrefs::instance()->mBackupEnabled),bupFrame);
136 bupLayout->addWidget((QWidget*)sb->checkBox());
137 mBackupUrl = new KURLRequester( bupFrame );
138 mBackupUrl->setURL( KGlobalSettings::backupDataDir() );
139 QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), mBackupUrl ,SLOT ( setDisabled( bool ) ) );
140 bupLayout->addWidget( mBackupUrl );
141
142
143 QHBox *dummy = new QHBox(bupFrame);
144 new QLabel(i18n("Number of Backups:"),dummy);
145 mBackupNumbersSpin = new QSpinBox(1,21,1,dummy);
146 new QLabel(i18n(" "),dummy);
147 bupLayout->addWidget( dummy );
148
149 dummy = new QHBox(bupFrame);
150 new QLabel(i18n("Make backup every "),dummy);
151 mBackupDayCountSpin = new QSpinBox(1,28,1,dummy);
152 new QLabel(i18n(" days"),dummy);
153 new QLabel(i18n(" "),dummy);
154 bupLayout->addWidget( dummy );
155
156}
118void KDEPIMConfigWidget::setupStoreTab() 157void KDEPIMConfigWidget::setupStoreTab()
119{ 158{
120 QVBox *colorPage = new QVBox( this ); 159 QVBox *colorPage = new QVBox( this );
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
@@ -79,6 +79,7 @@ class KDEPIMConfigWidget : public KPrefsWidget
79 void setupLocaleTab(); 79 void setupLocaleTab();
80 void setupTimeZoneTab(); 80 void setupTimeZoneTab();
81 void setupStoreTab(); 81 void setupStoreTab();
82 void setupBackupTab();
82 KURLRequester* mStoreUrl; 83 KURLRequester* mStoreUrl;
83 84
84 void setCombo(QComboBox *combo,const QString & text, const QStringList *tags = 0); 85 void setCombo(QComboBox *combo,const QString & text, const QStringList *tags = 0);
@@ -152,7 +153,8 @@ class KDEPIMConfigWidget : public KPrefsWidget
152 QString mSipOtherMessageParameters; 153 QString mSipOtherMessageParameters;
153 154
154 155
155 156 KURLRequester* mBackupUrl;
157 QSpinBox* mBackupDayCountSpin, *mBackupNumbersSpin ;
156 QMap<ExternalAppHandler::Types, QString> mExternalAppsMap; 158 QMap<ExternalAppHandler::Types, QString> mExternalAppsMap;
157 159
158// AddresseeWidget *mAddresseeWidget; 160// AddresseeWidget *mAddresseeWidget;
diff --git a/libkdepim/kpimglobalprefs.cpp b/libkdepim/kpimglobalprefs.cpp
index 873f0eb..90321b2 100644
--- a/libkdepim/kpimglobalprefs.cpp
+++ b/libkdepim/kpimglobalprefs.cpp
@@ -111,6 +111,13 @@ KPimGlobalPrefs::KPimGlobalPrefs( const QString &name )
111 addItemString("Ex2PhoneConnection",&mEx2PhoneConnection,"irda"); 111 addItemString("Ex2PhoneConnection",&mEx2PhoneConnection,"irda");
112 addItemString("Ex2PhoneModel",&mEx2PhoneModel,"6310i"); 112 addItemString("Ex2PhoneModel",&mEx2PhoneModel,"6310i");
113 113
114 KPrefs::setCurrentGroup( "BackupSettings" );
115 addItemString("BackupDatadir",&mBackupDatadir,KGlobalSettings::backupDataDir());
116 addItemInt( "BackupNumbers", &mBackupNumbers, 3 );
117 addItemInt( "BackupDayCount", &mBackupDayCount, 2 );
118 addItemBool( "BackupUseDefaultDir",&mBackupUseDefaultDir, true );
119 addItemBool( "BackupEnabled",&mBackupEnabled, false );
120
114} 121}
115 122
116void KPimGlobalPrefs::setGlobalConfig() 123void KPimGlobalPrefs::setGlobalConfig()
diff --git a/libkdepim/kpimglobalprefs.h b/libkdepim/kpimglobalprefs.h
index 36cc25a..94ac8ae 100644
--- a/libkdepim/kpimglobalprefs.h
+++ b/libkdepim/kpimglobalprefs.h
@@ -140,6 +140,12 @@ class KPimGlobalPrefs : public KPrefs
140 QString mEx2PhoneConnection; 140 QString mEx2PhoneConnection;
141 QString mEx2PhoneModel; 141 QString mEx2PhoneModel;
142 142
143
144 bool mBackupEnabled;
145 QString mBackupDatadir;
146 bool mBackupUseDefaultDir;
147 int mBackupNumbers;
148 int mBackupDayCount;
143}; 149};
144 150
145#endif 151#endif
diff --git a/libkdepim/kprefsdialog.cpp b/libkdepim/kprefsdialog.cpp
index dd9a602..b6ae775 100644
--- a/libkdepim/kprefsdialog.cpp
+++ b/libkdepim/kprefsdialog.cpp
@@ -280,7 +280,7 @@ KPrefsDialog::KPrefsDialog(KPrefs *prefs,QWidget *parent,char *name,bool modal)
280 mPrefs = prefs; 280 mPrefs = prefs;
281 281
282// This seems to cause a crash on exit. Investigate later. 282// This seems to cause a crash on exit. Investigate later.
283// mPrefsWids.setAutoDelete(true); 283 mPrefsWids.setAutoDelete(true);
284 284
285 connect(this,SIGNAL(defaultClicked()),SLOT(slotDefault())); 285 connect(this,SIGNAL(defaultClicked()),SLOT(slotDefault()));
286 //connect(this,SIGNAL(cancelClicked()),SLOT(slotDefault())); 286 //connect(this,SIGNAL(cancelClicked()),SLOT(slotDefault()));
diff --git a/libkdepim/kprefsdialog.h b/libkdepim/kprefsdialog.h
index ad13b78..efcb86a 100644
--- a/libkdepim/kprefsdialog.h
+++ b/libkdepim/kprefsdialog.h
@@ -46,7 +46,7 @@ class QButtonGroup;
46 This class provides the interface for the preferences widgets used by 46 This class provides the interface for the preferences widgets used by
47 KPrefsDialog. 47 KPrefsDialog.
48*/ 48*/
49class KPrefsDialogWid 49class KPrefsDialogWid : public QObject
50{ 50{
51 public: 51 public:
52 /** 52 /**
@@ -136,9 +136,8 @@ class KPrefsDialogWidTime : public KPrefsDialogWid
136 This class provides a widget for configuring color values. It is meant to be 136 This class provides a widget for configuring color values. It is meant to be
137 used by KPrefsDialog. The user is responsible for the layout management. 137 used by KPrefsDialog. The user is responsible for the layout management.
138*/ 138*/
139class KPrefsDialogWidColor : public QObject, public KPrefsDialogWid 139class KPrefsDialogWidColor : public KPrefsDialogWid
140{ 140{
141 Q_OBJECT
142 public: 141 public:
143 /** 142 /**
144 Create a color widget consisting of a test field and a button for opening 143 Create a color widget consisting of a test field and a button for opening
@@ -179,7 +178,7 @@ class KPrefsDialogWidColor : public QObject, public KPrefsDialogWid
179 This class provides a widget for configuring font values. It is meant to be 178 This class provides a widget for configuring font values. It is meant to be
180 used by KPrefsDialog. The user is responsible for the layout management. 179 used by KPrefsDialog. The user is responsible for the layout management.
181*/ 180*/
182class KPrefsDialogWidFont : public QObject, public KPrefsDialogWid 181class KPrefsDialogWidFont : public KPrefsDialogWid
183{ 182{
184 Q_OBJECT 183 Q_OBJECT
185 public: 184 public: