summaryrefslogtreecommitdiff
path: root/plugins/StopSpamPlus/src
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 /plugins/StopSpamPlus/src
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 'plugins/StopSpamPlus/src')
-rw-r--r--plugins/StopSpamPlus/src/options.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/plugins/StopSpamPlus/src/options.cpp b/plugins/StopSpamPlus/src/options.cpp
index 0d9d4431bf..568479c6dc 100644
--- a/plugins/StopSpamPlus/src/options.cpp
+++ b/plugins/StopSpamPlus/src/options.cpp
@@ -29,9 +29,10 @@ public:
CreateLink(chk6, g_sets.HistLog);
}
- virtual void OnInitDialog() override
+ bool OnInitDialog() override
{
edtDescr.SetText(pluginDescription);
+ return true;
}
};
@@ -63,10 +64,11 @@ public:
CreateLink(edtDivider, g_sets.AnswSplitString);
}
- virtual void OnInitDialog() override
+ bool OnInitDialog() override
{
variables_skin_helpbutton(m_hwnd, IDC_VARS);
btnHelp.Enable(ServiceExists(MS_VARS_FORMATSTRING));
+ return true;
}
void onHelp(CCtrlButton*)
@@ -100,7 +102,7 @@ public:
m_accounts.OnItemChanged = Callback(this, &COptAccountDlg::list_OnItemChanged);
}
- virtual void OnInitDialog() override
+ bool OnInitDialog() override
{
m_accounts.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES);
m_accounts.DeleteAllItems();
@@ -124,9 +126,10 @@ public:
int idx = m_accounts.InsertItem(&item);
m_accounts.SetCheckState(idx, g_sets.ProtoDisabled(pa->szModuleName));
}
+ return true;
}
- virtual void OnApply() override
+ bool OnApply() override
{
std::ostringstream out;
@@ -143,6 +146,7 @@ public:
}
g_sets.DisabledProtoList = (char*)out.str().c_str();
+ return true;
}
void list_OnItemChanged(CCtrlListView::TEventInfo*)