diff options
-rw-r--r-- | include/m_clist.h | 7 | ||||
-rw-r--r-- | include/m_clistint.h | 4 | ||||
-rw-r--r-- | libs/win32/mir_app.lib | bin | 145652 -> 146146 bytes | |||
-rw-r--r-- | libs/win64/mir_app.lib | bin | 141498 -> 141954 bytes | |||
-rw-r--r-- | plugins/CSList/src/cslist.cpp | 4 | ||||
-rw-r--r-- | plugins/Clist_modern/src/init.cpp | 2 | ||||
-rw-r--r-- | plugins/SimpleStatusMsg/src/options.cpp | 2 | ||||
-rw-r--r-- | plugins/StatusManager/src/StartupStatus/ss_options.cpp | 2 | ||||
-rw-r--r-- | protocols/IcqOscarJ/src/icq_xstatus.cpp | 2 | ||||
-rw-r--r-- | protocols/MRA/src/Mra_menus.cpp | 2 | ||||
-rw-r--r-- | src/mir_app/src/clc.h | 3 | ||||
-rw-r--r-- | src/mir_app/src/clistcore.cpp | 17 | ||||
-rw-r--r-- | src/mir_app/src/clistmod.cpp | 2 | ||||
-rw-r--r-- | src/mir_app/src/menu_clist.cpp | 30 | ||||
-rw-r--r-- | src/mir_app/src/menu_utils.cpp | 4 | ||||
-rw-r--r-- | src/mir_app/src/mir_app.def | 2 | ||||
-rw-r--r-- | src/mir_app/src/mir_app64.def | 2 | ||||
-rw-r--r-- | src/mir_app/src/proto_order.cpp | 2 |
18 files changed, 31 insertions, 56 deletions
diff --git a/include/m_clist.h b/include/m_clist.h index 43d67477bd..fb41feefc9 100644 --- a/include/m_clist.h +++ b/include/m_clist.h @@ -125,9 +125,14 @@ EXTERN_C MIR_APP_DLL(HGENMENU) Menu_AddStatusMenuItem(TMO_MenuItem *pmi, const c // PROTOCOL MENU
// adds an item to status or main menu, according to the option
-
EXTERN_C MIR_APP_DLL(HGENMENU) Menu_AddProtoMenuItem(TMO_MenuItem *pmi, const char *pszProto = nullptr);
+// returns root protocol menu for an account (either in main menu or in status bar)
+EXTERN_C MIR_APP_DLL(HGENMENU) Menu_GetProtocolMenu(const char *szModuleName);
+
+// rebuilds all protocol menus
+EXTERN_C MIR_APP_DLL(void) Menu_ReloadProtoMenus(void);
+
/////////////////////////////////////////////////////////////////////////////////////////
// GROUP MENU
diff --git a/include/m_clistint.h b/include/m_clistint.h index 8eb695413e..a9170b64e5 100644 --- a/include/m_clistint.h +++ b/include/m_clistint.h @@ -441,10 +441,6 @@ struct CLIST_INTERFACE int currentStatusMenuItem, currentDesiredStatusMode;
BOOL bDisplayLocked, bAutoRebuild;
- HGENMENU (*pfnGetProtocolMenu)(const char*);
- int (*pfnGetProtoIndexByPos)(PROTOCOLDESCRIPTOR **proto, int protoCnt, int Pos);
- void (*pfnReloadProtoMenus)(void);
-
/*************************************************************************************
* version 5 additions (0.7.0.x) - tray icons
*************************************************************************************/
diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.lib Binary files differindex eeff59c359..72624bf967 100644 --- a/libs/win32/mir_app.lib +++ b/libs/win32/mir_app.lib diff --git a/libs/win64/mir_app.lib b/libs/win64/mir_app.lib Binary files differindex 1880edde52..f3dab5e776 100644 --- a/libs/win64/mir_app.lib +++ b/libs/win64/mir_app.lib diff --git a/plugins/CSList/src/cslist.cpp b/plugins/CSList/src/cslist.cpp index cf4a830c2a..092bc18f5e 100644 --- a/plugins/CSList/src/cslist.cpp +++ b/plugins/CSList/src/cslist.cpp @@ -72,7 +72,7 @@ static int OnDbChanged(WPARAM hContact, LPARAM lparam) if (hContact == NULL) { const char *szUniqueID = Proto_GetUniqueId(cws->szModule); if (!mir_strcmp(cws->szSetting, szUniqueID)) - pcli->pfnReloadProtoMenus(); + Menu_ReloadProtoMenus(); } return 0; } @@ -1020,7 +1020,7 @@ INT_PTR CALLBACK CSOptionsProc(HWND hwnd, UINT message, WPARAM, LPARAM lparam) setByte("DeleteAfterImport", IsDlgButtonChecked(hwnd, IDC_DELETE_AFTER_IMPORT) ? 1 : 0); setByte("RememberWindowPosition", IsDlgButtonChecked(hwnd, IDC_REMEMBER_POSITION) ? 1 : 0); - pcli->pfnReloadProtoMenus(); + Menu_ReloadProtoMenus(); break; } return TRUE; diff --git a/plugins/Clist_modern/src/init.cpp b/plugins/Clist_modern/src/init.cpp index 553f41a45a..1f75296eef 100644 --- a/plugins/Clist_modern/src/init.cpp +++ b/plugins/Clist_modern/src/init.cpp @@ -135,7 +135,7 @@ static HRESULT SubclassClistInterface() corecli = *pcli;
pcli->hInst = g_hInst;
- pcli->bDisplayLocked = TRUE;
+ pcli->bDisplayLocked = true;
pcli->pfnCreateCacheItem = cliCreateCacheItem;
pcli->pfnCheckCacheItem = cliCheckCacheItem;
diff --git a/plugins/SimpleStatusMsg/src/options.cpp b/plugins/SimpleStatusMsg/src/options.cpp index 22dcf788f7..ff40aa54f8 100644 --- a/plugins/SimpleStatusMsg/src/options.cpp +++ b/plugins/SimpleStatusMsg/src/options.cpp @@ -22,7 +22,7 @@ with this program; if not, write to the Free Software Foundation, Inc., static void RebuildStatusMenu(void)
{
- pcli->pfnReloadProtoMenus();
+ Menu_ReloadProtoMenus();
}
static LRESULT CALLBACK OptEditBoxSubProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
diff --git a/plugins/StatusManager/src/StartupStatus/ss_options.cpp b/plugins/StatusManager/src/StartupStatus/ss_options.cpp index 1b401cdca7..6951b14ba3 100644 --- a/plugins/StatusManager/src/StartupStatus/ss_options.cpp +++ b/plugins/StatusManager/src/StartupStatus/ss_options.cpp @@ -718,7 +718,7 @@ public: // Rebuild status menu if (bNeedRebuildMenu) - pcli->pfnReloadProtoMenus(); + Menu_ReloadProtoMenus(); } // add a profile diff --git a/protocols/IcqOscarJ/src/icq_xstatus.cpp b/protocols/IcqOscarJ/src/icq_xstatus.cpp index 0a98def4bf..95f584be87 100644 --- a/protocols/IcqOscarJ/src/icq_xstatus.cpp +++ b/protocols/IcqOscarJ/src/icq_xstatus.cpp @@ -855,7 +855,7 @@ void CIcqProto::InitXStatusItems(BOOL bAllowStatus) mir_snwprintf(szItem, TranslateT("%s Custom Status"), m_tszUserName);
CMenuItem mi;
- mi.root = pcli->pfnGetProtocolMenu(m_szModuleName);
+ mi.root = Menu_GetProtocolMenu(m_szModuleName);
mi.name.w = szItem;
mi.position = 10001;
hRoot = Menu_AddStatusMenuItem(&mi, m_szModuleName);
diff --git a/protocols/MRA/src/Mra_menus.cpp b/protocols/MRA/src/Mra_menus.cpp index b87f16ef5b..c0fdb52406 100644 --- a/protocols/MRA/src/Mra_menus.cpp +++ b/protocols/MRA/src/Mra_menus.cpp @@ -284,7 +284,7 @@ int CMraProto::MraRebuildStatusMenu(WPARAM, LPARAM) mir_snwprintf(szItem, L"%s Custom Status", m_tszUserName);
CMenuItem mi;
- mi.root = pcli->pfnGetProtocolMenu(m_szModuleName);
+ mi.root = Menu_GetProtocolMenu(m_szModuleName);
mi.name.w = szItem;
mi.position = 10001;
hRoot = Menu_AddStatusMenuItem(&mi, m_szModuleName);
diff --git a/src/mir_app/src/clc.h b/src/mir_app/src/clc.h index dc58b0a330..188b50f8fe 100644 --- a/src/mir_app/src/clc.h +++ b/src/mir_app/src/clc.h @@ -111,9 +111,6 @@ int fnRowHitTest(struct ClcData *dat, int y); int ClcOptInit(WPARAM wParam, LPARAM lParam);
/* clistmenus.c */
-HGENMENU fnGetProtocolMenu(const char*);
-
-int fnGetProtoIndexByPos(PROTOCOLDESCRIPTOR **proto, int protoCnt, int Pos);
void RebuildMenuOrder(void);
/* clistsettings.c */
diff --git a/src/mir_app/src/clistcore.cpp b/src/mir_app/src/clistcore.cpp index a0af48e533..8b08cb8757 100644 --- a/src/mir_app/src/clistcore.cpp +++ b/src/mir_app/src/clistcore.cpp @@ -34,8 +34,6 @@ CLIST_INTERFACE cli = { 0 }; static wchar_t szTip[MAX_TIP_SIZE+1];
-void BuildProtoMenus(void);
-
static void fnPaintClc(HWND, ClcData*, HDC, RECT*)
{
}
@@ -59,18 +57,10 @@ static int fnIsVisibleContact(ClcCacheEntry*, ClcGroup*) return false;
}
-static void fnReloadProtoMenus(void)
-{
- RebuildMenuOrder();
- if (db_get_b(0, "CList", "MoveProtoMenus", TRUE))
- BuildProtoMenus();
- cli.pfnCluiProtocolStatusChanged(0, nullptr);
-}
-
void InitClistCore()
{
cli.version = 6;
- cli.bDisplayLocked = TRUE;
+ cli.bDisplayLocked = true;
cli.pfnClcOptionsChanged = fnClcOptionsChanged;
cli.pfnContactListControlWndProc = fnContactListControlWndProc;
@@ -186,11 +176,6 @@ void InitClistCore() cli.pfnShowHide = fnShowHide;
cli.pfnGetStatusModeDescription = fnGetStatusModeDescription;
- cli.pfnGetProtoIndexByPos = fnGetProtoIndexByPos;
- cli.pfnReloadProtoMenus = fnReloadProtoMenus;
-
- cli.pfnGetProtocolMenu = fnGetProtocolMenu;
-
cli.pfnReloadExtraIcons = fnReloadExtraIcons;
cli.pfnSetAllExtraIcons = fnSetAllExtraIcons;
diff --git a/src/mir_app/src/clistmod.cpp b/src/mir_app/src/clistmod.cpp index 9681a2c8d9..a4d841cc82 100644 --- a/src/mir_app/src/clistmod.cpp +++ b/src/mir_app/src/clistmod.cpp @@ -213,7 +213,7 @@ static int ContactListAccountsChanged(WPARAM eventCode, LPARAM lParam) RemoveProtoIconIndex((PROTOACCOUNT*)lParam);
break;
}
- cli.pfnReloadProtoMenus();
+ Menu_ReloadProtoMenus();
cli.pfnTrayIconIconsChanged();
Clist_Broadcast(INTM_RELOADOPTIONS, 0, 0);
Clist_Broadcast(INTM_INVALIDATE, 0, 0);
diff --git a/src/mir_app/src/menu_clist.cpp b/src/mir_app/src/menu_clist.cpp index 4cc25c3c32..25bb07c0f4 100644 --- a/src/mir_app/src/menu_clist.cpp +++ b/src/mir_app/src/menu_clist.cpp @@ -723,26 +723,6 @@ MIR_APP_DLL(int) Clist_GetAccountIndex(int Pos) return -1;
}
-int fnGetProtoIndexByPos(PROTOCOLDESCRIPTOR **proto, int protoCnt, int Pos)
-{
- char buf[10];
- _itoa(Pos, buf, 10);
-
- DBVARIANT dbv;
- if (!db_get_s(0, "Protocols", buf, &dbv)) {
- for (int p = 0; p < protoCnt; p++) {
- if (mir_strcmp(proto[p]->szName, dbv.pszVal) == 0) {
- db_free(&dbv);
- return p;
- }
- }
-
- db_free(&dbv);
- }
-
- return -1;
-}
-
void RebuildMenuOrder(void)
{
BYTE bHideStatusMenu = db_get_b(0, "CLUI", "DontHideStatusMenu", 0); // cool perversion, though
@@ -933,6 +913,14 @@ void RebuildProtoMenus() BuildProtoMenus();
}
+MIR_APP_DLL(void) Menu_ReloadProtoMenus(void)
+{
+ RebuildMenuOrder();
+ if (db_get_b(0, "CList", "MoveProtoMenus", true))
+ BuildProtoMenus();
+ cli.pfnCluiProtocolStatusChanged(0, nullptr);
+}
+
/////////////////////////////////////////////////////////////////////////////////////////
static int sttRebuildHotkeys(WPARAM, LPARAM)
@@ -1037,7 +1025,7 @@ static MenuProto* FindProtocolMenu(const char *proto) return nullptr;
}
-HGENMENU fnGetProtocolMenu(const char* proto)
+MIR_APP_DLL(HGENMENU) Menu_GetProtocolMenu(const char *proto)
{
MenuProto *mp = FindProtocolMenu(proto);
return (mp) ? mp->pMenu : nullptr;
diff --git a/src/mir_app/src/menu_utils.cpp b/src/mir_app/src/menu_utils.cpp index 8f7167cf2b..424e595cc7 100644 --- a/src/mir_app/src/menu_utils.cpp +++ b/src/mir_app/src/menu_utils.cpp @@ -227,7 +227,7 @@ MIR_APP_DLL(HGENMENU) Menu_GetProtocolRoot(PROTO_INTERFACE *pThis) Menu_RemoveItem(pThis->m_hmiMainMenu);
pThis->m_hmiMainMenu = nullptr;
}
- return cli.pfnGetProtocolMenu(pThis->m_szModuleName);
+ return Menu_GetProtocolMenu(pThis->m_szModuleName);
}
TIntMenuObject *pmo = GetMenuObjbyId(hMainMenuObject);
@@ -1199,7 +1199,7 @@ int OnIconLibChanges(WPARAM, LPARAM) MO_RecursiveWalkMenu(p->m_items.first, MO_ReloadIcon, nullptr);
}
- cli.pfnReloadProtoMenus();
+ Menu_ReloadProtoMenus();
return 0;
}
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index eda248c2e6..8503cb7da8 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -538,3 +538,5 @@ Clist_GetProtocolVisibility @556 Clist_InitAutoRebuild @558
Clist_GetContactIcon @559
Clist_GetAccountIndex @560
+Menu_ReloadProtoMenus @561
+Menu_GetProtocolMenu @562
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index 04c814f405..1db6bfddf7 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -538,3 +538,5 @@ Clist_GetProtocolVisibility @556 Clist_InitAutoRebuild @558
Clist_GetContactIcon @559
Clist_GetAccountIndex @560
+Menu_ReloadProtoMenus @561
+Menu_GetProtocolMenu @562
diff --git a/src/mir_app/src/proto_order.cpp b/src/mir_app/src/proto_order.cpp index 29b8ec8e42..4abd40804f 100644 --- a/src/mir_app/src/proto_order.cpp +++ b/src/mir_app/src/proto_order.cpp @@ -197,7 +197,7 @@ public: it->iOrder = idx++;
WriteDbAccounts();
- cli.pfnReloadProtoMenus();
+ Menu_ReloadProtoMenus();
cli.pfnTrayIconIconsChanged();
Clist_Broadcast(INTM_RELOADOPTIONS, 0, 0);
Clist_Broadcast(INTM_INVALIDATE, 0, 0);
|