-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 | |||
@@ -83,32 +83,33 @@ $Id$ | |||
83 | #include <kapplication.h> | 83 | #include <kapplication.h> |
84 | #include "KDGanttMinimizeSplitter.h" | 84 | #include "KDGanttMinimizeSplitter.h" |
85 | #include "kaddressbookmain.h" | 85 | #include "kaddressbookmain.h" |
86 | #include "kactioncollection.h" | 86 | #include "kactioncollection.h" |
87 | #include "addresseedialog.h" | 87 | #include "addresseedialog.h" |
88 | //US | 88 | //US |
89 | #include <addresseeview.h> | 89 | #include <addresseeview.h> |
90 | 90 | ||
91 | #include <qapp.h> | 91 | #include <qapp.h> |
92 | #include <qmenubar.h> | 92 | #include <qmenubar.h> |
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 |
105 | #include <qpe/ir.h> | 106 | #include <qpe/ir.h> |
106 | #include <qpe/qpemenubar.h> | 107 | #include <qpe/qpemenubar.h> |
107 | #include <qtopia/qcopenvelope_qws.h> | 108 | #include <qtopia/qcopenvelope_qws.h> |
108 | #else | 109 | #else |
109 | 110 | ||
110 | #include <qmenubar.h> | 111 | #include <qmenubar.h> |
111 | #endif | 112 | #endif |
112 | 113 | ||
113 | #endif // KAB_EMBEDDED | 114 | #endif // KAB_EMBEDDED |
114 | #include "kcmconfigs/kcmkabconfig.h" | 115 | #include "kcmconfigs/kcmkabconfig.h" |
@@ -1598,47 +1599,58 @@ QString KABCore::getNameByPhone( const QString &phone ) | |||
1598 | ++phoneIter) { | 1599 | ++phoneIter) { |
1599 | // Get rid of separator chars so just the numbers are compared. | 1600 | // Get rid of separator chars so just the numbers are compared. |
1600 | if ( (*phoneIter).number().replace( r, "" ) == localPhone.replace( r, "" ) ) { | 1601 | if ( (*phoneIter).number().replace( r, "" ) == localPhone.replace( r, "" ) ) { |
1601 | ownerName = (*iter).formattedName(); | 1602 | ownerName = (*iter).formattedName(); |
1602 | found = true; | 1603 | found = true; |
1603 | } | 1604 | } |
1604 | } | 1605 | } |
1605 | } | 1606 | } |
1606 | 1607 | ||
1607 | return ownerName; | 1608 | return ownerName; |
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 | 1615 | void KABCore::openConfigGlobalDialog() | |
1616 | { | ||
1617 | KPimPrefsGlobalDialog gc ( this ); | ||
1618 | gc.exec(); | ||
1619 | } | ||
1615 | void KABCore::openConfigDialog() | 1620 | void 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 | } |
1635 | 1647 | ||
1636 | void KABCore::openLDAPDialog() | 1648 | void KABCore::openLDAPDialog() |
1637 | { | 1649 | { |
1638 | #ifndef KAB_EMBEDDED | 1650 | #ifndef KAB_EMBEDDED |
1639 | if ( !mLdapSearchDialog ) { | 1651 | if ( !mLdapSearchDialog ) { |
1640 | mLdapSearchDialog = new LDAPSearchDialog( mAddressBook, this ); | 1652 | mLdapSearchDialog = new LDAPSearchDialog( mAddressBook, this ); |
1641 | connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), mViewManager, | 1653 | connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), mViewManager, |
1642 | SLOT( refreshView() ) ); | 1654 | SLOT( refreshView() ) ); |
1643 | connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), this, | 1655 | connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), this, |
1644 | SLOT( setModified() ) ); | 1656 | SLOT( setModified() ) ); |
@@ -2012,38 +2024,39 @@ void KABCore::initActions() | |||
2012 | 2024 | ||
2013 | if ( mIsPart ) { | 2025 | if ( mIsPart ) { |
2014 | mActionConfigKAddressbook = new KAction( i18n( "&Configure KAddressBook..." ), "configure", 0, this, | 2026 | mActionConfigKAddressbook = new KAction( i18n( "&Configure KAddressBook..." ), "configure", 0, this, |
2015 | SLOT( openConfigDialog() ), actionCollection(), | 2027 | SLOT( openConfigDialog() ), actionCollection(), |
2016 | "kaddressbook_configure" ); | 2028 | "kaddressbook_configure" ); |
2017 | 2029 | ||
2018 | //US not implemented yet | 2030 | //US not implemented yet |
2019 | //mActionConfigShortcuts = new KAction( i18n( "Configure S&hortcuts..." ), "configure_shortcuts", 0, | 2031 | //mActionConfigShortcuts = new KAction( i18n( "Configure S&hortcuts..." ), "configure_shortcuts", 0, |
2020 | // this, SLOT( configureKeyBindings() ), actionCollection(), | 2032 | // this, SLOT( configureKeyBindings() ), actionCollection(), |
2021 | // "kaddressbook_configure_shortcuts" ); | 2033 | // "kaddressbook_configure_shortcuts" ); |
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" ); |
2040 | connect( mActionDetails, SIGNAL( toggled( bool ) ), SLOT( setDetailsVisible( bool ) ) ); | 2053 | connect( mActionDetails, SIGNAL( toggled( bool ) ), SLOT( setDetailsVisible( bool ) ) ); |
2041 | 2054 | ||
2042 | 2055 | ||
2043 | mActionBR = new KToggleAction( i18n( "Beam receive enabled" ), "beam", 0, this, | 2056 | mActionBR = new KToggleAction( i18n( "Beam receive enabled" ), "beam", 0, this, |
2044 | SLOT( toggleBeamReceive() ), actionCollection(), | 2057 | SLOT( toggleBeamReceive() ), actionCollection(), |
2045 | "kaddressbook_beam_rec" ); | 2058 | "kaddressbook_beam_rec" ); |
2046 | 2059 | ||
2047 | 2060 | ||
2048 | // misc | 2061 | // misc |
2049 | // only enable LDAP lookup if we can handle the protocol | 2062 | // only enable LDAP lookup if we can handle the protocol |
@@ -2230,34 +2243,35 @@ void KABCore::addActionsManually() | |||
2230 | editMenu->insertSeparator(); | 2243 | editMenu->insertSeparator(); |
2231 | mActionCut->plug( editMenu ); | 2244 | mActionCut->plug( editMenu ); |
2232 | mActionCopy->plug( editMenu ); | 2245 | mActionCopy->plug( editMenu ); |
2233 | mActionPaste->plug( editMenu ); | 2246 | mActionPaste->plug( editMenu ); |
2234 | mActionDelete->plug( editMenu ); | 2247 | mActionDelete->plug( editMenu ); |
2235 | editMenu->insertSeparator(); | 2248 | editMenu->insertSeparator(); |
2236 | mActionSelectAll->plug( editMenu ); | 2249 | mActionSelectAll->plug( editMenu ); |
2237 | 2250 | ||
2238 | mActionSetFormattedName->plug( changeMenu ); | 2251 | mActionSetFormattedName->plug( changeMenu ); |
2239 | mActionRemoveVoice->plug( changeMenu ); | 2252 | mActionRemoveVoice->plug( changeMenu ); |
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 | ||
2254 | } else { | 2268 | } else { |
2255 | //US not implemented yet | 2269 | //US not implemented yet |
2256 | //mActionKeyBindings->plug( settingsMenu ); | 2270 | //mActionKeyBindings->plug( settingsMenu ); |
2257 | } | 2271 | } |
2258 | 2272 | ||
2259 | mActionEditCategories->plug( settingsMenu ); | 2273 | mActionEditCategories->plug( settingsMenu ); |
2260 | mActionManageCategories->plug( settingsMenu ); | 2274 | mActionManageCategories->plug( settingsMenu ); |
2261 | mActionJumpBar->plug( viewMenu,0 ); | 2275 | mActionJumpBar->plug( viewMenu,0 ); |
2262 | mActionDetails->plug( viewMenu,0 ); | 2276 | mActionDetails->plug( viewMenu,0 ); |
2263 | //if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop ) | 2277 | //if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop ) |
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h index 80dbf08..6479a58 100644 --- a/kaddressbook/kabcore.h +++ b/kaddressbook/kabcore.h | |||
@@ -314,32 +314,33 @@ class KABCore : public QWidget, public KSyncInterface | |||
314 | the method will try to find a selected addressee in the view. | 314 | the method will try to find a selected addressee in the view. |
315 | */ | 315 | */ |
316 | void editContact( const QString &uid /*US = QString::null*/ ); | 316 | void editContact( const QString &uid /*US = QString::null*/ ); |
317 | //US added a second method without defaultparameter | 317 | //US added a second method without defaultparameter |
318 | void editContact2(); | 318 | void editContact2(); |
319 | 319 | ||
320 | /** | 320 | /** |
321 | Shows or edits the detail view for the given uid. If the uid is QString::null, | 321 | Shows or edits the detail view for the given uid. If the uid is QString::null, |
322 | the method will try to find a selected addressee in the view. | 322 | the method will try to find a selected addressee in the view. |
323 | */ | 323 | */ |
324 | void executeContact( const QString &uid /*US = QString::null*/ ); | 324 | void executeContact( const QString &uid /*US = QString::null*/ ); |
325 | 325 | ||
326 | /** | 326 | /** |
327 | Launches the configuration dialog. | 327 | Launches the configuration dialog. |
328 | */ | 328 | */ |
329 | void openConfigDialog(); | 329 | void openConfigDialog(); |
330 | void openConfigGlobalDialog(); | ||
330 | 331 | ||
331 | /** | 332 | /** |
332 | Launches the ldap search dialog. | 333 | Launches the ldap search dialog. |
333 | */ | 334 | */ |
334 | void openLDAPDialog(); | 335 | void openLDAPDialog(); |
335 | 336 | ||
336 | /** | 337 | /** |
337 | Creates a KAddressBookPrinter, which will display the print | 338 | Creates a KAddressBookPrinter, which will display the print |
338 | dialog and do the printing. | 339 | dialog and do the printing. |
339 | */ | 340 | */ |
340 | void print(); | 341 | void print(); |
341 | 342 | ||
342 | /** | 343 | /** |
343 | Registers a new GUI client, so plugins can register its actions. | 344 | Registers a new GUI client, so plugins can register its actions. |
344 | */ | 345 | */ |
345 | void addGUIClient( KXMLGUIClient *client ); | 346 | void addGUIClient( KXMLGUIClient *client ); |
@@ -445,32 +446,33 @@ class KABCore : public QWidget, public KSyncInterface | |||
445 | KAction *mActionMailVCard; | 446 | KAction *mActionMailVCard; |
446 | KAction *mActionBeamVCard; | 447 | KAction *mActionBeamVCard; |
447 | 448 | ||
448 | KAction *mActionQuit; | 449 | KAction *mActionQuit; |
449 | 450 | ||
450 | //US edit menu | 451 | //US edit menu |
451 | KAction *mActionCopy; | 452 | KAction *mActionCopy; |
452 | KAction *mActionCut; | 453 | KAction *mActionCut; |
453 | KAction *mActionPaste; | 454 | KAction *mActionPaste; |
454 | KAction *mActionSelectAll; | 455 | KAction *mActionSelectAll; |
455 | KAction *mActionUndo; | 456 | KAction *mActionUndo; |
456 | KAction *mActionRedo; | 457 | KAction *mActionRedo; |
457 | KAction *mActionDelete; | 458 | KAction *mActionDelete; |
458 | 459 | ||
459 | //US settings menu | 460 | //US settings menu |
460 | KAction *mActionConfigResources; | 461 | KAction *mActionConfigResources; |
462 | KAction *mActionConfigGlobal; | ||
461 | KAction *mActionConfigKAddressbook; | 463 | KAction *mActionConfigKAddressbook; |
462 | KAction *mActionConfigShortcuts; | 464 | KAction *mActionConfigShortcuts; |
463 | KAction *mActionConfigureToolbars; | 465 | KAction *mActionConfigureToolbars; |
464 | KAction *mActionKeyBindings; | 466 | KAction *mActionKeyBindings; |
465 | KToggleAction *mActionJumpBar; | 467 | KToggleAction *mActionJumpBar; |
466 | KToggleAction *mActionDetails; | 468 | KToggleAction *mActionDetails; |
467 | KAction *mActionWhoAmI; | 469 | KAction *mActionWhoAmI; |
468 | KAction *mActionCategories; | 470 | KAction *mActionCategories; |
469 | KAction *mActionEditCategories; | 471 | KAction *mActionEditCategories; |
470 | KAction *mActionManageCategories; | 472 | KAction *mActionManageCategories; |
471 | KAction *mActionAboutKAddressbook; | 473 | KAction *mActionAboutKAddressbook; |
472 | KAction *mActionLicence; | 474 | KAction *mActionLicence; |
473 | KAction *mActionFaq; | 475 | KAction *mActionFaq; |
474 | KAction *mActionWN; | 476 | KAction *mActionWN; |
475 | KAction *mActionSyncHowto; | 477 | KAction *mActionSyncHowto; |
476 | KAction *mActionStorageHowto; | 478 | KAction *mActionStorageHowto; |
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 | |||
@@ -22,26 +22,26 @@ | |||
22 | */ | 22 | */ |
23 | 23 | ||
24 | #ifndef KCMKABCONFIG_H | 24 | #ifndef KCMKABCONFIG_H |
25 | #define KCMKABCONFIG_H | 25 | #define KCMKABCONFIG_H |
26 | 26 | ||
27 | #include <kcmodule.h> | 27 | #include <kcmodule.h> |
28 | 28 | ||
29 | class KABConfigWidget; | 29 | class KABConfigWidget; |
30 | class KABPrefs; | 30 | class KABPrefs; |
31 | 31 | ||
32 | class KCMKabConfig : public KCModule | 32 | class KCMKabConfig : public KCModule |
33 | { | 33 | { |
34 | Q_OBJECT | 34 | Q_OBJECT |
35 | 35 | ||
36 | public: | 36 | public: |
37 | KCMKabConfig( QWidget *parent = 0, const char *name = 0 ); | 37 | KCMKabConfig( QWidget *parent = 0, const char *name = 0 ); |
38 | 38 | public slots: | |
39 | virtual void load(); | 39 | virtual void load(); |
40 | virtual void save(); | 40 | virtual void save(); |
41 | virtual void defaults(); | 41 | virtual void defaults(); |
42 | 42 | ||
43 | private: | 43 | private: |
44 | KABConfigWidget *mConfigWidget; | 44 | KABConfigWidget *mConfigWidget; |
45 | }; | 45 | }; |
46 | 46 | ||
47 | #endif | 47 | #endif |