summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_disco.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-07-11 17:09:17 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-07-11 17:09:17 +0300
commitb2c91edc9646daa331de71d589e4fec6bdef4945 (patch)
tree847a77d0686d26e25b126313fbaa8262c81f8d1a /protocols/JabberG/src/jabber_disco.cpp
parentae081843e9663b3cb36b17309fbce1d2967315f1 (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/JabberG/src/jabber_disco.cpp')
-rw-r--r--protocols/JabberG/src/jabber_disco.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/protocols/JabberG/src/jabber_disco.cpp b/protocols/JabberG/src/jabber_disco.cpp
index d1fb73b739..a9a3dbb985 100644
--- a/protocols/JabberG/src/jabber_disco.cpp
+++ b/protocols/JabberG/src/jabber_disco.cpp
@@ -581,11 +581,11 @@ public:
CJabberDlgDiscovery(CJabberProto *proto, wchar_t *jid);
protected:
- void OnInitDialog();
- void OnClose();
- void OnDestroy();
- INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam);
- int Resizer(UTILRESIZECONTROL *urc);
+ bool OnInitDialog() override;
+ bool OnClose() override;
+ void OnDestroy() override;
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override;
+ int Resizer(UTILRESIZECONTROL *urc) override;
private:
wchar_t *m_jid;
@@ -628,7 +628,7 @@ CJabberDlgDiscovery::CJabberDlgDiscovery(CJabberProto *proto, wchar_t *jid) :
m_lstDiscoTree.OnFilterChanged = Callback(this, &CJabberDlgDiscovery::lstDiscoTree_OnFilter);
}
-void CJabberDlgDiscovery::OnInitDialog()
+bool CJabberDlgDiscovery::OnInitDialog()
{
CSuper::OnInitDialog();
@@ -702,9 +702,10 @@ void CJabberDlgDiscovery::OnInitDialog()
PostMessage(m_hwnd, WM_COMMAND, MAKEWPARAM(IDC_BUTTON_BROWSE, 0), 0);
Utils_RestoreWindowPosition(m_hwnd, 0, m_proto->m_szModuleName, "discoWnd_");
+ return true;
}
-void CJabberDlgDiscovery::OnClose()
+bool CJabberDlgDiscovery::OnClose()
{
m_proto->setByte("discoWnd_useTree", IsDlgButtonChecked(m_hwnd, IDC_BTN_VIEWTREE));
@@ -721,7 +722,7 @@ void CJabberDlgDiscovery::OnClose()
Utils_SaveWindowPosition(m_hwnd, 0, m_proto->m_szModuleName, "discoWnd_");
DestroyWindow(m_hwnd);
- CSuper::OnClose();
+ return CSuper::OnClose();
}
void CJabberDlgDiscovery::OnDestroy()