Bug 427072 - Global and Global Alternate columns are present in "Configure keyboard shortcuts" window even when not supported
Summary: Global and Global Alternate columns are present in "Configure keyboard shortc...
Status: RESOLVED FIXED
Alias: None
Product: Elisa
Classification: Applications
Component: general (show other bugs)
Version: 20.08.1
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Matthieu Gallien
URL:
Keywords: junior-jobs
Depends on:
Blocks:
 
Reported: 2020-09-28 14:03 UTC by Patrick Silva
Modified: 2020-09-29 20:13 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 20.12


Attachments
screenshot (159.60 KB, image/png)
2020-09-28 14:03 UTC, Patrick Silva
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Silva 2020-09-28 14:03:41 UTC
Created attachment 131983 [details]
screenshot

SUMMARY
As we can see in the attached screenshot, Global and Global Alternate columns are present in "Configure keyboard shortcuts" window. But it's impossible to set these types of shortcuts.

EXPECTED RESULT
only columns of supported keyboard shortcuts types should be present in "Configure keyboard shortcuts" window.

SOFTWARE/OS VERSIONS
Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.20.80
KDE Frameworks Version: 5.75.0
Qt Version: 5.15.0
Comment 1 Nate Graham 2020-09-29 17:49:51 UTC
This seems to be an issue with the keyboard shortcut configuration window in general, as now that you've called attention to this, I realize that it's affecting all other apps too.
Comment 2 Nate Graham 2020-09-29 19:22:09 UTC
in kshortcutseditor.cpp, there is already some code which can hide these columns if kglobalaccel is missing:

#if HAVE_GLOBALACCEL
    bool hideGlobals = !(actionTypes & KShortcutsEditor::GlobalAction);
#else
    bool hideGlobals = true;
#endif

    if (hideGlobals) {
        ui.list->header()->hideSection(GlobalPrimary);
        ui.list->header()->hideSection(GlobalAlternate);


I guess we just need to hook this up to something that knows it's being used to display application-specific shortcuts. Unclear if the dialog itself can know this, or if it needs to be told, in which case all applications using it would need to be ported to tell it so.
Comment 3 Nate Graham 2020-09-29 19:26:23 UTC
Oh I guess it's already there, but the apps need to be setting KShortcutsEditor::ActionTypes correctly.
Comment 4 Nate Graham 2020-09-29 19:35:52 UTC
Heh, and Elisa is setting it wrong:

#if defined KF5XmlGui_FOUND && KF5XmlGui_FOUND
    KShortcutsDialog dlg(KShortcutsEditor::AllActions, KShortcutsEditor::LetterShortcutsAllowed, nullptr);
    dlg.setModal(true);
    dlg.addCollection(&d->mCollection);
    dlg.configure();
#endif

Fixing momentarily.
Comment 5 Nate Graham 2020-09-29 20:01:22 UTC
Git commit 0ebd0242012a89e07fcb2682a6bc7b02d731b767 by Nate Graham.
Committed on 29/09/2020 at 19:58.
Pushed by ngraham into branch 'master'.

Don't show unnecessary global shortcuts columns in keyboard shortcuts window

Elisa doesn't set any global shortcuts, so the columns are blank and
waste space.
FIXED-IN: 20.12

M  +1    -1    src/elisaapplication.cpp

https://invent.kde.org/multimedia/elisa/commit/0ebd0242012a89e07fcb2682a6bc7b02d731b767