Bug 411446 - provide keyboard shortcut for "apply selection to folders" in (de-)selection dialog
Summary: provide keyboard shortcut for "apply selection to folders" in (de-)selection ...
Status: RESOLVED FIXED
Alias: None
Product: krusader
Classification: Applications
Component: shortcuts (show other bugs)
Version: Git
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Krusader Bugs Distribution List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-30 14:55 UTC by Moritz Bunkus
Modified: 2019-09-15 16:07 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
The dialog to select files (having the Alt key pressed in order to show the shortcuts) (36.89 KB, image/png)
2019-08-30 20:52 UTC, Toni Asensi Esteve
Details
krusader without KDE's automatic accelerator assignment (31.68 KB, image/png)
2019-08-30 21:14 UTC, Moritz Bunkus
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Moritz Bunkus 2019-08-30 14:55:04 UTC
krusader is great to use via keyboard. Having to use the mouse so little is one of its main draw for me.

One place where a keyboard shortcut is missing is the (de-)selection dialog. I often need to select folders, too, and for that I have to enable the "apply selection to folders" checkbox — which does not have a keyboard shortcut at the moment (my language is English). Therefore I have to use the mouse or a complicated & long sequence keys: "Alt-e" (jump to "case-sensitive"), "space" (for toggling "case-sensitive" off again), "tab" (for going to "apply selection to folders") and finally "space" (for checking "apply selection to folders").

It would be so much easier with a shortcut, e.g. Alt-d, which doesn't seem to be used in the English version of the dialog yet.

Thanks!

This is krusader git revision 489c122a448429724b92a8616c195c86de6e5361.
Comment 1 Toni Asensi Esteve 2019-08-30 20:51:52 UTC
Hi, Moritz. It's strange, I can use Alt+S in that dialog. I'll attach a screenshot.
Comment 2 Toni Asensi Esteve 2019-08-30 20:52:49 UTC
Created attachment 122430 [details]
The dialog to select files (having the Alt key pressed in order to show the shortcuts)
Comment 3 Toni Asensi Esteve 2019-08-30 20:54:20 UTC
Moritz, can you attach a screenshot (having the Alt key pressed in order to show the shortcuts)?
Comment 4 Moritz Bunkus 2019-08-30 21:14:08 UTC
Thanks for the quick reaction! Sure, I'll attach a screenshot in a second.

That your installation has a keyboard shortcut is most likely due to the (infamous) work of KDE's automatic shortcut injection[1] which I've turned off in order to have the shortcuts I want in the applications I write, not the ones KDE thinks I want. If you want to try this yourself, edit your ~/.config/kdeglobalsrc, add the following & restart KDE:

[Development]
AutoCheckAccelerators=false

As you can see in the source code[2], there's no intentional accelerator in the string.

[1]  https://github.com/GoldenCheetah/GoldenCheetah/wiki/Working-around-KDE-shortcut-injection
[2]  https://github.com/KDE/krusader/blob/master/krusader/Panel/PanelView/krview.cpp#L1088 and all other occurrences in that file; see also "grep -r 'to folders'"
Comment 5 Moritz Bunkus 2019-08-30 21:14:41 UTC
Created attachment 122432 [details]
krusader without KDE's automatic accelerator assignment
Comment 6 Toni Asensi Esteve 2019-08-31 16:38:41 UTC
I edited the ~/.config/kdeglobals file, added the following:
    [Development]
    AutoCheckAccelerators=false
executed Krusader, and Alt+S didn't work when selecting or deselecting files.

> Krusader is great to use via keyboard

Yes, that's one of the biggest advantages of Krusader.
Also, when people see you working a lot that way... think you work very fast :-)
Comment 7 Toni Asensi Esteve 2019-08-31 16:42:42 UTC
> This is krusader git revision 489c122a448429724b92a8616c195c86de6e5361.

Moritz, an you test the change proposed in https://phabricator.kde.org/D23606 ?

In order to apply the changes you just would need to execute something similar to:
    cd FOLDER_WHERE_KRUSADER_CODE_IS
    patch -p1 < PATH_TO_THE_DIFF_FILE
and rebuild Krusader.
Comment 8 Moritz Bunkus 2019-08-31 17:00:27 UTC
Sure! I've built git revision ad6ceca7384e57d1dcae53db721136d70242028e combined with the patch from D23606, and Alt+S is now nicely shown as a keyboard accelerator for the checkbox, and it works as expected. This is exactly what I was hoping for.

Thanks again so much for your quick reaction, Toni! I highly appreciate it.
Comment 9 Toni Asensi Esteve 2019-09-01 17:11:01 UTC
> Sure! I've built git revision ad6ceca7384e57d1dcae53db721136d70242028e combined with the patch from D23606, and Alt+S is now nicely shown as a keyboard accelerator for the checkbox, and it works as expected. This is exactly what I was hoping for.
> Thanks again so much for your quick reaction, Toni! I highly appreciate it.
OK! Moritz, as you are able, would you be so kind to test those proposals
    Replace Q_WS_WIN with Q_OS_WIN in all the source code
    https://phabricator.kde.org/D22957

    Avoid that Krusader crashes when trying to view any archive using the ark part
    https://phabricator.kde.org/D23243
?
Comment 10 Moritz Bunkus 2019-09-02 16:37:49 UTC
Of course.  I've taken git revision ad6ceca7384e57d1dcae53db721136d70242028e, applied D22957, D23243 and D23606 and built the whole thing. Patches apply fine (one with two lines of offset but no fuzz). Compilation goes fine. The resulting binary works fine, though I haven't done extensive testing — just a couple of exercises involving navigation/file creation/copying files & directories/accessing other hosts via ssh/accessing tar archives.

It doesn't crash when I trying to access the test files created from the instructions in D23243.

The new shortcut for "apply selection to folders" works, too.

TLDR: LGTM!
Comment 11 Toni Asensi Esteve 2019-09-02 21:43:52 UTC
Thank you for your tests, Moritz!
Comment 12 Toni Asensi Esteve 2019-09-15 16:07:31 UTC
Git commit 07848cc8ebc89876189c10bbd4e6f3e3981370db by Toni Asensi Esteve.
Committed on 15/09/2019 at 15:56.
Pushed by asensi into branch 'master'.

Provide keyboard shortcuts in (de-)selection and (de-)filter dialogs

Provide keyboard shortcuts for "Apply selection to folders" in (de-)selection dialog, and for "Apply filter to folders" in filter dialog. Other related minor changes.

FIXED: [ 411446 ] Provide keyboard shortcut for "apply selection to folders" in (de-)selection dialog

Differential Revision: https://phabricator.kde.org/D23606

M  +15   -9    krusader/Panel/PanelView/krview.cpp

https://commits.kde.org/krusader/07848cc8ebc89876189c10bbd4e6f3e3981370db