summaryrefslogtreecommitdiff
path: root/plugins/New_GPG/src/ui.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-06-04 17:03:28 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-06-04 17:03:28 +0300
commitf531ff887729783a7fe7a3e12ad12f658eefc7b0 (patch)
tree9e1844429448b6527ef7ca87163e44eafce250d8 /plugins/New_GPG/src/ui.cpp
parent1c2e5d128a7176ae827dda1e2a8fcc64e772a148 (diff)
UI classes:
- CDlgBase::m_bSucceeded variable introduced to check whether IDOK was pressed or not; - unused/useless buttons with id=IDOK or IDCANCEL removed; - brnOk.OnClick replaced with OnApply calls; - unused/useless calls of EndDialog/EndModal removed; - minor code cleaning
Diffstat (limited to 'plugins/New_GPG/src/ui.cpp')
-rwxr-xr-xplugins/New_GPG/src/ui.cpp25
1 files changed, 9 insertions, 16 deletions
diff --git a/plugins/New_GPG/src/ui.cpp b/plugins/New_GPG/src/ui.cpp
index ebc2fa8fd6..3742d43b24 100755
--- a/plugins/New_GPG/src/ui.cpp
+++ b/plugins/New_GPG/src/ui.cpp
@@ -1192,13 +1192,9 @@ CDlgKeyPasswordMsgBox::CDlgKeyPasswordMsgBox(MCONTACT _hContact) :
lbl_KEYID(this, IDC_KEYID),
edit_KEY_PASSWORD(this, IDC_KEY_PASSWORD),
chk_DEFAULT_PASSWORD(this, IDC_DEFAULT_PASSWORD),
- chk_SAVE_PASSWORD(this, IDC_SAVE_PASSWORD),
- btn_OK(this, IDOK),
- btn_CANCEL(this, IDCANCEL)
+ chk_SAVE_PASSWORD(this, IDC_SAVE_PASSWORD)
{
hContact = _hContact;
- btn_OK.OnClick = Callback(this, &CDlgKeyPasswordMsgBox::onClick_OK);
- btn_CANCEL.OnClick = Callback(this, &CDlgKeyPasswordMsgBox::onClick_CANCEL);
}
bool CDlgKeyPasswordMsgBox::OnInitDialog()
@@ -1213,13 +1209,7 @@ bool CDlgKeyPasswordMsgBox::OnInitDialog()
return true;
}
-void CDlgKeyPasswordMsgBox::OnDestroy()
-{
- mir_free(inkeyid);
- Utils_SaveWindowPosition(m_hwnd, 0, MODULENAME, "PasswordWindow");
-}
-
-void CDlgKeyPasswordMsgBox::onClick_OK(CCtrlButton*)
+bool CDlgKeyPasswordMsgBox::OnApply()
{
ptrW tmp(edit_KEY_PASSWORD.GetText());
if (tmp && tmp[0]) {
@@ -1236,11 +1226,14 @@ void CDlgKeyPasswordMsgBox::onClick_OK(CCtrlButton*)
globals.wszPassword = tmp;
}
mir_free(inkeyid);
- DestroyWindow(m_hwnd);
+ return true;
}
-void CDlgKeyPasswordMsgBox::onClick_CANCEL(CCtrlButton*)
+void CDlgKeyPasswordMsgBox::OnDestroy()
{
- globals._terminate = true;
- DestroyWindow(m_hwnd);
+ if (!m_bSucceeded)
+ globals._terminate = true;
+
+ mir_free(inkeyid);
+ Utils_SaveWindowPosition(m_hwnd, 0, MODULENAME, "PasswordWindow");
}