summaryrefslogtreecommitdiff
path: root/protocols/Steam/src
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 /protocols/Steam/src
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 'protocols/Steam/src')
-rw-r--r--protocols/Steam/src/steam_dialogs.cpp14
-rw-r--r--protocols/Steam/src/steam_dialogs.h6
2 files changed, 8 insertions, 12 deletions
diff --git a/protocols/Steam/src/steam_dialogs.cpp b/protocols/Steam/src/steam_dialogs.cpp
index 3e3fe3b912..690e04d1e6 100644
--- a/protocols/Steam/src/steam_dialogs.cpp
+++ b/protocols/Steam/src/steam_dialogs.cpp
@@ -110,16 +110,15 @@ bool CSteamTwoFactorDialog::OnClose()
/////////////////////////////////////////////////////////////////////////////////
-CSteamCaptchaDialog::CSteamCaptchaDialog(CSteamProto *proto, const uint8_t *captchaImage, size_t captchaImageSize)
- : CSteamDlgBase(proto, IDD_CAPTCHA),
- m_ok(this, IDOK), m_text(this, IDC_TEXT),
+CSteamCaptchaDialog::CSteamCaptchaDialog(CSteamProto *proto, const uint8_t *captchaImage, size_t captchaImageSize) :
+ CSteamDlgBase(proto, IDD_CAPTCHA),
+ m_text(this, IDC_TEXT),
m_captchaImage(nullptr)
{
memset(m_captchaText, 0, sizeof(m_captchaText));
m_captchaImageSize = captchaImageSize;
m_captchaImage = (uint8_t*)mir_alloc(captchaImageSize);
memcpy(m_captchaImage, captchaImage, captchaImageSize);
- m_ok.OnClick = Callback(this, &CSteamCaptchaDialog::OnOk);
}
CSteamCaptchaDialog::~CSteamCaptchaDialog()
@@ -140,16 +139,15 @@ bool CSteamCaptchaDialog::OnInitDialog()
return true;
}
-void CSteamCaptchaDialog::OnOk(CCtrlButton*)
+bool CSteamCaptchaDialog::OnApply()
{
mir_strncpy(m_captchaText, ptrA(m_text.GetTextA()), _countof(m_captchaText));
- EndModal(DIALOG_RESULT_OK);
+ return true;
}
-bool CSteamCaptchaDialog::OnClose()
+void CSteamCaptchaDialog::OnDestroy()
{
Utils_SaveWindowPosition(m_hwnd, NULL, m_proto->m_szModuleName, "CaptchaWindow");
- return true;
}
INT_PTR CSteamCaptchaDialog::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
diff --git a/protocols/Steam/src/steam_dialogs.h b/protocols/Steam/src/steam_dialogs.h
index 190c2504c5..8389e0bfd3 100644
--- a/protocols/Steam/src/steam_dialogs.h
+++ b/protocols/Steam/src/steam_dialogs.h
@@ -75,15 +75,13 @@ class CSteamCaptchaDialog : public CSteamDlgBase
size_t m_captchaImageSize;
CCtrlEdit m_text;
- CCtrlButton m_ok;
protected:
bool OnInitDialog() override;
- bool OnClose() override;
+ bool OnApply() override;
+ void OnDestroy() override;
INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override;
- void OnOk(CCtrlButton*);
-
public:
CSteamCaptchaDialog(CSteamProto *proto, const uint8_t *captchaImage, size_t captchaImageSize);
~CSteamCaptchaDialog();