summaryrefslogtreecommitdiff
path: root/plugins/FingerprintNG/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-12-26 22:38:55 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-12-26 22:38:55 +0300
commit4b2dc43470b6ef48f36f2ec5a1f72b0b13e38d9d (patch)
treee5aecc483f39a486f1c951a2e0674ce855e46f15 /plugins/FingerprintNG/src
parent6eb0f2f247e91915971be03c63c5c12907898a00 (diff)
code cleaning
Diffstat (limited to 'plugins/FingerprintNG/src')
-rw-r--r--plugins/FingerprintNG/src/options.cpp122
-rw-r--r--plugins/FingerprintNG/src/stdafx.h18
2 files changed, 64 insertions, 76 deletions
diff --git a/plugins/FingerprintNG/src/options.cpp b/plugins/FingerprintNG/src/options.cpp
index 187aca8825..f27c9cb62f 100644
--- a/plugins/FingerprintNG/src/options.cpp
+++ b/plugins/FingerprintNG/src/options.cpp
@@ -55,65 +55,71 @@ static settings[] =
{ IDC_STATUSBAR, TRUE, "StatusBarIcon" }
};
-void COptDialog::LoadDBCheckState(int idCtrl, LPCSTR szSetting, BYTE bDef)
+class COptDialog : public CDlgBase
{
- CCtrlCheck &item = *(CCtrlCheck*)FindControl(idCtrl);
- item.SetState(g_plugin.getByte(szSetting, bDef));
-}
-
-void COptDialog::StoreDBCheckState(int idCtrl, LPCSTR szSetting)
-{
- CCtrlCheck &item = *(CCtrlCheck*)FindControl(idCtrl);
- g_plugin.setByte(szSetting, item.GetState());
-}
-
-COptDialog::COptDialog() :
- CDlgBase(g_plugin, IDD_DIALOG),
- m_chkMiranda(this, IDC_GROUP_MIRANDA),
- m_chkMirandaPacks(this, IDC_GROUP_MIRANDA_PACKS),
- m_chkMirandaVer(this, IDC_GROUP_MIRANDA_VERSION),
- m_chkOverRes(this, IDC_GROUP_OVERLAYS_RESOURCE),
- m_chkOverPlatf(this, IDC_GROUP_OVERLAYS_PLATFORM),
- m_chkOverProto(this, IDC_GROUP_OVERLAYS_PROTO),
- m_chkOverUnicode(this, IDC_GROUP_OVERLAYS_UNICODE),
- m_chkOverSecur(this, IDC_GROUP_OVERLAYS_SECURITY),
- m_chkFacebbok(this, IDC_GROUP_FACEBOOK),
- m_chkGG(this, IDC_GROUP_GG),
- m_chkICQ(this, IDC_GROUP_ICQ),
- m_chkIRC(this, IDC_GROUP_IRC),
- m_chkJabber(this, IDC_GROUP_JABBER),
- m_chkMSN(this, IDC_GROUP_MSN),
- m_chkQQ(this, IDC_GROUP_QQ),
- m_chkRSS(this, IDC_GROUP_RSS),
- m_chkVK(this, IDC_GROUP_VK),
- m_chkWeather(this, IDC_GROUP_WEATHER),
- m_chkMulti(this, IDC_GROUP_MULTI),
- m_chkOthersProto(this, IDC_GROUP_OTHER_PROTOS),
- m_chkOthers(this, IDC_GROUP_OTHERS),
- m_chkStatusBar(this, IDC_STATUSBAR)
-{
-
-}
-
-bool COptDialog::OnInitDialog()
-{
- for (auto &it : settings)
- LoadDBCheckState(it.idCtrl, it.szSetName, it.defValue);
- return true;
-}
-
-bool COptDialog::OnApply()
-{
- for (auto &it : settings)
- StoreDBCheckState(it.idCtrl, it.szSetName);
-
- ClearFI();
- RegisterIcons();
-
- for (auto &hContact : Contacts())
- OnExtraImageApply(hContact, 0);
- return true;
-}
+ CCtrlCheck m_chkMiranda, m_chkMirandaPacks, m_chkMirandaVer, m_chkOverRes, m_chkOverPlatf, m_chkOverProto, m_chkOverUnicode, m_chkOverSecur,
+ m_chkFacebbok, m_chkGG, m_chkICQ, m_chkIRC, m_chkJabber, m_chkMSN, m_chkQQ, m_chkRSS, m_chkVK, m_chkWeather, m_chkMulti, m_chkOthersProto,
+ m_chkOthers, m_chkStatusBar;
+
+ void LoadDBCheckState(int idCtrl, LPCSTR szSetting, BYTE bDef)
+ {
+ CCtrlCheck &item = *(CCtrlCheck*)FindControl(idCtrl);
+ item.SetState(g_plugin.getByte(szSetting, bDef));
+ }
+
+ void StoreDBCheckState(int idCtrl, LPCSTR szSetting)
+ {
+ CCtrlCheck &item = *(CCtrlCheck*)FindControl(idCtrl);
+ g_plugin.setByte(szSetting, item.GetState());
+ }
+
+public:
+ COptDialog() :
+ CDlgBase(g_plugin, IDD_DIALOG),
+ m_chkMiranda(this, IDC_GROUP_MIRANDA),
+ m_chkMirandaPacks(this, IDC_GROUP_MIRANDA_PACKS),
+ m_chkMirandaVer(this, IDC_GROUP_MIRANDA_VERSION),
+ m_chkOverRes(this, IDC_GROUP_OVERLAYS_RESOURCE),
+ m_chkOverPlatf(this, IDC_GROUP_OVERLAYS_PLATFORM),
+ m_chkOverProto(this, IDC_GROUP_OVERLAYS_PROTO),
+ m_chkOverUnicode(this, IDC_GROUP_OVERLAYS_UNICODE),
+ m_chkOverSecur(this, IDC_GROUP_OVERLAYS_SECURITY),
+ m_chkFacebbok(this, IDC_GROUP_FACEBOOK),
+ m_chkGG(this, IDC_GROUP_GG),
+ m_chkICQ(this, IDC_GROUP_ICQ),
+ m_chkIRC(this, IDC_GROUP_IRC),
+ m_chkJabber(this, IDC_GROUP_JABBER),
+ m_chkMSN(this, IDC_GROUP_MSN),
+ m_chkQQ(this, IDC_GROUP_QQ),
+ m_chkRSS(this, IDC_GROUP_RSS),
+ m_chkVK(this, IDC_GROUP_VK),
+ m_chkWeather(this, IDC_GROUP_WEATHER),
+ m_chkMulti(this, IDC_GROUP_MULTI),
+ m_chkOthersProto(this, IDC_GROUP_OTHER_PROTOS),
+ m_chkOthers(this, IDC_GROUP_OTHERS),
+ m_chkStatusBar(this, IDC_STATUSBAR)
+ {}
+
+ bool OnInitDialog() override
+ {
+ for (auto &it : settings)
+ LoadDBCheckState(it.idCtrl, it.szSetName, it.defValue);
+ return true;
+ }
+
+ bool OnApply() override
+ {
+ for (auto &it : settings)
+ StoreDBCheckState(it.idCtrl, it.szSetName);
+
+ ClearFI();
+ RegisterIcons();
+
+ for (auto &hContact : Contacts())
+ OnExtraImageApply(hContact, 0);
+ return true;
+ }
+};
int OnOptInitialise(WPARAM wParam, LPARAM)
{
diff --git a/plugins/FingerprintNG/src/stdafx.h b/plugins/FingerprintNG/src/stdafx.h
index e08fde4acf..2bb30e8c44 100644
--- a/plugins/FingerprintNG/src/stdafx.h
+++ b/plugins/FingerprintNG/src/stdafx.h
@@ -149,21 +149,3 @@ extern int DEFAULT_KN_FP_MASK_COUNT, DEFAULT_KN_FP_OVERLAYS_COUNT, DEFAULT_KN_FP
// the last count is how many masks from 2nd layer is used as Miranda version overlays (counting from the end)
#define DEFAULT_KN_FP_OVERLAYS2_NO_VER_COUNT (DEFAULT_KN_FP_OVERLAYS2_COUNT - 13)
#define DEFAULT_KN_FP_OVERLAYS3_NO_UNICODE_COUNT (DEFAULT_KN_FP_OVERLAYS3_COUNT - 1)
-
-class COptDialog : public CDlgBase
-{
-private:
- CCtrlCheck m_chkMiranda, m_chkMirandaPacks, m_chkMirandaVer, m_chkOverRes, m_chkOverPlatf, m_chkOverProto, m_chkOverUnicode, m_chkOverSecur,
- m_chkFacebbok, m_chkGG, m_chkICQ, m_chkIRC, m_chkJabber, m_chkMSN, m_chkQQ, m_chkRSS, m_chkVK, m_chkWeather, m_chkMulti, m_chkOthersProto,
- m_chkOthers, m_chkStatusBar;
-
-protected:
- bool OnInitDialog() override;
- bool OnApply() override;
-
- void LoadDBCheckState(int idCtrl, LPCSTR szSetting, BYTE bDef);
- void StoreDBCheckState(int idCtrl, LPCSTR szSetting);
-
-public:
- COptDialog();
-}; \ No newline at end of file