Author Topic: Context menu changed after upgrade, how to edit?  (Read 3470 times)

0 Members and 1 Guest are viewing this topic.

Offline laci58

  • Newbie
  • *
  • Posts: 8
Context menu changed after upgrade, how to edit?
« on: 28 05 2025, 21:47:43 »
Hello, after I migrated from my older PC to the new one I also wanted to upgrade Miranda to the newest version (I was avoiding the upgrade because of some problems with Google and FB plugin in the past).
But I noticed that unfortunately context menu (right click on the Miranda window) has changed.

I suppose that this is part of the upgrade and I can't avoid of this change of the menu.

Can I somehow edit it after the upgrade?
I tried to use Customize -> Menus, but I have no idea how it works.
When I click on [Insert submenu] button, I can only set the Name, I can't set the action for this new menu item.

Am I missing something or why is it even there in Options if i can't set it up according to my needs?

I am attaching the pictures of how the menu looks before the upgrade and after the upgrade.

Any help appreciated, thanks.
 

Offline dartraiden

Re: Context menu changed after upgrade, how to edit?
« Reply #1 on: 29 05 2025, 07:23:12 »
These menu items are duplicated in the menu called by the tray icon, so they were removed.

"Insert submenu" is designed only to create submenus, but not new menu items. You can drag existing items into a newly created submenu. Miranda cannot create new menu items.

Probably all this will be fixed in future versions so you can add the desired menu items back
« Last Edit: 29 05 2025, 12:43:42 by dartraiden »
 

Offline laci58

  • Newbie
  • *
  • Posts: 8
Re: Context menu changed after upgrade, how to edit?
« Reply #2 on: 30 05 2025, 22:59:15 »
thanks for the info
 

Offline dartraiden

Re: Context menu changed after upgrade, how to edit?
« Reply #3 on: 31 05 2025, 14:26:58 »
Now (in the development version), you can see not only the UUID, but also service names

Knowing the name of the service that a menu item is associated with, you can add the same menu item to another menu using the MirLua plugin

Let's add an "Exit Miranda" menu item to the contact list menu. As you can see in menu editor, the "Exit" menu item (from the main menu) is implemented by calling the "CloseAction" service (see screenshot)

Install MirLua plugin and create a simple Lua script inside \Miranda NG\Scripts folder

AddExitMenuItem.lua:
Code: [Select]
local clist = require("m_clist") -- we want to modify contact list menu, so we need to import m_clist Lua module and we will call it "clist"
local icolib = require("m_icolib") -- we want to add an icon to our new menu item, so we need to import m_icolib Lua module and we will call it "icolib"

clist.AddGroupMenuItem({ -- as we want to add group menu item, we should call AddGroupMenuItem function from clist
  Name = "Exit Miranda", -- name of the menu item (will be shown in the groups menu)
  Service = "CloseAction", -- what service calls this menu item (we created this service function above)
  Icon = icolib.AddIcon('exit', 'Exit!'), -- as we want to add icon to our menu item and put it to Customize -> Icons -> MirLua, we should call AddIcon function from icolib
  Uid = '75EA040D-AC0E-40FA-9A3C-878210B0642C' -- unique GUID, you can create one on https://www.uuidgenerator.net/guid. All that is required of it is to be unique among all your scripts
})

Save script and restart Miranda or use "Reload scripts" button in Options -> Services -> MirLua
Congratulations, you have added a new menu item!



Now you can add more menu items

Code: [Select]
clist.AddGroupMenuItem({
  Name = "Main menu",
  Service = "MainMenu/Command",
  Icon = icolib.AddIcon('mainmenu', 'Main menu'),
  Uid = '75EA040D-AC0E-40FA-9A3C-878210B06421'
})
 
clist.AddGroupMenuItem({
  Name = "Status",
  Service = "GlobalStatus/Command",
  Icon = icolib.AddIcon('status', 'Status'),
  Uid = '75EA040D-AC0E-40FA-9A3C-878210B06422'
})
 
 clist.AddGroupMenuItem({
  Name = "Options",
  Service = "Options/OptionsCommand",
  Icon = icolib.AddIcon('options', 'Options'),
  Uid = '75EA040D-AC0E-40FA-9A3C-878210B06423'
})
 
clist.AddGroupMenuItem({
  Name = "About",
  Service = "Help/AboutCommand",
  Icon = icolib.AddIcon('about', 'About Miranda'),
  Uid = '75EA040D-AC0E-40FA-9A3C-878210B06424'
})
 
clist.AddGroupMenuItem({
  Name = "Exit Miranda",
  Service = "CloseAction",
  Icon = icolib.AddIcon('exit', 'Exit!'),
  Uid = '75EA040D-AC0E-40FA-9A3C-878210B06425'
})

Maybe we will implement menu item creation directly in the menu editor in the future.
« Last Edit: 31 05 2025, 18:19:27 by dartraiden »