author | ulf69 <ulf69> | 2004-09-21 19:50:27 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-09-21 19:50:27 (UTC) |
commit | 93313aa8d66c01aa0e4562449020af20b5cef0a7 (patch) (unidiff) | |
tree | 7bf9930c58b4651a29b5aa4210742340c9439bc8 /libkdepim | |
parent | c2cce86fdb2d0b291c3d3bdfa9fac47452153d1a (diff) | |
download | kdepimpi-93313aa8d66c01aa0e4562449020af20b5cef0a7.zip kdepimpi-93313aa8d66c01aa0e4562449020af20b5cef0a7.tar.gz kdepimpi-93313aa8d66c01aa0e4562449020af20b5cef0a7.tar.bz2 |
added edit elements for global prefs
-rw-r--r-- | libkdepim/kcmconfigs/kcmkdepimconfig.cpp | 17 | ||||
-rw-r--r-- | libkdepim/kcmconfigs/kcmkdepimconfig.h | 2 | ||||
-rw-r--r-- | libkdepim/kcmconfigs/kdepimconfigwidget.cpp | 313 | ||||
-rw-r--r-- | libkdepim/kcmconfigs/kdepimconfigwidget.h | 45 | ||||
-rw-r--r-- | libkdepim/kpimglobalprefs.cpp | 21 | ||||
-rw-r--r-- | libkdepim/kpimglobalprefs.h | 15 | ||||
-rw-r--r-- | libkdepim/kpimprefs.cpp | 6 | ||||
-rw-r--r-- | libkdepim/kpimprefs.h | 2 | ||||
-rw-r--r-- | libkdepim/kprefsdialog.cpp | 106 | ||||
-rw-r--r-- | libkdepim/kprefsdialog.h | 70 | ||||
-rw-r--r-- | libkdepim/libkdepimE.pro | 2 |
11 files changed, 410 insertions, 189 deletions
diff --git a/libkdepim/kcmconfigs/kcmkdepimconfig.cpp b/libkdepim/kcmconfigs/kcmkdepimconfig.cpp index f26efe0..e77c5ab 100644 --- a/libkdepim/kcmconfigs/kcmkdepimconfig.cpp +++ b/libkdepim/kcmconfigs/kcmkdepimconfig.cpp | |||
@@ -41,39 +41,40 @@ $Id$ | |||
41 | #include "kprefs.h" | 41 | #include "kprefs.h" |
42 | #include "kpimglobalprefs.h" | 42 | #include "kpimglobalprefs.h" |
43 | 43 | ||
44 | #ifndef _WIN32_ | 44 | #ifndef _WIN32_ |
45 | extern "C" | 45 | extern "C" |
46 | { | 46 | { |
47 | KCModule *create_kabconfig( KPimGlobalPrefs* prefs, QWidget *parent, const char * ) { | 47 | KCModule *create_kabconfig(QWidget *parent, const char * ) { |
48 | return new KCMKdePimConfig( prefs, parent, "kcmkdepimconfig" ); | 48 | return new KCMKdePimConfig(parent, "kcmkdepimconfig" ); |
49 | } | 49 | } |
50 | } | 50 | } |
51 | #endif | 51 | #endif |
52 | 52 | ||
53 | KCMKdePimConfig::KCMKdePimConfig( KPimGlobalPrefs* prefs, QWidget *parent, const char *name ) | 53 | KCMKdePimConfig::KCMKdePimConfig(QWidget *parent, const char *name ) |
54 | : KCModule( prefs, parent, name ) | 54 | : KCModule( KPimGlobalPrefs::instance(), parent, name ) |
55 | { | 55 | { |
56 | //abort(); | 56 | //abort(); |
57 | QVBoxLayout *layout = new QVBoxLayout( this ); | 57 | QVBoxLayout *layout = new QVBoxLayout( this ); |
58 | mConfigWidget = new KDEPIMConfigWidget( this, "mConfigWidget" ); | 58 | mConfigWidget = new KDEPIMConfigWidget( (KPimGlobalPrefs*)getPreferences(), this, "KDEPIMConfigWidget" ); |
59 | layout->addWidget( mConfigWidget ); | 59 | layout->addWidget( mConfigWidget ); |
60 | layout->setSpacing( 0 ); | 60 | layout->setSpacing( 0 ); |
61 | layout->setMargin( 0 ); | 61 | layout->setMargin( 0 ); |
62 | 62 | ||
63 | connect( mConfigWidget, SIGNAL( changed( bool ) ), SIGNAL( changed( bool ) ) ); | 63 | connect( mConfigWidget, SIGNAL( changed( bool ) ), SIGNAL( changed( bool ) ) ); |
64 | } | 64 | } |
65 | 65 | ||
66 | void KCMKdePimConfig::load() | 66 | void KCMKdePimConfig::load() |
67 | { | 67 | { |
68 | mConfigWidget->restoreSettings((KPimGlobalPrefs*)getPreferences()); | 68 | mConfigWidget->readConfig(); |
69 | } | 69 | } |
70 | 70 | ||
71 | void KCMKdePimConfig::save() | 71 | void KCMKdePimConfig::save() |
72 | { | 72 | { |
73 | mConfigWidget->saveSettings((KPimGlobalPrefs*)getPreferences()); | 73 | mConfigWidget->writeConfig(); |
74 | } | 74 | } |
75 | 75 | ||
76 | void KCMKdePimConfig::defaults() | 76 | void KCMKdePimConfig::defaults() |
77 | { | 77 | { |
78 | mConfigWidget->defaults((KPimGlobalPrefs*)getPreferences()); | 78 | qDebug("KCMKdePimConfig::defaults()"); |
79 | mConfigWidget->setDefaults(); | ||
79 | } | 80 | } |
diff --git a/libkdepim/kcmconfigs/kcmkdepimconfig.h b/libkdepim/kcmconfigs/kcmkdepimconfig.h index fa96eda..b471e53 100644 --- a/libkdepim/kcmconfigs/kcmkdepimconfig.h +++ b/libkdepim/kcmconfigs/kcmkdepimconfig.h | |||
@@ -38,13 +38,13 @@ class KPimGlobalPrefs; | |||
38 | 38 | ||
39 | class KCMKdePimConfig : public KCModule | 39 | class KCMKdePimConfig : public KCModule |
40 | { | 40 | { |
41 | Q_OBJECT | 41 | Q_OBJECT |
42 | 42 | ||
43 | public: | 43 | public: |
44 | KCMKdePimConfig( KPimGlobalPrefs* prefs, QWidget *parent = 0, const char *name = 0 ); | 44 | KCMKdePimConfig( QWidget *parent = 0, const char *name = 0 ); |
45 | 45 | ||
46 | virtual void load(); | 46 | virtual void load(); |
47 | virtual void save(); | 47 | virtual void save(); |
48 | virtual void defaults(); | 48 | virtual void defaults(); |
49 | 49 | ||
50 | private: | 50 | private: |
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp index 703aeb1..00a07d9 100644 --- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp +++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp | |||
@@ -31,17 +31,19 @@ $Id$ | |||
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 <qfile.h> | 38 | #include <qfile.h> |
38 | 39 | ||
39 | #include <kdialog.h> | 40 | #include <kdialog.h> |
40 | #include <klocale.h> | 41 | #include <klocale.h> |
41 | 42 | #include <kdateedit.h> | |
43 | #include <kglobal.h> | ||
42 | #include <stdlib.h> | 44 | #include <stdlib.h> |
43 | 45 | ||
44 | /*US | 46 | /*US |
45 | #include <qcheckbox.h> | 47 | #include <qcheckbox.h> |
46 | #include <qframe.h> | 48 | #include <qframe.h> |
47 | #include <qpushbutton.h> | 49 | #include <qpushbutton.h> |
@@ -68,37 +70,46 @@ $Id$ | |||
68 | 70 | ||
69 | #include "addresseewidget.h" | 71 | #include "addresseewidget.h" |
70 | #include "extensionconfigdialog.h" | 72 | #include "extensionconfigdialog.h" |
71 | #include "extensionwidget.h" | 73 | #include "extensionwidget.h" |
72 | */ | 74 | */ |
73 | 75 | ||
76 | #include "qapplication.h" | ||
77 | |||
74 | #include "kpimglobalprefs.h" | 78 | #include "kpimglobalprefs.h" |
75 | 79 | ||
76 | #include "kdepimconfigwidget.h" | 80 | #include "kdepimconfigwidget.h" |
77 | 81 | ||
78 | 82 | ||
79 | KDEPIMConfigWidget::KDEPIMConfigWidget( QWidget *parent, const char *name ) | 83 | KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name ) |
80 | : QWidget( parent, name ) | 84 | : KPrefsWidget(prefs, parent, name ) |
81 | { | 85 | { |
82 | mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email")); | 86 | mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email")); |
83 | mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone")); | 87 | mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone")); |
84 | mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS")); | 88 | mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS")); |
85 | mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax")); | 89 | mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax")); |
86 | mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager")); | 90 | mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager")); |
87 | mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP")); | 91 | mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP")); |
88 | 92 | ||
89 | 93 | ||
90 | QVBoxLayout *topLayout = new QVBoxLayout( this, 0, | 94 | QVBoxLayout *topLayout = new QVBoxLayout( this, 0, |
91 | KDialog::spacingHint() ); | 95 | KDialog::spacingHint() ); |
92 | 96 | ||
93 | QTabWidget *tabWidget = new QTabWidget( this ); | 97 | tabWidget = new QTabWidget( this ); |
94 | topLayout->addWidget( tabWidget ); | 98 | topLayout->addWidget( tabWidget ); |
95 | 99 | ||
96 | 100 | ||
101 | setupLocaleTab(); | ||
102 | setupLocaleDateTab(); | ||
103 | setupTimeZoneTab(); | ||
104 | setupExternalAppTab(); | ||
105 | |||
106 | } | ||
97 | 107 | ||
98 | // mailclient page | 108 | void KDEPIMConfigWidget::setupExternalAppTab() |
109 | { | ||
99 | QWidget *externalAppsPage = new QWidget( this ); | 110 | QWidget *externalAppsPage = new QWidget( this ); |
100 | QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(), | 111 | QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(), |
101 | KDialog::spacingHintSmall() ); | 112 | KDialog::spacingHintSmall() ); |
102 | 113 | ||
103 | mExternalApps = new QComboBox( externalAppsPage ); | 114 | mExternalApps = new QComboBox( externalAppsPage ); |
104 | 115 | ||
@@ -109,14 +120,12 @@ KDEPIMConfigWidget::KDEPIMConfigWidget( QWidget *parent, const char *name ) | |||
109 | layout->addWidget( mExternalApps ); | 120 | layout->addWidget( mExternalApps ); |
110 | 121 | ||
111 | connect( mExternalApps, SIGNAL( activated( int ) ), | 122 | connect( mExternalApps, SIGNAL( activated( int ) ), |
112 | this, SLOT (externalapp_changed( int ) ) ); | 123 | this, SLOT (externalapp_changed( int ) ) ); |
113 | 124 | ||
114 | 125 | ||
115 | |||
116 | |||
117 | mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage ); | 126 | mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage ); |
118 | QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" ); | 127 | QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" ); |
119 | 128 | ||
120 | 129 | ||
121 | mClient = new QComboBox( mExternalAppGroupBox ); | 130 | mClient = new QComboBox( mExternalAppGroupBox ); |
122 | boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 ); | 131 | boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 ); |
@@ -165,18 +174,188 @@ KDEPIMConfigWidget::KDEPIMConfigWidget( QWidget *parent, const char *name ) | |||
165 | connect( mMessage, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); | 174 | connect( mMessage, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); |
166 | connect( mParameters, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); | 175 | connect( mParameters, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); |
167 | connect( mMessage2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); | 176 | connect( mMessage2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); |
168 | connect( mParameters2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); | 177 | connect( mParameters2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); |
169 | 178 | ||
170 | 179 | ||
171 | |||
172 | layout->addWidget( mExternalAppGroupBox ); | 180 | layout->addWidget( mExternalAppGroupBox ); |
173 | tabWidget->addTab( externalAppsPage, i18n( "External Apps." ) ); | 181 | tabWidget->addTab( externalAppsPage, i18n( "External Apps." ) ); |
174 | 182 | ||
175 | } | 183 | } |
176 | 184 | ||
185 | |||
186 | void KDEPIMConfigWidget::setupLocaleDateTab() | ||
187 | { | ||
188 | QWidget *topFrame = new QWidget( this ); | ||
189 | QGridLayout *topLayout = new QGridLayout( topFrame, 3, 2); | ||
190 | |||
191 | topLayout->setSpacing(KDialog::spacingHint()); | ||
192 | topLayout->setMargin(KDialog::marginHint()); | ||
193 | int iii = 0; | ||
194 | |||
195 | |||
196 | KPrefsWidRadios *syncPrefsGroup = | ||
197 | addWidRadios(i18n("Date Format:"),&(KPimGlobalPrefs::instance()->mPreferredDate),topFrame); | ||
198 | QString format; | ||
199 | if ( QApplication::desktop()->width() < 480 ) | ||
200 | format = "(%d.%m.%Y)"; | ||
201 | else | ||
202 | format = "(%d.%m.%Y|%A %d %B %Y)"; | ||
203 | syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); | ||
204 | if ( QApplication::desktop()->width() < 480 ) | ||
205 | format = "(%m.%d.%Y)"; | ||
206 | else | ||
207 | format = "(%m.%d.%Y|%A %B %d %Y)"; | ||
208 | syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); | ||
209 | if ( QApplication::desktop()->width() < 480 ) | ||
210 | format = "(%Y-%m-%d)"; | ||
211 | else | ||
212 | format = "(%Y-%m-%d|%A %Y %B %d)"; | ||
213 | syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); | ||
214 | syncPrefsGroup->addRadio(i18n("User defined")); | ||
215 | topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); | ||
216 | ++iii; | ||
217 | ++iii; | ||
218 | QLabel * lab; | ||
219 | mUserDateFormatLong = new QLineEdit(topFrame); | ||
220 | lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); | ||
221 | topLayout->addWidget(lab ,iii,0); | ||
222 | topLayout->addWidget(mUserDateFormatLong,iii,1); | ||
223 | ++iii; | ||
224 | mUserDateFormatShort = new QLineEdit(topFrame); | ||
225 | lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); | ||
226 | topLayout->addWidget(lab ,iii,0); | ||
227 | topLayout->addWidget(mUserDateFormatShort,iii,1); | ||
228 | ++iii; | ||
229 | lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); | ||
230 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); | ||
231 | ++iii; | ||
232 | lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); | ||
233 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); | ||
234 | ++iii; | ||
235 | lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); | ||
236 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); | ||
237 | ++iii; | ||
238 | |||
239 | connect( mUserDateFormatLong, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); | ||
240 | connect( mUserDateFormatShort, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); | ||
241 | |||
242 | |||
243 | tabWidget->addTab( topFrame, i18n( "Date Format" ) ); | ||
244 | } | ||
245 | |||
246 | void KDEPIMConfigWidget::setupLocaleTab() | ||
247 | { | ||
248 | |||
249 | QWidget *topFrame = new QWidget( this ); | ||
250 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); | ||
251 | |||
252 | topLayout->setSpacing(KDialog::spacingHint()); | ||
253 | topLayout->setMargin(KDialog::marginHint()); | ||
254 | int iii = 0; | ||
255 | KPrefsWidRadios *syncPrefsGroup = | ||
256 | addWidRadios(i18n("Language:(needs restart)"),&(KPimGlobalPrefs::instance()->mPreferredLanguage),topFrame); | ||
257 | syncPrefsGroup->addRadio(i18n("English")); | ||
258 | syncPrefsGroup->addRadio(i18n("German")); | ||
259 | syncPrefsGroup->addRadio(i18n("French")); | ||
260 | syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); | ||
261 | if ( QApplication::desktop()->width() < 300 ) | ||
262 | ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); | ||
263 | topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); | ||
264 | ++iii; | ||
265 | |||
266 | syncPrefsGroup = | ||
267 | addWidRadios(i18n("Time Format(nr):"),&(KPimGlobalPrefs::instance()->mPreferredTime),topFrame); | ||
268 | if ( QApplication::desktop()->width() > 300 ) | ||
269 | syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical); | ||
270 | syncPrefsGroup->addRadio(i18n("24:00")); | ||
271 | syncPrefsGroup->addRadio(i18n("12:00am")); | ||
272 | syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical); | ||
273 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); | ||
274 | ++iii; | ||
275 | |||
276 | KPrefsWidBool *sb = addWidBool(i18n("Week starts on Sunday"), | ||
277 | &(KPimGlobalPrefs::instance()->mWeekStartsOnSunday),topFrame); | ||
278 | topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); | ||
279 | ++iii; | ||
280 | |||
281 | |||
282 | tabWidget->addTab( topFrame, i18n( "Locale" ) ); | ||
283 | |||
284 | } | ||
285 | |||
286 | |||
287 | void KDEPIMConfigWidget::setupTimeZoneTab() | ||
288 | { | ||
289 | QWidget *topFrame = new QWidget( this ); | ||
290 | QGridLayout *topLayout = new QGridLayout( topFrame, 5, 2); | ||
291 | topLayout->setSpacing(KDialog::spacingHint()); | ||
292 | topLayout->setMargin(KDialog::marginHint()); | ||
293 | |||
294 | QHBox *timeZoneBox = new QHBox( topFrame ); | ||
295 | topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 ); | ||
296 | |||
297 | new QLabel( i18n("Timezone:"), timeZoneBox ); | ||
298 | mTimeZoneCombo = new QComboBox( timeZoneBox ); | ||
299 | if ( QApplication::desktop()->width() < 300 ) { | ||
300 | mTimeZoneCombo->setMaximumWidth(150); | ||
301 | } | ||
302 | |||
303 | QStringList list; | ||
304 | list = KGlobal::locale()->timeZoneList(); | ||
305 | mTimeZoneCombo->insertStringList(list); | ||
306 | |||
307 | // find the currently set time zone and select it | ||
308 | QString sCurrentlySet = KPimGlobalPrefs::instance()->mTimeZoneId; | ||
309 | int nCurrentlySet = 11; | ||
310 | for (int i = 0; i < mTimeZoneCombo->count(); i++) | ||
311 | { | ||
312 | if (mTimeZoneCombo->text(i) == sCurrentlySet) | ||
313 | { | ||
314 | nCurrentlySet = i; | ||
315 | break; | ||
316 | } | ||
317 | } | ||
318 | mTimeZoneCombo->setCurrentItem(nCurrentlySet); | ||
319 | int iii = 1; | ||
320 | KPrefsWidBool *sb = | ||
321 | addWidBool(i18n("Timezone has daylight saving"), | ||
322 | &(KPimGlobalPrefs::instance()->mUseDaylightsaving),topFrame); | ||
323 | topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); | ||
324 | ++iii; | ||
325 | QLabel* lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame ); | ||
326 | topLayout->addMultiCellWidget(lab, iii,iii,0,1); | ||
327 | ++iii; | ||
328 | lab = new QLabel( i18n("The year in the date is ignored."), topFrame ); | ||
329 | topLayout->addMultiCellWidget(lab, iii,iii,0,1); | ||
330 | ++iii; | ||
331 | lab = new QLabel( i18n("Daylight start:"), topFrame ); | ||
332 | topLayout->addWidget(lab, iii,0); | ||
333 | mStartDateSavingEdit = new KDateEdit(topFrame); | ||
334 | topLayout->addWidget(mStartDateSavingEdit, iii,1); | ||
335 | ++iii; | ||
336 | |||
337 | lab = new QLabel( i18n("Daylight end:"), topFrame ); | ||
338 | topLayout->addWidget(lab, iii,0); | ||
339 | mEndDateSavingEdit = new KDateEdit(topFrame); | ||
340 | topLayout->addWidget(mEndDateSavingEdit, iii,1); | ||
341 | ++iii; | ||
342 | QDate current ( 2001, 1,1); | ||
343 | mStartDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingStart-1)); | ||
344 | mEndDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingEnd-1)); | ||
345 | |||
346 | connect( mStartDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) ); | ||
347 | connect( mEndDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) ); | ||
348 | connect( mTimeZoneCombo, SIGNAL( activated( int ) ), this, SLOT (modified() ) ); | ||
349 | |||
350 | |||
351 | |||
352 | tabWidget->addTab( topFrame, i18n( "Time Zone" ) ); | ||
353 | |||
354 | } | ||
355 | |||
177 | void KDEPIMConfigWidget::externalapp_changed( int newApp ) | 356 | void KDEPIMConfigWidget::externalapp_changed( int newApp ) |
178 | { | 357 | { |
179 | // first store the current data | 358 | // first store the current data |
180 | saveEditFieldSettings(); | 359 | saveEditFieldSettings(); |
181 | 360 | ||
182 | // set mCurrentApp | 361 | // set mCurrentApp |
@@ -225,13 +404,13 @@ void KDEPIMConfigWidget::client_changed( int newClient ) | |||
225 | //then reset the clientvariable | 404 | //then reset the clientvariable |
226 | mCurrentClient = newClient; | 405 | mCurrentClient = newClient; |
227 | 406 | ||
228 | // and at last update the widgets | 407 | // and at last update the widgets |
229 | updateClientWidgets(); | 408 | updateClientWidgets(); |
230 | 409 | ||
231 | modified(); | 410 | KPrefsWidget::modified(); |
232 | } | 411 | } |
233 | 412 | ||
234 | void KDEPIMConfigWidget::saveEditFieldSettings() | 413 | void KDEPIMConfigWidget::saveEditFieldSettings() |
235 | { | 414 | { |
236 | 415 | ||
237 | switch(mCurrentApp) | 416 | switch(mCurrentApp) |
@@ -441,20 +620,32 @@ void KDEPIMConfigWidget::updateClientWidgets() | |||
441 | 620 | ||
442 | 621 | ||
443 | blockSignals( blocked ); | 622 | blockSignals( blocked ); |
444 | 623 | ||
445 | } | 624 | } |
446 | 625 | ||
447 | 626 | void KDEPIMConfigWidget::usrReadConfig() | |
448 | |||
449 | |||
450 | void KDEPIMConfigWidget::restoreSettings(KPimGlobalPrefs* prefs) | ||
451 | { | 627 | { |
628 | KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance(); | ||
629 | |||
452 | bool blocked = signalsBlocked(); | 630 | bool blocked = signalsBlocked(); |
453 | blockSignals( true ); | 631 | blockSignals( true ); |
454 | 632 | ||
633 | QString dummy = prefs->mUserDateFormatLong; | ||
634 | mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") )); | ||
635 | dummy = prefs->mUserDateFormatShort; | ||
636 | mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") )); | ||
637 | |||
638 | QDate current ( 2001, 1,1); | ||
639 | mStartDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingStart-1)); | ||
640 | mEndDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingEnd-1)); | ||
641 | setCombo(mTimeZoneCombo,i18n(prefs->mTimeZoneId)); | ||
642 | |||
643 | |||
644 | |||
645 | |||
455 | mEmailClient = prefs->mEmailClient; | 646 | mEmailClient = prefs->mEmailClient; |
456 | mEmailOtherChannel = prefs->mEmailOtherChannel; | 647 | mEmailOtherChannel = prefs->mEmailOtherChannel; |
457 | mEmailOtherMessage = prefs->mEmailOtherMessage; | 648 | mEmailOtherMessage = prefs->mEmailOtherMessage; |
458 | mEmailOtherMessageParameters = prefs->mEmailOtherMessageParameters; | 649 | mEmailOtherMessageParameters = prefs->mEmailOtherMessageParameters; |
459 | mEmailOtherMessage2 = prefs->mEmailOtherMessage2; | 650 | mEmailOtherMessage2 = prefs->mEmailOtherMessage2; |
460 | mEmailOtherMessageParameters2 = prefs->mEmailOtherMessageParameters2; | 651 | mEmailOtherMessageParameters2 = prefs->mEmailOtherMessageParameters2; |
@@ -488,20 +679,39 @@ void KDEPIMConfigWidget::restoreSettings(KPimGlobalPrefs* prefs) | |||
488 | mCurrentClient = mEmailClient; | 679 | mCurrentClient = mEmailClient; |
489 | 680 | ||
490 | updateClientWidgets(); | 681 | updateClientWidgets(); |
491 | 682 | ||
492 | blockSignals( blocked ); | 683 | blockSignals( blocked ); |
493 | 684 | ||
494 | emit changed( false ); | ||
495 | |||
496 | } | 685 | } |
497 | 686 | ||
498 | void KDEPIMConfigWidget::saveSettings(KPimGlobalPrefs* prefs) | 687 | void KDEPIMConfigWidget::usrWriteConfig() |
499 | { | 688 | { |
689 | KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance(); | ||
690 | |||
500 | saveEditFieldSettings(); | 691 | saveEditFieldSettings(); |
501 | 692 | ||
693 | |||
694 | prefs->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") ); | ||
695 | prefs->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") ); | ||
696 | |||
697 | prefs->mTimeZoneId = mTimeZoneCombo->currentText(); | ||
698 | QDate date; | ||
699 | date = mStartDateSavingEdit->date(); | ||
700 | int sub = 0; | ||
701 | if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) | ||
702 | sub = 1; | ||
703 | prefs->mDaylightsavingStart = date.dayOfYear()-sub; | ||
704 | date = mEndDateSavingEdit->date(); | ||
705 | if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) | ||
706 | sub = 1; | ||
707 | else | ||
708 | sub = 0; | ||
709 | prefs->mDaylightsavingEnd = date.dayOfYear()-sub; | ||
710 | |||
711 | |||
502 | prefs->mEmailClient = mEmailClient; | 712 | prefs->mEmailClient = mEmailClient; |
503 | prefs->mEmailOtherChannel = mEmailOtherChannel; | 713 | prefs->mEmailOtherChannel = mEmailOtherChannel; |
504 | prefs->mEmailOtherMessage = mEmailOtherMessage; | 714 | prefs->mEmailOtherMessage = mEmailOtherMessage; |
505 | prefs->mEmailOtherMessageParameters = mEmailOtherMessageParameters; | 715 | prefs->mEmailOtherMessageParameters = mEmailOtherMessageParameters; |
506 | prefs->mEmailOtherMessage2 = mEmailOtherMessage2; | 716 | prefs->mEmailOtherMessage2 = mEmailOtherMessage2; |
507 | prefs->mEmailOtherMessageParameters2 = mEmailOtherMessageParameters2; | 717 | prefs->mEmailOtherMessageParameters2 = mEmailOtherMessageParameters2; |
@@ -529,76 +739,33 @@ void KDEPIMConfigWidget::saveSettings(KPimGlobalPrefs* prefs) | |||
529 | 739 | ||
530 | prefs->mSipClient = mSipClient; | 740 | prefs->mSipClient = mSipClient; |
531 | prefs->mSipOtherChannel = mSipOtherChannel; | 741 | prefs->mSipOtherChannel = mSipOtherChannel; |
532 | prefs->mSipOtherMessage = mSipOtherMessage; | 742 | prefs->mSipOtherMessage = mSipOtherMessage; |
533 | prefs->mSipOtherMessageParameters = mSipOtherMessageParameters; | 743 | prefs->mSipOtherMessageParameters = mSipOtherMessageParameters; |
534 | 744 | ||
535 | prefs->writeConfig(); | ||
536 | |||
537 | //release the cache that other views can access the changed values instantanious | 745 | //release the cache that other views can access the changed values instantanious |
538 | ExternalAppHandler::instance()->loadConfig(); | 746 | ExternalAppHandler::instance()->loadConfig(); |
539 | 747 | ||
540 | emit changed( false ); | ||
541 | } | 748 | } |
542 | 749 | ||
543 | void KDEPIMConfigWidget::defaults(KPimGlobalPrefs* prefs) | ||
544 | { | ||
545 | |||
546 | DefaultAppItem* dai = ExternalAppHandler::instance()->getDefaultItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::NONE_EMC); | ||
547 | |||
548 | mEmailClient = dai->_id; | ||
549 | mEmailOtherChannel = dai->_channel; | ||
550 | mEmailOtherMessage = dai->_message; | ||
551 | mEmailOtherMessageParameters = dai->_parameters; | ||
552 | mEmailOtherMessage2 = dai->_message2; | ||
553 | mEmailOtherMessageParameters2 = dai->_parameters2; | ||
554 | |||
555 | |||
556 | dai = ExternalAppHandler::instance()->getDefaultItem(ExternalAppHandler::PHONE, KPimGlobalPrefs::NONE_PHC); | ||
557 | |||
558 | mPhoneClient = dai->_id; | ||
559 | mPhoneOtherChannel = dai->_channel; | ||
560 | mPhoneOtherMessage = dai->_message; | ||
561 | mPhoneOtherMessageParameters = dai->_parameters; | ||
562 | |||
563 | dai = ExternalAppHandler::instance()->getDefaultItem(ExternalAppHandler::FAX, KPimGlobalPrefs::NONE_FAC); | ||
564 | |||
565 | mFaxClient = dai->_id; | ||
566 | mFaxOtherChannel = dai->_channel; | ||
567 | mFaxOtherMessage = dai->_message; | ||
568 | mFaxOtherMessageParameters = dai->_parameters; | ||
569 | 750 | ||
570 | dai = ExternalAppHandler::instance()->getDefaultItem(ExternalAppHandler::SMS, KPimGlobalPrefs::NONE_SMC); | 751 | void KDEPIMConfigWidget::setCombo(QComboBox *combo, const QString & text, |
571 | 752 | const QStringList *tags) | |
572 | mSMSClient = dai->_id; | ||
573 | mSMSOtherChannel = dai->_channel; | ||
574 | mSMSOtherMessage = dai->_message; | ||
575 | mSMSOtherMessageParameters = dai->_parameters; | ||
576 | |||
577 | dai = ExternalAppHandler::instance()->getDefaultItem(ExternalAppHandler::PAGER, KPimGlobalPrefs::NONE_PAC); | ||
578 | |||
579 | mPagerClient = dai->_id; | ||
580 | mPagerOtherChannel = dai->_channel; | ||
581 | mPagerOtherMessage = dai->_message; | ||
582 | mPagerOtherMessageParameters = dai->_parameters; | ||
583 | |||
584 | |||
585 | dai = ExternalAppHandler::instance()->getDefaultItem(ExternalAppHandler::SIP, KPimGlobalPrefs::NONE_SIC); | ||
586 | |||
587 | mSipClient = dai->_id; | ||
588 | mSipOtherChannel = dai->_channel; | ||
589 | mSipOtherMessage = dai->_message; | ||
590 | mSipOtherMessageParameters = dai->_parameters; | ||
591 | |||
592 | |||
593 | emit changed( true ); | ||
594 | } | ||
595 | |||
596 | void KDEPIMConfigWidget::modified() | ||
597 | { | 753 | { |
598 | emit changed( true ); | 754 | if (tags) { |
755 | int i = tags->findIndex(text); | ||
756 | if (i > 0) combo->setCurrentItem(i); | ||
757 | } else { | ||
758 | for(int i=0;i<combo->count();++i) { | ||
759 | if (combo->text(i) == text) { | ||
760 | combo->setCurrentItem(i); | ||
761 | break; | ||
762 | } | ||
763 | } | ||
764 | } | ||
599 | } | 765 | } |
600 | 766 | ||
767 | |||
601 | void KDEPIMConfigWidget::textChanged( const QString& text ) | 768 | void KDEPIMConfigWidget::textChanged( const QString& text ) |
602 | { | 769 | { |
603 | emit changed( true ); | 770 | emit changed( true ); |
604 | } | 771 | } |
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.h b/libkdepim/kcmconfigs/kdepimconfigwidget.h index e3cfd81..6f26513 100644 --- a/libkdepim/kcmconfigs/kdepimconfigwidget.h +++ b/libkdepim/kcmconfigs/kdepimconfigwidget.h | |||
@@ -28,61 +28,70 @@ Copyright (c) 2004 Ulf Schenk | |||
28 | $Id$ | 28 | $Id$ |
29 | */ | 29 | */ |
30 | 30 | ||
31 | #ifndef KDEPIMCONFIGWIDGET_H | 31 | #ifndef KDEPIMCONFIGWIDGET_H |
32 | #define KDEPIMCONFIGWIDGET_H | 32 | #define KDEPIMCONFIGWIDGET_H |
33 | 33 | ||
34 | #include <qwidget.h> | 34 | #include <kprefswidget.h> |
35 | #include <qmap.h> | 35 | #include <qmap.h> |
36 | 36 | ||
37 | #include "externalapphandler.h" | 37 | #include "externalapphandler.h" |
38 | 38 | ||
39 | 39 | ||
40 | /* | ||
41 | class QCheckBox; | ||
42 | class QListViewItem; | ||
43 | class QPushButton; | ||
44 | class KListView; | ||
45 | */ | ||
46 | class QComboBox; | 40 | class QComboBox; |
47 | class QLineEdit; | 41 | class QLineEdit; |
48 | class KPimGlobalPrefs; | 42 | class KPimGlobalPrefs; |
49 | class QGroupBox; | 43 | class QGroupBox; |
44 | class QTabWidget; | ||
45 | class KDateEdit; | ||
50 | 46 | ||
51 | class KDEPIMConfigWidget : public QWidget | 47 | class KDEPIMConfigWidget : public KPrefsWidget |
52 | { | 48 | { |
53 | Q_OBJECT | 49 | Q_OBJECT |
54 | 50 | ||
55 | public: | 51 | public: |
56 | KDEPIMConfigWidget( QWidget *parent, const char *name = 0 ); | 52 | KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name = 0 ); |
57 | |||
58 | void restoreSettings(KPimGlobalPrefs* prefs); | ||
59 | void saveSettings(KPimGlobalPrefs* prefs); | ||
60 | void defaults(KPimGlobalPrefs* prefs); | ||
61 | |||
62 | signals: | ||
63 | void changed( bool ); | ||
64 | |||
65 | 53 | ||
66 | public slots: | 54 | public slots: |
67 | void modified(); | ||
68 | void textChanged( const QString& text ); | 55 | void textChanged( const QString& text ); |
69 | 56 | ||
57 | protected: | ||
58 | /** Implement this to read custom configuration widgets. */ | ||
59 | virtual void usrReadConfig(); | ||
60 | /** Implement this to write custom configuration widgets. */ | ||
61 | virtual void usrWriteConfig(); | ||
70 | 62 | ||
71 | 63 | ||
72 | private slots: | 64 | private slots: |
73 | // void configureExtension(); | 65 | // void configureExtension(); |
74 | // void selectionChanged( QListViewItem* ); | 66 | // void selectionChanged( QListViewItem* ); |
75 | // void itemClicked( QListViewItem* ); | 67 | // void itemClicked( QListViewItem* ); |
76 | void client_changed( int newClient ); | 68 | void client_changed( int newClient ); |
77 | void externalapp_changed( int newApp ); | 69 | void externalapp_changed( int newApp ); |
78 | 70 | ||
79 | private: | 71 | private: |
72 | void setupExternalAppTab(); | ||
73 | void setupLocaleDateTab(); | ||
74 | void setupLocaleTab(); | ||
75 | void setupTimeZoneTab(); | ||
76 | |||
77 | void setCombo(QComboBox *combo,const QString & text, const QStringList *tags = 0); | ||
78 | |||
79 | |||
80 | void saveEditFieldSettings(); | 80 | void saveEditFieldSettings(); |
81 | void updateClientWidgets(); | 81 | void updateClientWidgets(); |
82 | 82 | ||
83 | QTabWidget *tabWidget; | ||
84 | |||
85 | |||
86 | QLineEdit* mUserDateFormatShort; | ||
87 | QLineEdit* mUserDateFormatLong; | ||
88 | QComboBox* mTimeZoneCombo; | ||
89 | KDateEdit* mStartDateSavingEdit; | ||
90 | KDateEdit* mEndDateSavingEdit; | ||
91 | |||
83 | // void restoreExtensionSettings(); | 92 | // void restoreExtensionSettings(); |
84 | // void saveExtensionSettings(); | 93 | // void saveExtensionSettings(); |
85 | 94 | ||
86 | // KListView *mExtensionView; | 95 | // KListView *mExtensionView; |
87 | 96 | ||
88 | // QCheckBox *mNameParsing; | 97 | // QCheckBox *mNameParsing; |
diff --git a/libkdepim/kpimglobalprefs.cpp b/libkdepim/kpimglobalprefs.cpp index eb8f1de..12a503d 100644 --- a/libkdepim/kpimglobalprefs.cpp +++ b/libkdepim/kpimglobalprefs.cpp | |||
@@ -40,12 +40,33 @@ KPimGlobalPrefs *KPimGlobalPrefs::sInstance = 0; | |||
40 | static KStaticDeleter<KPimGlobalPrefs> staticDeleter; | 40 | static KStaticDeleter<KPimGlobalPrefs> staticDeleter; |
41 | 41 | ||
42 | 42 | ||
43 | KPimGlobalPrefs::KPimGlobalPrefs( const QString &name ) | 43 | KPimGlobalPrefs::KPimGlobalPrefs( const QString &name ) |
44 | : KPrefs("microkdeglobalrc") | 44 | : KPrefs("microkdeglobalrc") |
45 | { | 45 | { |
46 | |||
47 | KPrefs::setCurrentGroup("Locale"); | ||
48 | addItemInt("PreferredLanguage",&mPreferredLanguage,0); | ||
49 | addItemInt("PreferredTime",&mPreferredTime,0); | ||
50 | addItemInt("PreferredDate",&mPreferredDate,0); | ||
51 | addItemBool("WeekStartsOnSunday",&mWeekStartsOnSunday,false); | ||
52 | //addItemBool("QuickSavingWOUnicode",&mUseQuicksave,false); | ||
53 | // addItemBool("ShortDateInViewer",&mShortDateInViewer,false); | ||
54 | addItemString("UserDateFormatLong", &mUserDateFormatLong, "%A %d %b %y"); | ||
55 | addItemString("UserDateFormatShort", &mUserDateFormatShort, "%aK %d.%m.%y"); | ||
56 | |||
57 | KPrefs::setCurrentGroup("Time & Date"); | ||
58 | |||
59 | addItemString("TimeZoneName",&mTimeZoneId,i18n ("+01:00 Europe/Oslo(CET)") ); | ||
60 | addItemBool("UseDaylightsaving",&mUseDaylightsaving,true); | ||
61 | addItemInt("DaylightsavingStart",&mDaylightsavingStart,90); | ||
62 | addItemInt("DaylightsavingEnd",&mDaylightsavingEnd,304); | ||
63 | |||
64 | |||
65 | |||
66 | |||
46 | KPrefs::setCurrentGroup( "ExternalApplications" ); | 67 | KPrefs::setCurrentGroup( "ExternalApplications" ); |
47 | 68 | ||
48 | addItemInt( "EmailChannelType", &mEmailClient, OMPI_EMC ); | 69 | addItemInt( "EmailChannelType", &mEmailClient, OMPI_EMC ); |
49 | addItemString( "EmailChannel", &mEmailOtherChannel, "" ); | 70 | addItemString( "EmailChannel", &mEmailOtherChannel, "" ); |
50 | addItemString( "EmailChannelMessage", &mEmailOtherMessage, "" ); | 71 | addItemString( "EmailChannelMessage", &mEmailOtherMessage, "" ); |
51 | addItemString( "EmailChannelParameters", &mEmailOtherMessageParameters, "" ); | 72 | addItemString( "EmailChannelParameters", &mEmailOtherMessageParameters, "" ); |
diff --git a/libkdepim/kpimglobalprefs.h b/libkdepim/kpimglobalprefs.h index 8bd543d..dad78e6 100644 --- a/libkdepim/kpimglobalprefs.h +++ b/libkdepim/kpimglobalprefs.h | |||
@@ -81,12 +81,27 @@ class KPimGlobalPrefs : public KPrefs | |||
81 | KPimGlobalPrefs( const QString &name = QString::null ); | 81 | KPimGlobalPrefs( const QString &name = QString::null ); |
82 | 82 | ||
83 | static KPimGlobalPrefs *sInstance; | 83 | static KPimGlobalPrefs *sInstance; |
84 | 84 | ||
85 | 85 | ||
86 | public: | 86 | public: |
87 | //US I copied the following "locale" settings from KOPrefs | ||
88 | int mPreferredDate; | ||
89 | QString mUserDateFormatLong; | ||
90 | QString mUserDateFormatShort; | ||
91 | int mPreferredLanguage; | ||
92 | int mPreferredTime; | ||
93 | bool mWeekStartsOnSunday; | ||
94 | QString mTimeZoneId; | ||
95 | bool mUseDaylightsaving; | ||
96 | int mDaylightsavingStart; | ||
97 | int mDaylightsavingEnd; | ||
98 | |||
99 | |||
100 | |||
101 | |||
87 | int mEmailClient; | 102 | int mEmailClient; |
88 | QString mEmailOtherChannel; | 103 | QString mEmailOtherChannel; |
89 | QString mEmailOtherMessage; | 104 | QString mEmailOtherMessage; |
90 | QString mEmailOtherMessageParameters; | 105 | QString mEmailOtherMessageParameters; |
91 | QString mEmailOtherMessage2; | 106 | QString mEmailOtherMessage2; |
92 | QString mEmailOtherMessageParameters2; | 107 | QString mEmailOtherMessageParameters2; |
diff --git a/libkdepim/kpimprefs.cpp b/libkdepim/kpimprefs.cpp index 140a286..a9ea330 100644 --- a/libkdepim/kpimprefs.cpp +++ b/libkdepim/kpimprefs.cpp | |||
@@ -61,6 +61,12 @@ void KPimPrefs::usrReadConfig() | |||
61 | 61 | ||
62 | void KPimPrefs::usrWriteConfig() | 62 | void KPimPrefs::usrWriteConfig() |
63 | { | 63 | { |
64 | config()->setGroup("General"); | 64 | config()->setGroup("General"); |
65 | config()->writeEntry("Custom Categories",mCustomCategories); | 65 | config()->writeEntry("Custom Categories",mCustomCategories); |
66 | } | 66 | } |
67 | |||
68 | void KPimPrefs::setCategoryDefaults() | ||
69 | { | ||
70 | // empty implementation | ||
71 | } | ||
72 | |||
diff --git a/libkdepim/kpimprefs.h b/libkdepim/kpimprefs.h index 9bd9466..860665b 100644 --- a/libkdepim/kpimprefs.h +++ b/libkdepim/kpimprefs.h | |||
@@ -55,10 +55,10 @@ class KPimPrefs : public KPrefs | |||
55 | 55 | ||
56 | public: | 56 | public: |
57 | QStringList mCustomCategories; | 57 | QStringList mCustomCategories; |
58 | 58 | ||
59 | 59 | ||
60 | protected: | 60 | protected: |
61 | virtual void setCategoryDefaults() = 0; | 61 | virtual void setCategoryDefaults(); |
62 | }; | 62 | }; |
63 | 63 | ||
64 | #endif | 64 | #endif |
diff --git a/libkdepim/kprefsdialog.cpp b/libkdepim/kprefsdialog.cpp index 205c526..dd9a602 100644 --- a/libkdepim/kprefsdialog.cpp +++ b/libkdepim/kprefsdialog.cpp | |||
@@ -54,74 +54,74 @@ | |||
54 | 54 | ||
55 | #include "kprefs.h" | 55 | #include "kprefs.h" |
56 | 56 | ||
57 | #include "kprefsdialog.h" | 57 | #include "kprefsdialog.h" |
58 | //#include "kprefsdialog.moc" | 58 | //#include "kprefsdialog.moc" |
59 | 59 | ||
60 | KPrefsWidBool::KPrefsWidBool(const QString &text,bool *reference, | 60 | KPrefsDialogWidBool::KPrefsDialogWidBool(const QString &text,bool *reference, |
61 | QWidget *parent) | 61 | QWidget *parent) |
62 | { | 62 | { |
63 | mReference = reference; | 63 | mReference = reference; |
64 | 64 | ||
65 | mCheck = new QCheckBox(text,parent); | 65 | mCheck = new QCheckBox(text,parent); |
66 | } | 66 | } |
67 | 67 | ||
68 | void KPrefsWidBool::readConfig() | 68 | void KPrefsDialogWidBool::readConfig() |
69 | { | 69 | { |
70 | mCheck->setChecked(*mReference); | 70 | mCheck->setChecked(*mReference); |
71 | } | 71 | } |
72 | 72 | ||
73 | void KPrefsWidBool::writeConfig() | 73 | void KPrefsDialogWidBool::writeConfig() |
74 | { | 74 | { |
75 | *mReference = mCheck->isChecked(); | 75 | *mReference = mCheck->isChecked(); |
76 | } | 76 | } |
77 | 77 | ||
78 | QCheckBox *KPrefsWidBool::checkBox() | 78 | QCheckBox *KPrefsDialogWidBool::checkBox() |
79 | { | 79 | { |
80 | return mCheck; | 80 | return mCheck; |
81 | } | 81 | } |
82 | 82 | ||
83 | 83 | ||
84 | KPrefsWidColor::KPrefsWidColor(const QString &text,QColor *reference, | 84 | KPrefsDialogWidColor::KPrefsDialogWidColor(const QString &text,QColor *reference, |
85 | QWidget *parent) | 85 | QWidget *parent) |
86 | { | 86 | { |
87 | mReference = reference; | 87 | mReference = reference; |
88 | 88 | ||
89 | mButton = new KColorButton(parent); | 89 | mButton = new KColorButton(parent); |
90 | mLabel = new QLabel(mButton, text, parent); | 90 | mLabel = new QLabel(mButton, text, parent); |
91 | mButton->setColor( *mReference ); | 91 | mButton->setColor( *mReference ); |
92 | mButton->setColor( Qt::red ); | 92 | mButton->setColor( Qt::red ); |
93 | 93 | ||
94 | } | 94 | } |
95 | 95 | ||
96 | KPrefsWidColor::~KPrefsWidColor() | 96 | KPrefsDialogWidColor::~KPrefsDialogWidColor() |
97 | { | 97 | { |
98 | // kdDebug(5300) << "KPrefsWidColor::~KPrefsWidColor()" << endl; | 98 | // kdDebug(5300) << "KPrefsDialogWidColor::~KPrefsDialogWidColor()" << endl; |
99 | } | 99 | } |
100 | 100 | ||
101 | void KPrefsWidColor::readConfig() | 101 | void KPrefsDialogWidColor::readConfig() |
102 | { | 102 | { |
103 | mButton->setColor(*mReference); | 103 | mButton->setColor(*mReference); |
104 | } | 104 | } |
105 | 105 | ||
106 | void KPrefsWidColor::writeConfig() | 106 | void KPrefsDialogWidColor::writeConfig() |
107 | { | 107 | { |
108 | *mReference = mButton->color(); | 108 | *mReference = mButton->color(); |
109 | } | 109 | } |
110 | 110 | ||
111 | QLabel *KPrefsWidColor::label() | 111 | QLabel *KPrefsDialogWidColor::label() |
112 | { | 112 | { |
113 | return mLabel; | 113 | return mLabel; |
114 | } | 114 | } |
115 | 115 | ||
116 | KColorButton *KPrefsWidColor::button() | 116 | KColorButton *KPrefsDialogWidColor::button() |
117 | { | 117 | { |
118 | return mButton; | 118 | return mButton; |
119 | } | 119 | } |
120 | 120 | ||
121 | KPrefsWidFont::KPrefsWidFont(const QString &sampleText,const QString &labelText, | 121 | KPrefsDialogWidFont::KPrefsDialogWidFont(const QString &sampleText,const QString &labelText, |
122 | QFont *reference,QWidget *parent) | 122 | QFont *reference,QWidget *parent) |
123 | { | 123 | { |
124 | mReference = reference; | 124 | mReference = reference; |
125 | 125 | ||
126 | mLabel = new QLabel(labelText, parent); | 126 | mLabel = new QLabel(labelText, parent); |
127 | 127 | ||
@@ -131,146 +131,146 @@ KPrefsWidFont::KPrefsWidFont(const QString &sampleText,const QString &labelText, | |||
131 | mButton = new QPushButton(i18n("Choose..."), parent); | 131 | mButton = new QPushButton(i18n("Choose..."), parent); |
132 | connect(mButton,SIGNAL(clicked()),SLOT(selectFont())); | 132 | connect(mButton,SIGNAL(clicked()),SLOT(selectFont())); |
133 | mPreview->setMaximumHeight( QApplication::desktop()->height() / 12 ); | 133 | mPreview->setMaximumHeight( QApplication::desktop()->height() / 12 ); |
134 | mPreview->setMaximumWidth( (QApplication::desktop()->width() / 2)-10 ); | 134 | mPreview->setMaximumWidth( (QApplication::desktop()->width() / 2)-10 ); |
135 | } | 135 | } |
136 | 136 | ||
137 | KPrefsWidFont::~KPrefsWidFont() | 137 | KPrefsDialogWidFont::~KPrefsDialogWidFont() |
138 | { | 138 | { |
139 | } | 139 | } |
140 | 140 | ||
141 | void KPrefsWidFont::readConfig() | 141 | void KPrefsDialogWidFont::readConfig() |
142 | { | 142 | { |
143 | mPreview->setFont(*mReference); | 143 | mPreview->setFont(*mReference); |
144 | } | 144 | } |
145 | 145 | ||
146 | void KPrefsWidFont::writeConfig() | 146 | void KPrefsDialogWidFont::writeConfig() |
147 | { | 147 | { |
148 | *mReference = mPreview->font(); | 148 | *mReference = mPreview->font(); |
149 | } | 149 | } |
150 | 150 | ||
151 | QLabel *KPrefsWidFont::label() | 151 | QLabel *KPrefsDialogWidFont::label() |
152 | { | 152 | { |
153 | return mLabel; | 153 | return mLabel; |
154 | } | 154 | } |
155 | 155 | ||
156 | QLabel *KPrefsWidFont::preview() | 156 | QLabel *KPrefsDialogWidFont::preview() |
157 | { | 157 | { |
158 | return mPreview; | 158 | return mPreview; |
159 | } | 159 | } |
160 | 160 | ||
161 | QPushButton *KPrefsWidFont::button() | 161 | QPushButton *KPrefsDialogWidFont::button() |
162 | { | 162 | { |
163 | return mButton; | 163 | return mButton; |
164 | } | 164 | } |
165 | 165 | ||
166 | void KPrefsWidFont::selectFont() | 166 | void KPrefsDialogWidFont::selectFont() |
167 | { | 167 | { |
168 | QFont myFont(mPreview->font()); | 168 | QFont myFont(mPreview->font()); |
169 | bool ok; | 169 | bool ok; |
170 | myFont = KFontDialog::getFont(myFont, ok); | 170 | myFont = KFontDialog::getFont(myFont, ok); |
171 | if ( ok ) { | 171 | if ( ok ) { |
172 | mPreview->setFont(myFont); | 172 | mPreview->setFont(myFont); |
173 | } | 173 | } |
174 | } | 174 | } |
175 | 175 | ||
176 | 176 | ||
177 | KPrefsWidTime::KPrefsWidTime(const QString &text,int *reference, | 177 | KPrefsDialogWidTime::KPrefsDialogWidTime(const QString &text,int *reference, |
178 | QWidget *parent) | 178 | QWidget *parent) |
179 | { | 179 | { |
180 | mReference = reference; | 180 | mReference = reference; |
181 | 181 | ||
182 | mLabel = new QLabel(text,parent); | 182 | mLabel = new QLabel(text,parent); |
183 | mSpin = new QSpinBox(0,23,1,parent); | 183 | mSpin = new QSpinBox(0,23,1,parent); |
184 | mSpin->setSuffix(":00"); | 184 | mSpin->setSuffix(":00"); |
185 | } | 185 | } |
186 | 186 | ||
187 | void KPrefsWidTime::readConfig() | 187 | void KPrefsDialogWidTime::readConfig() |
188 | { | 188 | { |
189 | mSpin->setValue(*mReference); | 189 | mSpin->setValue(*mReference); |
190 | } | 190 | } |
191 | 191 | ||
192 | void KPrefsWidTime::writeConfig() | 192 | void KPrefsDialogWidTime::writeConfig() |
193 | { | 193 | { |
194 | *mReference = mSpin->value(); | 194 | *mReference = mSpin->value(); |
195 | } | 195 | } |
196 | 196 | ||
197 | QLabel *KPrefsWidTime::label() | 197 | QLabel *KPrefsDialogWidTime::label() |
198 | { | 198 | { |
199 | return mLabel; | 199 | return mLabel; |
200 | } | 200 | } |
201 | 201 | ||
202 | QSpinBox *KPrefsWidTime::spinBox() | 202 | QSpinBox *KPrefsDialogWidTime::spinBox() |
203 | { | 203 | { |
204 | return mSpin; | 204 | return mSpin; |
205 | } | 205 | } |
206 | 206 | ||
207 | 207 | ||
208 | KPrefsWidRadios::KPrefsWidRadios(const QString &text,int *reference, | 208 | KPrefsDialogWidRadios::KPrefsDialogWidRadios(const QString &text,int *reference, |
209 | QWidget *parent) | 209 | QWidget *parent) |
210 | { | 210 | { |
211 | mReference = reference; | 211 | mReference = reference; |
212 | 212 | ||
213 | mBox = new QButtonGroup(1,Qt::Horizontal,text,parent); | 213 | mBox = new QButtonGroup(1,Qt::Horizontal,text,parent); |
214 | } | 214 | } |
215 | 215 | ||
216 | KPrefsWidRadios::~KPrefsWidRadios() | 216 | KPrefsDialogWidRadios::~KPrefsDialogWidRadios() |
217 | { | 217 | { |
218 | } | 218 | } |
219 | 219 | ||
220 | void KPrefsWidRadios::addRadio(const QString &text) | 220 | void KPrefsDialogWidRadios::addRadio(const QString &text) |
221 | { | 221 | { |
222 | new QRadioButton(text,mBox); | 222 | new QRadioButton(text,mBox); |
223 | } | 223 | } |
224 | 224 | ||
225 | QButtonGroup *KPrefsWidRadios::groupBox() | 225 | QButtonGroup *KPrefsDialogWidRadios::groupBox() |
226 | { | 226 | { |
227 | return mBox; | 227 | return mBox; |
228 | } | 228 | } |
229 | 229 | ||
230 | void KPrefsWidRadios::readConfig() | 230 | void KPrefsDialogWidRadios::readConfig() |
231 | { | 231 | { |
232 | mBox->setButton(*mReference); | 232 | mBox->setButton(*mReference); |
233 | } | 233 | } |
234 | 234 | ||
235 | void KPrefsWidRadios::writeConfig() | 235 | void KPrefsDialogWidRadios::writeConfig() |
236 | { | 236 | { |
237 | *mReference = mBox->id(mBox->selected()); | 237 | *mReference = mBox->id(mBox->selected()); |
238 | } | 238 | } |
239 | 239 | ||
240 | 240 | ||
241 | KPrefsWidString::KPrefsWidString(const QString &text,QString *reference, | 241 | KPrefsDialogWidString::KPrefsDialogWidString(const QString &text,QString *reference, |
242 | QWidget *parent, QLineEdit::EchoMode echomode) | 242 | QWidget *parent, QLineEdit::EchoMode echomode) |
243 | { | 243 | { |
244 | mReference = reference; | 244 | mReference = reference; |
245 | 245 | ||
246 | mLabel = new QLabel(text,parent); | 246 | mLabel = new QLabel(text,parent); |
247 | mEdit = new QLineEdit(parent); | 247 | mEdit = new QLineEdit(parent); |
248 | mEdit->setEchoMode( echomode ); | 248 | mEdit->setEchoMode( echomode ); |
249 | } | 249 | } |
250 | 250 | ||
251 | KPrefsWidString::~KPrefsWidString() | 251 | KPrefsDialogWidString::~KPrefsDialogWidString() |
252 | { | 252 | { |
253 | } | 253 | } |
254 | 254 | ||
255 | void KPrefsWidString::readConfig() | 255 | void KPrefsDialogWidString::readConfig() |
256 | { | 256 | { |
257 | mEdit->setText(*mReference); | 257 | mEdit->setText(*mReference); |
258 | } | 258 | } |
259 | 259 | ||
260 | void KPrefsWidString::writeConfig() | 260 | void KPrefsDialogWidString::writeConfig() |
261 | { | 261 | { |
262 | *mReference = mEdit->text(); | 262 | *mReference = mEdit->text(); |
263 | } | 263 | } |
264 | 264 | ||
265 | QLabel *KPrefsWidString::label() | 265 | QLabel *KPrefsDialogWidString::label() |
266 | { | 266 | { |
267 | return mLabel; | 267 | return mLabel; |
268 | } | 268 | } |
269 | 269 | ||
270 | QLineEdit *KPrefsWidString::lineEdit() | 270 | QLineEdit *KPrefsDialogWidString::lineEdit() |
271 | { | 271 | { |
272 | return mEdit; | 272 | return mEdit; |
273 | } | 273 | } |
274 | 274 | ||
275 | 275 | ||
276 | KPrefsDialog::KPrefsDialog(KPrefs *prefs,QWidget *parent,char *name,bool modal) : | 276 | KPrefsDialog::KPrefsDialog(KPrefs *prefs,QWidget *parent,char *name,bool modal) : |
@@ -288,63 +288,63 @@ KPrefsDialog::KPrefsDialog(KPrefs *prefs,QWidget *parent,char *name,bool modal) | |||
288 | } | 288 | } |
289 | 289 | ||
290 | KPrefsDialog::~KPrefsDialog() | 290 | KPrefsDialog::~KPrefsDialog() |
291 | { | 291 | { |
292 | } | 292 | } |
293 | 293 | ||
294 | void KPrefsDialog::addWid(KPrefsWid *wid) | 294 | void KPrefsDialog::addWid(KPrefsDialogWid *wid) |
295 | { | 295 | { |
296 | mPrefsWids.append(wid); | 296 | mPrefsWids.append(wid); |
297 | } | 297 | } |
298 | 298 | ||
299 | KPrefsWidBool *KPrefsDialog::addWidBool(const QString &text,bool *reference,QWidget *parent) | 299 | KPrefsDialogWidBool *KPrefsDialog::addWidBool(const QString &text,bool *reference,QWidget *parent) |
300 | { | 300 | { |
301 | KPrefsWidBool *w = new KPrefsWidBool(text,reference,parent); | 301 | KPrefsDialogWidBool *w = new KPrefsDialogWidBool(text,reference,parent); |
302 | addWid(w); | 302 | addWid(w); |
303 | return w; | 303 | return w; |
304 | } | 304 | } |
305 | 305 | ||
306 | KPrefsWidTime *KPrefsDialog::addWidTime(const QString &text,int *reference,QWidget *parent) | 306 | KPrefsDialogWidTime *KPrefsDialog::addWidTime(const QString &text,int *reference,QWidget *parent) |
307 | { | 307 | { |
308 | KPrefsWidTime *w = new KPrefsWidTime(text,reference,parent); | 308 | KPrefsDialogWidTime *w = new KPrefsDialogWidTime(text,reference,parent); |
309 | addWid(w); | 309 | addWid(w); |
310 | return w; | 310 | return w; |
311 | } | 311 | } |
312 | 312 | ||
313 | KPrefsWidColor *KPrefsDialog::addWidColor(const QString &text,QColor *reference,QWidget *parent) | 313 | KPrefsDialogWidColor *KPrefsDialog::addWidColor(const QString &text,QColor *reference,QWidget *parent) |
314 | { | 314 | { |
315 | KPrefsWidColor *w = new KPrefsWidColor(text,reference,parent); | 315 | KPrefsDialogWidColor *w = new KPrefsDialogWidColor(text,reference,parent); |
316 | addWid(w); | 316 | addWid(w); |
317 | return w; | 317 | return w; |
318 | } | 318 | } |
319 | 319 | ||
320 | KPrefsWidRadios *KPrefsDialog::addWidRadios(const QString &text,int *reference,QWidget *parent) | 320 | KPrefsDialogWidRadios *KPrefsDialog::addWidRadios(const QString &text,int *reference,QWidget *parent) |
321 | { | 321 | { |
322 | KPrefsWidRadios *w = new KPrefsWidRadios(text,reference,parent); | 322 | KPrefsDialogWidRadios *w = new KPrefsDialogWidRadios(text,reference,parent); |
323 | addWid(w); | 323 | addWid(w); |
324 | return w; | 324 | return w; |
325 | } | 325 | } |
326 | 326 | ||
327 | KPrefsWidString *KPrefsDialog::addWidString(const QString &text,QString *reference,QWidget *parent) | 327 | KPrefsDialogWidString *KPrefsDialog::addWidString(const QString &text,QString *reference,QWidget *parent) |
328 | { | 328 | { |
329 | KPrefsWidString *w = new KPrefsWidString(text,reference,parent); | 329 | KPrefsDialogWidString *w = new KPrefsDialogWidString(text,reference,parent); |
330 | addWid(w); | 330 | addWid(w); |
331 | return w; | 331 | return w; |
332 | } | 332 | } |
333 | 333 | ||
334 | KPrefsWidString *KPrefsDialog::addWidPassword(const QString &text,QString *reference,QWidget *parent) | 334 | KPrefsDialogWidString *KPrefsDialog::addWidPassword(const QString &text,QString *reference,QWidget *parent) |
335 | { | 335 | { |
336 | KPrefsWidString *w = new KPrefsWidString(text,reference,parent,QLineEdit::Password); | 336 | KPrefsDialogWidString *w = new KPrefsDialogWidString(text,reference,parent,QLineEdit::Password); |
337 | addWid(w); | 337 | addWid(w); |
338 | return w; | 338 | return w; |
339 | } | 339 | } |
340 | 340 | ||
341 | KPrefsWidFont *KPrefsDialog::addWidFont(const QString &sampleText,const QString &buttonText, | 341 | KPrefsDialogWidFont *KPrefsDialog::addWidFont(const QString &sampleText,const QString &buttonText, |
342 | QFont *reference,QWidget *parent) | 342 | QFont *reference,QWidget *parent) |
343 | { | 343 | { |
344 | KPrefsWidFont *w = new KPrefsWidFont(sampleText,buttonText,reference,parent); | 344 | KPrefsDialogWidFont *w = new KPrefsDialogWidFont(sampleText,buttonText,reference,parent); |
345 | addWid(w); | 345 | addWid(w); |
346 | return w; | 346 | return w; |
347 | } | 347 | } |
348 | 348 | ||
349 | void KPrefsDialog::setDefaults() | 349 | void KPrefsDialog::setDefaults() |
350 | { | 350 | { |
@@ -354,25 +354,25 @@ void KPrefsDialog::setDefaults() | |||
354 | } | 354 | } |
355 | 355 | ||
356 | void KPrefsDialog::readConfig() | 356 | void KPrefsDialog::readConfig() |
357 | { | 357 | { |
358 | // kdDebug(5300) << "KPrefsDialog::readConfig()" << endl; | 358 | // kdDebug(5300) << "KPrefsDialog::readConfig()" << endl; |
359 | 359 | ||
360 | KPrefsWid *wid; | 360 | KPrefsDialogWid *wid; |
361 | for(wid = mPrefsWids.first();wid;wid=mPrefsWids.next()) { | 361 | for(wid = mPrefsWids.first();wid;wid=mPrefsWids.next()) { |
362 | wid->readConfig(); | 362 | wid->readConfig(); |
363 | } | 363 | } |
364 | 364 | ||
365 | usrReadConfig(); | 365 | usrReadConfig(); |
366 | } | 366 | } |
367 | 367 | ||
368 | void KPrefsDialog::writeConfig() | 368 | void KPrefsDialog::writeConfig() |
369 | { | 369 | { |
370 | // kdDebug(5300) << "KPrefsDialog::writeConfig()" << endl; | 370 | // kdDebug(5300) << "KPrefsDialog::writeConfig()" << endl; |
371 | 371 | ||
372 | KPrefsWid *wid; | 372 | KPrefsDialogWid *wid; |
373 | for(wid = mPrefsWids.first();wid;wid=mPrefsWids.next()) { | 373 | for(wid = mPrefsWids.first();wid;wid=mPrefsWids.next()) { |
374 | wid->writeConfig(); | 374 | wid->writeConfig(); |
375 | } | 375 | } |
376 | 376 | ||
377 | usrWriteConfig(); | 377 | usrWriteConfig(); |
378 | 378 | ||
diff --git a/libkdepim/kprefsdialog.h b/libkdepim/kprefsdialog.h index dceab01..ad13b78 100644 --- a/libkdepim/kprefsdialog.h +++ b/libkdepim/kprefsdialog.h | |||
@@ -43,13 +43,13 @@ class QButtonGroup; | |||
43 | @author Cornelius Schumacher | 43 | @author Cornelius Schumacher |
44 | @see KPrefsDialog | 44 | @see KPrefsDialog |
45 | 45 | ||
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 | */ |
49 | class KPrefsWid | 49 | class KPrefsDialogWid |
50 | { | 50 | { |
51 | public: | 51 | public: |
52 | /** | 52 | /** |
53 | This function is called to read value of the setting from the | 53 | This function is called to read value of the setting from the |
54 | stored configuration and display it in the widget. | 54 | stored configuration and display it in the widget. |
55 | */ | 55 | */ |
@@ -64,23 +64,23 @@ class KPrefsWid | |||
64 | /** | 64 | /** |
65 | @short Widget for bool settings in @ref KPrefsDialog. | 65 | @short Widget for bool settings in @ref KPrefsDialog. |
66 | 66 | ||
67 | This class provides a widget for configuring bool values. It is meant to be | 67 | This class provides a widget for configuring bool values. It is meant to be |
68 | used by KPrefsDialog. The user is responsible for the layout management. | 68 | used by KPrefsDialog. The user is responsible for the layout management. |
69 | */ | 69 | */ |
70 | class KPrefsWidBool : public KPrefsWid | 70 | class KPrefsDialogWidBool : public KPrefsDialogWid |
71 | { | 71 | { |
72 | public: | 72 | public: |
73 | /** | 73 | /** |
74 | Create a bool widget consisting of a QCheckbox. | 74 | Create a bool widget consisting of a QCheckbox. |
75 | 75 | ||
76 | @param text Text of QCheckBox. | 76 | @param text Text of QCheckBox. |
77 | @param reference Pointer to variable read and written by this widget. | 77 | @param reference Pointer to variable read and written by this widget. |
78 | @param parent Parent widget. | 78 | @param parent Parent widget. |
79 | */ | 79 | */ |
80 | KPrefsWidBool(const QString &text,bool *reference,QWidget *parent); | 80 | KPrefsDialogWidBool(const QString &text,bool *reference,QWidget *parent); |
81 | 81 | ||
82 | /** | 82 | /** |
83 | Return the QCheckbox used by this widget. | 83 | Return the QCheckbox used by this widget. |
84 | */ | 84 | */ |
85 | QCheckBox *checkBox(); | 85 | QCheckBox *checkBox(); |
86 | 86 | ||
@@ -96,23 +96,23 @@ class KPrefsWidBool : public KPrefsWid | |||
96 | /** | 96 | /** |
97 | @short Widget for time settings in @ref KPrefsDialog. | 97 | @short Widget for time settings in @ref KPrefsDialog. |
98 | 98 | ||
99 | This class provides a widget for configuring time values. It is meant to be | 99 | This class provides a widget for configuring time values. It is meant to be |
100 | used by KPrefsDialog. The user is responsible for the layout management. | 100 | used by KPrefsDialog. The user is responsible for the layout management. |
101 | */ | 101 | */ |
102 | class KPrefsWidTime : public KPrefsWid | 102 | class KPrefsDialogWidTime : public KPrefsDialogWid |
103 | { | 103 | { |
104 | public: | 104 | public: |
105 | /** | 105 | /** |
106 | Create a time widget consisting of a label and a spinbox. | 106 | Create a time widget consisting of a label and a spinbox. |
107 | 107 | ||
108 | @param text Text of Label. | 108 | @param text Text of Label. |
109 | @param reference Pointer to variable read and written by this widget. | 109 | @param reference Pointer to variable read and written by this widget. |
110 | @param parent Parent widget. | 110 | @param parent Parent widget. |
111 | */ | 111 | */ |
112 | KPrefsWidTime(const QString &text,int *reference,QWidget *parent); | 112 | KPrefsDialogWidTime(const QString &text,int *reference,QWidget *parent); |
113 | 113 | ||
114 | /** | 114 | /** |
115 | Return QLabel used by this widget. | 115 | Return QLabel used by this widget. |
116 | */ | 116 | */ |
117 | QLabel *label(); | 117 | QLabel *label(); |
118 | /** | 118 | /** |
@@ -133,29 +133,29 @@ class KPrefsWidTime : public KPrefsWid | |||
133 | /** | 133 | /** |
134 | @short Widget for color settings in @ref KPrefsDialog. | 134 | @short Widget for color settings in @ref KPrefsDialog. |
135 | 135 | ||
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 | */ |
139 | class KPrefsWidColor : public QObject, public KPrefsWid | 139 | class KPrefsDialogWidColor : public QObject, public KPrefsDialogWid |
140 | { | 140 | { |
141 | Q_OBJECT | 141 | Q_OBJECT |
142 | public: | 142 | public: |
143 | /** | 143 | /** |
144 | Create a color widget consisting of a test field and a button for opening | 144 | Create a color widget consisting of a test field and a button for opening |
145 | a color dialog. | 145 | a color dialog. |
146 | 146 | ||
147 | @param text Text of button. | 147 | @param text Text of button. |
148 | @param reference Pointer to variable read and written by this widget. | 148 | @param reference Pointer to variable read and written by this widget. |
149 | @param parent Parent widget. | 149 | @param parent Parent widget. |
150 | */ | 150 | */ |
151 | KPrefsWidColor(const QString &text,QColor *reference,QWidget *parent); | 151 | KPrefsDialogWidColor(const QString &text,QColor *reference,QWidget *parent); |
152 | /** | 152 | /** |
153 | Destruct color setting widget. | 153 | Destruct color setting widget. |
154 | */ | 154 | */ |
155 | ~KPrefsWidColor(); | 155 | ~KPrefsDialogWidColor(); |
156 | 156 | ||
157 | /** | 157 | /** |
158 | Return QLabel for the button | 158 | Return QLabel for the button |
159 | */ | 159 | */ |
160 | QLabel *label(); | 160 | QLabel *label(); |
161 | /** | 161 | /** |
@@ -176,30 +176,30 @@ class KPrefsWidColor : public QObject, public KPrefsWid | |||
176 | /** | 176 | /** |
177 | @short Widget for font settings in @ref KPrefsDialog. | 177 | @short Widget for font settings in @ref KPrefsDialog. |
178 | 178 | ||
179 | This class provides a widget for configuring font values. It is meant to be | 179 | 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. | 180 | used by KPrefsDialog. The user is responsible for the layout management. |
181 | */ | 181 | */ |
182 | class KPrefsWidFont : public QObject, public KPrefsWid | 182 | class KPrefsDialogWidFont : public QObject, public KPrefsDialogWid |
183 | { | 183 | { |
184 | Q_OBJECT | 184 | Q_OBJECT |
185 | public: | 185 | public: |
186 | /** | 186 | /** |
187 | Create a font widget consisting of a test field and a button for opening | 187 | Create a font widget consisting of a test field and a button for opening |
188 | a font dialog. | 188 | a font dialog. |
189 | 189 | ||
190 | @param label Text of label. | 190 | @param label Text of label. |
191 | @param reference Pointer to variable read and written by this widget. | 191 | @param reference Pointer to variable read and written by this widget. |
192 | @param parent Parent widget. | 192 | @param parent Parent widget. |
193 | */ | 193 | */ |
194 | KPrefsWidFont(const QString &sampleText,const QString &labelText, | 194 | KPrefsDialogWidFont(const QString &sampleText,const QString &labelText, |
195 | QFont *reference,QWidget *parent); | 195 | QFont *reference,QWidget *parent); |
196 | /** | 196 | /** |
197 | Destruct font setting widget. | 197 | Destruct font setting widget. |
198 | */ | 198 | */ |
199 | ~KPrefsWidFont(); | 199 | ~KPrefsDialogWidFont(); |
200 | 200 | ||
201 | /** | 201 | /** |
202 | Return label. | 202 | Return label. |
203 | */ | 203 | */ |
204 | QLabel *label(); | 204 | QLabel *label(); |
205 | /** | 205 | /** |
@@ -232,25 +232,25 @@ class KPrefsWidFont : public QObject, public KPrefsWid | |||
232 | This class provides a widget for configuring selections. It is meant to be | 232 | This class provides a widget for configuring selections. It is meant to be |
233 | used by KPrefsDialog. The user is responsible for the layout management. The | 233 | used by KPrefsDialog. The user is responsible for the layout management. The |
234 | setting is interpreted as an int value, corresponding to the position of the | 234 | setting is interpreted as an int value, corresponding to the position of the |
235 | radio button. The position of the button is defined by the sequence of @ref | 235 | radio button. The position of the button is defined by the sequence of @ref |
236 | addRadio() calls, starting with 0. | 236 | addRadio() calls, starting with 0. |
237 | */ | 237 | */ |
238 | class KPrefsWidRadios : public KPrefsWid | 238 | class KPrefsDialogWidRadios : public KPrefsDialogWid |
239 | { | 239 | { |
240 | public: | 240 | public: |
241 | /** | 241 | /** |
242 | Create a widget for selection of an option. It consists of a box with | 242 | Create a widget for selection of an option. It consists of a box with |
243 | several radio buttons. | 243 | several radio buttons. |
244 | 244 | ||
245 | @param text Text of main box. | 245 | @param text Text of main box. |
246 | @param reference Pointer to variable read and written by this widget. | 246 | @param reference Pointer to variable read and written by this widget. |
247 | @param parent Parent widget. | 247 | @param parent Parent widget. |
248 | */ | 248 | */ |
249 | KPrefsWidRadios(const QString &text,int *reference,QWidget *parent); | 249 | KPrefsDialogWidRadios(const QString &text,int *reference,QWidget *parent); |
250 | virtual ~KPrefsWidRadios(); | 250 | virtual ~KPrefsDialogWidRadios(); |
251 | 251 | ||
252 | /** | 252 | /** |
253 | Add a radio button. | 253 | Add a radio button. |
254 | 254 | ||
255 | @param text Text of the button. | 255 | @param text Text of the button. |
256 | */ | 256 | */ |
@@ -274,27 +274,27 @@ class KPrefsWidRadios : public KPrefsWid | |||
274 | /** | 274 | /** |
275 | @short Widget for string settings in @ref KPrefsDialog. | 275 | @short Widget for string settings in @ref KPrefsDialog. |
276 | 276 | ||
277 | This class provides a widget for configuring string values. It is meant to be | 277 | This class provides a widget for configuring string values. It is meant to be |
278 | used by KPrefsDialog. The user is responsible for the layout management. | 278 | used by KPrefsDialog. The user is responsible for the layout management. |
279 | */ | 279 | */ |
280 | class KPrefsWidString : public KPrefsWid | 280 | class KPrefsDialogWidString : public KPrefsDialogWid |
281 | { | 281 | { |
282 | public: | 282 | public: |
283 | /** | 283 | /** |
284 | Create a string widget consisting of a test label and a line edit. | 284 | Create a string widget consisting of a test label and a line edit. |
285 | 285 | ||
286 | @param text Text of label. | 286 | @param text Text of label. |
287 | @param reference Pointer to variable read and written by this widget. | 287 | @param reference Pointer to variable read and written by this widget. |
288 | @param parent Parent widget. | 288 | @param parent Parent widget. |
289 | */ | 289 | */ |
290 | KPrefsWidString(const QString &text,QString *reference,QWidget *parent,QLineEdit::EchoMode echomode=QLineEdit::Normal); | 290 | KPrefsDialogWidString(const QString &text,QString *reference,QWidget *parent,QLineEdit::EchoMode echomode=QLineEdit::Normal); |
291 | /** | 291 | /** |
292 | Destructor. | 292 | Destructor. |
293 | */ | 293 | */ |
294 | virtual ~KPrefsWidString(); | 294 | virtual ~KPrefsDialogWidString(); |
295 | 295 | ||
296 | /** | 296 | /** |
297 | Return label used by this widget. | 297 | Return label used by this widget. |
298 | */ | 298 | */ |
299 | QLabel *label(); | 299 | QLabel *label(); |
300 | /** | 300 | /** |
@@ -317,13 +317,13 @@ class KPrefsWidString : public KPrefsWid | |||
317 | @short Base class for a preferences dialog. | 317 | @short Base class for a preferences dialog. |
318 | 318 | ||
319 | This class provides the framework for a preferences dialog. You have to | 319 | This class provides the framework for a preferences dialog. You have to |
320 | subclass it and add the code to create the actual configuration widgets and | 320 | subclass it and add the code to create the actual configuration widgets and |
321 | do the layout management. | 321 | do the layout management. |
322 | 322 | ||
323 | KPrefsDialog provides functions to add subclasses of @ref KPrefsWid. For | 323 | KPrefsDialog provides functions to add subclasses of @ref KPrefsDialogWid. For |
324 | these widgets the reading, writing and setting to default values is handled | 324 | these widgets the reading, writing and setting to default values is handled |
325 | automatically. Custom widgets have to be handled in the functions @ref | 325 | automatically. Custom widgets have to be handled in the functions @ref |
326 | usrReadConfig() and @ref usrWriteConfig(). | 326 | usrReadConfig() and @ref usrWriteConfig(). |
327 | */ | 327 | */ |
328 | class KPrefsDialog : public KDialogBase | 328 | class KPrefsDialog : public KDialogBase |
329 | { | 329 | { |
@@ -341,72 +341,72 @@ class KPrefsDialog : public KDialogBase | |||
341 | /** | 341 | /** |
342 | Destructor. | 342 | Destructor. |
343 | */ | 343 | */ |
344 | virtual ~KPrefsDialog(); | 344 | virtual ~KPrefsDialog(); |
345 | 345 | ||
346 | /** | 346 | /** |
347 | Register a custom KPrefsWid object. | 347 | Register a custom KPrefsDialogWid object. |
348 | */ | 348 | */ |
349 | void addWid(KPrefsWid *); | 349 | void addWid(KPrefsDialogWid *); |
350 | /** | 350 | /** |
351 | Register a @ref KPrefsWidBool object. | 351 | Register a @ref KPrefsDialogWidBool object. |
352 | 352 | ||
353 | @param text Text of bool widget. | 353 | @param text Text of bool widget. |
354 | @param reference Reference to variable storing the setting. | 354 | @param reference Reference to variable storing the setting. |
355 | @param parent Parent widget. | 355 | @param parent Parent widget. |
356 | */ | 356 | */ |
357 | KPrefsWidBool *addWidBool(const QString &text,bool *reference,QWidget *parent); | 357 | KPrefsDialogWidBool *addWidBool(const QString &text,bool *reference,QWidget *parent); |
358 | /** | 358 | /** |
359 | Register a @ref KPrefsWidTime object. | 359 | Register a @ref KPrefsDialogWidTime object. |
360 | 360 | ||
361 | @param text Text of time widget. | 361 | @param text Text of time widget. |
362 | @param reference Reference to variable storing the setting. | 362 | @param reference Reference to variable storing the setting. |
363 | @param parent Parent widget. | 363 | @param parent Parent widget. |
364 | */ | 364 | */ |
365 | KPrefsWidTime *addWidTime(const QString &text,int *reference,QWidget *parent); | 365 | KPrefsDialogWidTime *addWidTime(const QString &text,int *reference,QWidget *parent); |
366 | /** | 366 | /** |
367 | Register a @ref KPrefsWidColor object. | 367 | Register a @ref KPrefsDialogWidColor object. |
368 | 368 | ||
369 | @param text Text of color widget. | 369 | @param text Text of color widget. |
370 | @param reference Reference to variable storing the setting. | 370 | @param reference Reference to variable storing the setting. |
371 | @param parent Parent widget. | 371 | @param parent Parent widget. |
372 | */ | 372 | */ |
373 | KPrefsWidColor *addWidColor(const QString &text,QColor *reference,QWidget *parent); | 373 | KPrefsDialogWidColor *addWidColor(const QString &text,QColor *reference,QWidget *parent); |
374 | /** | 374 | /** |
375 | Register a @ref KPrefsWidRadios object. | 375 | Register a @ref KPrefsDialogWidRadios object. |
376 | 376 | ||
377 | @param text Text of radio button box widget. | 377 | @param text Text of radio button box widget. |
378 | @param reference Reference to variable storing the setting. | 378 | @param reference Reference to variable storing the setting. |
379 | @param parent Parent widget. | 379 | @param parent Parent widget. |
380 | */ | 380 | */ |
381 | KPrefsWidRadios *addWidRadios(const QString &text,int *reference,QWidget *parent); | 381 | KPrefsDialogWidRadios *addWidRadios(const QString &text,int *reference,QWidget *parent); |
382 | /** | 382 | /** |
383 | Register a @ref KPrefsWidString object. | 383 | Register a @ref KPrefsDialogWidString object. |
384 | 384 | ||
385 | @param text Text of string widget. | 385 | @param text Text of string widget. |
386 | @param reference Reference to variable storing the setting. | 386 | @param reference Reference to variable storing the setting. |
387 | @param parent Parent widget. | 387 | @param parent Parent widget. |
388 | */ | 388 | */ |
389 | KPrefsWidString *addWidString(const QString &text,QString *reference,QWidget *parent); | 389 | KPrefsDialogWidString *addWidString(const QString &text,QString *reference,QWidget *parent); |
390 | /** | 390 | /** |
391 | Register a password @ref KPrefsWidString object, with echomode set to QLineEdit::Password. | 391 | Register a password @ref KPrefsDialogWidString object, with echomode set to QLineEdit::Password. |
392 | 392 | ||
393 | @param text Text of string widget. | 393 | @param text Text of string widget. |
394 | @param reference Reference to variable storing the setting. | 394 | @param reference Reference to variable storing the setting. |
395 | @param parent Parent widget. | 395 | @param parent Parent widget. |
396 | */ | 396 | */ |
397 | KPrefsWidString *addWidPassword (const QString &text,QString *reference,QWidget *parent); | 397 | KPrefsDialogWidString *addWidPassword (const QString &text,QString *reference,QWidget *parent); |
398 | /** | 398 | /** |
399 | Register a @ref KPrefsWidFont object. | 399 | Register a @ref KPrefsDialogWidFont object. |
400 | 400 | ||
401 | @param sampleText Sample text of font widget. | 401 | @param sampleText Sample text of font widget. |
402 | @param buttonText Button text of font widget. | 402 | @param buttonText Button text of font widget. |
403 | @param reference Reference to variable storing the setting. | 403 | @param reference Reference to variable storing the setting. |
404 | @param parent Parent widget. | 404 | @param parent Parent widget. |
405 | */ | 405 | */ |
406 | KPrefsWidFont *addWidFont(const QString &sampleText,const QString &buttonText, | 406 | KPrefsDialogWidFont *addWidFont(const QString &sampleText,const QString &buttonText, |
407 | QFont *reference,QWidget *parent); | 407 | QFont *reference,QWidget *parent); |
408 | 408 | ||
409 | public slots: | 409 | public slots: |
410 | /** Set all widgets to default values. */ | 410 | /** Set all widgets to default values. */ |
411 | void setDefaults(); | 411 | void setDefaults(); |
412 | 412 | ||
@@ -437,10 +437,10 @@ class KPrefsDialog : public KDialogBase | |||
437 | /** Implement this to write custom configuration widgets. */ | 437 | /** Implement this to write custom configuration widgets. */ |
438 | virtual void usrWriteConfig() {} | 438 | virtual void usrWriteConfig() {} |
439 | 439 | ||
440 | private: | 440 | private: |
441 | KPrefs *mPrefs; | 441 | KPrefs *mPrefs; |
442 | 442 | ||
443 | QPtrList<KPrefsWid> mPrefsWids; | 443 | QPtrList<KPrefsDialogWid> mPrefsWids; |
444 | }; | 444 | }; |
445 | 445 | ||
446 | #endif | 446 | #endif |
diff --git a/libkdepim/libkdepimE.pro b/libkdepim/libkdepimE.pro index 69980e3..2a30ee8 100644 --- a/libkdepim/libkdepimE.pro +++ b/libkdepim/libkdepimE.pro | |||
@@ -21,12 +21,13 @@ HEADERS = \ | |||
21 | kdateedit.h \ | 21 | kdateedit.h \ |
22 | kdatepicker.h \ | 22 | kdatepicker.h \ |
23 | kinputdialog.h \ | 23 | kinputdialog.h \ |
24 | kpimprefs.h \ | 24 | kpimprefs.h \ |
25 | kpimglobalprefs.h \ | 25 | kpimglobalprefs.h \ |
26 | kprefsdialog.h \ | 26 | kprefsdialog.h \ |
27 | kprefswidget.h \ | ||
27 | ksyncprofile.h \ | 28 | ksyncprofile.h \ |
28 | ksyncprefsdialog.h \ | 29 | ksyncprefsdialog.h \ |
29 | kcmconfigs/kcmkdepimconfig.h \ | 30 | kcmconfigs/kcmkdepimconfig.h \ |
30 | kcmconfigs/kdepimconfigwidget.h | 31 | kcmconfigs/kdepimconfigwidget.h |
31 | 32 | ||
32 | 33 | ||
@@ -40,12 +41,13 @@ SOURCES = \ | |||
40 | kdateedit.cpp \ | 41 | kdateedit.cpp \ |
41 | kinputdialog.cpp \ | 42 | kinputdialog.cpp \ |
42 | kdatepicker.cpp \ | 43 | kdatepicker.cpp \ |
43 | kpimprefs.cpp \ | 44 | kpimprefs.cpp \ |
44 | kpimglobalprefs.cpp \ | 45 | kpimglobalprefs.cpp \ |
45 | kprefsdialog.cpp \ | 46 | kprefsdialog.cpp \ |
47 | kprefswidget.cpp \ | ||
46 | ksyncprofile.cpp \ | 48 | ksyncprofile.cpp \ |
47 | ksyncprefsdialog.cpp \ | 49 | ksyncprefsdialog.cpp \ |
48 | kcmconfigs/kcmkdepimconfig.cpp \ | 50 | kcmconfigs/kcmkdepimconfig.cpp \ |
49 | kcmconfigs/kdepimconfigwidget.cpp | 51 | kcmconfigs/kdepimconfigwidget.cpp |
50 | 52 | ||
51 | 53 | ||