summaryrefslogtreecommitdiffabout
path: root/kaddressbook/kcmconfigs/kabconfigwidget.cpp
Side-by-side diff
Diffstat (limited to 'kaddressbook/kcmconfigs/kabconfigwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kcmconfigs/kabconfigwidget.cpp32
1 files changed, 7 insertions, 25 deletions
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
@@ -82,14 +82,14 @@ class ExtensionItem : public QCheckListItem
QString mComment;
#endif //KAB_EMBEDDED
};
-KABConfigWidget::KABConfigWidget( QWidget *parent, const char *name )
- : QWidget( parent, name )
+KABConfigWidget::KABConfigWidget( KABPrefs* prefs, QWidget *parent, const char *name )
+ : KPrefsWidget( prefs, parent, name )
{
QVBoxLayout *topLayout = new QVBoxLayout( this, 0,
KDialog::spacingHint() );
QTabWidget *tabWidget = new QTabWidget( this );
topLayout->addWidget( tabWidget );
@@ -170,16 +170,15 @@ KABConfigWidget::KABConfigWidget( QWidget *parent, const char *name )
mAddresseeWidget = new AddresseeWidget( this );
tabWidget->addTab( mAddresseeWidget, i18n( "Contact" ) );
connect( mAddresseeWidget, SIGNAL( modified() ), SLOT( modified() ) );
}
-
-void KABConfigWidget::restoreSettings(KABPrefs* prefs)
+void KABConfigWidget::usrReadConfig()
{
-//US prefs was KABPrefs::instance() before
+ KABPrefs* prefs = KABPrefs::instance();
bool blocked = signalsBlocked();
blockSignals( true );
mNameParsing->setChecked( prefs->mAutomaticNameParsing );
mViewsSingleClickBox->setChecked( prefs->mHonorSingleClick );
@@ -190,45 +189,28 @@ void KABConfigWidget::restoreSettings(KABPrefs* prefs)
mAddresseeWidget->restoreSettings();
restoreExtensionSettings();
blockSignals( blocked );
- emit changed( false );
}
-void KABConfigWidget::saveSettings(KABPrefs* prefs)
+void KABConfigWidget::usrWriteConfig()
{
+ KABPrefs* prefs = KABPrefs::instance();
+
prefs->mAutomaticNameParsing = mNameParsing->isChecked();
prefs->mHonorSingleClick = mViewsSingleClickBox->isChecked();
prefs->mSearchWithReturn = mSearchReturnBox->isChecked();
prefs->mMultipleViewsAtOnce = mMultipleViewsAtOnce->isChecked();
prefs->mAskForQuit = mAskForQuit->isChecked();
mAddresseeWidget->saveSettings();
saveExtensionSettings();
- KABPrefs::instance()->writeConfig();
- emit changed( false );
-}
-
-void KABConfigWidget::defaults(KABPrefs* prefs)
-{
- mNameParsing->setChecked( true );
- mViewsSingleClickBox->setChecked( false );
- mMultipleViewsAtOnce->setChecked( true );
- mSearchReturnBox->setChecked( true );
- mAskForQuit->setChecked (true);
-
- emit changed( true );
-}
-
-void KABConfigWidget::modified()
-{
- emit changed( true );
}
void KABConfigWidget::restoreExtensionSettings()
{
QStringList activeExtensions = KABPrefs::instance()->mActiveExtensions;