summaryrefslogtreecommitdiff
path: root/plugins/SecureIM/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-11-12 20:12:53 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-11-12 20:12:53 +0300
commit488214ac8af0c4aeb1a5c1d8fd48368daaf4c4c7 (patch)
tree96b0db981b4f5054f24d484902b597ba7da1c1a5 /plugins/SecureIM/src
parent9b35784c5042984fbb60785f0a4a41a64af545f6 (diff)
end of ME_OPT_INITIALISE related zoo in another plugins
Diffstat (limited to 'plugins/SecureIM/src')
-rw-r--r--plugins/SecureIM/src/main.cpp6
-rw-r--r--plugins/SecureIM/src/options.cpp12
-rw-r--r--plugins/SecureIM/src/popupOptions.cpp55
-rw-r--r--plugins/SecureIM/src/popupOptions.h2
4 files changed, 32 insertions, 43 deletions
diff --git a/plugins/SecureIM/src/main.cpp b/plugins/SecureIM/src/main.cpp
index 35bd01a72d..36e6f2067b 100644
--- a/plugins/SecureIM/src/main.cpp
+++ b/plugins/SecureIM/src/main.cpp
@@ -206,11 +206,6 @@ static int onModulesLoaded(WPARAM, LPARAM)
g_IEC[i] = (HANDLE)-1;
HookEvent(ME_CLIST_PREBUILDCONTACTMENU, onRebuildContactMenu);
-
- // hook init options
- HookEvent(ME_OPT_INITIALISE, onRegisterOptions);
- if (bPopupExists)
- HookEvent(ME_OPT_INITIALISE, onRegisterPopOptions);
HookEvent(ME_DB_CONTACT_SETTINGCHANGED, onContactSettingChanged);
HookEvent(ME_DB_CONTACT_ADDED, onContactAdded);
HookEvent(ME_DB_CONTACT_DELETED, onContactDeleted);
@@ -323,6 +318,7 @@ int CMPlugin::Load(void)
HookEvent(ME_SYSTEM_PRESHUTDOWN, onShutdown);
HookEvent(ME_SYSTEM_MODULELOAD, onModuleLoad);
HookEvent(ME_SYSTEM_MODULEUNLOAD, onModuleLoad);
+ HookEvent(ME_OPT_INITIALISE, onRegisterOptions);
g_hEvent[0] = CreateHookableEvent(MODULENAME"/Disabled");
g_hEvent[1] = CreateHookableEvent(MODULENAME"/Established");
diff --git a/plugins/SecureIM/src/options.cpp b/plugins/SecureIM/src/options.cpp
index 89fce2390d..02e0eb4e02 100644
--- a/plugins/SecureIM/src/options.cpp
+++ b/plugins/SecureIM/src/options.cpp
@@ -1684,13 +1684,21 @@ BOOL LoadImportRSAKeyDlg(HWND hParent, LPSTR key, BOOL priv)
return TRUE;
}
-int onRegisterOptions(WPARAM wParam, LPARAM)
+int onRegisterOptions(WPARAM wParam, LPARAM lParam)
{
OPTIONSDIALOGPAGE odp = {};
+ odp.szTitle.a = MODULENAME;
+
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONSTAB);
- odp.szTitle.a = (char*)MODULENAME;
odp.szGroup.a = LPGEN("Services");
odp.pfnDlgProc = OptionsDlgProc;
g_plugin.addOptions(wParam, &odp);
+
+ if (bPopupExists) {
+ odp.pszTemplate = MAKEINTRESOURCE(IDD_POPUP);
+ odp.szGroup.a = LPGEN("Popups");
+ odp.pfnDlgProc = PopOptionsDlgProc;
+ g_plugin.addOptions(wParam, &odp);
+ }
return 0;
}
diff --git a/plugins/SecureIM/src/popupOptions.cpp b/plugins/SecureIM/src/popupOptions.cpp
index f9288bdfac..f7dd998e49 100644
--- a/plugins/SecureIM/src/popupOptions.cpp
+++ b/plugins/SecureIM/src/popupOptions.cpp
@@ -1,5 +1,26 @@
#include "commonheaders.h"
+static void RefreshPopupOptionsDlg(HWND hec, HWND hdc, HWND hss, HWND hsr, HWND hks, HWND hkr)
+{
+ // ec checkbox
+ SendMessage(hec, BM_SETCHECK, db_get_b(0, MODULENAME, "ec", 1), 0L);
+
+ // dc checkbox
+ SendMessage(hdc, BM_SETCHECK, db_get_b(0, MODULENAME, "dc", 1), 0L);
+
+ // ks checkbox
+ SendMessage(hks, BM_SETCHECK, db_get_b(0, MODULENAME, "ks", 1), 0L);
+
+ // kr checkbox
+ SendMessage(hkr, BM_SETCHECK, db_get_b(0, MODULENAME, "kr", 1), 0L);
+
+ //ss checkbox
+ SendMessage(hss, BM_SETCHECK, db_get_b(0, MODULENAME, "ss", 0), 0L);
+
+ //sr checkbox
+ SendMessage(hsr, BM_SETCHECK, db_get_b(0, MODULENAME, "sr", 0), 0L);
+}
+
INT_PTR CALLBACK PopOptionsDlgProc(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM lParam)
{
char getTimeout[5];
@@ -137,37 +158,3 @@ INT_PTR CALLBACK PopOptionsDlgProc(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM l
}
return TRUE;
}
-
-void RefreshPopupOptionsDlg(HWND hec, HWND hdc, HWND hss, HWND hsr, HWND hks, HWND hkr)
-{
- // ec checkbox
- SendMessage(hec, BM_SETCHECK, db_get_b(0, MODULENAME, "ec", 1), 0L);
-
- // dc checkbox
- SendMessage(hdc, BM_SETCHECK, db_get_b(0, MODULENAME, "dc", 1), 0L);
-
- // ks checkbox
- SendMessage(hks, BM_SETCHECK, db_get_b(0, MODULENAME, "ks", 1), 0L);
-
- // kr checkbox
- SendMessage(hkr, BM_SETCHECK, db_get_b(0, MODULENAME, "kr", 1), 0L);
-
- //ss checkbox
- SendMessage(hss, BM_SETCHECK, db_get_b(0, MODULENAME, "ss", 0), 0L);
-
- //sr checkbox
- SendMessage(hsr, BM_SETCHECK, db_get_b(0, MODULENAME, "sr", 0), 0L);
-}
-
-int onRegisterPopOptions(WPARAM wParam, LPARAM)
-{
- if (bPopupExists) {
- OPTIONSDIALOGPAGE odp = {};
- odp.pszTemplate = MAKEINTRESOURCE(IDD_POPUP);
- odp.szTitle.a = (char*)MODULENAME;
- odp.szGroup.a = LPGEN("Popups");
- odp.pfnDlgProc = PopOptionsDlgProc;
- g_plugin.addOptions(wParam, &odp);
- }
- return 0;
-}
diff --git a/plugins/SecureIM/src/popupOptions.h b/plugins/SecureIM/src/popupOptions.h
index 22d3453adc..ae6dff7c66 100644
--- a/plugins/SecureIM/src/popupOptions.h
+++ b/plugins/SecureIM/src/popupOptions.h
@@ -2,7 +2,5 @@
#define __POPUP_OPTIONS__
INT_PTR CALLBACK PopOptionsDlgProc(HWND,UINT,WPARAM,LPARAM);
-void RefreshPopupOptionsDlg(HWND,HWND,HWND,HWND,HWND,HWND);
-int onRegisterPopOptions(WPARAM,LPARAM);
#endif