From b2c91edc9646daa331de71d589e4fec6bdef4945 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 11 Jul 2018 17:09:17 +0300 Subject: 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) --- protocols/JabberG/src/jabber_groupchat.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'protocols/JabberG/src/jabber_groupchat.cpp') diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp index 4deab1e08d..392d439f51 100644 --- a/protocols/JabberG/src/jabber_groupchat.cpp +++ b/protocols/JabberG/src/jabber_groupchat.cpp @@ -392,12 +392,12 @@ public: protected: wchar_t *m_jid; - void OnInitDialog(); - void OnDestroy(); + bool OnInitDialog() override; + void OnDestroy(); void OnBtnOk(CCtrlButton*); - INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam); + INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override; }; CJabberDlgGcJoin::CJabberDlgGcJoin(CJabberProto *proto, wchar_t *jid) : @@ -413,7 +413,7 @@ CJabberDlgGcJoin::~CJabberDlgGcJoin() mir_free(m_jid); } -void CJabberDlgGcJoin::OnInitDialog() +bool CJabberDlgGcJoin::OnInitDialog() { CSuper::OnInitDialog(); @@ -475,6 +475,7 @@ void CJabberDlgGcJoin::OnInitDialog() SetDlgItemText(m_hwnd, IDC_RECENT1 + i, jid); } sttJoinDlgShowRecentItems(m_hwnd, i); + return true; } void CJabberDlgGcJoin::OnDestroy() @@ -1147,7 +1148,7 @@ public: m_accept.OnClick = Callback(this, &CGroupchatInviteAcceptDlg::OnCommand_Accept); } - void OnInitDialog() + bool OnInitDialog() override { CSuper::OnInitDialog(); @@ -1162,6 +1163,7 @@ public: Window_SetIcon_IcoLib(m_hwnd, g_GetIconHandle(IDI_GROUP)); SetFocus(GetDlgItem(m_hwnd, IDC_NICK)); + return true; } void OnCommand_Accept(CCtrlButton*) -- cgit v1.2.3