summaryrefslogtreecommitdiffabout
path: root/pwmanager/pwmanager/setmasterpwwndimpl.cpp
Side-by-side diff
Diffstat (limited to 'pwmanager/pwmanager/setmasterpwwndimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--pwmanager/pwmanager/setmasterpwwndimpl.cpp43
1 files changed, 42 insertions, 1 deletions
diff --git a/pwmanager/pwmanager/setmasterpwwndimpl.cpp b/pwmanager/pwmanager/setmasterpwwndimpl.cpp
index aac0408..3482643 100644
--- a/pwmanager/pwmanager/setmasterpwwndimpl.cpp
+++ b/pwmanager/pwmanager/setmasterpwwndimpl.cpp
@@ -43,24 +43,26 @@ SetMasterPwWndImpl::SetMasterPwWndImpl(QWidget * parent, const char *name)
#ifdef CONFIG_KEYCARD
curCardIdLabel->setText(STRING_CARD_NONE);
#else // CONFIG_KEYCARD
#ifndef PWM_EMBEDDED
mainTab->removePage(mainTab->page(1));
#else
- qDebug("SetMasterPwWndImpl::SetMasterPwWndImpl has to be fixed");
+ mainTab->removePage(tab_2);
#endif
+
#endif // CONFIG_KEYCARD
keyCard = 0;
}
SetMasterPwWndImpl::~SetMasterPwWndImpl()
{
}
void SetMasterPwWndImpl::okButton_slot()
{
+#ifndef PWM_EMBEDDED
int index = mainTab->currentPageIndex();
if (index == 0) {
// normal password
if (pwEdit_1->text() != pwEdit_2->text()) {
KMessageBox::error(this,
i18n
@@ -85,19 +87,58 @@ void SetMasterPwWndImpl::okButton_slot()
"PwM-key-card."),
i18n("no card"));
return;
}
}
done(1);
+#endif
}
void SetMasterPwWndImpl::cancelButton_slot()
{
+#ifndef PWM_EMBEDDED
done(2);
+#endif
+}
+
+void SetMasterPwWndImpl::slotOk()
+{
+ int index = mainTab->currentPageIndex();
+ if (index == 0) {
+ // normal password
+ if (pwEdit_1->text() != pwEdit_2->text()) {
+ KMessageBox::error(this,
+ i18n
+ ("The two passwords you have entered\ndon't match.\n"
+ "Please try entering them again."),
+ i18n("Different passwords"));
+ return;
+ }
+ if (pwEdit_1->text() == "") {
+ KMessageBox::error(this,
+ i18n("No password entered.\n"
+ "Please type in a password,\nthat "
+ "you want to use for\nthe encryption."),
+ i18n("no password"));
+ return;
+ }
+ } else {
+ // key-card
+ if (curCardIdLabel->text() == STRING_CARD_NONE) {
+ KMessageBox::error(this,
+ i18n("You didn't select a card as\n"
+ "PwM-key-card."),
+ i18n("no card"));
+ return;
+ }
+ }
+
+ setMasterPwWnd::slotOk();
}
+
void SetMasterPwWndImpl::genCardButton_slot()
{
#ifdef CONFIG_KEYCARD
PWM_ASSERT(keyCard);
keyCard->genNewCard();
#endif // CONFIG_KEYCARD