author | ulf69 <ulf69> | 2004-09-23 19:33:54 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-09-23 19:33:54 (UTC) |
commit | 15c6615421bc50d6d54dc334c90944749c347d9e (patch) (unidiff) | |
tree | 9843c16340d2681dc529cca410472136ea1123fd /pwmanager | |
parent | ccf18890228a471d048d591c0d488e63c2de1ccc (diff) | |
download | kdepimpi-15c6615421bc50d6d54dc334c90944749c347d9e.zip kdepimpi-15c6615421bc50d6d54dc334c90944749c347d9e.tar.gz kdepimpi-15c6615421bc50d6d54dc334c90944749c347d9e.tar.bz2 |
modified the add password dialog to fit on embedded devices
-rw-r--r-- | pwmanager/pwmanager/addentrywndimpl.cpp | 30 | ||||
-rw-r--r-- | pwmanager/pwmanager/addentrywndimpl.h | 19 | ||||
-rw-r--r-- | pwmanager/pwmanager/pwgenwndimpl.cpp | 25 | ||||
-rw-r--r-- | pwmanager/pwmanager/pwgenwndimpl.h | 12 | ||||
-rw-r--r-- | pwmanager/pwmanager/pwm.cpp | 5 | ||||
-rw-r--r-- | pwmanager/pwmanager/pwmanagerE.pro | 8 |
6 files changed, 90 insertions, 9 deletions
diff --git a/pwmanager/pwmanager/addentrywndimpl.cpp b/pwmanager/pwmanager/addentrywndimpl.cpp index 73ba36c..ffd301f 100644 --- a/pwmanager/pwmanager/addentrywndimpl.cpp +++ b/pwmanager/pwmanager/addentrywndimpl.cpp | |||
@@ -34,10 +34,12 @@ | |||
34 | #include <qpushbutton.h> | 34 | #include <qpushbutton.h> |
35 | #include <qlabel.h> | 35 | #include <qlabel.h> |
36 | 36 | ||
37 | 37 | #ifndef PWM_EMBEDDED | |
38 | AddEntryWndImpl::AddEntryWndImpl() | 38 | AddEntryWndImpl::AddEntryWndImpl() |
39 | #ifdef PWM_EMBEDDED | ||
40 | : addEntryWnd( 0, "AddEntryWndImpl", TRUE) | 39 | : addEntryWnd( 0, "AddEntryWndImpl", TRUE) |
40 | #else | ||
41 | AddEntryWndImpl::AddEntryWndImpl( QWidget* parent, const char* name) | ||
42 | : addEntryWnd( parent, name) | ||
41 | #endif | 43 | #endif |
42 | { | 44 | { |
43 | editAdvCommentButton = 0; | 45 | editAdvCommentButton = 0; |
@@ -53,6 +55,29 @@ AddEntryWndImpl::~AddEntryWndImpl() | |||
53 | delete pwGen; | 55 | delete pwGen; |
54 | } | 56 | } |
55 | 57 | ||
58 | #ifdef PWM_EMBEDDED | ||
59 | void AddEntryWndImpl::slotOk() | ||
60 | { | ||
61 | slotApply(); | ||
62 | |||
63 | if (pwLineEdit->text().isEmpty()) { | ||
64 | KMessageBox::error(this, | ||
65 | i18n("Sorry, you haven't set a password."), | ||
66 | i18n("no password")); | ||
67 | return; | ||
68 | } | ||
69 | |||
70 | if (descLineEdit->text().isEmpty()) { | ||
71 | KMessageBox::error(this, | ||
72 | i18n("You haven't set a \"Description\"."), | ||
73 | i18n("Description not set")); | ||
74 | return; | ||
75 | } | ||
76 | |||
77 | KDialogBase::slotOk(); | ||
78 | } | ||
79 | #else | ||
80 | |||
56 | void AddEntryWndImpl::okButton_slot() | 81 | void AddEntryWndImpl::okButton_slot() |
57 | { | 82 | { |
58 | if (pwLineEdit->text().isEmpty()) { | 83 | if (pwLineEdit->text().isEmpty()) { |
@@ -75,6 +100,7 @@ void AddEntryWndImpl::cancelButton_slot() | |||
75 | { | 100 | { |
76 | done(2); | 101 | done(2); |
77 | } | 102 | } |
103 | #endif | ||
78 | 104 | ||
79 | void AddEntryWndImpl::setCurrCategory(const QString &cat) | 105 | void AddEntryWndImpl::setCurrCategory(const QString &cat) |
80 | { | 106 | { |
diff --git a/pwmanager/pwmanager/addentrywndimpl.h b/pwmanager/pwmanager/addentrywndimpl.h index c0bfcee..622e9d2 100644 --- a/pwmanager/pwmanager/addentrywndimpl.h +++ b/pwmanager/pwmanager/addentrywndimpl.h | |||
@@ -20,16 +20,19 @@ | |||
20 | #ifndef __ADDENTRYWNDIMPL_H | 20 | #ifndef __ADDENTRYWNDIMPL_H |
21 | #define __ADDENTRYWNDIMPL_H | 21 | #define __ADDENTRYWNDIMPL_H |
22 | 22 | ||
23 | #include "addentrywnd.h" | ||
24 | 23 | ||
25 | #include <qlineedit.h> | ||
26 | #ifndef PWM_EMBEDDED | 24 | #ifndef PWM_EMBEDDED |
25 | #include <qlineedit.h> | ||
27 | #include <qtextedit.h> | 26 | #include <qtextedit.h> |
27 | #include <qcombobox.h> | ||
28 | #include "addentrywnd.h" | ||
28 | #else | 29 | #else |
30 | #include <klineedit.h> | ||
31 | #include <kcombobox.h> | ||
29 | #include <qmultilineedit.h> | 32 | #include <qmultilineedit.h> |
33 | #include "addentrywnd_emb.h" | ||
30 | #endif | 34 | #endif |
31 | 35 | ||
32 | #include <qcombobox.h> | ||
33 | #include <qpushbutton.h> | 36 | #include <qpushbutton.h> |
34 | 37 | ||
35 | class PwGenWndImpl; | 38 | class PwGenWndImpl; |
@@ -39,7 +42,11 @@ class AddEntryWndImpl : public addEntryWnd | |||
39 | { | 42 | { |
40 | Q_OBJECT | 43 | Q_OBJECT |
41 | public: | 44 | public: |
45 | #ifndef PWM_EMBEDDED | ||
42 | AddEntryWndImpl(); | 46 | AddEntryWndImpl(); |
47 | #else | ||
48 | AddEntryWndImpl( QWidget* parent = 0, const char* name = 0); | ||
49 | #endif | ||
43 | ~AddEntryWndImpl(); | 50 | ~AddEntryWndImpl(); |
44 | 51 | ||
45 | /* get... functions */ | 52 | /* get... functions */ |
@@ -78,10 +85,16 @@ public: | |||
78 | { return useAdvComment; } | 85 | { return useAdvComment; } |
79 | 86 | ||
80 | public slots: | 87 | public slots: |
88 | #ifndef PWM_EMBEDDED | ||
89 | //MOC_SKIP_BEGIN | ||
81 | /** OK button pressed */ | 90 | /** OK button pressed */ |
82 | void okButton_slot(); | 91 | void okButton_slot(); |
83 | /** cancel button pressed */ | 92 | /** cancel button pressed */ |
84 | void cancelButton_slot(); | 93 | void cancelButton_slot(); |
94 | //MOC_SKIP_END | ||
95 | #else | ||
96 | virtual void slotOk(); | ||
97 | #endif | ||
85 | /** Reveal button pressed */ | 98 | /** Reveal button pressed */ |
86 | void revealButton_slot(); | 99 | void revealButton_slot(); |
87 | /** Generate button pressed */ | 100 | /** Generate button pressed */ |
diff --git a/pwmanager/pwmanager/pwgenwndimpl.cpp b/pwmanager/pwmanager/pwgenwndimpl.cpp index 01f5740..5313060 100644 --- a/pwmanager/pwmanager/pwgenwndimpl.cpp +++ b/pwmanager/pwmanager/pwgenwndimpl.cpp | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <kmessagebox.h> | 30 | #include <kmessagebox.h> |
31 | 31 | ||
32 | 32 | ||
33 | #ifndef PWM_EMBEDDED | ||
33 | PwGenWndImpl::PwGenWndImpl(QWidget *parent, | 34 | PwGenWndImpl::PwGenWndImpl(QWidget *parent, |
34 | const char *name, | 35 | const char *name, |
35 | bool modal, | 36 | bool modal, |
@@ -38,12 +39,33 @@ PwGenWndImpl::PwGenWndImpl(QWidget *parent, | |||
38 | { | 39 | { |
39 | } | 40 | } |
40 | 41 | ||
42 | #else | ||
43 | PwGenWndImpl::PwGenWndImpl( QWidget* parent, const char* name) | ||
44 | : pwGenWnd( parent, name) | ||
45 | { | ||
46 | } | ||
47 | #endif | ||
48 | |||
41 | PwGenWndImpl::~PwGenWndImpl() | 49 | PwGenWndImpl::~PwGenWndImpl() |
42 | { | 50 | { |
43 | } | 51 | } |
44 | 52 | ||
53 | #ifdef PWM_EMBEDDED | ||
54 | void PwGenWndImpl::slotOk() | ||
55 | { | ||
56 | // internal generator | ||
57 | if (!optionsSanityIntGen()) | ||
58 | return; | ||
59 | if (!startIntGen()) | ||
60 | return; | ||
61 | |||
62 | KDialogBase::slotOk(); | ||
63 | } | ||
64 | #endif | ||
65 | |||
45 | void PwGenWndImpl::genButton_slot() | 66 | void PwGenWndImpl::genButton_slot() |
46 | { | 67 | { |
68 | #ifndef PWM_EMBEDDED | ||
47 | // internal generator | 69 | // internal generator |
48 | if (!optionsSanityIntGen()) | 70 | if (!optionsSanityIntGen()) |
49 | return; | 71 | return; |
@@ -52,11 +74,14 @@ void PwGenWndImpl::genButton_slot() | |||
52 | done(0); | 74 | done(0); |
53 | exit_success: | 75 | exit_success: |
54 | done(1); | 76 | done(1); |
77 | #endif | ||
55 | } | 78 | } |
56 | 79 | ||
57 | void PwGenWndImpl::cancelButton_slot() | 80 | void PwGenWndImpl::cancelButton_slot() |
58 | { | 81 | { |
82 | #ifndef PWM_EMBEDDED | ||
59 | done(0); | 83 | done(0); |
84 | #endif | ||
60 | } | 85 | } |
61 | 86 | ||
62 | bool PwGenWndImpl::optionsSanityIntGen() | 87 | bool PwGenWndImpl::optionsSanityIntGen() |
diff --git a/pwmanager/pwmanager/pwgenwndimpl.h b/pwmanager/pwmanager/pwgenwndimpl.h index 5c25643..994ff2f 100644 --- a/pwmanager/pwmanager/pwgenwndimpl.h +++ b/pwmanager/pwmanager/pwgenwndimpl.h | |||
@@ -20,15 +20,24 @@ | |||
20 | #ifndef __PWGENWNDIMPL_H | 20 | #ifndef __PWGENWNDIMPL_H |
21 | #define __PWGENWNDIMPL_H | 21 | #define __PWGENWNDIMPL_H |
22 | 22 | ||
23 | #ifndef PWM_EMBEDDED | ||
23 | #include "pwgenwnd.h" | 24 | #include "pwgenwnd.h" |
25 | #else | ||
26 | #include "pwgenwnd_emb.h" | ||
27 | #endif | ||
24 | 28 | ||
25 | class PwGenWndImpl : public pwGenWnd | 29 | class PwGenWndImpl : public pwGenWnd |
26 | { | 30 | { |
27 | public: | 31 | public: |
32 | #ifndef PWM_EMBEDDED | ||
28 | PwGenWndImpl(QWidget *parent = 0, | 33 | PwGenWndImpl(QWidget *parent = 0, |
29 | const char *name = 0, | 34 | const char *name = 0, |
30 | bool modal = FALSE, | 35 | bool modal = FALSE, |
31 | WFlags fl = 0); | 36 | WFlags fl = 0); |
37 | #else | ||
38 | PwGenWndImpl( QWidget* parent = 0, const char* name = 0); | ||
39 | #endif | ||
40 | |||
32 | ~PwGenWndImpl(); | 41 | ~PwGenWndImpl(); |
33 | 42 | ||
34 | /** returns the generated password */ | 43 | /** returns the generated password */ |
@@ -37,6 +46,9 @@ public: | |||
37 | protected slots: | 46 | protected slots: |
38 | /** generate button pressed */ | 47 | /** generate button pressed */ |
39 | void genButton_slot(); | 48 | void genButton_slot(); |
49 | #ifdef PWM_EMBEDDED | ||
50 | virtual void slotOk(); | ||
51 | #endif | ||
40 | /** cancel button pressed */ | 52 | /** cancel button pressed */ |
41 | void cancelButton_slot(); | 53 | void cancelButton_slot(); |
42 | 54 | ||
diff --git a/pwmanager/pwmanager/pwm.cpp b/pwmanager/pwmanager/pwm.cpp index 08fcb25..107e845 100644 --- a/pwmanager/pwmanager/pwm.cpp +++ b/pwmanager/pwmanager/pwm.cpp | |||
@@ -568,7 +568,12 @@ void PwM::addPwd_slot(QString *pw, PwMDoc *_doc) | |||
568 | } | 568 | } |
569 | PWM_ASSERT(doc); | 569 | PWM_ASSERT(doc); |
570 | doc->timer()->getLock(DocTimer::id_autoLockTimer); | 570 | doc->timer()->getLock(DocTimer::id_autoLockTimer); |
571 | #ifndef PWM_EMBEDDED | ||
571 | AddEntryWndImpl w; | 572 | AddEntryWndImpl w; |
573 | #else | ||
574 | AddEntryWndImpl w(this, "addentrywndimpl"); | ||
575 | #endif | ||
576 | |||
572 | vector<string> catList; | 577 | vector<string> catList; |
573 | doc->getCategoryList(&catList); | 578 | doc->getCategoryList(&catList); |
574 | unsigned i, size = catList.size(); | 579 | unsigned i, size = catList.size(); |
diff --git a/pwmanager/pwmanager/pwmanagerE.pro b/pwmanager/pwmanager/pwmanagerE.pro index 5c29ea4..87142b7 100644 --- a/pwmanager/pwmanager/pwmanagerE.pro +++ b/pwmanager/pwmanager/pwmanagerE.pro | |||
@@ -39,7 +39,7 @@ LIBS += $(QTOPIALIB) | |||
39 | #selftest.h | 39 | #selftest.h |
40 | 40 | ||
41 | HEADERS = \ | 41 | HEADERS = \ |
42 | addentrywnd.h \ | 42 | addentrywnd_emb.h \ |
43 | addentrywndimpl.h \ | 43 | addentrywndimpl.h \ |
44 | base64.h \ | 44 | base64.h \ |
45 | binentrygen.h \ | 45 | binentrygen.h \ |
@@ -62,7 +62,7 @@ ipc.h \ | |||
62 | listobjselectwnd.h \ | 62 | listobjselectwnd.h \ |
63 | listviewpwm.h \ | 63 | listviewpwm.h \ |
64 | printtext.h \ | 64 | printtext.h \ |
65 | pwgenwnd.h \ | 65 | pwgenwnd_emb.h \ |
66 | pwgenwndimpl.h \ | 66 | pwgenwndimpl.h \ |
67 | pwmdoc.h \ | 67 | pwmdoc.h \ |
68 | pwmdocui.h \ | 68 | pwmdocui.h \ |
@@ -103,7 +103,7 @@ kcmconfigs/pwmconfigwidget.h \ | |||
103 | #spinforsignal.cpp | 103 | #spinforsignal.cpp |
104 | 104 | ||
105 | SOURCES = \ | 105 | SOURCES = \ |
106 | addentrywnd.cpp \ | 106 | addentrywnd_emb.cpp \ |
107 | addentrywndimpl.cpp \ | 107 | addentrywndimpl.cpp \ |
108 | base64.cpp \ | 108 | base64.cpp \ |
109 | binentrygen.cpp \ | 109 | binentrygen.cpp \ |
@@ -124,7 +124,7 @@ ipc.cpp \ | |||
124 | listobjselectwnd.cpp \ | 124 | listobjselectwnd.cpp \ |
125 | listviewpwm.cpp \ | 125 | listviewpwm.cpp \ |
126 | main.cpp \ | 126 | main.cpp \ |
127 | pwgenwnd.cpp \ | 127 | pwgenwnd_emb.cpp \ |
128 | pwgenwndimpl.cpp \ | 128 | pwgenwndimpl.cpp \ |
129 | pwm.cpp \ | 129 | pwm.cpp \ |
130 | pwmdoc.cpp \ | 130 | pwmdoc.cpp \ |