summaryrefslogtreecommitdiff
path: root/plugins/MirFox/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/MirFox/src')
-rw-r--r--plugins/MirFox/src/MirandaInterface.cpp13
-rw-r--r--plugins/MirFox/src/MirandaOptions.cpp24
-rw-r--r--plugins/MirFox/src/MirandaOptions.h4
3 files changed, 6 insertions, 35 deletions
diff --git a/plugins/MirFox/src/MirandaInterface.cpp b/plugins/MirFox/src/MirandaInterface.cpp
index f72400a2f6..bb5242f90a 100644
--- a/plugins/MirFox/src/MirandaInterface.cpp
+++ b/plugins/MirFox/src/MirandaInterface.cpp
@@ -5,11 +5,6 @@
// Miranda - handle from DllMain
CMPlugin g_plugin;
-//Miranda - Langpack
-
-//Miranda - HANDLE to hooked protocols ACK
-HANDLE hProtoAck;
-
//popup classes handles
HANDLE hPopupNotify;
HANDLE hPopupError;
@@ -136,11 +131,11 @@ static int OnShutdown(WPARAM, LPARAM)
int CMPlugin::Load()
{
+ HookEvent(ME_OPT_INITIALISE, OptInit);
+ HookEvent(ME_PROTO_ACK, MirandaUtils::onProtoAck);
HookEvent(ME_SYSTEM_MODULESLOADED, onModulesLoaded);
HookEvent(ME_SYSTEM_SHUTDOWN, OnShutdown);
- hProtoAck = HookEvent(ME_PROTO_ACK, MirandaUtils::onProtoAck);
-
// Ensure that the common control DLL is loaded. needed to use ICC_LISTVIEW_CLASSES control in options TODO move to InitOptions();?
INITCOMMONCONTROLSEX icex = { 0 };
icex.dwSize = sizeof(icex);
@@ -150,7 +145,6 @@ int CMPlugin::Load()
mirfoxMiranda.getMirfoxData().Plugin_Terminated = false;
mirfoxMiranda.getMirfoxData().setPluginState(MFENUM_PLUGIN_STATE_INIT);
mirfoxMiranda.onMirandaInterfaceLoad();
- InitOptions();
if (mirfoxMiranda.getMirfoxData().getPluginState() != MFENUM_PLUGIN_STATE_ERROR)
mirfoxMiranda.getMirfoxData().setPluginState(MFENUM_PLUGIN_STATE_WORK);
@@ -166,7 +160,7 @@ int CMPlugin::Unload()
// wait for csmThread, msgQueueThread and userActionThread's end
mirfoxMiranda.getMirfoxData().Plugin_Terminated = true;
- UnhookEvent(hProtoAck);
+
int counter = 0;
const int UNLOAD_WAIT_TIME = 50; //[ms]
const int MAX_UNLOAD_WAIT_COUNTER = 10; //10 * 50ms = 0,5s
@@ -180,6 +174,5 @@ int CMPlugin::Unload()
MFLogger::getInstance()->log(L"Unload: last log");
mirfoxMiranda.onMirandaInterfaceUnload();
- DeinitOptions();
return 0;
}
diff --git a/plugins/MirFox/src/MirandaOptions.cpp b/plugins/MirFox/src/MirandaOptions.cpp
index 34991bb4b3..b316f3222b 100644
--- a/plugins/MirFox/src/MirandaOptions.cpp
+++ b/plugins/MirFox/src/MirandaOptions.cpp
@@ -667,8 +667,8 @@ INT_PTR CALLBACK DlgProcOpts_Tab3(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
*
* called from: options.cpp.InitOptions()
*/
-int OptInit(WPARAM wParam, LPARAM) {
-
+int OptInit(WPARAM wParam, LPARAM)
+{
OPTIONSDIALOGPAGE odp = {};
odp.position = -790000000;
odp.szTitle.a = LPGEN(PLUGIN_OPTIONS_NAME);
@@ -694,23 +694,3 @@ int OptInit(WPARAM wParam, LPARAM) {
g_plugin.addOptions(wParam, &odp);
return 0;
}
-
-
-
-HANDLE hEventOptInit;
-
-/**
- *
- * called from: MirfoxMiranda.cpp.Load(PLUGINLINK *link)
- */
-void InitOptions() {
- hEventOptInit = HookEvent(ME_OPT_INITIALISE, OptInit);
-}
-
-/**
- *
- * called from: MirfoxMiranda.cpp.Unload()
- */
-void DeinitOptions() {
- UnhookEvent(hEventOptInit);
-}
diff --git a/plugins/MirFox/src/MirandaOptions.h b/plugins/MirFox/src/MirandaOptions.h
index 8b68c25a53..02db76c1ce 100644
--- a/plugins/MirFox/src/MirandaOptions.h
+++ b/plugins/MirFox/src/MirandaOptions.h
@@ -3,8 +3,6 @@
#include "MirandaInterface.h"
-void InitOptions();
-
-void DeinitOptions();
+int OptInit(WPARAM, LPARAM);
#endif //#ifndef _MIRANDA_OPTIONS_INC