diff options
author | George Hazan <ghazan@miranda.im> | 2018-07-11 17:09:17 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-07-11 17:09:17 +0300 |
commit | b2c91edc9646daa331de71d589e4fec6bdef4945 (patch) | |
tree | 847a77d0686d26e25b126313fbaa8262c81f8d1a /protocols/FacebookRM/src | |
parent | ae081843e9663b3cb36b17309fbce1d2967315f1 (diff) |
GUI change:
- methods OnInitDialog, OnApply & OnClose of CDlgBase now return true if successful. return of false prevents a dialog from being loaded or left respectively;
- massive code cleaning considering the 'virtual' attribute of overridden methods;
- also fixes #1476 (Don't close "Create new account" window if user not set account name)
Diffstat (limited to 'protocols/FacebookRM/src')
-rw-r--r-- | protocols/FacebookRM/src/dialogs.cpp | 6 | ||||
-rw-r--r-- | protocols/FacebookRM/src/dialogs.h | 5 |
2 files changed, 7 insertions, 4 deletions
diff --git a/protocols/FacebookRM/src/dialogs.cpp b/protocols/FacebookRM/src/dialogs.cpp index 7e9447fd02..dce5630ca9 100644 --- a/protocols/FacebookRM/src/dialogs.cpp +++ b/protocols/FacebookRM/src/dialogs.cpp @@ -632,13 +632,14 @@ CFacebookGuardDialog::CFacebookGuardDialog(FacebookProto *proto, const char *fb_ m_sms.OnClick = Callback(this, &CFacebookGuardDialog::OnSms); } -void CFacebookGuardDialog::OnInitDialog() +bool CFacebookGuardDialog::OnInitDialog() { Window_SetIcon_IcoLib(m_hwnd, GetIconHandle("facebook")); SendMessage(m_text.GetHwnd(), EM_LIMITTEXT, 6, 0); Utils_RestoreWindowPosition(m_hwnd, 0, m_proto->m_szModuleName, "GuardWindow"); + return true; } void CFacebookGuardDialog::OnOk(CCtrlButton*) @@ -653,9 +654,10 @@ void CFacebookGuardDialog::OnSms(CCtrlButton *btn) m_proto->facy.sms_code(m_fb_dtsg); } -void CFacebookGuardDialog::OnClose() +bool CFacebookGuardDialog::OnClose() { Utils_SaveWindowPosition(m_hwnd, 0, m_proto->m_szModuleName, "GuardWindow"); + return true; } const char* CFacebookGuardDialog::GetCode() diff --git a/protocols/FacebookRM/src/dialogs.h b/protocols/FacebookRM/src/dialogs.h index 33229c7f6c..85d6ffff44 100644 --- a/protocols/FacebookRM/src/dialogs.h +++ b/protocols/FacebookRM/src/dialogs.h @@ -46,10 +46,11 @@ private: CCtrlButton m_sms;
protected:
- void OnInitDialog();
+ bool OnInitDialog() override;
+ bool OnClose() override;
+
void OnOk(CCtrlButton*);
void OnSms(CCtrlButton*);
- void OnClose();
public:
CFacebookGuardDialog(FacebookProto *proto, const char *fb_dtsg);
|