summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mir_app/src/mir_app.def1
-rw-r--r--src/mir_app/src/mir_app64.def1
-rw-r--r--src/mir_app/src/newplugins.cpp1
-rw-r--r--src/mir_app/src/options.cpp59
4 files changed, 33 insertions, 29 deletions
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def
index 089e2f3ae4..055c4aa466 100644
--- a/src/mir_app/src/mir_app.def
+++ b/src/mir_app/src/mir_app.def
@@ -487,3 +487,4 @@ Clist_SetStatusMode @464
?MetaDetouchSub@MDatabaseCommon@@UAGHPAUDBCachedContact@@H@Z @492 NONAME
?MetaSetDefault@MDatabaseCommon@@UAGHPAUDBCachedContact@@@Z @493 NONAME
?EnumResidentSettings@MDatabaseCommon@@UAGHP6AHPBDPAX@Z1@Z @494 NONAME
+KillModuleOptions @495
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def
index 6970a920e7..fa96e4fb75 100644
--- a/src/mir_app/src/mir_app64.def
+++ b/src/mir_app/src/mir_app64.def
@@ -487,3 +487,4 @@ Clist_SetStatusMode @464
?MetaDetouchSub@MDatabaseCommon@@UEAAHPEAUDBCachedContact@@H@Z @492 NONAME
?MetaSetDefault@MDatabaseCommon@@UEAAHPEAUDBCachedContact@@@Z @493 NONAME
?EnumResidentSettings@MDatabaseCommon@@UEAAHP6AHPEBDPEAX@Z1@Z @494 NONAME
+KillModuleOptions @495
diff --git a/src/mir_app/src/newplugins.cpp b/src/mir_app/src/newplugins.cpp
index 82c4d9066b..a080c0eab0 100644
--- a/src/mir_app/src/newplugins.cpp
+++ b/src/mir_app/src/newplugins.cpp
@@ -377,6 +377,7 @@ int Plugin_UnloadDyn(pluginEntry *p)
KillModuleExtraIcons(_hLang);
KillModuleSrmmIcons(_hLang);
KillModuleToolbarIcons(_hLang);
+ KillModuleOptions(_hLang);
}
NotifyFastHook(hevUnloadModule, (WPARAM)p->bpi.pluginInfo, (LPARAM)p->bpi.hInst);
diff --git a/src/mir_app/src/options.cpp b/src/mir_app/src/options.cpp
index 565a45790a..15ae8796c8 100644
--- a/src/mir_app/src/options.cpp
+++ b/src/mir_app/src/options.cpp
@@ -31,7 +31,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define FILTER_TIMEOUT_TIMER 10012
#define HM_MODULELOAD (WM_USER+12)
-#define HM_MODULEUNLOAD (WM_USER+13)
#define ALL_MODULES_FILTER LPGENW("<all modules>")
#define CORE_MODULES_FILTER LPGENW("<core modules>")
@@ -366,7 +365,7 @@ class COptionsDlg : public CDlgBase
RECT m_rcTab;
HFONT m_hBoldFont;
wchar_t m_szFilterString[1024];
- HANDLE m_hPluginLoad, m_hPluginUnload;
+ HANDLE m_hPluginLoad;
const wchar_t *m_szCaption, *m_szGroup, *m_szPage, *m_szTab;
const OptionsPageList &m_pages;
@@ -685,27 +684,6 @@ class COptionsDlg : public CDlgBase
RebuildPageTree();
}
- void UnloadOptionsModule(HINSTANCE hInst)
- {
- bool bToRebuildTree = false;
-
- for (int i = m_arOpd.getCount() - 1; i >= 0; i--) {
- OptionsPageData *opd = m_arOpd[i];
- if (opd->getInst() != hInst)
- continue;
-
- if (m_currentPage > i)
- m_currentPage--;
-
- m_arOpd.remove(i);
- delete opd;
- bToRebuildTree = true;
- }
-
- if (bToRebuildTree)
- RebuildPageTree();
- }
-
OptionsPageData* getCurrent() const
{ return (m_currentPage == -1) ? nullptr : m_arOpd[m_currentPage];
}
@@ -759,7 +737,6 @@ public:
m_hBoldFont = CreateFontIndirect(&lf);
m_hPluginLoad = HookEventMessage(ME_SYSTEM_MODULELOAD, m_hwnd, HM_MODULELOAD);
- m_hPluginUnload = HookEventMessage(ME_SYSTEM_MODULEUNLOAD, m_hwnd, HM_MODULEUNLOAD);
m_currentPage = -1;
ptrW lastPage, lastGroup, lastTab;
@@ -818,7 +795,6 @@ public:
m_szFilterString[0] = 0;
UnhookEvent(m_hPluginLoad);
- UnhookEvent(m_hPluginUnload);
SaveOptionsTreeState();
Window_FreeIcon_IcoLib(m_hwnd);
@@ -1046,10 +1022,6 @@ public:
LoadOptionsModule((HINSTANCE)lParam);
break;
- case HM_MODULEUNLOAD:
- UnloadOptionsModule((HINSTANCE)lParam);
- break;
-
case PSM_CHANGED:
m_btnApply.Enable();
{
@@ -1111,6 +1083,27 @@ public:
m_pageTree.SelectItem(hItem);
}
}
+
+ void KillModule(int _hLang)
+ {
+ bool bToRebuildTree = false;
+
+ for (int i = m_arOpd.getCount() - 1; i >= 0; i--) {
+ OptionsPageData *opd = m_arOpd[i];
+ if (opd->hLangpack != _hLang)
+ continue;
+
+ if (m_currentPage > i)
+ m_currentPage--;
+
+ m_arOpd.remove(i);
+ delete opd;
+ bToRebuildTree = true;
+ }
+
+ if (bToRebuildTree)
+ RebuildPageTree();
+ }
};
void OpenAccountOptions(PROTOACCOUNT *pa)
@@ -1203,6 +1196,14 @@ MIR_APP_DLL(int) Options_AddPage(WPARAM wParam, OPTIONSDIALOGPAGE *odp, int _hLa
/////////////////////////////////////////////////////////////////////////////////////////
+MIR_APP_DLL(void) KillModuleOptions(int _hLang)
+{
+ if (pOptionsDlg != nullptr)
+ pOptionsDlg->KillModule(_hLang);
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
static INT_PTR OpenOptionsDialog(WPARAM, LPARAM)
{
OpenOptionsNow(0, nullptr, nullptr, nullptr, false);