summaryrefslogtreecommitdiffabout
path: root/pwmanager/pwmanager/setmasterpwwndimpl.cpp
Side-by-side diff
Diffstat (limited to 'pwmanager/pwmanager/setmasterpwwndimpl.cpp') (more/less context) (show whitespace changes)
-rw-r--r--pwmanager/pwmanager/setmasterpwwndimpl.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/pwmanager/pwmanager/setmasterpwwndimpl.cpp b/pwmanager/pwmanager/setmasterpwwndimpl.cpp
index 3482643..7041d2e 100644
--- a/pwmanager/pwmanager/setmasterpwwndimpl.cpp
+++ b/pwmanager/pwmanager/setmasterpwwndimpl.cpp
@@ -95,99 +95,99 @@ void SetMasterPwWndImpl::okButton_slot()
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
}
void SetMasterPwWndImpl::selCardButton_slot()
{
#ifdef CONFIG_KEYCARD
PWM_ASSERT(keyCard);
connect(keyCard, SIGNAL(keyAvailable(uint32_t, const string &)),
this, SLOT(keyAvailable_slot(uint32_t, const string &)));
keyCard->getKey();
#endif // CONFIG_KEYCARD
}
void SetMasterPwWndImpl::keyAvailable_slot(uint32_t cardId,
const string &key)
{
if (key == "")
return;
curCardKey = key;
char id_buf[(sizeof(cardId) * 2) + 2 /* "0x" */ + 1 /* NULL */];
memcpy(id_buf, "0x", 2);
sprintf(id_buf + 2, "%X", cardId);
curCardIdLabel->setText(id_buf);
}
string SetMasterPwWndImpl::getPw(bool *useCard)
{
int index = mainTab->currentPageIndex();
if (index == 0) {
// normal password
if (useCard)
*useCard = false;
PWM_ASSERT(pwEdit_1->text() == pwEdit_2->text());
return pwEdit_1->text().latin1();
} else {
#ifdef CONFIG_KEYCARD
// key-card
if (useCard)
*useCard = true;
PWM_ASSERT(curCardKey != "");
PWM_ASSERT(curCardIdLabel->text() != STRING_CARD_NONE);
return curCardKey;
#endif // CONFIG_KEYCARD
}
return "";
}
-#ifndef PWM_EMBEDDED
-#include "setmasterpwwndimpl.moc"
+#ifndef PWM_EMBEDDED_
+#include "moc_setmasterpwwndimpl.cpp"
#endif