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 | |||
@@ -45,16 +45,16 @@ $Id$ | |||
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 ); |
@@ -66,14 +66,15 @@ KCMKdePimConfig::KCMKdePimConfig( KPimGlobalPrefs* prefs, QWidget *parent, const | |||
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 | |||
@@ -42,5 +42,5 @@ class KCMKdePimConfig : public KCModule | |||
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(); |
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 | |||
@@ -35,9 +35,11 @@ $Id$ | |||
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 | ||
@@ -72,4 +74,6 @@ $Id$ | |||
72 | */ | 74 | */ |
73 | 75 | ||
76 | #include "qapplication.h" | ||
77 | |||
74 | #include "kpimglobalprefs.h" | 78 | #include "kpimglobalprefs.h" |
75 | 79 | ||
@@ -77,6 +81,6 @@ $Id$ | |||
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")); |
@@ -91,10 +95,17 @@ KDEPIMConfigWidget::KDEPIMConfigWidget( QWidget *parent, const char *name ) | |||
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(), |
@@ -113,6 +124,4 @@ KDEPIMConfigWidget::KDEPIMConfigWidget( QWidget *parent, const char *name ) | |||
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" ); |
@@ -169,5 +178,4 @@ KDEPIMConfigWidget::KDEPIMConfigWidget( QWidget *parent, const char *name ) | |||
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." ) ); |
@@ -175,4 +183,175 @@ KDEPIMConfigWidget::KDEPIMConfigWidget( QWidget *parent, const char *name ) | |||
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 | { |
@@ -229,5 +408,5 @@ void KDEPIMConfigWidget::client_changed( int newClient ) | |||
229 | updateClientWidgets(); | 408 | updateClientWidgets(); |
230 | 409 | ||
231 | modified(); | 410 | KPrefsWidget::modified(); |
232 | } | 411 | } |
233 | 412 | ||
@@ -445,12 +624,24 @@ void KDEPIMConfigWidget::updateClientWidgets() | |||
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; |
@@ -492,12 +683,31 @@ void KDEPIMConfigWidget::restoreSettings(KPimGlobalPrefs* prefs) | |||
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; |
@@ -533,70 +743,27 @@ void KDEPIMConfigWidget::saveSettings(KPimGlobalPrefs* prefs) | |||
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 | { |
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 | |||
@@ -32,5 +32,5 @@ $Id$ | |||
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 | ||
@@ -38,34 +38,26 @@ $Id$ | |||
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 | ||
@@ -78,7 +70,24 @@ class KDEPIMConfigWidget : public QWidget | |||
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(); |
diff --git a/libkdepim/kpimglobalprefs.cpp b/libkdepim/kpimglobalprefs.cpp index eb8f1de..12a503d 100644 --- a/libkdepim/kpimglobalprefs.cpp +++ b/libkdepim/kpimglobalprefs.cpp | |||
@@ -44,4 +44,25 @@ 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 | ||
diff --git a/libkdepim/kpimglobalprefs.h b/libkdepim/kpimglobalprefs.h index 8bd543d..dad78e6 100644 --- a/libkdepim/kpimglobalprefs.h +++ b/libkdepim/kpimglobalprefs.h | |||
@@ -85,4 +85,19 @@ class KPimGlobalPrefs : public KPrefs | |||
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; |
diff --git a/libkdepim/kpimprefs.cpp b/libkdepim/kpimprefs.cpp index 140a286..a9ea330 100644 --- a/libkdepim/kpimprefs.cpp +++ b/libkdepim/kpimprefs.cpp | |||
@@ -65,2 +65,8 @@ void KPimPrefs::usrWriteConfig() | |||
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 | |||
@@ -59,5 +59,5 @@ class KPimPrefs : public KPrefs | |||
59 | 59 | ||
60 | protected: | 60 | protected: |
61 | virtual void setCategoryDefaults() = 0; | 61 | virtual void setCategoryDefaults(); |
62 | }; | 62 | }; |
63 | 63 | ||
diff --git a/libkdepim/kprefsdialog.cpp b/libkdepim/kprefsdialog.cpp index 205c526..dd9a602 100644 --- a/libkdepim/kprefsdialog.cpp +++ b/libkdepim/kprefsdialog.cpp | |||
@@ -58,5 +58,5 @@ | |||
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 | { |
@@ -66,15 +66,15 @@ KPrefsWidBool::KPrefsWidBool(const QString &text,bool *reference, | |||
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; |
@@ -82,5 +82,5 @@ QCheckBox *KPrefsWidBool::checkBox() | |||
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 | { |
@@ -94,30 +94,30 @@ KPrefsWidColor::KPrefsWidColor(const QString &text,QColor *reference, | |||
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 | { |
@@ -135,34 +135,34 @@ KPrefsWidFont::KPrefsWidFont(const QString &sampleText,const QString &labelText, | |||
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()); |
@@ -175,5 +175,5 @@ void KPrefsWidFont::selectFont() | |||
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 | { |
@@ -185,20 +185,20 @@ KPrefsWidTime::KPrefsWidTime(const QString &text,int *reference, | |||
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; |
@@ -206,5 +206,5 @@ QSpinBox *KPrefsWidTime::spinBox() | |||
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 | { |
@@ -214,24 +214,24 @@ KPrefsWidRadios::KPrefsWidRadios(const QString &text,int *reference, | |||
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()); |
@@ -239,5 +239,5 @@ void KPrefsWidRadios::writeConfig() | |||
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 | { |
@@ -249,24 +249,24 @@ KPrefsWidString::KPrefsWidString(const QString &text,QString *reference, | |||
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; |
@@ -292,55 +292,55 @@ KPrefsDialog::~KPrefsDialog() | |||
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; |
@@ -358,5 +358,5 @@ void KPrefsDialog::readConfig() | |||
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(); |
@@ -370,5 +370,5 @@ void KPrefsDialog::writeConfig() | |||
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(); |
diff --git a/libkdepim/kprefsdialog.h b/libkdepim/kprefsdialog.h index dceab01..ad13b78 100644 --- a/libkdepim/kprefsdialog.h +++ b/libkdepim/kprefsdialog.h | |||
@@ -47,5 +47,5 @@ class QButtonGroup; | |||
47 | KPrefsDialog. | 47 | KPrefsDialog. |
48 | */ | 48 | */ |
49 | class KPrefsWid | 49 | class KPrefsDialogWid |
50 | { | 50 | { |
51 | public: | 51 | public: |
@@ -68,5 +68,5 @@ class KPrefsWid | |||
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: |
@@ -78,5 +78,5 @@ class KPrefsWidBool : public KPrefsWid | |||
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 | /** |
@@ -100,5 +100,5 @@ class KPrefsWidBool : public KPrefsWid | |||
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: |
@@ -110,5 +110,5 @@ class KPrefsWidTime : public KPrefsWid | |||
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 | /** |
@@ -137,5 +137,5 @@ class KPrefsWidTime : public KPrefsWid | |||
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 |
@@ -149,9 +149,9 @@ class KPrefsWidColor : public QObject, public KPrefsWid | |||
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 | /** |
@@ -180,5 +180,5 @@ class KPrefsWidColor : public QObject, public KPrefsWid | |||
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 |
@@ -192,10 +192,10 @@ class KPrefsWidFont : public QObject, public KPrefsWid | |||
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 | /** |
@@ -236,5 +236,5 @@ class KPrefsWidFont : public QObject, public KPrefsWid | |||
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: |
@@ -247,6 +247,6 @@ class KPrefsWidRadios : public KPrefsWid | |||
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 | /** |
@@ -278,5 +278,5 @@ class KPrefsWidRadios : public KPrefsWid | |||
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: |
@@ -288,9 +288,9 @@ class KPrefsWidString : public KPrefsWid | |||
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 | /** |
@@ -321,5 +321,5 @@ class KPrefsWidString : public KPrefsWid | |||
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 |
@@ -345,9 +345,9 @@ class KPrefsDialog : public KDialogBase | |||
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. |
@@ -355,7 +355,7 @@ class KPrefsDialog : public KDialogBase | |||
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. |
@@ -363,7 +363,7 @@ class KPrefsDialog : public KDialogBase | |||
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. |
@@ -371,7 +371,7 @@ class KPrefsDialog : public KDialogBase | |||
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. |
@@ -379,7 +379,7 @@ class KPrefsDialog : public KDialogBase | |||
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. |
@@ -387,7 +387,7 @@ class KPrefsDialog : public KDialogBase | |||
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. |
@@ -395,7 +395,7 @@ class KPrefsDialog : public KDialogBase | |||
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. |
@@ -404,5 +404,5 @@ class KPrefsDialog : public KDialogBase | |||
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 | ||
@@ -441,5 +441,5 @@ class KPrefsDialog : public KDialogBase | |||
441 | KPrefs *mPrefs; | 441 | KPrefs *mPrefs; |
442 | 442 | ||
443 | QPtrList<KPrefsWid> mPrefsWids; | 443 | QPtrList<KPrefsDialogWid> mPrefsWids; |
444 | }; | 444 | }; |
445 | 445 | ||
diff --git a/libkdepim/libkdepimE.pro b/libkdepim/libkdepimE.pro index 69980e3..2a30ee8 100644 --- a/libkdepim/libkdepimE.pro +++ b/libkdepim/libkdepimE.pro | |||
@@ -25,4 +25,5 @@ HEADERS = \ | |||
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 \ |
@@ -44,4 +45,5 @@ SOURCES = \ | |||
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 \ |