summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--pwmanager/pwmanager/addentrywndimpl.cpp30
-rw-r--r--pwmanager/pwmanager/addentrywndimpl.h19
-rw-r--r--pwmanager/pwmanager/pwgenwndimpl.cpp25
-rw-r--r--pwmanager/pwmanager/pwgenwndimpl.h12
-rw-r--r--pwmanager/pwmanager/pwm.cpp5
-rw-r--r--pwmanager/pwmanager/pwmanagerE.pro8
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
@@ -31,16 +31,18 @@
31#include <kmessagebox.h> 31#include <kmessagebox.h>
32#include <klocale.h> 32#include <klocale.h>
33 33
34#include <qpushbutton.h> 34#include <qpushbutton.h>
35#include <qlabel.h> 35#include <qlabel.h>
36 36
37 37#ifndef PWM_EMBEDDED
38AddEntryWndImpl::AddEntryWndImpl() 38AddEntryWndImpl::AddEntryWndImpl()
39#ifdef PWM_EMBEDDED
40 : addEntryWnd( 0, "AddEntryWndImpl", TRUE) 39 : addEntryWnd( 0, "AddEntryWndImpl", TRUE)
40#else
41AddEntryWndImpl::AddEntryWndImpl( QWidget* parent, const char* name)
42 : addEntryWnd( parent, name)
41#endif 43#endif
42{ 44{
43 editAdvCommentButton = 0; 45 editAdvCommentButton = 0;
44 commentTextEdit = 0; 46 commentTextEdit = 0;
45 switchComment(false); 47 switchComment(false);
46 pwGen = new PwGenWndImpl(this); 48 pwGen = new PwGenWndImpl(this);
@@ -50,12 +52,35 @@ AddEntryWndImpl::~AddEntryWndImpl()
50{ 52{
51 delete_ifnot_null(editAdvCommentButton); 53 delete_ifnot_null(editAdvCommentButton);
52 delete_ifnot_null(commentTextEdit); 54 delete_ifnot_null(commentTextEdit);
53 delete pwGen; 55 delete pwGen;
54} 56}
55 57
58#ifdef PWM_EMBEDDED
59void 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
56void AddEntryWndImpl::okButton_slot() 81void AddEntryWndImpl::okButton_slot()
57{ 82{
58 if (pwLineEdit->text().isEmpty()) { 83 if (pwLineEdit->text().isEmpty()) {
59 KMessageBox::error(this, 84 KMessageBox::error(this,
60 i18n("Sorry, you haven't set a password."), 85 i18n("Sorry, you haven't set a password."),
61 i18n("no password")); 86 i18n("no password"));
@@ -72,12 +97,13 @@ void AddEntryWndImpl::okButton_slot()
72} 97}
73 98
74void AddEntryWndImpl::cancelButton_slot() 99void AddEntryWndImpl::cancelButton_slot()
75{ 100{
76 done(2); 101 done(2);
77} 102}
103#endif
78 104
79void AddEntryWndImpl::setCurrCategory(const QString &cat) 105void AddEntryWndImpl::setCurrCategory(const QString &cat)
80{ 106{
81 int i, count = categoryComboBox->count(); 107 int i, count = categoryComboBox->count();
82 108
83 for (i = 0; i < count; ++i) { 109 for (i = 0; i < count; ++i) {
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
@@ -17,32 +17,39 @@
17 * $Id$ 17 * $Id$
18 **************************************************************************/ 18 **************************************************************************/
19 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
35class PwGenWndImpl; 38class PwGenWndImpl;
36 39
37/** "add/edit" Window */ 40/** "add/edit" Window */
38class AddEntryWndImpl : public addEntryWnd 41class AddEntryWndImpl : public addEntryWnd
39{ 42{
40 Q_OBJECT 43 Q_OBJECT
41public: 44public:
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 */
46 QString getDescription() 53 QString getDescription()
47 { return descLineEdit->text(); } 54 { return descLineEdit->text(); }
48 QString getCategory() 55 QString getCategory()
@@ -75,16 +82,22 @@ public:
75 82
76 /** are we using an advanced comment */ 83 /** are we using an advanced comment */
77 bool isAdvancedComment() 84 bool isAdvancedComment()
78 { return useAdvComment; } 85 { return useAdvComment; }
79 86
80public slots: 87public 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 */
88 void generateButton_slot(); 101 void generateButton_slot();
89 /** advanced comment button pressed */ 102 /** advanced comment button pressed */
90 void advancedCommentButton_slot(bool on); 103 void advancedCommentButton_slot(bool on);
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
@@ -27,39 +27,64 @@
27#include <qlineedit.h> 27#include <qlineedit.h>
28 28
29#include <klocale.h> 29#include <klocale.h>
30#include <kmessagebox.h> 30#include <kmessagebox.h>
31 31
32 32
33#ifndef PWM_EMBEDDED
33PwGenWndImpl::PwGenWndImpl(QWidget *parent, 34PwGenWndImpl::PwGenWndImpl(QWidget *parent,
34 const char *name, 35 const char *name,
35 bool modal, 36 bool modal,
36 WFlags fl) 37 WFlags fl)
37 : pwGenWnd(parent, name, modal, fl) 38 : pwGenWnd(parent, name, modal, fl)
38{ 39{
39} 40}
40 41
42#else
43PwGenWndImpl::PwGenWndImpl( QWidget* parent, const char* name)
44 : pwGenWnd( parent, name)
45{
46}
47#endif
48
41PwGenWndImpl::~PwGenWndImpl() 49PwGenWndImpl::~PwGenWndImpl()
42{ 50{
43} 51}
44 52
53#ifdef PWM_EMBEDDED
54void PwGenWndImpl::slotOk()
55{
56 // internal generator
57 if (!optionsSanityIntGen())
58 return;
59 if (!startIntGen())
60 return;
61
62 KDialogBase::slotOk();
63}
64#endif
65
45void PwGenWndImpl::genButton_slot() 66void 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;
50 if (startIntGen()) 72 if (startIntGen())
51 goto exit_success; 73 goto exit_success;
52 done(0); 74 done(0);
53exit_success: 75exit_success:
54 done(1); 76 done(1);
77#endif
55} 78}
56 79
57void PwGenWndImpl::cancelButton_slot() 80void PwGenWndImpl::cancelButton_slot()
58{ 81{
82#ifndef PWM_EMBEDDED
59 done(0); 83 done(0);
84#endif
60} 85}
61 86
62bool PwGenWndImpl::optionsSanityIntGen() 87bool PwGenWndImpl::optionsSanityIntGen()
63{ 88{
64 if (int_charLowerCheckBox->isChecked()) 89 if (int_charLowerCheckBox->isChecked())
65 return true; 90 return true;
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
@@ -17,29 +17,41 @@
17 * $Id$ 17 * $Id$
18 **************************************************************************/ 18 **************************************************************************/
19 19
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
25class PwGenWndImpl : public pwGenWnd 29class PwGenWndImpl : public pwGenWnd
26{ 30{
27public: 31public:
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 */
35 QString getPassword(); 44 QString getPassword();
36 45
37protected slots: 46protected 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
43protected: 55protected:
44 /** start the internal generator */ 56 /** start the internal generator */
45 bool startIntGen(); 57 bool startIntGen();
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
@@ -565,13 +565,18 @@ void PwM::addPwd_slot(QString *pw, PwMDoc *_doc)
565 doc = _doc; 565 doc = _doc;
566 } else { 566 } else {
567 doc = curDoc(); 567 doc = curDoc();
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();
575 for (i = 0; i < size; ++i) { 580 for (i = 0; i < size; ++i) {
576 w.addCategory(catList[i].c_str()); 581 w.addCategory(catList[i].c_str());
577 } 582 }
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
@@ -36,13 +36,13 @@ LIBS += $(QTOPIALIB)
36#configuration.h \ 36#configuration.h \
37#configwnd.h \ 37#configwnd.h \
38#configwndimpl.h \ 38#configwndimpl.h \
39#selftest.h 39#selftest.h
40 40
41HEADERS = \ 41HEADERS = \
42addentrywnd.h \ 42addentrywnd_emb.h \
43addentrywndimpl.h \ 43addentrywndimpl.h \
44base64.h \ 44base64.h \
45binentrygen.h \ 45binentrygen.h \
46blowfish.h \ 46blowfish.h \
47commentbox.h \ 47commentbox.h \
48compiler.h \ 48compiler.h \
@@ -59,13 +59,13 @@ gpasmanfile.h \
59htmlgen.h \ 59htmlgen.h \
60htmlparse.h \ 60htmlparse.h \
61ipc.h \ 61ipc.h \
62listobjselectwnd.h \ 62listobjselectwnd.h \
63listviewpwm.h \ 63listviewpwm.h \
64printtext.h \ 64printtext.h \
65pwgenwnd.h \ 65pwgenwnd_emb.h \
66pwgenwndimpl.h \ 66pwgenwndimpl.h \
67pwmdoc.h \ 67pwmdoc.h \
68pwmdocui.h \ 68pwmdocui.h \
69pwmexception.h \ 69pwmexception.h \
70pwm.h \ 70pwm.h \
71pwminit.h \ 71pwminit.h \
@@ -100,13 +100,13 @@ kcmconfigs/pwmconfigwidget.h \
100#printtext.cpp \ 100#printtext.cpp \
101#selftest.cpp \ 101#selftest.cpp \
102#pwmprint.cpp \ 102#pwmprint.cpp \
103#spinforsignal.cpp 103#spinforsignal.cpp
104 104
105SOURCES = \ 105SOURCES = \
106addentrywnd.cpp \ 106addentrywnd_emb.cpp \
107addentrywndimpl.cpp \ 107addentrywndimpl.cpp \
108base64.cpp \ 108base64.cpp \
109binentrygen.cpp \ 109binentrygen.cpp \
110blowfish.cpp \ 110blowfish.cpp \
111commentbox.cpp \ 111commentbox.cpp \
112compressbzip2.cpp \ 112compressbzip2.cpp \
@@ -121,13 +121,13 @@ globalstuff.cpp \
121gpasmanfile.cpp \ 121gpasmanfile.cpp \
122htmlgen.cpp \ 122htmlgen.cpp \
123ipc.cpp \ 123ipc.cpp \
124listobjselectwnd.cpp \ 124listobjselectwnd.cpp \
125listviewpwm.cpp \ 125listviewpwm.cpp \
126main.cpp \ 126main.cpp \
127pwgenwnd.cpp \ 127pwgenwnd_emb.cpp \
128pwgenwndimpl.cpp \ 128pwgenwndimpl.cpp \
129pwm.cpp \ 129pwm.cpp \
130pwmdoc.cpp \ 130pwmdoc.cpp \
131pwmdocui.cpp \ 131pwmdocui.cpp \
132pwmexception.cpp \ 132pwmexception.cpp \
133pwminit.cpp \ 133pwminit.cpp \