Diffstat (limited to 'pwmanager/pwmanager/setmasterpwwndimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | pwmanager/pwmanager/setmasterpwwndimpl.cpp | 43 |
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 @@ -46,8 +46,9 @@ SetMasterPwWndImpl::SetMasterPwWndImpl(QWidget * parent, const char *name) #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; } @@ -58,6 +59,7 @@ SetMasterPwWndImpl::~SetMasterPwWndImpl() void SetMasterPwWndImpl::okButton_slot() { +#ifndef PWM_EMBEDDED int index = mainTab->currentPageIndex(); if (index == 0) { // normal password @@ -88,13 +90,52 @@ void SetMasterPwWndImpl::okButton_slot() } } 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 |