From 092bd6e814c5112e19fcffb8716e1a02938f8803 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Thu, 30 Jun 2016 08:29:55 +0000 Subject: Steam: Implement two factor (mobile) authentization; version bump git-svn-id: http://svn.miranda-ng.org/main/trunk@17052 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Steam/src/steam_dialogs.cpp | 38 +++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'protocols/Steam/src/steam_dialogs.cpp') diff --git a/protocols/Steam/src/steam_dialogs.cpp b/protocols/Steam/src/steam_dialogs.cpp index c9bfb2540b..a51193f9cf 100644 --- a/protocols/Steam/src/steam_dialogs.cpp +++ b/protocols/Steam/src/steam_dialogs.cpp @@ -76,6 +76,44 @@ const char* CSteamGuardDialog::GetGuardCode() ///////////////////////////////////////////////////////////////////////////////// +CSteamTwoFactorDialog::CSteamTwoFactorDialog(CSteamProto *proto) +: CSteamDlgBase(proto, IDD_TWOFACTOR, false), +m_ok(this, IDOK), +m_text(this, IDC_TEXT) +{ + memset(m_twoFactorCode, 0, sizeof(m_twoFactorCode)); + m_ok.OnClick = Callback(this, &CSteamTwoFactorDialog::OnOk); +} + +void CSteamTwoFactorDialog::OnInitDialog() +{ + char iconName[100]; + mir_snprintf(iconName, "%s_%s", MODULE, "main"); + Window_SetIcon_IcoLib(m_hwnd, IcoLib_GetIconHandle(iconName)); + + SendMessage(m_text.GetHwnd(), EM_LIMITTEXT, 5, 0); + + Utils_RestoreWindowPosition(m_hwnd, NULL, m_proto->m_szModuleName, "TwoFactorWindow"); +} + +void CSteamTwoFactorDialog::OnOk(CCtrlButton*) +{ + mir_strncpy(m_twoFactorCode, ptrA(m_text.GetTextA()), _countof(m_twoFactorCode)); + EndDialog(m_hwnd, DIALOG_RESULT_OK); +} + +void CSteamTwoFactorDialog::OnClose() +{ + Utils_SaveWindowPosition(m_hwnd, NULL, m_proto->m_szModuleName, "TwoFactorWindow"); +} + +const char* CSteamTwoFactorDialog::GetTwoFactorCode() +{ + return m_twoFactorCode; +} + +///////////////////////////////////////////////////////////////////////////////// + CSteamCaptchaDialog::CSteamCaptchaDialog(CSteamProto *proto, BYTE *captchaImage, int captchaImageSize) : CSteamDlgBase(proto, IDD_CAPTCHA, false), m_ok(this, IDOK), m_text(this, IDC_TEXT), -- cgit v1.2.3