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) (unidiff)
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
33{ 33{
34 Q_OBJECT 34 Q_OBJECT
35 35
36 public: 36 public:
37 KCMPwmConfig(QWidget *parent = 0, const char *name = 0 ); 37 KCMPwmConfig(QWidget *parent = 0, const char *name = 0 );
38 38
39 public slots:
39 virtual void load(); 40 virtual void load();
40 virtual void save(); 41 virtual void save();
41 virtual void defaults(); 42 virtual void defaults();
42 43
43 private: 44 private:
44 PWMConfigWidget *mConfigWidget; 45 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 @@
34#include "configuration.h" 34#include "configuration.h"
35#else 35#else
36#include <qmenubar.h> 36#include <qmenubar.h>
37#include <qmessagebox.h> 37#include <qmessagebox.h>
38#include <pwmprefs.h> 38#include <pwmprefs.h>
39#include <kpimglobalprefs.h> 39#include <kpimglobalprefs.h>
40#include <kprefsdialog.h>
40#include <kcmconfigs/kcmpwmconfig.h> 41#include <kcmconfigs/kcmpwmconfig.h>
41#include <kcmconfigs/kcmkdepimconfig.h> 42#include <kcmconfigs/kcmkdepimconfig.h>
42#include <kcmultidialog.h> 43#include <kcmultidialog.h>
43#include "editcategory.h" 44#include "editcategory.h"
44#endif 45#endif
45 46
@@ -71,13 +72,12 @@
71# include "kwalletemu.h" 72# include "kwalletemu.h"
72#endif 73#endif
73#ifdef CONFIG_KEYCARD 74#ifdef CONFIG_KEYCARD
74# include "pwmkeycard.h" 75# include "pwmkeycard.h"
75#endif 76#endif
76 77
77
78 #define DEFAULT_SIZE (QSize(700, 400)) 78 #define DEFAULT_SIZE (QSize(700, 400))
79 79
80// Button IDs for "file" popup menu 80// Button IDs for "file" popup menu
81enum { 81enum {
82 BUTTON_POPUP_FILE_NEW = 0, 82 BUTTON_POPUP_FILE_NEW = 0,
83 BUTTON_POPUP_FILE_OPEN, 83 BUTTON_POPUP_FILE_OPEN,
@@ -114,13 +114,14 @@ enum {
114 BUTTON_POPUP_VIEW_LOCK, 114 BUTTON_POPUP_VIEW_LOCK,
115 BUTTON_POPUP_VIEW_DEEPLOCK, 115 BUTTON_POPUP_VIEW_DEEPLOCK,
116 BUTTON_POPUP_VIEW_UNLOCK 116 BUTTON_POPUP_VIEW_UNLOCK
117}; 117};
118// Button IDs for "options" popup menu 118// Button IDs for "options" popup menu
119enum { 119enum {
120 BUTTON_POPUP_OPTIONS_CONFIG = 0 120 BUTTON_POPUP_OPTIONS_CONFIG = 0,
121 BUTTON_POPUP_OPTIONS_GLOBAL_CONFIG
121#ifdef PWM_EMBEDDED 122#ifdef PWM_EMBEDDED
122 ,BUTTON_POPUP_OPTIONS_CATEGORY 123 ,BUTTON_POPUP_OPTIONS_CATEGORY
123#endif 124#endif
124}; 125};
125// Button IDs for "export" popup menu (in "file" popup menu) 126// Button IDs for "export" popup menu (in "file" popup menu)
126enum { 127enum {
@@ -356,15 +357,19 @@ void PwM::initMenubar()
356 i18n("&Unlock all entries"), this, 357 i18n("&Unlock all entries"), this,
357 SLOT(unlockWnd_slot()), 0, 358 SLOT(unlockWnd_slot()), 0,
358 BUTTON_POPUP_VIEW_UNLOCK); 359 BUTTON_POPUP_VIEW_UNLOCK);
359 menuBar()->insertItem(i18n("&View"), viewPopup); 360 menuBar()->insertItem(i18n("&View"), viewPopup);
360// "options" popup menu 361// "options" popup menu
361 optionsPopup->insertItem(QIconSet(picons->loadIcon("configure", KIcon::Small)), 362 optionsPopup->insertItem(QIconSet(picons->loadIcon("configure", KIcon::Small)),
362 i18n("&Configure..."), this, 363 i18n("&Configure PwM/Pi..."), this,
363 SLOT(config_slot()),0, 364 SLOT(config_slot()),0,
364 BUTTON_POPUP_OPTIONS_CONFIG); 365 BUTTON_POPUP_OPTIONS_CONFIG);
366 optionsPopup->insertItem(QIconSet(picons->loadIcon("configure", KIcon::Small)),
367 i18n("Global Settings..."), this,
368 SLOT(config_global_slot()),0,
369 BUTTON_POPUP_OPTIONS_GLOBAL_CONFIG);
365 if ( QApplication::desktop()->width() <= 240 ) { 370 if ( QApplication::desktop()->width() <= 240 ) {
366 managePopup->insertSeparator(); 371 managePopup->insertSeparator();
367 managePopup->insertItem(i18n("&Options"), optionsPopup); 372 managePopup->insertItem(i18n("&Options"), optionsPopup);
368 } else 373 } else
369 menuBar()->insertItem(i18n("&Options"), optionsPopup); 374 menuBar()->insertItem(i18n("&Options"), optionsPopup);
370// "help" popup menu 375// "help" popup menu
@@ -848,37 +853,57 @@ void PwM::deepLockWnd_slot()
848 853
849void PwM::unlockWnd_slot() 854void PwM::unlockWnd_slot()
850{ 855{
851 PWM_ASSERT(curDoc()); 856 PWM_ASSERT(curDoc());
852 curDoc()->lockAll(false); 857 curDoc()->lockAll(false);
853} 858}
854 859void PwM::config_global_slot()
860{
861 KPimPrefsGlobalDialog gc ( this );
862 gc.exec();
863}
855void PwM::config_slot() 864void PwM::config_slot()
856{ 865{
857 int oldStyle = conf()->confWndMainViewStyle(); 866 int oldStyle = conf()->confWndMainViewStyle();
858#ifdef PWM_EMBEDDED 867
868#if 0
859 KCMultiDialog* ConfigureDialog = new KCMultiDialog( "PIM", this ,"pwmconfigdialog", true ); 869 KCMultiDialog* ConfigureDialog = new KCMultiDialog( "PIM", this ,"pwmconfigdialog", true );
860 870
861 KCMPwmConfig* pwmcfg = new KCMPwmConfig( ConfigureDialog->getNewVBoxPage(i18n( "PwManager")) , "KCMPwmConfig" ); 871 KCMPwmConfig* pwmcfg = new KCMPwmConfig( ConfigureDialog->getNewVBoxPage(i18n( "PwManager")) , "KCMPwmConfig" );
862 ConfigureDialog->addModule(pwmcfg ); 872 ConfigureDialog->addModule(pwmcfg );
863 873
864 KCMKdePimConfig* kdelibcfg = new KCMKdePimConfig( ConfigureDialog->getNewVBoxPage(i18n( "Global")) , "KCMKdeLibConfig" ); 874 KCMKdePimConfig* kdelibcfg = new KCMKdePimConfig( ConfigureDialog->getNewVBoxPage(i18n( "Global")) , "KCMKdeLibConfig" );
865 ConfigureDialog->addModule(kdelibcfg ); 875 ConfigureDialog->addModule(kdelibcfg );
876#endif
877
866 878
879
880 KDialogBase * ConfigureDialog = new KDialogBase ( KDialogBase::Plain , i18n("Configure KA/Pi"), KDialogBase::Default |KDialogBase::Cancel | KDialogBase::Apply | KDialogBase::Ok, KDialogBase::Ok,0, "name", true, true);
881
882 KCMPwmConfig* kabcfg = new KCMPwmConfig( ConfigureDialog , "KCMpwmConfig" );
883 ConfigureDialog->setMainWidget( kabcfg );
884 connect( ConfigureDialog, SIGNAL( applyClicked() ),
885 kabcfg, SLOT( save() ) );
886 connect( ConfigureDialog, SIGNAL( acceptClicked() ),
887 kabcfg, SLOT( save() ) );
888 connect( ConfigureDialog, SIGNAL( defaultClicked() ),
889 kabcfg, SLOT( defaults() ) );
890 //saveSettings();
891 kabcfg->load();
867#ifndef DESKTOP_VERSION 892#ifndef DESKTOP_VERSION
893 if ( QApplication::desktop()->height() <= 480 )
894 ;// ConfigureDialog->hideButtons();
868 ConfigureDialog->showMaximized(); 895 ConfigureDialog->showMaximized();
869#endif 896#endif
897
898
870 if ( ConfigureDialog->exec() ) 899 if ( ConfigureDialog->exec() )
871 KMessageBox::information( this, i18n("Some changes are only\neffective after a restart!\n") ); 900 KMessageBox::information( this, i18n("Some changes are only\neffective after a restart!\n") );
872 delete ConfigureDialog; 901 delete ConfigureDialog;
873 902
874#else //PWM_EMBEDDED 903
875 // display the configuration window (modal mode)
876 if (!conf()->showConfWnd(this))
877 return;
878#endif
879 904
880 int newStyle = conf()->confWndMainViewStyle(); 905 int newStyle = conf()->confWndMainViewStyle();
881 // reinitialize tray 906 // reinitialize tray
882 init->initTray(); 907 init->initTray();
883 // reinitialize KWallet emulation 908 // reinitialize KWallet emulation
884 init->initKWalletEmu(); 909 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:
162 /** window/unlock triggered */ 162 /** window/unlock triggered */
163 void unlockWnd_slot(); 163 void unlockWnd_slot();
164 /** find item */ 164 /** find item */
165 void find_slot(); 165 void find_slot();
166 /** configure clicked */ 166 /** configure clicked */
167 void config_slot(); 167 void config_slot();
168 void config_global_slot();
168 /** (de)activate the "change master pw" button in the menu-bar */ 169 /** (de)activate the "change master pw" button in the menu-bar */
169 void activateMpButton(bool activate = true); 170 void activateMpButton(bool activate = true);
170 /** generate a new chipcard */ 171 /** generate a new chipcard */
171 void genNewCard_slot(); 172 void genNewCard_slot();
172 /** completely erase the current card */ 173 /** completely erase the current card */
173 void eraseCard_slot(); 174 void eraseCard_slot();