-rw-r--r-- | kaddressbook/kabcore.cpp | 40 | ||||
-rw-r--r-- | kaddressbook/kabcore.h | 2 | ||||
-rw-r--r-- | kaddressbook/kcmconfigs/kcmkabconfig.h | 2 |
3 files changed, 30 insertions, 14 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index cba5850..cd833cf 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp @@ -95,8 +95,9 @@ $Id$ #include <kdebug.h> #include <kiconloader.h> // needed for SmallIcon #include <kresources/kcmkresources.h> #include <ktoolbar.h> +#include <kprefsdialog.h> //#include <qlabel.h> @@ -1610,23 +1611,34 @@ QString KABCore::getNameByPhone( const QString &phone ) return ""; #endif //KAB_EMBEDDED } - +void KABCore::openConfigGlobalDialog() +{ + KPimPrefsGlobalDialog gc ( this ); + gc.exec(); +} void KABCore::openConfigDialog() { - KCMultiDialog* ConfigureDialog = new KCMultiDialog( "PIM", this ,"kabconfigdialog", true ); - KCMKabConfig* kabcfg = new KCMKabConfig( ConfigureDialog->getNewVBoxPage(i18n( "Addressbook")) , "KCMKabConfig" ); - ConfigureDialog->addModule(kabcfg ); - KCMKdePimConfig* kdelibcfg = new KCMKdePimConfig( ConfigureDialog->getNewVBoxPage(i18n( "Global")) , "KCMKdeLibConfig" ); - ConfigureDialog->addModule(kdelibcfg ); + KDialogBase * ConfigureDialog = new KDialogBase ( KDialogBase::Plain , i18n("Configure KA/Pi"), KDialogBase::Default |KDialogBase::Cancel | KDialogBase::Apply | KDialogBase::Ok, KDialogBase::Ok,0, "name", true, true); + KCMKabConfig* kabcfg = new KCMKabConfig( ConfigureDialog , "KCMKabConfig" ); + ConfigureDialog->setMainWidget( kabcfg ); connect( ConfigureDialog, SIGNAL( applyClicked() ), this, SLOT( configurationChanged() ) ); + connect( ConfigureDialog, SIGNAL( applyClicked() ), + kabcfg, SLOT( save() ) ); connect( ConfigureDialog, SIGNAL( okClicked() ), this, SLOT( configurationChanged() ) ); + connect( ConfigureDialog, SIGNAL( okClicked() ), + kabcfg, SLOT( save() ) ); + connect( ConfigureDialog, SIGNAL( defaultClicked() ), + kabcfg, SLOT( defaults() ) ); saveSettings(); + kabcfg->load(); #ifndef DESKTOP_VERSION + if ( QApplication::desktop()->height() <= 480 ) + ConfigureDialog->hideButtons(); ConfigureDialog->showMaximized(); #endif if ( ConfigureDialog->exec() ) KMessageBox::information( this, i18n("Some changes are only\neffective after a restart!\n") ); @@ -2024,14 +2036,15 @@ void KABCore::initActions() mActionConfigureToolbars->setEnabled( false ); #endif //KAB_EMBEDDED } else { - mActionConfigKAddressbook = KStdAction::preferences( this, SLOT( openConfigDialog() ), actionCollection() ); - - //US not implemented yet - //mActionKeyBindings = KStdAction::keyBindings( this, SLOT( configureKeyBindings() ), actionCollection() ); + mActionConfigKAddressbook = new KAction( i18n( "&Configure KA/Pi..." ), "configure", 0, this, + SLOT( openConfigDialog() ), actionCollection(), + "kaddressbook_configure" ); + mActionConfigGlobal = new KAction( i18n( "Global Settings..." ), "configure", 0, this, + SLOT( openConfigGlobalDialog() ), actionCollection(), + "kaddressbook_configure" ); } - mActionJumpBar = new KToggleAction( i18n( "Show Jump Bar" ), 0, 0, actionCollection(), "options_show_jump_bar" ); connect( mActionJumpBar, SIGNAL( toggled( bool ) ), SLOT( setJumpButtonBar( bool ) ) ); @@ -2242,10 +2255,11 @@ void KABCore::addActionsManually() // you do that through the control center !!! // settingsMenu->insertSeparator(); mActionConfigKAddressbook->plug( settingsMenu, 0 ); - mActionConfigResources->plug( settingsMenu,1 ); - settingsMenu->insertSeparator(2); + mActionConfigGlobal->plug( settingsMenu, 1 ); + mActionConfigResources->plug( settingsMenu,2 ); + settingsMenu->insertSeparator(3); if ( mIsPart ) { //US not implemented yet //mActionConfigShortcuts->plug( settingsMenu ); diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h index 80dbf08..6479a58 100644 --- a/kaddressbook/kabcore.h +++ b/kaddressbook/kabcore.h @@ -326,8 +326,9 @@ class KABCore : public QWidget, public KSyncInterface /** Launches the configuration dialog. */ void openConfigDialog(); + void openConfigGlobalDialog(); /** Launches the ldap search dialog. */ @@ -457,8 +458,9 @@ class KABCore : public QWidget, public KSyncInterface KAction *mActionDelete; //US settings menu KAction *mActionConfigResources; + KAction *mActionConfigGlobal; KAction *mActionConfigKAddressbook; KAction *mActionConfigShortcuts; KAction *mActionConfigureToolbars; KAction *mActionKeyBindings; diff --git a/kaddressbook/kcmconfigs/kcmkabconfig.h b/kaddressbook/kcmconfigs/kcmkabconfig.h index 2ecbfef..2af10d7 100644 --- a/kaddressbook/kcmconfigs/kcmkabconfig.h +++ b/kaddressbook/kcmconfigs/kcmkabconfig.h @@ -34,9 +34,9 @@ class KCMKabConfig : public KCModule Q_OBJECT public: KCMKabConfig( QWidget *parent = 0, const char *name = 0 ); - + public slots: virtual void load(); virtual void save(); virtual void defaults(); |