different use-cases which require different design. So for "Find files" "Search in archives" separate suggestion posted here.
This suggestion adds ability for users to select unpacker they want to use for extractig archive (or group of archives) and
also to (re)open archive with any unpacker, and even use ALT+F6 dialog on any file that not recognized by TC as archive using Enter or Ctrl+PgDn actions. As optional addition, for better usability I suggest also to divide all unpackers in dropdown list into groups (5 groups for "Extract files" dialog §1.3-1.7, and 2 groups for "(re)open with" dialog, see 2.3.1), details below. This suggestion doesn't change current "Enter" key, "Ctrl+PgDn" or "Alt+F6+Enter" hotkeys behaviour, so shouldn't cause problems with compatibility.
1. Extract files (Alt+F6) dialog; for one file extension:
1.1. Add a dropdown list of Unpackers (internal, external, WCX) similar to existing on in Pack (Alt+F5) dialog, but
instead of extensions like in Alt+F5 dropdown list, here we will use unpacker names. This dropdown list is designed to be
visible only if Extract files (Alt+F6) dialog called for one or several files with one extension. It will make possible to
use "Extract files" dialog for files that are not detected by Total Commander as archives neither by their extension nor by header. For better usability unpackers will be present in dropdown list by groups, with separate sorting inside each group.
This dropdown list is designed for using when TC has files with one extension selected in panel, but a simplified version of this dropdown list in theory may also be present if files with several extensions selected in panel, for this see §2.
1.2. In wincmd.ini in addition to [Packer] and [PackerPlugins] sections, another section have to be added for
§1.4 group of dropdown list. This section will contain custom unpacker priority for each allowed extension.
1.3 "Work with archive as with directory default unpacker". Here, for compatibility with current TC behaviour, we place one first unpacker that use "Open archive" (Enter, or Ctrl+PgDn key) for our extension. For WCX plugins Enter key defined by match our extension in [packerplugins] section in wincmd.ini, or Ctrl+PgDn key - they have 256 value there. For this unpacker in dropdown list we use default font color and "bold" style. If our archive(s) extension doesn't match unpacker for "Open archive" action, this item isn't present in "Extract files" dialog's dropdown list.
1.4. "Custom order for extension" group. Here we put unpackers present for our archive extension in our new wincmd.ini
section. For this group in dropdown list we use different font color ("Color1"), default style. Items in this group sorted by their # (see §4.) If our archive(s) extension doesn't match unpacker for "Open archive" action, this group isn't present in
dropdown list.
1.5 "Work with archive as with directory" unpackers group. Here we put all other unpackers except one (first in priority) used in $1.3, that can use "Open archive (either Enter or Ctrl+PgDn key) for our extension. For WCX plugins Enter key defined by match our extension in [packerplugins] section in wincmd.ini, or Ctrl+PgDn key - they have 256 value there. For this group in dropdown list we use default font color and "bold" style. If our archive(s) extension doesn't match unpacker for "Open archive" action, this group isn't present in "Extract files" dialog's dropdown list.
1.6. "Other WCXex w/ Detects archive type by content unpackers" group. Here we put only installed WCX plugins that
doesn't match our extension and have 64 value in [packerplugins] section of wincmd.ini. For this group in dropdown list we
use different font color ("Color2"), default style. Items in this group sorted by their order in [packerplugins] section of wincmd.ini. If [packerplugins] section of wincmd.ini doesn't have plugins that match requirements for this group, the group is not present in our dropdown list.
1.7. "Other installed unpackers" group. This group lists all other unpackers, including plugins, that don't match any of above groups. For this group in dropdown list we use default color, default style. Items in this group sorted by their order in Configuration dialog for external and internal unpackers, and then for their order in [packerplugins] section of wincmd.ini for WCX plugins. It seems that this group can always be present because at least the list of all or most of internal TC unpackers will be present here.
2. Extract files (Alt+F6) dialog; for several file extensions or files without extension.
Since here we have files that belong to different unpackers, in addition to dropdown list we may add checkboxes:
2.1. Checkbox "Try unpackers for Open archive action where possible". If checked, for each extension TC will try to use
unpacker defined for Open action (see §1.1). This checkbox can be active by default.
2.2. Checkbox "Try WCX plugins thet detect archive type by content". If checked, and checkbox from §2.1 also checked, TC will try this only for files where §2.1 will fail or can't be used. If checkbox from §2.1 unchecked, TC will try this for all selected files.
2.3. Checkbox "Try next unpacker for all files", with following our dropdown list. Here we can put all available unpackers, so user can try any unpacker for all selected files. Because here we have several extensions, sorting inside dropdown list probably won't give much benefit.
2.3.1. However, since chances to open file with unpacker from §2.1 or §2.2 criteria is higher, they may form a first group, and other unpacker will for second, with alphabet or natural sorting inside each. We also can divide dropdown list to alternative groups, with unpackers from Configuration dialog for external and internal unpackers being first, and then WCX plugins form [packerplugins] section of wincmd.ini, with sorting order from §1.7.
2.4. Below checkboxes and dropdown list, there are [OK] and [Cancel] buttons. If user deactivate all checkboxes, [OK] button became inactive.
3. (Re)Open archive with any unpacker.
For focused archive in panel, "Open with ..." action will be called using Ctrl+<somekey>+PgDn hotkey.
For for archive already opened in panel "Reopen with..." action will be called using Ctrl+<somekey>+PgDn on [..] element.
When action called, a dialog titled "(Re)Open with ..." appears. This dialog is also simplified version of one used in §1, without all extract-only-related items. So it will have just a dropdown list of unpackers from §1, [OK] and [Cancel]
buttons.
4. "Custom order for extension" wincmd.ini action design.
Since this section will match archive extension with unpackers already listed in wincmd.ini, I suggest to add unique ID for each unpacker (internal, external or WCX).
Then our custom order section will have next format:
Code: Select all
[custom order section name]
EXT=#,UID,name
# - number of unpacker for its order in dropdown list
UID - unique ID of unpacker.
name - custom name user want to see in dropdown list. If not present, TC can use something like INT:ZIP, EXT:ZIP for internal and external unpackers, and dll name for WCX plugins.
This way we can make a sorted list of unpackers for each desired extension.
5. Example:
Let's pretend we have next settings in wincmd.ini
Code: Select all
[configuration]
;new parameters for extract dialog dropdownlist colors, see §1.4, §1.5
unpackdialogfont1=blue ;Color1
unpackdialogfont2=green ;Color2
[packer]
InternalUnzip=1
UnZIP=c:\totalcmd\utils\zip\pkunzip.exe
intunzipuid=uidrandomnumber1
extunzipuid=uidrandomnumber2
PluginOverrideZip=1
[packerplugins]
ZIP=68,uidrandomnumber3,c:\totalcmd\plugins\powerfulzip.wcx
ZIP=4,uidrandomnumber4,c:\totalcmd\plugins\simpleunzip.wcx
SOMEEXT1=260,uidrandomnumber5,c:\totalcmd\plugins\multiunpackerzipsupport.wcx
SOMEEXT2=68,uidrandomnumber6,c:\totalcmd\plugins\someformatunpacker.wcx
SOMEEXT3=260,uidrandomnumber7,c:\totalcmd\plugins\multiformatunpacker.wcx
[new custom order section]
ZIP=1,uidrandomnumber6,multiunpackerzipsupport.wcx
ZIP=2,uidrandomnumber2
This suggestion, with optional "order" thing, looks complicated, but when implemented it will be easy to configure and use.powerfulzip.wcx ;- §1.3 rule, PluginOverrideZip=1 counted
multiunpackerzipsupport.wcx ;- §1.4 rule
EXT:pkunzip.exe ;- §1.4 rule
INT:unzip ;- §1.5 rule
simpleunzip.wcx ;- §1.5 rule
multiformatunpacker.wcx ;- §1.6 rule
someformatunpacker.wcx ;-1.7 rule