Adding a global shortcut for suspending/resume rsibreak
Needs ReviewPublic

Authored by sankethi on Aug 7 2019, 10:53 PM.

Details

Reviewers
aacid
anazarov
Summary

This fixes a wishlist issue in the KDE bug tracker : https://bugs.kde.org/show_bug.cgi?id=368765

BUG: 368765

Test Plan

Ran rsibreak_tests. Verified that the new shortcut works. Verified that the new shortcut shows up in KDE System Settings. Verified that overriding the new shortcut in the KDE System Settings->Shortcuts menu works.

Diff Detail

Repository
R368 RSIBreak
Branch
tooltip (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 14859
Build 14877: arc lint + arc unit
sankethi requested review of this revision.Aug 7 2019, 10:53 PM
sankethi created this revision.
aacid added a comment.Aug 8 2019, 8:50 PM

Having the possibility of setting a global shortcut is cool, but having one by default i think it may be a bit too much.

How would you feel about just making it be a global shortcut and letting people configure it from the config screen?

That sounds reasonable. It should just be a matter of calling setDefaultShortcut instead, I think. Let me play around with it and update the diff.

sankethi updated this revision to Diff 63449.Aug 9 2019, 8:38 PM

Instead of pre-assigning a global shortcut, this makes it just show up in the global shortcuts entry and lets the user enable and customize the key combination. I verified that enabling the shortcut works as expected.

aacid added a comment.Aug 9 2019, 11:43 PM

The "problem" with this is that you need to go to systemsettings and configure the shortcut from there.

Do you think you could look at spectacle's code and see how they do it so that they can show the configure global shortcuts from the app too?

I see, you are suggesting a method to configure the shortcut within the app itself. I think I found an example of this in kompare - https://github.com/annulen/kompare/blob/master/kompare_shell.cpp#L438 - that seems to be the way to make this happen.

aacid added a comment.Aug 13 2019, 8:27 PM

I see, you are suggesting a method to configure the shortcut within the app itself. I think I found an example of this in kompare - https://github.com/annulen/kompare/blob/master/kompare_shell.cpp#L438 - that seems to be the way to make this happen.

KShorcutsEditor is what you wants, but you need the special options to show the global actions, as mentioned, looked at the spectacle code