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
@@ -36,6 +36,7 @@ class KCMPwmConfig : public KCModule
public:
KCMPwmConfig(QWidget *parent = 0, const char *name = 0 );
+ public slots:
virtual void load();
virtual void save();
virtual void defaults();
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
@@ -37,6 +37,7 @@
#include <qmessagebox.h>
#include <pwmprefs.h>
#include <kpimglobalprefs.h>
+#include <kprefsdialog.h>
#include <kcmconfigs/kcmpwmconfig.h>
#include <kcmconfigs/kcmkdepimconfig.h>
#include <kcmultidialog.h>
@@ -74,7 +75,6 @@
# include "pwmkeycard.h"
#endif
-
#define DEFAULT_SIZE (QSize(700, 400))
// Button IDs for "file" popup menu
@@ -117,7 +117,8 @@ enum {
};
// 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
@@ -359,9 +360,13 @@ void PwM::initMenubar()
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);
@@ -851,11 +856,16 @@ 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" );
@@ -863,19 +873,34 @@ void PwM::config_slot()
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
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
@@ -165,6 +165,7 @@ public slots:
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 */