diff options
author | George Hazan <ghazan@miranda.im> | 2018-04-04 21:49:37 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-04-04 21:49:37 +0300 |
commit | ad2a5992f1fa9558ad653f8d5c81896472ce8363 (patch) | |
tree | 9c43ee9b96c20395f38a897382a7321325fb1d13 /src/mir_app | |
parent | b064f2ebde6d4a58141e5b2e8186c6ea53680f64 (diff) |
- CLIST_INTERFACE::pfnGetProtocolMenu => Menu_GetProtocolMenu
- CLIST_INTERFACE::pfnReloadProtoMenus => Menu_ReloadProtoMenus
- CLIST_INTERFACE::pfnGetProtoIndexByPos considered unused... thus removed
Diffstat (limited to 'src/mir_app')
-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 |
8 files changed, 18 insertions, 44 deletions
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);
|