summaryrefslogtreecommitdiffabout
path: root/kaddressbook
Side-by-side diff
Diffstat (limited to 'kaddressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp40
-rw-r--r--kaddressbook/kabcore.h2
-rw-r--r--kaddressbook/kcmconfigs/kcmkabconfig.h2
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
@@ -96,6 +96,7 @@ $Id$
#include <kiconloader.h> // needed for SmallIcon
#include <kresources/kcmkresources.h>
#include <ktoolbar.h>
+#include <kprefsdialog.h>
//#include <qlabel.h>
@@ -1611,21 +1612,32 @@ QString KABCore::getNameByPhone( const QString &phone )
#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() )
@@ -2025,12 +2037,13 @@ void KABCore::initActions()
#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 ) ) );
@@ -2243,8 +2256,9 @@ void KABCore::addActionsManually()
// 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
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h
index 80dbf08..6479a58 100644
--- a/kaddressbook/kabcore.h
+++ b/kaddressbook/kabcore.h
@@ -327,6 +327,7 @@ class KABCore : public QWidget, public KSyncInterface
Launches the configuration dialog.
*/
void openConfigDialog();
+ void openConfigGlobalDialog();
/**
Launches the ldap search dialog.
@@ -458,6 +459,7 @@ class KABCore : public QWidget, public KSyncInterface
//US settings menu
KAction *mActionConfigResources;
+ KAction *mActionConfigGlobal;
KAction *mActionConfigKAddressbook;
KAction *mActionConfigShortcuts;
KAction *mActionConfigureToolbars;
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
@@ -35,7 +35,7 @@ class KCMKabConfig : public KCModule
public:
KCMKabConfig( QWidget *parent = 0, const char *name = 0 );
-
+ public slots:
virtual void load();
virtual void save();
virtual void defaults();