From f340ed2b1039f68c23bb461f485c25c70d1cf32f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 30 May 2025 14:53:49 +0300 Subject: =?UTF-8?q?fixes=20#5039=20(=D0=A0=D0=B5=D0=B4=D0=B0=D0=BA=D1=82?= =?UTF-8?q?=D0=BE=D1=80=20=D0=BC=D0=B5=D0=BD=D1=8E:=20=D0=BF=D0=BE=D0=BA?= =?UTF-8?q?=D0=B0=D0=B7=D1=8B=D0=B2=D0=B0=D1=82=D1=8C=20=D0=BD=D0=B0=D0=B7?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D1=81=D0=B5=D1=80=D0=B2=D0=B8?= =?UTF-8?q?=D1=81=D0=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mir_app/res/resource.rc | 28 ++++++++++++++++++---------- src/mir_app/src/menu_options.cpp | 24 +++++++++++++----------- src/mir_app/src/resource.h | 3 ++- 3 files changed, 33 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/mir_app/res/resource.rc b/src/mir_app/res/resource.rc index 0933ec329e..281f5e33ee 100644 --- a/src/mir_app/res/resource.rc +++ b/src/mir_app/res/resource.rc @@ -7,6 +7,7 @@ // // Generated from the TEXTINCLUDE 2 resource. // +#define WINVER 0x0501 #include #include "../../include/statusmodes.h" @@ -472,15 +473,16 @@ BEGIN GROUPBOX "Protocol menus",IDC_STATIC,5,81,140,41 CONTROL "Move to the main menu",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON,11,95,128,8 CONTROL "Move to the status bar",IDC_RADIO2,"Button",BS_AUTORADIOBUTTON,11,107,130,8 - LTEXT "Warning!\r\nThis menu object not support user defined options.",IDC_NOTSUPPORTWARNING,10,124,136,32,NOT WS_VISIBLE - PUSHBUTTON "Insert submenu",IDC_INSERTSUBMENU,39,147,97,14,WS_DISABLED - PUSHBUTTON "Insert separator",IDC_INSERTSEPARATOR,39,164,97,14,WS_DISABLED - LTEXT "Module:",IDC_STATIC,4,184,29,8 - EDITTEXT IDC_GENMENU_MODULE,36,183,108,14,ES_AUTOHSCROLL | ES_READONLY - LTEXT "Service:",IDC_STATIC,4,201,29,8 - EDITTEXT IDC_GENMENU_SERVICE,36,199,108,14,ES_AUTOHSCROLL | ES_READONLY - LTEXT "Name:",IDC_STATIC,4,218,29,8 - EDITTEXT IDC_GENMENU_CUSTOMNAME,36,215,108,14,ES_AUTOHSCROLL | WS_DISABLED + PUSHBUTTON "Insert submenu",IDC_INSERTSUBMENU,39,128,97,14,WS_DISABLED + PUSHBUTTON "Insert separator",IDC_INSERTSEPARATOR,39,145,97,14,WS_DISABLED + LTEXT "Module:",IDC_STATIC,4,164,29,8 + EDITTEXT IDC_GENMENU_MODULE,36,162,108,12,ES_AUTOHSCROLL | ES_READONLY + LTEXT "Service:",IDC_STATIC,4,180,29,8 + EDITTEXT IDC_GENMENU_SERVICE,36,178,108,12,ES_AUTOHSCROLL | ES_READONLY + LTEXT "ID:",IDC_STATIC,4,196,29,8 + EDITTEXT IDC_GENMENU_ID,36,194,108,12,ES_AUTOHSCROLL | WS_DISABLED + LTEXT "Name:",IDC_STATIC,4,212,29,8 + EDITTEXT IDC_GENMENU_CUSTOMNAME,36,210,108,12,ES_AUTOHSCROLL | WS_DISABLED PUSHBUTTON "Default",IDC_GENMENU_DEFAULT,7,233,39,15,WS_DISABLED PUSHBUTTON "Set",IDC_GENMENU_SET,50,233,45,15,WS_DISABLED CONTROL "Enable icons",IDC_DISABLEMENUICONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,156,234,91,10 @@ -755,7 +757,7 @@ BEGIN CONTROL "User &details",IDC_DETAILS,"MButtonClass",WS_TABSTOP,248,29,16,14,WS_EX_NOACTIVATE | 0x10000000L LTEXT "Reason:",IDC_STATIC,7,39,101,10,SS_CENTERIMAGE EDITTEXT IDC_REASON,7,50,257,54,ES_MULTILINE | ES_READONLY | NOT WS_BORDER | WS_VSCROLL | WS_HSCROLL,WS_EX_STATICEDGE - LTEXT "Denial reason:",IDC_STATIC,7,111,89,10,SS_CENTERIMAGE | 0x40 + LTEXT "Denial reason:",IDC_STATIC,7,111,89,10,SS_CENTERIMAGE | SS_REALSIZECONTROL EDITTEXT IDC_DENYREASON,7,124,257,32,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | NOT WS_BORDER,WS_EX_STATICEDGE CONTROL "Add to contact list if authorized",IDC_ADDCHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,162,239,10 END @@ -1459,6 +1461,7 @@ END 2 TEXTINCLUDE BEGIN + "#define WINVER 0x0501\r\n" "#include \r\n" "#include ""../../include/statusmodes.h""\r\n" "\0" @@ -1800,6 +1803,11 @@ BEGIN 0 END +IDD_OPT_GENMENU AFX_DIALOG_LAYOUT +BEGIN + 0 +END + #endif // English (United States) resources ///////////////////////////////////////////////////////////////////////////// diff --git a/src/mir_app/src/menu_options.cpp b/src/mir_app/src/menu_options.cpp index a3696d331e..99b6e81b85 100644 --- a/src/mir_app/src/menu_options.cpp +++ b/src/mir_app/src/menu_options.cpp @@ -254,12 +254,9 @@ class CGenMenuOptionsPage : public CDlgBase m_menuItems.SetDraw(false); m_menuItems.DeleteAllItems(); - BuildTreeInternal(szModule, bReread, pmo->m_items, nullptr); - m_menuItems.SetDraw(true); - m_warning.Show(!pmo->m_bUseUserDefinedItems); m_menuItems.Enable(pmo->m_bUseUserDefinedItems); m_btnInsSeparator.Enable(pmo->m_bUseUserDefinedItems); m_btnInsMenu.Enable(pmo->m_bUseUserDefinedItems); @@ -279,9 +276,8 @@ class CGenMenuOptionsPage : public CDlgBase CCtrlListBox m_menuObjects; CCtrlTreeView m_menuItems; CCtrlCheck m_radio1, m_radio2, m_enableIcons; - CCtrlEdit m_customName, m_service, m_module; + CCtrlEdit m_customName, m_service, m_module, m_id; CCtrlButton m_btnInsSeparator, m_btnInsMenu, m_btnReset, m_btnSet, m_btnDefault, m_btnDelete; - CCtrlBase m_warning; public: CGenMenuOptionsPage() : @@ -298,10 +294,10 @@ public: m_btnSet(this, IDC_GENMENU_SET), m_btnDelete(this, IDC_GENMENU_DELETE), m_btnDefault(this, IDC_GENMENU_DEFAULT), + m_id(this, IDC_GENMENU_ID), m_customName(this, IDC_GENMENU_CUSTOMNAME), m_service(this, IDC_GENMENU_SERVICE), - m_module(this, IDC_GENMENU_MODULE), - m_warning(this, IDC_NOTSUPPORTWARNING) + m_module(this, IDC_GENMENU_MODULE) { m_btnSet.OnClick = Callback(this, &CGenMenuOptionsPage::btnSet_Clicked); m_btnReset.OnClick = Callback(this, &CGenMenuOptionsPage::btnReset_Clicked); @@ -537,6 +533,7 @@ public: m_customName.SetTextA(""); m_service.SetTextA(""); m_module.SetTextA(""); + m_id.SetTextA(""); m_btnInsMenu.Disable(); m_btnDefault.Disable(); @@ -562,13 +559,18 @@ public: m_customName.SetText(iod->name); if (iod->pimi->mi.uid != miid_last) { + auto &id = iod->pimi->mi.uid; char szText[100]; - bin2hex(&iod->pimi->mi.uid, sizeof(iod->pimi->mi.uid), szText); - m_service.SetTextA(szText); + mir_snprintf(szText, "%08x-%04x-%04x-", id.a, id.b, id.c); + bin2hex(&iod->pimi->mi.uid.d, sizeof(iod->pimi->mi.uid.d), szText + strlen(szText)); + m_id.SetTextA(szText); } - const CMPluginBase *pPlugin = iod->pimi->mi.pPlugin; - m_module.SetTextA(pPlugin == nullptr ? "" : pPlugin->getInfo().shortName); + if (iod->pimi->mi.pszService) + m_service.SetTextA(iod->pimi->mi.pszService); + + auto *pPlugin = iod->pimi->mi.pPlugin; + m_module.SetTextA(pPlugin ? pPlugin->getInfo().shortName : ""); m_btnInsMenu.Enable(iod->pimi->mi.root == nullptr); m_btnDefault.Enable(mir_wstrcmp(iod->name, iod->defname) != 0); diff --git a/src/mir_app/src/resource.h b/src/mir_app/src/resource.h index 65b746277a..0a7cd65a53 100644 --- a/src/mir_app/src/resource.h +++ b/src/mir_app/src/resource.h @@ -297,6 +297,7 @@ #define IDC_GENMENU_CUSTOMNAME 1086 #define IDC_GENMENU_SET 1087 #define IDC_REVERSE_ORDER 1088 +#define IDC_GENMENU_ID 1088 #define IDC_GENMENU_DEFAULT 1089 #define IDC_ICON1 1090 #define IDC_GENMENU_DELETE 1090 @@ -697,7 +698,7 @@ // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 341 +#define _APS_NEXT_RESOURCE_VALUE 342 #define _APS_NEXT_COMMAND_VALUE 40018 #define _APS_NEXT_CONTROL_VALUE 1762 #define _APS_NEXT_SYMED_VALUE 101 -- cgit v1.2.3