Disable shortcuts when an action is disabled
ClosedPublic

Authored by leinir on Sep 14 2017, 12:22 PM.

Details

Summary

This equalises the API with QQC2's actions (which also disable shortcuts when the action itself is disabled)

nb: This pushes the task of disabling actions on sub-pages and anywhere else not currently supposed to be active onto the app developer, but it reduces complexity a very great deal, and also means when it comes time to switch to QQC2.Action. It is less magic, but this is not necessarily a bad thing. It would still be nice to have everything on non-current pages entirely disabled when the page is not current (or indeed visible), but this works.

Test Plan

Previously, disabling an action would still cause the shortcut sequence defined for that action to be active, which very easily caused clashes and required manual intervention. Now, simply disabling the action will propagate that to the shortcut, resulting in simpler code than the previous state.

Diff Detail

Repository
R169 Kirigami
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
leinir created this revision.Sep 14 2017, 12:22 PM
Restricted Application added a subscriber: plasma-devel. · View Herald TranscriptSep 14 2017, 12:22 PM
leinir updated this revision to Diff 19731.Sep 21 2017, 10:54 AM
leinir retitled this revision from Disable shortcuts for actions not on the current page to Disable shortcuts when an action is disabled.
leinir edited the summary of this revision. (Show Details)
leinir edited the test plan for this revision. (Show Details)

Change the approach from performing all the magic inside Kirigami (which resulted in not entirely consistent behaviours, depending on which actions you used), pushing some of the requirements for disabling things onto the app developer.

mart accepted this revision.Sep 21 2017, 10:57 AM
This revision is now accepted and ready to land.Sep 21 2017, 10:57 AM
This revision was automatically updated to reflect the committed changes.