diff options
author | Robert Pösel <robyer@seznam.cz> | 2015-12-12 07:06:46 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2015-12-12 07:06:46 +0000 |
commit | ba0eb9d04b41db0a7190a61f518c281423d23d80 (patch) | |
tree | e735362ce3dd77f6ba0fc36f4bed2892f2d4fb87 | |
parent | 258cfc3509afb2aa0fd6444b59abcfaa27606573 (diff) |
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
-rw-r--r-- | protocols/Steam/src/steam_dialogs.cpp | 6 | ||||
-rw-r--r-- | protocols/Steam/src/steam_dialogs.h | 2 | ||||
-rw-r--r-- | protocols/Steam/src/steam_login.cpp | 4 |
3 files changed, 7 insertions, 5 deletions
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<CSteamProto> 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");
|