-rw-r--r-- | libkdepim/kcmconfigs/kdepimconfigwidget.cpp | 41 | ||||
-rw-r--r-- | libkdepim/kcmconfigs/kdepimconfigwidget.h | 4 |
2 files changed, 43 insertions, 2 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 | |||
@@ -26,32 +26,35 @@ Enhanced Version of the file for platform independent KDE tools. | |||
26 | Copyright (c) 2004 Ulf Schenk | 26 | Copyright (c) 2004 Ulf Schenk |
27 | 27 | ||
28 | $Id$ | 28 | $Id$ |
29 | */ | 29 | */ |
30 | 30 | ||
31 | #include <qlayout.h> | 31 | #include <qlayout.h> |
32 | #include <qtabwidget.h> | 32 | #include <qtabwidget.h> |
33 | #include <qcombobox.h> | 33 | #include <qcombobox.h> |
34 | #include <qgroupbox.h> | 34 | #include <qgroupbox.h> |
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> |
49 | 52 | ||
50 | /*US | 53 | /*US |
51 | #include <qcheckbox.h> | 54 | #include <qcheckbox.h> |
52 | #include <qframe.h> | 55 | #include <qframe.h> |
53 | #include <qpushbutton.h> | 56 | #include <qpushbutton.h> |
54 | #include <qcombobox.h> | 57 | #include <qcombobox.h> |
55 | #include <qlineedit.h> | 58 | #include <qlineedit.h> |
56 | #include <qlabel.h> | 59 | #include <qlabel.h> |
57 | #include <qfile.h> | 60 | #include <qfile.h> |
@@ -100,30 +103,66 @@ KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, | |||
100 | QVBoxLayout *topLayout = new QVBoxLayout( this, 0, | 103 | QVBoxLayout *topLayout = new QVBoxLayout( this, 0, |
101 | KDialog::spacingHint() ); | 104 | KDialog::spacingHint() ); |
102 | 105 | ||
103 | tabWidget = new QTabWidget( this ); | 106 | tabWidget = new QTabWidget( this ); |
104 | topLayout->addWidget( tabWidget ); | 107 | topLayout->addWidget( tabWidget ); |
105 | 108 | ||
106 | 109 | ||
107 | setupLocaleTab(); | 110 | setupLocaleTab(); |
108 | setupLocaleDateTab(); | 111 | setupLocaleDateTab(); |
109 | setupTimeZoneTab(); | 112 | setupTimeZoneTab(); |
110 | setupExternalAppTab(); | 113 | setupExternalAppTab(); |
111 | setupStoreTab(); | 114 | setupStoreTab(); |
112 | 115 | setupBackupTab(); | |
113 | } | 116 | } |
114 | void KDEPIMConfigWidget::showTimeZoneTab() | 117 | void KDEPIMConfigWidget::showTimeZoneTab() |
115 | { | 118 | { |
116 | tabWidget->setCurrentPage ( 3 ) ; | 119 | tabWidget->setCurrentPage ( 3 ) ; |
117 | } | 120 | } |
121 | void 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 | } | ||
118 | void KDEPIMConfigWidget::setupStoreTab() | 157 | void KDEPIMConfigWidget::setupStoreTab() |
119 | { | 158 | { |
120 | QVBox *colorPage = new QVBox( this ); | 159 | QVBox *colorPage = new QVBox( this ); |
121 | tabWidget->addTab( colorPage, i18n( "Colors" ) ); | 160 | tabWidget->addTab( colorPage, i18n( "Colors" ) ); |
122 | QWidget* cw = new QWidget( colorPage ); | 161 | QWidget* cw = new QWidget( colorPage ); |
123 | KPrefsWidColor *holidayColor = | 162 | KPrefsWidColor *holidayColor = |
124 | addWidColor(i18n("Alternating background of list views"), | 163 | addWidColor(i18n("Alternating background of list views"), |
125 | &(KPimGlobalPrefs::instance()->mAlternateColor),cw); | 164 | &(KPimGlobalPrefs::instance()->mAlternateColor),cw); |
126 | QHBoxLayout *topLayout = new QHBoxLayout(cw); | 165 | QHBoxLayout *topLayout = new QHBoxLayout(cw); |
127 | topLayout->addWidget(holidayColor->label()); | 166 | topLayout->addWidget(holidayColor->label()); |
128 | topLayout->addWidget( (QWidget* )holidayColor->button()); | 167 | topLayout->addWidget( (QWidget* )holidayColor->button()); |
129 | 168 | ||
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 | |||
@@ -70,24 +70,25 @@ class KDEPIMConfigWidget : public KPrefsWidget | |||
70 | void client_changed( int newClient ); | 70 | void client_changed( int newClient ); |
71 | void externalapp_changed( int newApp ); | 71 | void externalapp_changed( int newApp ); |
72 | void saveStoreSettings(); | 72 | void saveStoreSettings(); |
73 | void setStandardStore(); | 73 | void setStandardStore(); |
74 | void setLocalStore(); | 74 | void setLocalStore(); |
75 | 75 | ||
76 | private: | 76 | private: |
77 | void setupExternalAppTab(); | 77 | void setupExternalAppTab(); |
78 | void setupLocaleDateTab(); | 78 | void setupLocaleDateTab(); |
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); |
85 | 86 | ||
86 | 87 | ||
87 | void saveEditFieldSettings(); | 88 | void saveEditFieldSettings(); |
88 | void updateClientWidgets(); | 89 | void updateClientWidgets(); |
89 | 90 | ||
90 | QTabWidget *tabWidget; | 91 | QTabWidget *tabWidget; |
91 | 92 | ||
92 | 93 | ||
93 | QLineEdit* mUserDateFormatShort; | 94 | QLineEdit* mUserDateFormatShort; |
@@ -143,19 +144,20 @@ class KDEPIMConfigWidget : public KPrefsWidget | |||
143 | 144 | ||
144 | int mPagerClient; | 145 | int mPagerClient; |
145 | QString mPagerOtherChannel; | 146 | QString mPagerOtherChannel; |
146 | QString mPagerOtherMessage; | 147 | QString mPagerOtherMessage; |
147 | QString mPagerOtherMessageParameters; | 148 | QString mPagerOtherMessageParameters; |
148 | 149 | ||
149 | int mSipClient; | 150 | int mSipClient; |
150 | QString mSipOtherChannel; | 151 | QString mSipOtherChannel; |
151 | QString mSipOtherMessage; | 152 | QString mSipOtherMessage; |
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; |
159 | }; | 161 | }; |
160 | 162 | ||
161 | #endif | 163 | #endif |