From 9536e0bb47b12ea2ae01ab070dd9f6aa5bb360c2 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 29 Dec 2023 17:03:21 +0300 Subject: =?UTF-8?q?fixes=20#4085=20(=D0=A3=D0=B4=D0=B0=D0=BB=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20=D0=BD=D0=B0=D1=81=D1=82=D1=80=D0=BE=D0=B9=D0=BA=D0=B8?= =?UTF-8?q?=20=D0=BD=D0=B5=D0=B2=D0=B8=D0=B4=D0=B8=D0=BC=D0=BE=D1=81=D1=82?= =?UTF-8?q?=D0=B8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/MenuItemEx/res/resource.rc | 1 - plugins/MenuItemEx/src/main.cpp | 66 +++----------------------------------- plugins/MenuItemEx/src/options.cpp | 10 +----- plugins/MenuItemEx/src/resource.h | 1 - plugins/MenuItemEx/src/stdafx.h | 1 - 5 files changed, 5 insertions(+), 74 deletions(-) (limited to 'plugins/MenuItemEx') diff --git a/plugins/MenuItemEx/res/resource.rc b/plugins/MenuItemEx/res/resource.rc index a21a9df1ba..4c0eb66367 100644 --- a/plugins/MenuItemEx/res/resource.rc +++ b/plugins/MenuItemEx/res/resource.rc @@ -62,7 +62,6 @@ EXSTYLE WS_EX_CONTROLPARENT FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN GROUPBOX "Shown menu items",IDC_STATIC,7,3,266,151 - CONTROL "Visibility",IDC_VIS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,18,131,10 CONTROL "Show alpha icons",IDC_SHOWALPHAICONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,151,18,116,10 CONTROL "Hide from list",IDC_HIDE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,30,251,10 CONTROL "Ignore",IDC_IGNORE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,42,253,10 diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp index fdca3118e8..4cbf357fbd 100644 --- a/plugins/MenuItemEx/src/main.cpp +++ b/plugins/MenuItemEx/src/main.cpp @@ -1,7 +1,5 @@ #include "stdafx.h" -#define MS_SETINVIS "MenuEx/SetInvis" -#define MS_SETVIS "MenuEx/SetVis" #define MS_HIDE "MenuEx/Hide" #define MS_IGNORE "MenuEx/Ignore" #define MS_PROTO "MenuEx/ChangeProto" @@ -12,9 +10,9 @@ #define MS_COPYMIRVER "MenuEx/CopyMirVer" #define MS_OPENIGNORE "MenuEx/OpenIgnoreOptions" -const int vf_default = VF_VS | VF_HFL | VF_IGN | VF_CID | VF_SHOWID | VF_RECV | VF_STAT | VF_SMNAME | VF_CIDN | VF_CIP; +const int vf_default = VF_HFL | VF_IGN | VF_CID | VF_SHOWID | VF_RECV | VF_STAT | VF_SMNAME | VF_CIDN | VF_CIP; -HGENMENU hmenuVis, hmenuOff, hmenuHide, hmenuIgnore, hmenuProto; +HGENMENU hmenuOff, hmenuHide, hmenuIgnore, hmenuProto; HGENMENU hmenuCopyID, hmenuRecvFiles, hmenuStatusMsg, hmenuCopyIP, hmenuCopyMirVer; static HGENMENU hIgnoreItem[9], hProtoItem[MAX_PROTOS]; HICON hIcons[5]; @@ -305,22 +303,6 @@ static BOOL isProtoOnline(char *szProto) return (protoStatus > ID_STATUS_OFFLINE && protoStatus < ID_STATUS_IDLE); } -// set the invisible-flag in db -static INT_PTR onSetInvis(WPARAM wparam, LPARAM) -{ - MCONTACT hContact = (MCONTACT)wparam; - ProtoChainSend(hContact, PSS_SETAPPARENTMODE, (db_get_w(hContact, Proto_GetBaseAccountName(hContact), "ApparentMode", 0) == ID_STATUS_OFFLINE) ? 0 : ID_STATUS_OFFLINE, 0); - return 0; -} - -// set visible-flag in db -static INT_PTR onSetVis(WPARAM wparam, LPARAM) -{ - MCONTACT hContact = (MCONTACT)wparam; - ProtoChainSend(hContact, PSS_SETAPPARENTMODE, (db_get_w(hContact, Proto_GetBaseAccountName(hContact), "ApparentMode", 0) == ID_STATUS_ONLINE) ? 0 : ID_STATUS_ONLINE, 0); - return 0; -} - static INT_PTR onHide(WPARAM wparam, LPARAM) { MCONTACT hContact = (MCONTACT)wparam; @@ -328,17 +310,6 @@ static INT_PTR onHide(WPARAM wparam, LPARAM) return 0; } -// following 4 functions should be self-explanatory -static void ModifyVisibleSet(int mode, BOOL alpha) -{ - Menu_ModifyItem(hmenuVis, nullptr, (mode) ? hIcons[1] : (alpha ? hIcons[3] : Skin_GetIconHandle(SKINICON_OTHER_SMALLDOT))); -} - -static void ModifyInvisSet(int mode, BOOL alpha) -{ - Menu_ModifyItem(hmenuOff, nullptr, (mode) ? hIcons[2] : (alpha ? hIcons[4] : Skin_GetIconHandle(SKINICON_OTHER_SMALLDOT))); -} - static void ModifyCopyID(MCONTACT hContact, BOOL bShowID, BOOL bTrimID) { if (isMetaContact(hContact)) { @@ -636,11 +607,9 @@ static int BuildMenu(WPARAM wparam, LPARAM) bIsOnline = isProtoOnline(pszProto); - bool bEnabled = bShowAll || (flags & VF_VS); - Menu_ShowItem(hmenuVis, bEnabled); - Menu_ShowItem(hmenuOff, bEnabled); + Menu_ShowItem(hmenuOff, bShowAll); - bEnabled = bShowAll || (flags & VF_HFL); + bool bEnabled = bShowAll || (flags & VF_HFL); Menu_ShowItem(hmenuHide, bEnabled); if (bEnabled) { if (Contact::IsHidden(hContact)) @@ -704,19 +673,6 @@ static int BuildMenu(WPARAM wparam, LPARAM) Menu_ShowItem(hmenuCopyMirVer, bEnabled); if (bEnabled) ModifyCopyMirVer(hContact); - - if ((bShowAll || (flags & VF_VS)) && pszProto) { - INT_PTR caps = CallProtoService(pszProto, PS_GETCAPS, PFLAGNUM_1, 0); - int apparent = db_get_w(hContact, Proto_GetBaseAccountName(hContact), "ApparentMode", 0); - - Menu_ShowItem(hmenuVis, (caps & PF1_VISLIST) != 0); - if (caps & PF1_VISLIST) - ModifyVisibleSet(apparent == ID_STATUS_ONLINE, flags & VF_SAI); - - Menu_ShowItem(hmenuOff, (caps & PF1_INVISLIST) != 0); - if (caps & PF1_INVISLIST) - ModifyInvisSet(apparent == ID_STATUS_OFFLINE, flags & VF_SAI); - } return 0; } @@ -794,18 +750,6 @@ static int PluginInit(WPARAM, LPARAM) CMenuItem mi(&g_plugin); mi.flags = CMIF_UNICODE; - SET_UID(mi, 0x2616aa3f, 0x535a, 0x464c, 0xbd, 0x26, 0x1b, 0x15, 0xbe, 0xfa, 0x1f, 0xf); - mi.position = 120000; - mi.name.w = LPGENW("Always visible"); - mi.pszService = MS_SETVIS; - hmenuVis = Menu_AddContactMenuItem(&mi); - - SET_UID(mi, 0x7d93de78, 0xb1c, 0x4c51, 0x8c, 0x88, 0x33, 0x72, 0x12, 0xb5, 0xb8, 0xe7); - mi.position++; - mi.name.w = LPGENW("Never visible"); - mi.pszService = MS_SETINVIS; - hmenuOff = Menu_AddContactMenuItem(&mi); - SET_UID(mi, 0x724f6ac0, 0x7f69, 0x407d, 0x85, 0x98, 0x9c, 0x80, 0x32, 0xdb, 0x66, 0x2d); mi.position++; mi.name.w = LPGENW("Hide from list"); @@ -889,8 +833,6 @@ int CMPlugin::Load() { g_plugin.registerIcon(LPGEN("MenuItemEx"), iconList, "miex"); - CreateServiceFunction(MS_SETINVIS, onSetInvis); - CreateServiceFunction(MS_SETVIS, onSetVis); CreateServiceFunction(MS_HIDE, onHide); CreateServiceFunction(MS_IGNORE, onIgnore); CreateServiceFunction(MS_PROTO, onChangeProto); diff --git a/plugins/MenuItemEx/src/options.cpp b/plugins/MenuItemEx/src/options.cpp index cf84d6daa6..b17894b790 100644 --- a/plugins/MenuItemEx/src/options.cpp +++ b/plugins/MenuItemEx/src/options.cpp @@ -10,7 +10,6 @@ static const checkboxes[] = { { IDC_STATUSMSG, VF_STAT }, { IDC_COPYIP, VF_CIP }, { IDC_COPYMIRVER, VF_CMV }, - { IDC_VIS, VF_VS }, { IDC_SHOWALPHAICONS, VF_SAI }, { IDC_HIDE, VF_HFL }, { IDC_IGNORE, VF_IGN }, @@ -27,14 +26,13 @@ class COptDialog : public CDlgBase { uint32_t m_flags; - CCtrlCheck m_chkVis, m_chkAlpha, m_chkHide, m_chkIgnore, m_chkProtos, m_chkRecvFiles, m_chkCopyIP, m_chkCopyMirver, m_chkStatusMsg, + CCtrlCheck m_chkAlpha, m_chkHide, m_chkIgnore, m_chkProtos, m_chkRecvFiles, m_chkCopyIP, m_chkCopyMirver, m_chkStatusMsg, m_chkSMName, m_chkCopyID, m_chkCopyIDName, m_chkShowID, m_chkTrimID, m_chkIgnoreHide; CCtrlLabel m_lblHint; public: COptDialog() : CDlgBase(g_plugin, IDD_OPTIONS), - m_chkVis(this, IDC_VIS), m_chkAlpha(this, IDC_SHOWALPHAICONS), m_chkHide(this, IDC_HIDE), m_chkIgnore(this, IDC_IGNORE), @@ -53,7 +51,6 @@ public: { m_flags = g_plugin.getDword("flags", vf_default); - m_chkVis.OnChange = Callback(this, &COptDialog::onChange_Vis); m_chkIgnore.OnChange = Callback(this, &COptDialog::onChange_Ignore); m_chkStatusMsg.OnChange = Callback(this, &COptDialog::onChange_StatusMsg); m_chkCopyID.OnChange = m_chkShowID.OnChange = Callback(this, &COptDialog::onChange_CopyID); @@ -88,11 +85,6 @@ public: return true; } - void onChange_Vis(CCtrlBase *) - { - m_chkAlpha.Enable(m_chkVis.GetState()); - } - void onChange_Ignore(CCtrlBase *) { m_chkIgnoreHide.Enable(m_chkIgnore.GetState()); diff --git a/plugins/MenuItemEx/src/resource.h b/plugins/MenuItemEx/src/resource.h index c8c493cfaf..a97b5fa080 100644 --- a/plugins/MenuItemEx/src/resource.h +++ b/plugins/MenuItemEx/src/resource.h @@ -16,7 +16,6 @@ #define IDI_COPYIP 121 #define IDI_BROWSE 122 #define IDI_MIRVER 123 -#define IDC_VIS 1000 #define IDC_REASON 1001 #define IDC_HIDE 1002 #define IDC_IGNORE 1003 diff --git a/plugins/MenuItemEx/src/stdafx.h b/plugins/MenuItemEx/src/stdafx.h index 94bf0ea81b..1ff9aa7ce5 100644 --- a/plugins/MenuItemEx/src/stdafx.h +++ b/plugins/MenuItemEx/src/stdafx.h @@ -47,7 +47,6 @@ int OptionsInit(WPARAM, LPARAM); #define MAX_GROUPS 32 #define MAX_IDLEN 16 -#define VF_VS 0x00000001 #define VF_SMNAME 0x00000002 #define VF_HFL 0x00000004 #define VF_IGN 0x00000008 -- cgit v1.2.3