diff options
-rw-r--r-- | include/m_langpack.h | 2 | ||||
-rw-r--r-- | src/mir_core/commonheaders.h | 1 | ||||
-rw-r--r-- | src/mir_core/langpack.cpp | 5 | ||||
-rw-r--r-- | src/modules/langpack/lpservices.cpp | 1 |
4 files changed, 8 insertions, 1 deletions
diff --git a/include/m_langpack.h b/include/m_langpack.h index 9edfe03309..2edede4426 100644 --- a/include/m_langpack.h +++ b/include/m_langpack.h @@ -113,6 +113,8 @@ __forceinline void mir_getLP(const PLUGININFOEX* pInfo) //always returns 0
#define MS_LANGPACK_RELOAD "LangPack/Reload"
+#define ME_LANGPACK_CHANGED "LangPack/Changed"
+
//retrieves the hLangpack of a plugin by its HINSTANCE
//wParam = 0 (ignored)
//lParam = (LPARAM)(HINSTANCE)plugin's base address
diff --git a/src/mir_core/commonheaders.h b/src/mir_core/commonheaders.h index 5afcda256e..94afa341ea 100644 --- a/src/mir_core/commonheaders.h +++ b/src/mir_core/commonheaders.h @@ -57,6 +57,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_database.h>
#include <m_db_int.h>
#include <newpluginapi.h>
+#include <m_langpack.h>
#include "miranda.h"
diff --git a/src/mir_core/langpack.cpp b/src/mir_core/langpack.cpp index 015af8f469..bc0d59300b 100644 --- a/src/mir_core/langpack.cpp +++ b/src/mir_core/langpack.cpp @@ -31,6 +31,7 @@ static int CompareMuuids(const MUUID* p1, const MUUID* p2) static LIST<MUUID> lMuuids(10, CompareMuuids);
static MUUID* pCurrentMuuid = NULL;
+static HANDLE hevChanged = 0;
static BOOL bModuleInitialized = FALSE;
@@ -576,6 +577,8 @@ MIR_CORE_DLL(int) LoadLangPackModule(void) ZeroMemory(&langPack, sizeof(langPack));
+ hevChanged = CreateHookableEvent(ME_LANGPACK_CHANGED);
+
TCHAR szSearch[MAX_PATH];
PathToAbsoluteT(_T("langpack_*.txt"), szSearch, NULL);
@@ -628,4 +631,6 @@ MIR_CORE_DLL(void) ReloadLangpack(TCHAR *pszStr) UnloadLangPackModule();
LoadLangPack(pszStr);
Langpack_SortDuplicates();
+
+ NotifyEventHooks(hevChanged, 0, 0);
}
diff --git a/src/modules/langpack/lpservices.cpp b/src/modules/langpack/lpservices.cpp index aef4a605f6..62db2f256e 100644 --- a/src/modules/langpack/lpservices.cpp +++ b/src/modules/langpack/lpservices.cpp @@ -109,6 +109,5 @@ int LoadLangpackModule(void) CreateServiceFunction(MS_LANGPACK_REGISTER, srvRegisterLP);
CreateServiceFunction(MS_LANGPACK_RELOAD, srvReloadLangpack);
CreateServiceFunction(MS_LANGPACK_LOOKUPHANDLE, srvGetPluginLangpack);
-
return 0;
}
|