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) --- src/core/stdautoaway/src/options.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/core/stdautoaway') diff --git a/src/core/stdautoaway/src/options.cpp b/src/core/stdautoaway/src/options.cpp index e8ee0669da..79f6795174 100644 --- a/src/core/stdautoaway/src/options.cpp +++ b/src/core/stdautoaway/src/options.cpp @@ -87,7 +87,7 @@ public: chkShortIdle.OnChange = chkShort.OnChange = Callback(this, &COptionsDlg::onChange); } - virtual void OnInitDialog() override + bool OnInitDialog() override { chkOnWindows.SetState(!g_plugin.bIdleMethod); @@ -99,9 +99,10 @@ public: cmbAAStatus.SetCurSel(IdleGetStatusIndex(g_plugin.bAAStatus)); ShowHide(); + return true; } - virtual void OnApply() override + bool OnApply() override { g_plugin.iIdleTime1st = spinIdle.GetPosition(); @@ -112,6 +113,7 @@ public: // destroy any current idle and reset settings. IdleObject_Destroy(); IdleObject_Create(); + return true; } void onChange(CCtrlCheck*) -- cgit v1.2.3