diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2016-04-17 19:37:20 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2016-04-17 19:37:20 +0000 |
commit | 8551deec1d694fafacb5476e0203441829063faf (patch) | |
tree | 395068a7309ccb0b9afd1e42732a1336ecbab00d /plugins | |
parent | 067bd391d5a6d28e250f6e375607be6d667f66bf (diff) |
oops
git-svn-id: http://svn.miranda-ng.org/main/trunk@16709 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/AuthState/src/options.h | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/plugins/AuthState/src/options.h b/plugins/AuthState/src/options.h new file mode 100644 index 0000000000..35c75d697a --- /dev/null +++ b/plugins/AuthState/src/options.h @@ -0,0 +1,66 @@ +struct Opts
+{
+ CMOption<BYTE> bUseAuthIcon;
+ CMOption<BYTE> bUseGrantIcon;
+ CMOption<BYTE> bContactMenuItem;
+ CMOption<BYTE> bIconsForRecentContacts;
+
+ Opts() :
+ bUseAuthIcon(MODULENAME, "EnableAuthIcon", 1),
+ bUseGrantIcon(MODULENAME, "EnableGrantIcon", 1),
+ bContactMenuItem(MODULENAME, "MenuItem", 0),
+ bIconsForRecentContacts(MODULENAME, "EnableOnlyForRecent", 0)
+ {}
+};
+
+extern Opts Options;
+
+class CPluginDlgBase : public CDlgBase
+{
+ const char *m_szModule;
+public:
+ CPluginDlgBase(HINSTANCE hInst, int idDialog, const char *module) : CDlgBase(hInst, idDialog), m_szModule(module) {};
+
+ void CreateLink(CCtrlData& ctrl, const char *szSetting, BYTE type, DWORD iValue)
+ {
+ ctrl.CreateDbLink(m_szModule, szSetting, type, iValue);
+ }
+ void CreateLink(CCtrlData& ctrl, const char *szSetting, TCHAR *szValue)
+ {
+ ctrl.CreateDbLink(m_szModule, szSetting, szValue);
+ }
+ template<class T>
+ __inline void CreateLink(CCtrlData& ctrl, CMOption<T> &option)
+ {
+ ctrl.CreateDbLink(new CMOptionLink<T>(option));
+ }
+};
+
+
+class COptionsDialog : public CPluginDlgBase
+{
+ CCtrlCheck m_chkAuthIcon;
+ CCtrlCheck m_chkGrantIcon;
+ CCtrlCheck m_chkMenuItem;
+ CCtrlCheck m_chkOnlyForRecent;
+public:
+ COptionsDialog() :
+ CPluginDlgBase(g_hInst, IDD_AUTHSTATE_OPT, MODULENAME),
+ m_chkAuthIcon(this, IDC_AUTHICON),
+ m_chkGrantIcon(this, IDC_GRANTICON),
+ m_chkMenuItem(this, IDC_ENABLEMENUITEM),
+ m_chkOnlyForRecent(this, IDC_ICONSFORRECENT)
+ {
+ CreateLink(m_chkAuthIcon, Options.bUseAuthIcon);
+ CreateLink(m_chkGrantIcon, Options.bUseGrantIcon);
+ CreateLink(m_chkMenuItem, Options.bContactMenuItem);
+ CreateLink(m_chkOnlyForRecent, Options.bIconsForRecentContacts);
+ }
+
+ void OnApply() override
+ {
+ for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ onExtraImageApplying((WPARAM)hContact, 0);
+ }
+
+};
\ No newline at end of file |