Page 1 of 1

Customize Context Menus

Posted: 06 Jun 2015 21:19
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

Re: Customize Context Menus

Posted: 07 Jun 2015 05:37
by bdeshi
Not possible in XY.

Re: Customize Context Menus

Posted: 07 Jun 2015 09:10
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.

Re: Customize Context Menus

Posted: 08 Jun 2015 03:52
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

Re: Customize Context Menus

Posted: 08 Jun 2015 05:18
by Stef123
Maybe as an ini-tweak "OpenWithCaption=" that accepts a custom string

Re: Customize Context Menus

Posted: 08 Jun 2015 20:06
by bdeshi
Or customize the English language file.
Reference_8.62.lng
[Help > Select Local Language File... , pick downloaded lngfile]

Re: Customize Context Menus

Posted: 08 Jun 2015 21:41
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?

Re: Customize Context Menus

Posted: 19 Jul 2015 01:56
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?

Re: Customize Context Menus

Posted: 19 Jul 2015 08:52
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.

Re: Customize Context Menus

Posted: 19 Jul 2015 10:38
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).

Re: Customize Context Menus

Posted: 19 Jul 2015 15:34
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.

Re: Customize Context Menus

Posted: 19 Jul 2015 16:02
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?

Re: Customize Context Menus

Posted: 19 Jul 2015 16:31
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.

Re: Customize Context Menus

Posted: 19 Jul 2015 16:41
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.