summaryrefslogtreecommitdiffabout
path: root/kaddressbook/kabcore.cpp
Unidiff
Diffstat (limited to 'kaddressbook/kabcore.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp40
1 files changed, 27 insertions, 13 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index cba5850..cd833cf 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -93,12 +93,13 @@ $Id$
93//#include <qtoolbar.h> 93//#include <qtoolbar.h>
94#include <qmessagebox.h> 94#include <qmessagebox.h>
95#include <kdebug.h> 95#include <kdebug.h>
96#include <kiconloader.h> // needed for SmallIcon 96#include <kiconloader.h> // needed for SmallIcon
97#include <kresources/kcmkresources.h> 97#include <kresources/kcmkresources.h>
98#include <ktoolbar.h> 98#include <ktoolbar.h>
99#include <kprefsdialog.h>
99 100
100 101
101//#include <qlabel.h> 102//#include <qlabel.h>
102 103
103 104
104#ifndef DESKTOP_VERSION 105#ifndef DESKTOP_VERSION
@@ -1608,27 +1609,38 @@ QString KABCore::getNameByPhone( const QString &phone )
1608#else //KAB_EMBEDDED 1609#else //KAB_EMBEDDED
1609 qDebug("KABCore::getNameByPhone finsih method"); 1610 qDebug("KABCore::getNameByPhone finsih method");
1610 return ""; 1611 return "";
1611#endif //KAB_EMBEDDED 1612#endif //KAB_EMBEDDED
1612 1613
1613} 1614}
1614 1615void KABCore::openConfigGlobalDialog()
1616{
1617 KPimPrefsGlobalDialog gc ( this );
1618 gc.exec();
1619}
1615void KABCore::openConfigDialog() 1620void KABCore::openConfigDialog()
1616{ 1621{
1617 KCMultiDialog* ConfigureDialog = new KCMultiDialog( "PIM", this ,"kabconfigdialog", true ); 1622 KDialogBase * ConfigureDialog = new KDialogBase ( KDialogBase::Plain , i18n("Configure KA/Pi"), KDialogBase::Default |KDialogBase::Cancel | KDialogBase::Apply | KDialogBase::Ok, KDialogBase::Ok,0, "name", true, true);
1618 KCMKabConfig* kabcfg = new KCMKabConfig( ConfigureDialog->getNewVBoxPage(i18n( "Addressbook")) , "KCMKabConfig" );
1619 ConfigureDialog->addModule(kabcfg );
1620 KCMKdePimConfig* kdelibcfg = new KCMKdePimConfig( ConfigureDialog->getNewVBoxPage(i18n( "Global")) , "KCMKdeLibConfig" );
1621 ConfigureDialog->addModule(kdelibcfg );
1622 1623
1624 KCMKabConfig* kabcfg = new KCMKabConfig( ConfigureDialog , "KCMKabConfig" );
1625 ConfigureDialog->setMainWidget( kabcfg );
1623 connect( ConfigureDialog, SIGNAL( applyClicked() ), 1626 connect( ConfigureDialog, SIGNAL( applyClicked() ),
1624 this, SLOT( configurationChanged() ) ); 1627 this, SLOT( configurationChanged() ) );
1628 connect( ConfigureDialog, SIGNAL( applyClicked() ),
1629 kabcfg, SLOT( save() ) );
1625 connect( ConfigureDialog, SIGNAL( okClicked() ), 1630 connect( ConfigureDialog, SIGNAL( okClicked() ),
1626 this, SLOT( configurationChanged() ) ); 1631 this, SLOT( configurationChanged() ) );
1632 connect( ConfigureDialog, SIGNAL( okClicked() ),
1633 kabcfg, SLOT( save() ) );
1634 connect( ConfigureDialog, SIGNAL( defaultClicked() ),
1635 kabcfg, SLOT( defaults() ) );
1627 saveSettings(); 1636 saveSettings();
1637 kabcfg->load();
1628#ifndef DESKTOP_VERSION 1638#ifndef DESKTOP_VERSION
1639 if ( QApplication::desktop()->height() <= 480 )
1640 ConfigureDialog->hideButtons();
1629 ConfigureDialog->showMaximized(); 1641 ConfigureDialog->showMaximized();
1630#endif 1642#endif
1631 if ( ConfigureDialog->exec() ) 1643 if ( ConfigureDialog->exec() )
1632 KMessageBox::information( this, i18n("Some changes are only\neffective after a restart!\n") ); 1644 KMessageBox::information( this, i18n("Some changes are only\neffective after a restart!\n") );
1633 delete ConfigureDialog; 1645 delete ConfigureDialog;
1634} 1646}
@@ -2022,18 +2034,19 @@ void KABCore::initActions()
2022#ifdef KAB_EMBEDDED 2034#ifdef KAB_EMBEDDED
2023 mActionConfigureToolbars = KStdAction::configureToolbars( this, SLOT( mMainWindow->configureToolbars() ), actionCollection() ); 2035 mActionConfigureToolbars = KStdAction::configureToolbars( this, SLOT( mMainWindow->configureToolbars() ), actionCollection() );
2024 mActionConfigureToolbars->setEnabled( false ); 2036 mActionConfigureToolbars->setEnabled( false );
2025#endif //KAB_EMBEDDED 2037#endif //KAB_EMBEDDED
2026 2038
2027 } else { 2039 } else {
2028 mActionConfigKAddressbook = KStdAction::preferences( this, SLOT( openConfigDialog() ), actionCollection() ); 2040 mActionConfigKAddressbook = new KAction( i18n( "&Configure KA/Pi..." ), "configure", 0, this,
2029 2041 SLOT( openConfigDialog() ), actionCollection(),
2030 //US not implemented yet 2042 "kaddressbook_configure" );
2031 //mActionKeyBindings = KStdAction::keyBindings( this, SLOT( configureKeyBindings() ), actionCollection() ); 2043 mActionConfigGlobal = new KAction( i18n( "Global Settings..." ), "configure", 0, this,
2044 SLOT( openConfigGlobalDialog() ), actionCollection(),
2045 "kaddressbook_configure" );
2032 } 2046 }
2033
2034 mActionJumpBar = new KToggleAction( i18n( "Show Jump Bar" ), 0, 0, 2047 mActionJumpBar = new KToggleAction( i18n( "Show Jump Bar" ), 0, 0,
2035 actionCollection(), "options_show_jump_bar" ); 2048 actionCollection(), "options_show_jump_bar" );
2036 connect( mActionJumpBar, SIGNAL( toggled( bool ) ), SLOT( setJumpButtonBar( bool ) ) ); 2049 connect( mActionJumpBar, SIGNAL( toggled( bool ) ), SLOT( setJumpButtonBar( bool ) ) );
2037 2050
2038 mActionDetails = new KToggleAction( i18n( "Show Details" ), "listview", 0, 2051 mActionDetails = new KToggleAction( i18n( "Show Details" ), "listview", 0,
2039 actionCollection(), "options_show_details" ); 2052 actionCollection(), "options_show_details" );
@@ -2240,14 +2253,15 @@ void KABCore::addActionsManually()
2240 // settingsmings menu 2253 // settingsmings menu
2241//US special menuentry to configure the addressbook resources. On KDE 2254//US special menuentry to configure the addressbook resources. On KDE
2242// you do that through the control center !!! 2255// you do that through the control center !!!
2243 // settingsMenu->insertSeparator(); 2256 // settingsMenu->insertSeparator();
2244 2257
2245 mActionConfigKAddressbook->plug( settingsMenu, 0 ); 2258 mActionConfigKAddressbook->plug( settingsMenu, 0 );
2246 mActionConfigResources->plug( settingsMenu,1 ); 2259 mActionConfigGlobal->plug( settingsMenu, 1 );
2247 settingsMenu->insertSeparator(2); 2260 mActionConfigResources->plug( settingsMenu,2 );
2261 settingsMenu->insertSeparator(3);
2248 2262
2249 if ( mIsPart ) { 2263 if ( mIsPart ) {
2250 //US not implemented yet 2264 //US not implemented yet
2251 //mActionConfigShortcuts->plug( settingsMenu ); 2265 //mActionConfigShortcuts->plug( settingsMenu );
2252 //mActionConfigureToolbars->plug( settingsMenu ); 2266 //mActionConfigureToolbars->plug( settingsMenu );
2253 2267