author | ulf69 <ulf69> | 2004-09-21 19:54:39 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-09-21 19:54:39 (UTC) |
commit | 618dec7bf4371c2085048cc1f95a93220bc8a233 (patch) (unidiff) | |
tree | df5e3e47a417400fa9f6871912eda6558294d9b4 /kaddressbook | |
parent | 186ee062d9169860fbab1613ca21b956c69296a6 (diff) | |
download | kdepimpi-618dec7bf4371c2085048cc1f95a93220bc8a233.zip kdepimpi-618dec7bf4371c2085048cc1f95a93220bc8a233.tar.gz kdepimpi-618dec7bf4371c2085048cc1f95a93220bc8a233.tar.bz2 |
modified configdialog to work properly with global configwidget from (libkdepim)
-rw-r--r-- | kaddressbook/kabcore.cpp | 9 | ||||
-rw-r--r-- | kaddressbook/kcmconfigs/kabconfigwidget.cpp | 32 | ||||
-rw-r--r-- | kaddressbook/kcmconfigs/kabconfigwidget.h | 20 | ||||
-rw-r--r-- | kaddressbook/kcmconfigs/kcmkabconfig.cpp | 16 | ||||
-rw-r--r-- | kaddressbook/kcmconfigs/kcmkabconfig.h | 2 |
5 files changed, 26 insertions, 53 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 4ebd6a8..1b40d71 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -1285,13 +1285,8 @@ void KABCore::openConfigDialog() | |||
1285 | { | 1285 | { |
1286 | KABPrefs* kab_prefs = KABPrefs::instance(); | ||
1287 | KPimGlobalPrefs* kpim_prefs = KPimGlobalPrefs::instance(); | ||
1288 | |||
1289 | KCMultiDialog* ConfigureDialog = new KCMultiDialog( "PIM", this ,"kabconfigdialog", true ); | 1286 | KCMultiDialog* ConfigureDialog = new KCMultiDialog( "PIM", this ,"kabconfigdialog", true ); |
1290 | KCMKabConfig* kabcfg = new KCMKabConfig( kab_prefs, ConfigureDialog->getNewVBoxPage(i18n( "Addressbook")) , "KCMKabConfig" ); | 1287 | KCMKabConfig* kabcfg = new KCMKabConfig( ConfigureDialog->getNewVBoxPage(i18n( "Addressbook")) , "KCMKabConfig" ); |
1291 | ConfigureDialog->addModule(kabcfg ); | 1288 | ConfigureDialog->addModule(kabcfg ); |
1292 | KCMKdePimConfig* kdelibcfg = new KCMKdePimConfig( kpim_prefs, ConfigureDialog->getNewVBoxPage(i18n( "Global")) , "KCMKdeLibConfig" ); | 1289 | KCMKdePimConfig* kdelibcfg = new KCMKdePimConfig( ConfigureDialog->getNewVBoxPage(i18n( "Global")) , "KCMKdeLibConfig" ); |
1293 | ConfigureDialog->addModule(kdelibcfg ); | 1290 | ConfigureDialog->addModule(kdelibcfg ); |
1294 | 1291 | ||
1295 | |||
1296 | |||
1297 | connect( ConfigureDialog, SIGNAL( applyClicked() ), | 1292 | connect( ConfigureDialog, SIGNAL( applyClicked() ), |
diff --git a/kaddressbook/kcmconfigs/kabconfigwidget.cpp b/kaddressbook/kcmconfigs/kabconfigwidget.cpp index 0c3a199..e970c3d 100644 --- a/kaddressbook/kcmconfigs/kabconfigwidget.cpp +++ b/kaddressbook/kcmconfigs/kabconfigwidget.cpp | |||
@@ -87,4 +87,4 @@ class ExtensionItem : public QCheckListItem | |||
87 | 87 | ||
88 | KABConfigWidget::KABConfigWidget( QWidget *parent, const char *name ) | 88 | KABConfigWidget::KABConfigWidget( KABPrefs* prefs, QWidget *parent, const char *name ) |
89 | : QWidget( parent, name ) | 89 | : KPrefsWidget( prefs, parent, name ) |
90 | { | 90 | { |
@@ -175,6 +175,5 @@ KABConfigWidget::KABConfigWidget( QWidget *parent, const char *name ) | |||
175 | 175 | ||
176 | 176 | void KABConfigWidget::usrReadConfig() | |
177 | void KABConfigWidget::restoreSettings(KABPrefs* prefs) | ||
178 | { | 177 | { |
179 | //US prefs was KABPrefs::instance() before | 178 | KABPrefs* prefs = KABPrefs::instance(); |
180 | 179 | ||
@@ -195,7 +194,8 @@ void KABConfigWidget::restoreSettings(KABPrefs* prefs) | |||
195 | 194 | ||
196 | emit changed( false ); | ||
197 | } | 195 | } |
198 | 196 | ||
199 | void KABConfigWidget::saveSettings(KABPrefs* prefs) | 197 | void KABConfigWidget::usrWriteConfig() |
200 | { | 198 | { |
199 | KABPrefs* prefs = KABPrefs::instance(); | ||
200 | |||
201 | prefs->mAutomaticNameParsing = mNameParsing->isChecked(); | 201 | prefs->mAutomaticNameParsing = mNameParsing->isChecked(); |
@@ -209,21 +209,3 @@ void KABConfigWidget::saveSettings(KABPrefs* prefs) | |||
209 | saveExtensionSettings(); | 209 | saveExtensionSettings(); |
210 | KABPrefs::instance()->writeConfig(); | ||
211 | 210 | ||
212 | emit changed( false ); | ||
213 | } | ||
214 | |||
215 | void KABConfigWidget::defaults(KABPrefs* prefs) | ||
216 | { | ||
217 | mNameParsing->setChecked( true ); | ||
218 | mViewsSingleClickBox->setChecked( false ); | ||
219 | mMultipleViewsAtOnce->setChecked( true ); | ||
220 | mSearchReturnBox->setChecked( true ); | ||
221 | mAskForQuit->setChecked (true); | ||
222 | |||
223 | emit changed( true ); | ||
224 | } | ||
225 | |||
226 | void KABConfigWidget::modified() | ||
227 | { | ||
228 | emit changed( true ); | ||
229 | } | 211 | } |
diff --git a/kaddressbook/kcmconfigs/kabconfigwidget.h b/kaddressbook/kcmconfigs/kabconfigwidget.h index 6cd4223..1e71fd1 100644 --- a/kaddressbook/kcmconfigs/kabconfigwidget.h +++ b/kaddressbook/kcmconfigs/kabconfigwidget.h | |||
@@ -26,3 +26,3 @@ | |||
26 | 26 | ||
27 | #include <qwidget.h> | 27 | #include <kprefswidget.h> |
28 | 28 | ||
@@ -38,3 +38,3 @@ class AddresseeWidget; | |||
38 | 38 | ||
39 | class KABConfigWidget : public QWidget | 39 | class KABConfigWidget : public KPrefsWidget |
40 | { | 40 | { |
@@ -43,13 +43,9 @@ class KABConfigWidget : public QWidget | |||
43 | public: | 43 | public: |
44 | KABConfigWidget( QWidget *parent, const char *name = 0 ); | 44 | KABConfigWidget(KABPrefs *prefs, QWidget *parent, const char *name = 0 ); |
45 | 45 | ||
46 | void restoreSettings(KABPrefs* prefs); | 46 | protected: |
47 | void saveSettings(KABPrefs* prefs); | 47 | /** Implement this to read custom configuration widgets. */ |
48 | void defaults(KABPrefs* prefs); | 48 | virtual void usrReadConfig(); |
49 | 49 | /** Implement this to write custom configuration widgets. */ | |
50 | signals: | 50 | virtual void usrWriteConfig(); |
51 | void changed( bool ); | ||
52 | |||
53 | public slots: | ||
54 | void modified(); | ||
55 | 51 | ||
diff --git a/kaddressbook/kcmconfigs/kcmkabconfig.cpp b/kaddressbook/kcmconfigs/kcmkabconfig.cpp index b460a81..cbfedbd 100644 --- a/kaddressbook/kcmconfigs/kcmkabconfig.cpp +++ b/kaddressbook/kcmconfigs/kcmkabconfig.cpp | |||
@@ -41,4 +41,4 @@ extern "C" | |||
41 | { | 41 | { |
42 | KCModule *create_kabconfig( KABPrefs* prefs, QWidget *parent, const char * ) { | 42 | KCModule *create_kabconfig( QWidget *parent, const char * ) { |
43 | return new KCMKabConfig( prefs, parent, "kcmkabconfig" ); | 43 | return new KCMKabConfig( parent, "kcmkabconfig" ); |
44 | } | 44 | } |
@@ -46,4 +46,4 @@ extern "C" | |||
46 | 46 | ||
47 | KCMKabConfig::KCMKabConfig( KABPrefs* prefs, QWidget *parent, const char *name ) | 47 | KCMKabConfig::KCMKabConfig( QWidget *parent, const char *name ) |
48 | : KCModule( prefs, parent, name ) | 48 | : KCModule( KABPrefs::instance(), parent, name ) |
49 | { | 49 | { |
@@ -51,3 +51,3 @@ KCMKabConfig::KCMKabConfig( KABPrefs* prefs, QWidget *parent, const char *name ) | |||
51 | QVBoxLayout *layout = new QVBoxLayout( this ); | 51 | QVBoxLayout *layout = new QVBoxLayout( this ); |
52 | mConfigWidget = new KABConfigWidget( this, "mConfigWidget" ); | 52 | mConfigWidget = new KABConfigWidget( (KABPrefs*)getPreferences(), this, "KABConfigWidget" ); |
53 | layout->addWidget( mConfigWidget ); | 53 | layout->addWidget( mConfigWidget ); |
@@ -61,3 +61,3 @@ void KCMKabConfig::load() | |||
61 | { | 61 | { |
62 | mConfigWidget->restoreSettings((KABPrefs*)getPreferences()); | 62 | mConfigWidget->readConfig(); |
63 | } | 63 | } |
@@ -66,3 +66,3 @@ void KCMKabConfig::save() | |||
66 | { | 66 | { |
67 | mConfigWidget->saveSettings((KABPrefs*)getPreferences()); | 67 | mConfigWidget->writeConfig(); |
68 | } | 68 | } |
@@ -71,3 +71,3 @@ void KCMKabConfig::defaults() | |||
71 | { | 71 | { |
72 | mConfigWidget->defaults((KABPrefs*)getPreferences()); | 72 | mConfigWidget->setDefaults(); |
73 | } | 73 | } |
diff --git a/kaddressbook/kcmconfigs/kcmkabconfig.h b/kaddressbook/kcmconfigs/kcmkabconfig.h index 1cb6ad3..2ecbfef 100644 --- a/kaddressbook/kcmconfigs/kcmkabconfig.h +++ b/kaddressbook/kcmconfigs/kcmkabconfig.h | |||
@@ -36,3 +36,3 @@ class KCMKabConfig : public KCModule | |||
36 | public: | 36 | public: |
37 | KCMKabConfig( KABPrefs* prefs, QWidget *parent = 0, const char *name = 0 ); | 37 | KCMKabConfig( QWidget *parent = 0, const char *name = 0 ); |
38 | 38 | ||