-rw-r--r-- | pwmanager/pwmanager/addentrywnd_emb.cpp | 45 | ||||
-rw-r--r-- | pwmanager/pwmanager/addentrywnd_emb.h | 8 | ||||
-rw-r--r-- | pwmanager/pwmanager/addentrywndimpl.cpp | 7 | ||||
-rw-r--r-- | pwmanager/pwmanager/addentrywndimpl.h | 2 | ||||
-rw-r--r-- | pwmanager/pwmanager/pwm.cpp | 4 |
5 files changed, 51 insertions, 15 deletions
diff --git a/pwmanager/pwmanager/addentrywnd_emb.cpp b/pwmanager/pwmanager/addentrywnd_emb.cpp index dd09d13..f065058 100644 --- a/pwmanager/pwmanager/addentrywnd_emb.cpp +++ b/pwmanager/pwmanager/addentrywnd_emb.cpp | |||
@@ -26,2 +26,3 @@ $Id$ | |||
26 | #include "addentrywnd_emb.h" | 26 | #include "addentrywnd_emb.h" |
27 | #include "pwmdoc.h" | ||
27 | 28 | ||
@@ -44,6 +45,6 @@ $Id$ | |||
44 | */ | 45 | */ |
45 | addEntryWnd::addEntryWnd( QWidget* parent, const char* name) | 46 | addEntryWnd::addEntryWnd( PwMDoc* d, QWidget* parent, const char* name) |
46 | : KDialogBase( KDialogBase::Plain, i18n( "edit/add a password entry" ), | 47 | : KDialogBase( KDialogBase::Plain, i18n( "edit/add a password entry" ), |
47 | KDialogBase::Ok | KDialogBase::Cancel, | 48 | KDialogBase::Ok | KDialogBase::Cancel, |
48 | KDialogBase::Ok, parent, name, true ) | 49 | KDialogBase::Ok, parent, name, true ), doc(d) |
49 | { | 50 | { |
@@ -67,4 +68,4 @@ addEntryWnd::addEntryWnd( QWidget* parent, const char* name) | |||
67 | descLineEdit = new KLineEdit( tab1, "descLineEdit" ); | 68 | descLineEdit = new KLineEdit( tab1, "descLineEdit" ); |
68 | QLabel* label = new QLabel( descLineEdit, i18n("Description:"), tab1 ); | 69 | descLineLabel = new QLabel( descLineEdit, i18n("Description:"), tab1 ); |
69 | layout->addWidget( label, i, 0 ); | 70 | layout->addWidget( descLineLabel, i, 0 ); |
70 | layout->addWidget( descLineEdit, i, 1 ); | 71 | layout->addWidget( descLineEdit, i, 1 ); |
@@ -73,3 +74,3 @@ addEntryWnd::addEntryWnd( QWidget* parent, const char* name) | |||
73 | categoryComboBox = new KComboBox( tab1 ); | 74 | categoryComboBox = new KComboBox( tab1 ); |
74 | label = new QLabel( categoryComboBox, i18n("Category:"), tab1 ); | 75 | QLabel* label = new QLabel( categoryComboBox, i18n("Category:"), tab1 ); |
75 | layout->addWidget( label, i, 0 ); | 76 | layout->addWidget( label, i, 0 ); |
@@ -81,6 +82,8 @@ addEntryWnd::addEntryWnd( QWidget* parent, const char* name) | |||
81 | categoryComboBox->setDuplicatesEnabled( FALSE ); | 82 | categoryComboBox->setDuplicatesEnabled( FALSE ); |
83 | connect(categoryComboBox,SIGNAL(activated(const QString&)), SLOT(categorySelected(const QString&))); | ||
84 | |||
82 | 85 | ||
83 | usernameLineEdit = new KLineEdit( tab1, "usernameLineEdit" ); | 86 | usernameLineEdit = new KLineEdit( tab1, "usernameLineEdit" ); |
84 | label = new QLabel( usernameLineEdit, i18n("Username:"), tab1 ); | 87 | usernameLineLabel = new QLabel( usernameLineEdit, i18n("Username:"), tab1 ); |
85 | layout->addWidget( label, i, 0 ); | 88 | layout->addWidget( usernameLineLabel, i, 0 ); |
86 | layout->addWidget( usernameLineEdit, i, 1 ); | 89 | layout->addWidget( usernameLineEdit, i, 1 ); |
@@ -90,4 +93,4 @@ addEntryWnd::addEntryWnd( QWidget* parent, const char* name) | |||
90 | pwLineEdit->setEchoMode( QLineEdit::Password ); | 93 | pwLineEdit->setEchoMode( QLineEdit::Password ); |
91 | label = new QLabel( pwLineEdit, i18n("Password:"), tab1 ); | 94 | pwLineLabel = new QLabel( pwLineEdit, i18n("Password:"), tab1 ); |
92 | layout->addWidget( label, i, 0 ); | 95 | layout->addWidget( pwLineLabel, i, 0 ); |
93 | layout->addWidget( pwLineEdit, i, 1 ); | 96 | layout->addWidget( pwLineEdit, i, 1 ); |
@@ -198,2 +201,26 @@ void addEntryWnd::advancedCommentButton_slot(bool) | |||
198 | 201 | ||
202 | void addEntryWnd::categorySelected ( const QString & string ) | ||
203 | { | ||
204 | unsigned int idx; | ||
205 | bool found = doc->findCategory(string, &idx); | ||
206 | |||
207 | if (found == true) | ||
208 | { | ||
209 | qDebug("addEntryWnd::categorySelected found"); | ||
210 | PwMCategoryItem* catitem = doc->getCategoryEntry(idx); | ||
211 | |||
212 | descLineLabel->setText(catitem->desc_text.c_str()); | ||
213 | usernameLineLabel->setText(catitem->name_text.c_str()); | ||
214 | pwLineLabel->setText(catitem->pw_text.c_str()); | ||
215 | return; | ||
216 | } | ||
217 | else | ||
218 | { | ||
219 | qDebug("addEntryWnd::categorySelected NOT found"); | ||
220 | BUG(); | ||
221 | } | ||
222 | |||
223 | |||
224 | } | ||
225 | |||
199 | 226 | ||
diff --git a/pwmanager/pwmanager/addentrywnd_emb.h b/pwmanager/pwmanager/addentrywnd_emb.h index 83761dc..966d9d2 100644 --- a/pwmanager/pwmanager/addentrywnd_emb.h +++ b/pwmanager/pwmanager/addentrywnd_emb.h | |||
@@ -41,2 +41,3 @@ class QGroupBox; | |||
41 | class QMultiLineEdit; | 41 | class QMultiLineEdit; |
42 | class PwMDoc; | ||
42 | 43 | ||
@@ -47,3 +48,3 @@ class addEntryWnd : public KDialogBase | |||
47 | public: | 48 | public: |
48 | addEntryWnd( QWidget* parent = 0, const char* name = 0); | 49 | addEntryWnd( PwMDoc* doc, QWidget* parent = 0, const char* name = 0); |
49 | ~addEntryWnd(); | 50 | ~addEntryWnd(); |
@@ -57,2 +58,5 @@ public: | |||
57 | KLineEdit* urlLineEdit; | 58 | KLineEdit* urlLineEdit; |
59 | QLabel* descLineLabel; | ||
60 | QLabel* usernameLineLabel; | ||
61 | QLabel* pwLineLabel; | ||
58 | 62 | ||
@@ -60,2 +64,3 @@ public: | |||
60 | QMultiLineEdit* commentTextEdit; | 64 | QMultiLineEdit* commentTextEdit; |
65 | PwMDoc* doc; | ||
61 | 66 | ||
@@ -68,2 +73,3 @@ public slots: | |||
68 | virtual void slotOk(); | 73 | virtual void slotOk(); |
74 | virtual void categorySelected ( const QString & string ); | ||
69 | 75 | ||
diff --git a/pwmanager/pwmanager/addentrywndimpl.cpp b/pwmanager/pwmanager/addentrywndimpl.cpp index d47f32c..fa6b6c0 100644 --- a/pwmanager/pwmanager/addentrywndimpl.cpp +++ b/pwmanager/pwmanager/addentrywndimpl.cpp | |||
@@ -42,4 +42,4 @@ AddEntryWndImpl::AddEntryWndImpl() | |||
42 | #else | 42 | #else |
43 | AddEntryWndImpl::AddEntryWndImpl( QWidget* parent, const char* name) | 43 | AddEntryWndImpl::AddEntryWndImpl( PwMDoc* doc, QWidget* parent, const char* name) |
44 | : addEntryWnd( parent, name) | 44 | : addEntryWnd( doc, parent, name) |
45 | #endif | 45 | #endif |
@@ -117,2 +117,5 @@ void AddEntryWndImpl::setCurrCategory(const QString &cat) | |||
117 | categoryComboBox->setCurrentItem(i); | 117 | categoryComboBox->setCurrentItem(i); |
118 | #ifdef PWM_EMBEDDED | ||
119 | categorySelected(cat); | ||
120 | #endif | ||
118 | return; | 121 | return; |
diff --git a/pwmanager/pwmanager/addentrywndimpl.h b/pwmanager/pwmanager/addentrywndimpl.h index ce9a594..e13eb54 100644 --- a/pwmanager/pwmanager/addentrywndimpl.h +++ b/pwmanager/pwmanager/addentrywndimpl.h | |||
@@ -47,3 +47,3 @@ public: | |||
47 | #else | 47 | #else |
48 | AddEntryWndImpl( QWidget* parent = 0, const char* name = 0); | 48 | AddEntryWndImpl( PwMDoc* doc, QWidget* parent = 0, const char* name = 0); |
49 | #endif | 49 | #endif |
diff --git a/pwmanager/pwmanager/pwm.cpp b/pwmanager/pwmanager/pwm.cpp index bd98d72..9642a43 100644 --- a/pwmanager/pwmanager/pwm.cpp +++ b/pwmanager/pwmanager/pwm.cpp | |||
@@ -635,3 +635,3 @@ void PwM::addPwd_slot1(QString *pw, PwMDoc *_doc) | |||
635 | #else | 635 | #else |
636 | AddEntryWndImpl w(this, "addentrywndimpl"); | 636 | AddEntryWndImpl w(doc, this, "addentrywndimpl"); |
637 | #endif | 637 | #endif |
@@ -734,3 +734,3 @@ void PwM::editPwd_slot3(const QString *category, const int *index, | |||
734 | 734 | ||
735 | AddEntryWndImpl w; | 735 | AddEntryWndImpl w(doc); |
736 | vector<string> catList; | 736 | vector<string> catList; |