diff options
author | George Hazan <ghazan@miranda.im> | 2020-06-09 11:54:00 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-06-09 11:54:00 +0300 |
commit | 492804ca02dd69ceccae8322eb985bb8277071cc (patch) | |
tree | 871c0d57e7bb86a29e2eeafaa5b104624074f67f | |
parent | b4d1e68688b1fe2d8e040c4b48ebe0f7b34bacc0 (diff) |
fix for running the same dialog multiple times
-rw-r--r-- | plugins/Dbx_mdbx/src/dbcrypt.cpp | 3 | ||||
-rw-r--r-- | src/mir_core/src/CDlgBase.cpp | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/plugins/Dbx_mdbx/src/dbcrypt.cpp b/plugins/Dbx_mdbx/src/dbcrypt.cpp index 8c47a1a4d3..1b22fa6618 100644 --- a/plugins/Dbx_mdbx/src/dbcrypt.cpp +++ b/plugins/Dbx_mdbx/src/dbcrypt.cpp @@ -233,8 +233,9 @@ int CDbxMDBX::InitCrypt() if (!m_crypto->setKey((const BYTE*)value.iov_base, value.iov_len)) {
CEnterPasswordDialog dlg(this);
while (true) {
- if (!dlg.DoModal())
+ if (dlg.DoModal() != IDOK)
return 4;
+
m_crypto->setPassword(pass_ptrA(mir_utf8encodeW(dlg.m_newPass)));
if (m_crypto->setKey((const BYTE*)value.iov_base, value.iov_len)) {
m_bUsesPassword = true;
diff --git a/src/mir_core/src/CDlgBase.cpp b/src/mir_core/src/CDlgBase.cpp index f89f68139c..71af58e913 100644 --- a/src/mir_core/src/CDlgBase.cpp +++ b/src/mir_core/src/CDlgBase.cpp @@ -202,7 +202,7 @@ INT_PTR CDlgBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { case WM_INITDIALOG: - m_bInitialized = false; + m_bInitialized = m_bSucceeded = false; TranslateDialog_LP(m_hwnd, &m_pPlugin); ::EnumChildWindows(m_hwnd, &GlobalFieldEnum, LPARAM(this)); |