-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modernize user menu #4571
Comments
|
|
|
Few comments:
Why do you want to offer this alternative? (honest question)
At least on Mac this doesn't exist, can you use a fallback to shasum -a512 ? |
Replying to zaytsev:
It's working now. Thank you for fixing it! |
Replying to zaytsev:
Some systems still use older XZ that is not multi-threaded. But even on systems with newer XZ, 7z is sill faster (especially if you use the "ASMC" compiled version). Also, in my local menu I add "-slp -m0=lzma2 -mx=9 -mfb=256 -md=256m -mlc=4 -ms=on" and get better compression but it was too much for default config ;-)
It should be trivial, assuming MacOS has the "which" command. |
Everyone,
Since I can't check all other Distros and OS's, could you please report which variants of '7z' are available on you system.
Thanks. |
On macOS only 7zz is provided via the sevenzip homebrew package:
https://formulae.brew.sh/formula/sevenzip
On BSD I think 7z is provided via the p7zip port.
On Red Hat you have 7za via p7zip package.
You can check other distros yourself using the service from our friend Mykola: |
Attaching an updated version of the 2nd patch which minor fix and shasum hashing as a default, since it is a part of Perl and should be available by default on more systems(shaXXXsum is the fallback).
Will start working on 7z support on "all" systems. |
|
I just reviewed all 7zip related code and '7za' is used in most places with fallback to 7z in some places and 7z/7zz/7zr in other.
This is what 7zip doc say:
Should we unify that with something like:
Here is my reasoning:
P.S. |
I am attaching a new version of the main (second) patch.
P.S. |
|
New version of the patch with 7z binary detection and various fixes |
Updated version of the main patch with more compression options, fixes, improvments and shortcuts reorganization |
Optional patch to add various GUI tools |
Updated version of the main patch with various fixes |
We had a discussion recently about using command -v instead of which:
https://github.com/search?q=repo%3AMidnightCommander%2Fmc%20%22command%20-v%22&type=code
Otherwise I don't have much to say / strong opinions about menus. I use them very rarely. Are you finished with your work eugenesan?
Andrew, maybe we can take it, apparently it will close a number of open requests like you linked. I can make a branch. |
Updated version of the main patch with "which" replacement and shasum preference reversal (non-perl version is 2x faster) |
@zaytsev
I believe the patch is ready and tested.
P.S. Line 489 in 449917f
That would allow to replace all the "echo"/"read" interactions for menu commands with proper input dialog. |
The dialogs are shown before the script is "compiled" to run in the shell. So you cannot do it unless we make a "zenity" mode for mc and the scripts can call mc to show an overlay dialog :) But I'm not sure this is really necessary. You can just say something like press enter for default (basename)... I don't think the variable values add much value. |
Actually there are official variables XZ_OPT & ZSTD_OPT - is there any particular reason why you use your own? |
Replying to zaytsev:
Good point.
I'd name those differently but didn't want interference and variables cannot start with a number so 7Z_OPT wasn't an option.
I needed a way to be able to change default compression options but didn't want to push those in usermenu directly. Those variable are harmless but can be very useful in usermenu context.
Also, I found a last minute bug and will be pushing a new patch momentarily. |
Last minute fix |
Latest optional patch with addition of GUI tools |
|
The patch 0001-menu-drop-archaic-items-modernize-archival-options-v9.patch doesn't apply at all. Are you sure you're on latest master? |
There are 2 staged patches:
The first touches only the visuals and the second one is the actual patch. |
Thanks for the explanation, I was able to apply the patches and test them.
Sorry, my opinion is that whereas this is solid work and maybe a good menu file for you personally, this is not really suitable for stock mc in this form.
Our old files were designed to make menus mostly fit on 80x24 screens and leave a lot of shortcuts for users to customize. Unfortunately, primarily due to the explosion of compression options, the default options list now looks more like an infiniscroll (see attached screenshot).
What I like though is that you tried to keep the shortcuts of the existing options. This is a good thought. Otherwise there will be a huge backlash as the users discover that their muscle memory now causes mc do random things. We need to consider this.
I wonder what we can do to make it fit on one screen for most users again?
Even with those changes the options I consider "useful" are still more than before, and the new ones are actually not visible :( I'm at a bit of a loss in terms of more "compression" ideas.
Other notes:
I really tried to make it as close to acceptable as possible, but for now I'm exhausted... Just to show what the current state looks like:
Branch: 4571_modernize_usermenu |
Some shortcuts are still changed as compared to original. I wonder if I should take a different strategy if you are not interested in adjusting this to stock requirements - just try to remove myself what I think is not useful, and pick from you what I think is useful... |
|
diff --git a/src/usermenu.c b/src/usermenu.c
index 1ec961153..9bc4db4cd 100644
--- a/src/usermenu.c
+++ b/src/usermenu.c
@@ -1146,8 +1146,8 @@ user_menu_cmd (const Widget *edit_widget, const char *menu_file, int selected_en
max_cols = MIN (MAX (max_cols, col), MAX_ENTRY_LEN);
/* Create listbox */
- listbox = listbox_window_new (entries->len, max_cols + 2, _("User menu"),
- "[Edit Menu File]");
+ listbox = listbox_window_new (MIN (entries->len, LINES - 6), max_cols + 2,
+ _("User menu"), "[Edit Menu File]");
/* insert all the items found */
for (i = 0; i < entries->len; i++)
{ |
Thank you for the feedback.
Following your ideas, I am thinking about:
I think I can remove ~6 items.
Also, we should consider fixing/implementing one of the following:
|
|
Important
This issue was migrated from Trac:
eugenesan
(eugenesan@….com)I've been working on modernizing the default user menu and decided to share it here.
First patch changes the default spacing in menu items.
The second patch:
Feel free to adjust if I removed something people actually.
P.S.
From my previous experience using this ticket tracker, I never get notifications.
Do I need to do anything special to enable mail notifications for tickets?
P.P.S.
I chose mc-skin as a component. Wasn't sure where user menu fits.
Note
Original attachments:
eugenesan
(eugenesan@….com) onAug 23, 2024 at 6:50 UTC
eugenesan
(eugenesan@….com) onAug 23, 2024 at 6:50 UTC
eugenesan
(eugenesan@….com) onAug 23, 2024 at 18:23 UTC
eugenesan
(eugenesan@….com) onAug 27, 2024 at 3:31 UTC
eugenesan
(eugenesan@….com) onAug 29, 2024 at 19:23 UTC
eugenesan
(eugenesan@….com) onAug 30, 2024 at 18:46 UTC
eugenesan
(eugenesan@….com) onAug 30, 2024 at 18:47 UTC
eugenesan
(eugenesan@….com) onSep 25, 2024 at 2:21 UTC
eugenesan
(eugenesan@….com) onSep 25, 2024 at 16:15 UTC
eugenesan
(eugenesan@….com) onSep 25, 2024 at 19:23 UTC
eugenesan
(eugenesan@….com) onSep 25, 2024 at 19:23 UTC
zaytsev
(@zyv) onOct 23, 2024 at 17:25 UTC
The text was updated successfully, but these errors were encountered: