summaryrefslogtreecommitdiffabout
path: root/kaddressbook
authorzautrix <zautrix>2005-06-10 10:31:22 (UTC)
committer zautrix <zautrix>2005-06-10 10:31:22 (UTC)
commite5ca8e0d8d6d08b597253f43de401aa1a99a6abe (patch) (side-by-side diff)
treec319ba89abbe5cd90647bc38deb0ab1ce46f48e5 /kaddressbook
parent89c5159208fd982f527117e49d67ea1f90553dbe (diff)
downloadkdepimpi-e5ca8e0d8d6d08b597253f43de401aa1a99a6abe.zip
kdepimpi-e5ca8e0d8d6d08b597253f43de401aa1a99a6abe.tar.gz
kdepimpi-e5ca8e0d8d6d08b597253f43de401aa1a99a6abe.tar.bz2
config dialog fixes
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
@@ -83,32 +83,33 @@ $Id$
#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"
@@ -1598,47 +1599,58 @@ QString KABCore::getNameByPhone( const QString &phone )
++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() ) );
@@ -2012,38 +2024,39 @@ void KABCore::initActions()
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
@@ -2230,34 +2243,35 @@ void KABCore::addActionsManually()
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 )
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
the method will try to find a selected addressee in the view.
*/
void editContact( const QString &uid /*US = QString::null*/ );
//US added a second method without defaultparameter
void editContact2();
/**
Shows or edits the detail view for the given uid. If the uid is QString::null,
the method will try to find a selected addressee in the view.
*/
void executeContact( const QString &uid /*US = QString::null*/ );
/**
Launches the configuration dialog.
*/
void openConfigDialog();
+ void openConfigGlobalDialog();
/**
Launches the ldap search dialog.
*/
void openLDAPDialog();
/**
Creates a KAddressBookPrinter, which will display the print
dialog and do the printing.
*/
void print();
/**
Registers a new GUI client, so plugins can register its actions.
*/
void addGUIClient( KXMLGUIClient *client );
@@ -445,32 +446,33 @@ class KABCore : public QWidget, public KSyncInterface
KAction *mActionMailVCard;
KAction *mActionBeamVCard;
KAction *mActionQuit;
//US edit menu
KAction *mActionCopy;
KAction *mActionCut;
KAction *mActionPaste;
KAction *mActionSelectAll;
KAction *mActionUndo;
KAction *mActionRedo;
KAction *mActionDelete;
//US settings menu
KAction *mActionConfigResources;
+ KAction *mActionConfigGlobal;
KAction *mActionConfigKAddressbook;
KAction *mActionConfigShortcuts;
KAction *mActionConfigureToolbars;
KAction *mActionKeyBindings;
KToggleAction *mActionJumpBar;
KToggleAction *mActionDetails;
KAction *mActionWhoAmI;
KAction *mActionCategories;
KAction *mActionEditCategories;
KAction *mActionManageCategories;
KAction *mActionAboutKAddressbook;
KAction *mActionLicence;
KAction *mActionFaq;
KAction *mActionWN;
KAction *mActionSyncHowto;
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 @@
*/
#ifndef KCMKABCONFIG_H
#define KCMKABCONFIG_H
#include <kcmodule.h>
class KABConfigWidget;
class KABPrefs;
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();
private:
KABConfigWidget *mConfigWidget;
};
#endif