summaryrefslogtreecommitdiff
path: root/protocols/Steam/src/steam_dialogs.cpp
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2016-06-30 08:29:55 +0000
committerRobert Pösel <robyer@seznam.cz>2016-06-30 08:29:55 +0000
commit092bd6e814c5112e19fcffb8716e1a02938f8803 (patch)
tree8fbf4e303682bc4e7fece17b01348e0ab36f979f /protocols/Steam/src/steam_dialogs.cpp
parentff1c157a941458735ece56effc60f3ab7a88b8d8 (diff)
Steam: Implement two factor (mobile) authentization; version bump
git-svn-id: http://svn.miranda-ng.org/main/trunk@17052 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Steam/src/steam_dialogs.cpp')
-rw-r--r--protocols/Steam/src/steam_dialogs.cpp38
1 files changed, 38 insertions, 0 deletions
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),