From ba0eb9d04b41db0a7190a61f518c281423d23d80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Sat, 12 Dec 2015 07:06:46 +0000 Subject: Steam: Use more explicit check for modal dialog's result git-svn-id: http://svn.miranda-ng.org/main/trunk@15839 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Steam/src/steam_dialogs.cpp | 6 +++--- protocols/Steam/src/steam_dialogs.h | 2 ++ protocols/Steam/src/steam_login.cpp | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) (limited to 'protocols/Steam') diff --git a/protocols/Steam/src/steam_dialogs.cpp b/protocols/Steam/src/steam_dialogs.cpp index a773a3bd3b..eac9710528 100644 --- a/protocols/Steam/src/steam_dialogs.cpp +++ b/protocols/Steam/src/steam_dialogs.cpp @@ -27,7 +27,7 @@ void CSteamPasswordEditor::OnOk(CCtrlButton*) if (m_savePermanently.Enabled()) m_proto->setTString("Password", m_proto->password); - EndDialog(m_hwnd, 1); + EndDialog(m_hwnd, DIALOG_RESULT_OK); } void CSteamPasswordEditor::OnClose() @@ -63,7 +63,7 @@ void CSteamGuardDialog::OnInitDialog() void CSteamGuardDialog::OnOk(CCtrlButton*) { mir_strncpy(m_guardCode, ptrA(m_text.GetTextA()), _countof(m_guardCode)); - EndDialog(m_hwnd, 1); + EndDialog(m_hwnd, DIALOG_RESULT_OK); } void CSteamGuardDialog::OnClose() @@ -111,7 +111,7 @@ void CSteamCaptchaDialog::OnInitDialog() void CSteamCaptchaDialog::OnOk(CCtrlButton*) { mir_strncpy(m_captchaText, ptrA(m_text.GetTextA()), _countof(m_captchaText)); - EndDialog(m_hwnd, 1); + EndDialog(m_hwnd, DIALOG_RESULT_OK); } void CSteamCaptchaDialog::OnClose() diff --git a/protocols/Steam/src/steam_dialogs.h b/protocols/Steam/src/steam_dialogs.h index 2915e5fecc..5bc4d6ecd3 100644 --- a/protocols/Steam/src/steam_dialogs.h +++ b/protocols/Steam/src/steam_dialogs.h @@ -3,6 +3,8 @@ typedef CProtoDlgBase CSteamDlgBase; +#define DIALOG_RESULT_OK 1 + ///////////////////////////////////////////////////////////////////////////////// class CSteamPasswordEditor : public CSteamDlgBase diff --git a/protocols/Steam/src/steam_login.cpp b/protocols/Steam/src/steam_login.cpp index b54149b03c..c149f33eb1 100644 --- a/protocols/Steam/src/steam_login.cpp +++ b/protocols/Steam/src/steam_login.cpp @@ -136,7 +136,7 @@ void CSteamProto::OnAuthorizationError(const JSONNode &node) std::string domain = node["emaildomain"].as_string(); CSteamGuardDialog guardDialog(this, domain.c_str()); - if (!guardDialog.DoModal()) + if (guardDialog.DoModal() != DIALOG_RESULT_OK) { delSetting("GuardId"); delSetting("GuardCode"); @@ -165,7 +165,7 @@ void CSteamProto::OnAuthorizationError(const JSONNode &node) CSteamCaptchaDialog captchaDialog(this, (BYTE*)response->pData, response->dataLength); delete response; - if (!captchaDialog.DoModal()) + if (captchaDialog.DoModal() != DIALOG_RESULT_OK) { delSetting("CaptchaId"); delSetting("CaptchaText"); -- cgit v1.2.3