summaryrefslogtreecommitdiffabout
path: root/kaddressbook/kabcore.cpp
Side-by-side diff
Diffstat (limited to 'kaddressbook/kabcore.cpp') (more/less context) (ignore 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
@@ -75,48 +75,49 @@ $Id$
#include "addresseeeditordialog.h"
#include "extensionmanager.h"
#include "kstdaction.h"
#include "kaddressbookservice.h"
#include "ldapsearchdialog.h"
#include "printing/printingwizard.h"
#else // KAB_EMBEDDED
#include <kapplication.h>
#include "KDGanttMinimizeSplitter.h"
#include "kaddressbookmain.h"
#include "kactioncollection.h"
#include "addresseedialog.h"
//US
#include <addresseeview.h>
#include <qapp.h>
#include <qmenubar.h>
//#include <qtoolbar.h>
#include <qmessagebox.h>
#include <kdebug.h>
#include <kiconloader.h> // needed for SmallIcon
#include <kresources/kcmkresources.h>
#include <ktoolbar.h>
+#include <kprefsdialog.h>
//#include <qlabel.h>
#ifndef DESKTOP_VERSION
#include <qpe/ir.h>
#include <qpe/qpemenubar.h>
#include <qtopia/qcopenvelope_qws.h>
#else
#include <qmenubar.h>
#endif
#endif // KAB_EMBEDDED
#include "kcmconfigs/kcmkabconfig.h"
#include "kcmconfigs/kcmkdepimconfig.h"
#include "kpimglobalprefs.h"
#include "externalapphandler.h"
#include "xxportselectdialog.h"
#include <kresources/selectdialog.h>
#include <kmessagebox.h>
@@ -1590,63 +1591,74 @@ QString KABCore::getNameByPhone( const QString &phone )
bool found = false;
QString ownerName = "";
KABC::AddressBook::Iterator iter;
KABC::PhoneNumber::List::Iterator phoneIter;
KABC::PhoneNumber::List phoneList;
for ( iter = mAddressBook->begin(); !found && ( iter != mAddressBook->end() ); ++iter ) {
phoneList = (*iter).phoneNumbers();
for ( phoneIter = phoneList.begin(); !found && ( phoneIter != phoneList.end() );
++phoneIter) {
// Get rid of separator chars so just the numbers are compared.
if ( (*phoneIter).number().replace( r, "" ) == localPhone.replace( r, "" ) ) {
ownerName = (*iter).formattedName();
found = true;
}
}
}
return ownerName;
#else //KAB_EMBEDDED
qDebug("KABCore::getNameByPhone finsih method");
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") );
delete ConfigureDialog;
}
void KABCore::openLDAPDialog()
{
#ifndef KAB_EMBEDDED
if ( !mLdapSearchDialog ) {
mLdapSearchDialog = new LDAPSearchDialog( mAddressBook, this );
connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), mViewManager,
SLOT( refreshView() ) );
connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), this,
SLOT( setModified() ) );
} else
mLdapSearchDialog->restoreSettings();
if ( mLdapSearchDialog->isOK() )
mLdapSearchDialog->exec();
#else //KAB_EMBEDDED
qDebug("KABCore::openLDAPDialog() finsih method");
#endif //KAB_EMBEDDED
@@ -2004,54 +2016,55 @@ void KABCore::initActions()
// settings menu
#ifdef KAB_EMBEDDED
//US special menuentry to configure the addressbook resources. On KDE
// you do that through the control center !!!
mActionConfigResources = new KAction( i18n( "Configure &Resources..." ), "configure_resources", 0, this,
SLOT( configureResources() ), actionCollection(),
"kaddressbook_configure_resources" );
#endif //KAB_EMBEDDED
if ( mIsPart ) {
mActionConfigKAddressbook = new KAction( i18n( "&Configure KAddressBook..." ), "configure", 0, this,
SLOT( openConfigDialog() ), actionCollection(),
"kaddressbook_configure" );
//US not implemented yet
//mActionConfigShortcuts = new KAction( i18n( "Configure S&hortcuts..." ), "configure_shortcuts", 0,
// this, SLOT( configureKeyBindings() ), actionCollection(),
// "kaddressbook_configure_shortcuts" );
#ifdef KAB_EMBEDDED
mActionConfigureToolbars = KStdAction::configureToolbars( this, SLOT( mMainWindow->configureToolbars() ), actionCollection() );
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 ) ) );
mActionDetails = new KToggleAction( i18n( "Show Details" ), "listview", 0,
actionCollection(), "options_show_details" );
connect( mActionDetails, SIGNAL( toggled( bool ) ), SLOT( setDetailsVisible( bool ) ) );
mActionBR = new KToggleAction( i18n( "Beam receive enabled" ), "beam", 0, this,
SLOT( toggleBeamReceive() ), actionCollection(),
"kaddressbook_beam_rec" );
// misc
// only enable LDAP lookup if we can handle the protocol
#ifndef KAB_EMBEDDED
if ( KProtocolInfo::isKnownProtocol( KURL( "ldap://localhost" ) ) ) {
new KAction( i18n( "&Lookup Addresses in Directory" ), "find", 0,
this, SLOT( openLDAPDialog() ), actionCollection(),
"ldap_lookup" );
}
#else //KAB_EMBEDDED
//qDebug("KABCore::initActions() LDAP has to be implemented");
@@ -2222,50 +2235,51 @@ void KABCore::addActionsManually()
fileMenu->insertSeparator();
mActionQuit->plug( fileMenu );
#ifdef _OL_IMPORT_
mActionImportOL->plug( ImportMenu );
#endif
// edit menu
mActionUndo->plug( editMenu );
mActionRedo->plug( editMenu );
editMenu->insertSeparator();
mActionCut->plug( editMenu );
mActionCopy->plug( editMenu );
mActionPaste->plug( editMenu );
mActionDelete->plug( editMenu );
editMenu->insertSeparator();
mActionSelectAll->plug( editMenu );
mActionSetFormattedName->plug( changeMenu );
mActionRemoveVoice->plug( changeMenu );
// settingsmings menu
//US special menuentry to configure the addressbook resources. On KDE
// 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 );
//mActionConfigureToolbars->plug( settingsMenu );
} else {
//US not implemented yet
//mActionKeyBindings->plug( settingsMenu );
}
mActionEditCategories->plug( settingsMenu );
mActionManageCategories->plug( settingsMenu );
mActionJumpBar->plug( viewMenu,0 );
mActionDetails->plug( viewMenu,0 );
//if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop )
mActionDetails->plug( tb );
settingsMenu->insertSeparator();
#ifndef DESKTOP_VERSION
if ( Ir::supported() ) mActionBR->plug(settingsMenu );
settingsMenu->insertSeparator();
#endif
mActionWhoAmI->plug( settingsMenu );