Make button from em command and em command from button

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Make button from em command and em command from button

Post by *DrShark »

To make it easier to test complex buttons with many em_ commands used, and to make easier the creation of the em_ command itself, I have following suggestions:
* to the user command edit dialog add the item "Copy as a button" that will copy the fields of user command in TOTALCMD#BAR#DATA format.
* to the button edit dialog add a the item "Make user command from this button" with an additional input field to set a name for new user command and a button "Create..." after pressing which the dialog of editing our em_ command with all fields from our button already added will be opened so user will just have to confirm the creation.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

* to the user command edit dialog add the item "Copy as a button"
This item may be added to Change button's menu for both full (all buttons) and mini (one button and usercommand) button edit dialogs.
* to the button edit dialog add a the item "Make user command from this button"
It would be much better here to open standard command brower and its command creation dialog...
User avatar
Vochomurka
Power Member
Power Member
Posts: 814
Joined: 2005-09-14, 22:19 UTC
Location: Russia
Contact:

Post by *Vochomurka »

Single user license #329241
PowerPro scripts for Total Commander
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Post by *DrShark »

MVV wrote:
DrShark wrote:* to the button edit dialog add a the item "Make user command from this button"
It would be much better here to open standard command brower and its command creation dialog...
By "item" I meant an additionl row in the button edit dialog that looks like this:
Suggested interface wrote:Make user command from this button: [em_newname_____] [Create...]
Click on [Create...] should open a user command creation dialog (called "Change user command") with our em_newname in title and with the values from button fields already added to it. I'm not sure about the need of opening the cm_CommandBrowser window too because if user will need the command browser for something it's possible to open it right from user command creation dialog by clicking on the [...] button (the one placed left from [Change >>] button.)

2Vochomurka
Thanks, I will try it.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

By "item" I meant an additionl row in the button edit dialog that looks like this:
Too much unnecessary extra space. User-command name is not a necessary parameter for a button, and for user-command buttons its name will already be in the Command field, so this line will be redundant.
User avatar
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

Please also consider this larger suggestion which includes creating a em commando automatically when creating a button. In other words all places where a user command can be inserted should be based on em commands.

http://www.ghisler.ch/wiki/index.php?title=Unified_command_launcher_editor
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Lefteous,
Replacing buttons with em-commands will complicate exchange of buttons/buttonbars, also there are limits on INI file size and number of EM commands which will cause more problems (currently such limits are only a problem for a few TC users who create thousands of EM-commands)...
User avatar
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2MVV
Replacing buttons with em-commands will complicate exchange of buttons/buttonbars
No, why should it?
also there are limits on INI file size and number of EM commands which will cause more problems (currently such limits are only a problem for a few TC users who create thousands of EM-commands)...
For me it seems it's just the way around. The problem is always section size and they are much larger in buttonbar files then they are in usercmd.ini.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

No, why should it?
E.g. you wouldn't be able to just copy a BAR file with EM-dependencies.
The problem is always section size and they are much larger in buttonbar files then they are in usercmd.ini.
Exactly. Total size of all buttonbar files may be much greater than size of a single INI file, therefore a bunch of BAR files has less limitations than single usercmd.ini file.

Also merging multiple buttonbars would be more complicated due to merging usercmd.ini files, and you would need additional tools for detecting dead EM-commands...
User avatar
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

E.g. you wouldn't be able to just copy a BAR file with EM-dependencies.
Also merging multiple buttonbars would be more complicated due to merging usercmd.ini files, and you would need additional tools for detecting dead EM-commands...
I think this are mainly tooling problems. More importantly I consider the stuff you mentioned as edge cases. We need a solution that works for 99% of the user.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

And I'm afraid 99% of users would expect internal solutions...
User avatar
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

Internal solutions for what? A unified command editor or something else? In this case I agree. Absolutely standard in many applications nowadays.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

In case of EM-commanded buttonbars there will be also required a way for exporting/importing independent buttonbar...
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Post by *DrShark »

2Vochomurka
I tried your script and it does the job (required PowerPro update from my 3.8 to 5.x)! The only thing I miss is the ability to edit the user command before the command will be finally created (it may help if the user command I want to make should have some minor differences with the button).
2MVV
MVV wrote:...its name will already be in the Command field, so this line will be redundant.
Well, this will work if after a click on [Create...] button TC will auto-open Command Browser, then auto-focus on "usercmd.ini" item, then auto-click the [New...] button and will auto-suggset the new usercommand name (like mentioned Button2em script does,) and finally after user will confirm the name (or give a different one) for em command, TC should open "Change user command" with the same values of its fields like in our button.
2Lefteous
I do not support the merging of a button and a em-command to a single thing. Why? User command may be used not only in a button, but also in Start menu, Directory menu, Command line or just be assigned to a hotkey. I just don't see the point in making the additional button record for each em command.
Last edited by DrShark on 2017-05-15, 21:23 UTC, edited 1 time in total.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
ts4242
Power Member
Power Member
Posts: 2081
Joined: 2004-02-02, 20:08 UTC
Contact:

Re: Make button from em command and em command from button

Post by *ts4242 »

DrShark wrote:* to the user command edit dialog add the item "Copy as a button" that will copy the fields of user command in TOTALCMD#BAR#DATA format.

* to the button edit dialog add a the item "Make user command from this button"
You can use both Extended Command Editor and Button Bar Editor to Copy any command/button in TOTALCMD#BAR#DATA format then Paste anywhere.
Post Reply