Customize Context Menus

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
tealduck
Posts: 10
Joined: 11 Sep 2014 16:35

Customize Context Menus

Post by tealduck »

I would like to know how we can customize the context menus that appear in the File List window. I was able to remove a number of items that were not wanted but a few list items remain that I wish to remove. Specifically:
* Open
* Pin to Start
* Open MobaXterm terminal here (thought this would have been removed with checking "Hide shell extensions from shell context menu"

It would also be nice to remove the let margin where icons would appear, anyone know how to do this?

I would also be interested in renaming "Open With..." to "Custom..." since a lot of the options in the list perform actions other than opening the actual file/folder.

Thanks for any and all help,
Keith

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Customize Context Menus

Post by bdeshi »

Not possible in XY.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Stef123

Re: Customize Context Menus

Post by Stef123 »

tealduck wrote:I would also be interested in renaming "Open With..." to "Custom..." since a lot of the options in the list perform actions other than opening the actual file/folder.
:tup: +1
I also "abuse" this feature to get a fake custom context menu on the second click. A name change would much better reflect the capabilities of OpenWith - especially with its new separator features.

Nighted
Posts: 463
Joined: 21 Jan 2007 01:58
Location: Gitmo Nation North, Win 7/10/Linux/(x64)

Re: Customize Context Menus

Post by Nighted »

Stef123 wrote: :tup: +1
I also "abuse" this feature to get a fake custom context menu on the second click. A name change would much better reflect the capabilities of OpenWith - especially with its new separator features.
+1
I want XY to serve soft ice cream. Please Don, make XY serve soft ice cream.

Stef123

Re: Customize Context Menus

Post by Stef123 »

Maybe as an ini-tweak "OpenWithCaption=" that accepts a custom string

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Customize Context Menus

Post by bdeshi »

Or customize the English language file.
Reference_8.62.lng
[Help > Select Local Language File... , pick downloaded lngfile]
To see the attached files, you need to log into the forum.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Stef123

Re: Customize Context Menus

Post by Stef123 »

:tup: This works. Amazingly well, throughout key shortcuts and what not.
A bit more work than the sticky ini-alternative, considering that all updates require replacing the language file again.

Let me ask you this, Sammay: Is it safe to run an unattended Replace All on all "open with" occurences?

Stef123

Re: Customize Context Menus

Post by Stef123 »

I wonder if an outdated English language file can be responsible for interface glitches that are very hard to track down.
Such as missing color swatches:
http://www.xyplorer.com/xyfc/viewtopic. ... it=missing

The problem above seems to disappear when I replace the custom language with a newer version. And that raises the question how to move my custom entries over to the newer language file?

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Customize Context Menus

Post by bdeshi »

[I had made a reply to your previous post, but must've gotten ~disconnected. sorry!]

Well, when you reported the missing color swatches, I wasn't using any custom language file.

And back to propagating those changes.
1. No you can't just blindly replace all "open with" with "<you_custom_caption>", because the source strings come as &open with, open &with, and even as part of a phrase in another context (such as "Open with arguments")
2. The language file is actually a ini file in disguise. So you can just make a script with a barrage of mainly SC setkeys to move those replacements to any other English lng file version (because the string names/ini key names are static)

As an XYScript exercise for you, ( :ugeek: ) her are the keynames you need to replace.

Code: Select all

[header]
Language=English [Open With => <you_custom_caption>]
Comments=Default language file. "Open With" caption replaced with "<you_custom_caption>"
(The header keys are optional, they just help identify the lng file as custom, as opposed to a stock English.)

Code: Select all

[core]
co.0018=
tb.0019=
01.0386=
01.0612=
ms.0064=
ms.1450=
ms.1451=
ms.1827=
ms.2559=
A [core] key is structured like this:

Code: Select all

keyname=[flags:]state|original string/template|--|translated string/template
;state: 00=not translated, 01=translated
by the way, instead of plain blind-but-now-with-a-replacing-stick replacement, you might build the translated string by regexreplacing "&?open &?with" in the original string.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Stef123

Re: Customize Context Menus

Post by Stef123 »

Thank you Sammay,
you're right, the language file is not the culprit - the color label glitches are back. Drives me nuts, it's random and very persistent, makes me stop using labels altogether.

But nevertheless, I think it's a good idea to upgrade, unless - maybe - XY also updates custom language files, the way it does update custom ini files? Newer menu items don't seem to be missing, even though I never added them manually.
SammaySarkar wrote:As an XYScript exercise for you, ( :ugeek: ) her are the keynames you need to replace.
...
by the way, instead of plain blind-but-now-with-a-replacing-stick replacement, you might build the translated string by regexreplacing "&?open &?with" in the original string.
:D Thanks. Very much appreciated.
Still hoping for the OT suggestion of enabling the rename via ini, though. This seems the smoothest way.

Actually, I am not just asking on behalf of the open-with caption. A long time ago, I changed other stuff, such as info-texts, to have my own customized quick-help texts (that was before the ahk-context help came out).

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Customize Context Menus

Post by bdeshi »

Stef123 wrote:I think it's a good idea to upgrade, unless - maybe - XY also updates custom language files, the way it does update custom ini files? Newer menu items don't seem to be missing, even though I never added them manually.
you don't see anything missing because you're using the English language. Any holes in the custom language is filled by XYplorer's default "string bank", which is also in English.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Stef123

Re: Customize Context Menus

Post by Stef123 »

Good to know. In that case I just keep my custom language file.
The only drawback is probably that I won't be able to rename newer items since they're not in the file to start with. But other than that ... I don't suppose startup or performance suffers from this auto-fill-up?

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Customize Context Menus

Post by bdeshi »

The only drawback is probably that I won't be able to rename newer items since they're not in the file to start with.
Help > Interface Translation Tool > File > Upgrade Language file (download). This should add newer entries to your lng file.
Then View > not yet translated. This should list those newer items, so you can edit any new instances of Open With.

btw, I made a small update to the [core] key template.
I don't suppose startup or performance suffers from this auto-fill-up?
None practically.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Stef123

Re: Customize Context Menus

Post by Stef123 »

Thank you Sammay,
also for the core-key template. With all the customizing I almost lost sight of the real purpose of this thing, to cater to translators. And I definetly need to streamline my stuff. Too many language file versions, ATM I am comparing them with WinMerge.

Post Reply