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/Discord/src/options.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'protocols/Discord/src') diff --git a/protocols/Discord/src/options.cpp b/protocols/Discord/src/options.cpp index b291f98cdd..04947f76e2 100644 --- a/protocols/Discord/src/options.cpp +++ b/protocols/Discord/src/options.cpp @@ -39,20 +39,22 @@ public: CreateLink(chkHideChats, ppro->m_bHideGroupchats); } - virtual void OnInitDialog() override + bool OnInitDialog() override { ptrW buf(m_proto->getWStringA(DB_KEY_PASSWORD)); if (buf) m_edPassword.SetText(buf); + return true; } - virtual void OnApply() override + bool OnApply() override { if (mir_wstrcmp(m_proto->m_wszDefaultGroup, m_wszOldGroup)) Clist_GroupCreate(0, m_proto->m_wszDefaultGroup); ptrW buf(m_edPassword.GetText()); m_proto->setWString(DB_KEY_PASSWORD, buf); + return true; } }; -- cgit v1.2.3