summaryrefslogtreecommitdiffabout
path: root/pwmanager
authorzautrix <zautrix>2005-06-10 11:53:12 (UTC)
committer zautrix <zautrix>2005-06-10 11:53:12 (UTC)
commitd2f00fc2034450bc9a3cd1d2c3510bef1758d3bc (patch) (side-by-side diff)
tree0764371abfdb5d663ffebf408d47d49f0ca919f3 /pwmanager
parente5ca8e0d8d6d08b597253f43de401aa1a99a6abe (diff)
downloadkdepimpi-d2f00fc2034450bc9a3cd1d2c3510bef1758d3bc.zip
kdepimpi-d2f00fc2034450bc9a3cd1d2c3510bef1758d3bc.tar.gz
kdepimpi-d2f00fc2034450bc9a3cd1d2c3510bef1758d3bc.tar.bz2
config dialog changes
Diffstat (limited to 'pwmanager') (more/less context) (ignore whitespace changes)
-rw-r--r--pwmanager/pwmanager/kcmconfigs/kcmpwmconfig.h1
-rw-r--r--pwmanager/pwmanager/pwm.cpp45
-rw-r--r--pwmanager/pwmanager/pwm.h1
3 files changed, 37 insertions, 10 deletions
diff --git a/pwmanager/pwmanager/kcmconfigs/kcmpwmconfig.h b/pwmanager/pwmanager/kcmconfigs/kcmpwmconfig.h
index b9ea6b8..2d19680 100644
--- a/pwmanager/pwmanager/kcmconfigs/kcmpwmconfig.h
+++ b/pwmanager/pwmanager/kcmconfigs/kcmpwmconfig.h
@@ -33,12 +33,13 @@ class KCMPwmConfig : public KCModule
{
Q_OBJECT
public:
KCMPwmConfig(QWidget *parent = 0, const char *name = 0 );
+ public slots:
virtual void load();
virtual void save();
virtual void defaults();
private:
PWMConfigWidget *mConfigWidget;
diff --git a/pwmanager/pwmanager/pwm.cpp b/pwmanager/pwmanager/pwm.cpp
index 9c8d12d..e12dc49 100644
--- a/pwmanager/pwmanager/pwm.cpp
+++ b/pwmanager/pwmanager/pwm.cpp
@@ -34,12 +34,13 @@
#include "configuration.h"
#else
#include <qmenubar.h>
#include <qmessagebox.h>
#include <pwmprefs.h>
#include <kpimglobalprefs.h>
+#include <kprefsdialog.h>
#include <kcmconfigs/kcmpwmconfig.h>
#include <kcmconfigs/kcmkdepimconfig.h>
#include <kcmultidialog.h>
#include "editcategory.h"
#endif
@@ -71,13 +72,12 @@
# include "kwalletemu.h"
#endif
#ifdef CONFIG_KEYCARD
# include "pwmkeycard.h"
#endif
-
#define DEFAULT_SIZE (QSize(700, 400))
// Button IDs for "file" popup menu
enum {
BUTTON_POPUP_FILE_NEW = 0,
BUTTON_POPUP_FILE_OPEN,
@@ -114,13 +114,14 @@ enum {
BUTTON_POPUP_VIEW_LOCK,
BUTTON_POPUP_VIEW_DEEPLOCK,
BUTTON_POPUP_VIEW_UNLOCK
};
// Button IDs for "options" popup menu
enum {
- BUTTON_POPUP_OPTIONS_CONFIG = 0
+ BUTTON_POPUP_OPTIONS_CONFIG = 0,
+ BUTTON_POPUP_OPTIONS_GLOBAL_CONFIG
#ifdef PWM_EMBEDDED
,BUTTON_POPUP_OPTIONS_CATEGORY
#endif
};
// Button IDs for "export" popup menu (in "file" popup menu)
enum {
@@ -356,15 +357,19 @@ void PwM::initMenubar()
i18n("&Unlock all entries"), this,
SLOT(unlockWnd_slot()), 0,
BUTTON_POPUP_VIEW_UNLOCK);
menuBar()->insertItem(i18n("&View"), viewPopup);
// "options" popup menu
optionsPopup->insertItem(QIconSet(picons->loadIcon("configure", KIcon::Small)),
- i18n("&Configure..."), this,
+ i18n("&Configure PwM/Pi..."), this,
SLOT(config_slot()),0,
BUTTON_POPUP_OPTIONS_CONFIG);
+ optionsPopup->insertItem(QIconSet(picons->loadIcon("configure", KIcon::Small)),
+ i18n("Global Settings..."), this,
+ SLOT(config_global_slot()),0,
+ BUTTON_POPUP_OPTIONS_GLOBAL_CONFIG);
if ( QApplication::desktop()->width() <= 240 ) {
managePopup->insertSeparator();
managePopup->insertItem(i18n("&Options"), optionsPopup);
} else
menuBar()->insertItem(i18n("&Options"), optionsPopup);
// "help" popup menu
@@ -848,37 +853,57 @@ void PwM::deepLockWnd_slot()
void PwM::unlockWnd_slot()
{
PWM_ASSERT(curDoc());
curDoc()->lockAll(false);
}
-
+void PwM::config_global_slot()
+{
+ KPimPrefsGlobalDialog gc ( this );
+ gc.exec();
+}
void PwM::config_slot()
{
int oldStyle = conf()->confWndMainViewStyle();
-#ifdef PWM_EMBEDDED
+
+#if 0
KCMultiDialog* ConfigureDialog = new KCMultiDialog( "PIM", this ,"pwmconfigdialog", true );
KCMPwmConfig* pwmcfg = new KCMPwmConfig( ConfigureDialog->getNewVBoxPage(i18n( "PwManager")) , "KCMPwmConfig" );
ConfigureDialog->addModule(pwmcfg );
KCMKdePimConfig* kdelibcfg = new KCMKdePimConfig( ConfigureDialog->getNewVBoxPage(i18n( "Global")) , "KCMKdeLibConfig" );
ConfigureDialog->addModule(kdelibcfg );
+#endif
+
+
+ KDialogBase * ConfigureDialog = new KDialogBase ( KDialogBase::Plain , i18n("Configure KA/Pi"), KDialogBase::Default |KDialogBase::Cancel | KDialogBase::Apply | KDialogBase::Ok, KDialogBase::Ok,0, "name", true, true);
+
+ KCMPwmConfig* kabcfg = new KCMPwmConfig( ConfigureDialog , "KCMpwmConfig" );
+ ConfigureDialog->setMainWidget( kabcfg );
+ connect( ConfigureDialog, SIGNAL( applyClicked() ),
+ kabcfg, SLOT( save() ) );
+ connect( ConfigureDialog, SIGNAL( acceptClicked() ),
+ 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;
-#else //PWM_EMBEDDED
- // display the configuration window (modal mode)
- if (!conf()->showConfWnd(this))
- return;
-#endif
+
int newStyle = conf()->confWndMainViewStyle();
// reinitialize tray
init->initTray();
// reinitialize KWallet emulation
init->initKWalletEmu();
diff --git a/pwmanager/pwmanager/pwm.h b/pwmanager/pwmanager/pwm.h
index 9fa9edc..2d1b854 100644
--- a/pwmanager/pwmanager/pwm.h
+++ b/pwmanager/pwmanager/pwm.h
@@ -162,12 +162,13 @@ public slots:
/** window/unlock triggered */
void unlockWnd_slot();
/** find item */
void find_slot();
/** configure clicked */
void config_slot();
+ void config_global_slot();
/** (de)activate the "change master pw" button in the menu-bar */
void activateMpButton(bool activate = true);
/** generate a new chipcard */
void genNewCard_slot();
/** completely erase the current card */
void eraseCard_slot();