Basic keyboard support + fixes to QuickShare plasmoid

Authored by yuenlim on Feb 26 2017, 7:07 AM.



While working on basic keyboard support for QuickShare, I found and addressed some other issues. This patch thus addresses 3 items (let me know if I should make 3 separate diffs instead).

  1. Basic keyboard support: allow navigating the plasmoid paste menu with arrow keys, selection with enter key, and dismissal with escape key. No keyboard support yet for "secondary menus" eg the device picker in send to device. Also makes the plasmoid show the paste menu when activated by the global keyboard shortcut (previously does nothing).

Note: I'm not 100% on how separation should work between the plasmoid's ui and the purpose plugin mechanism itself, but since the purpose plugin side also has UI elements I thought it made sense to have relevant keyboard support implemented there where applicable so the plasmoid inherits and modifies it. In theory this should also extend basic keyboard support to any other consumers of the purpose plugins.

  1. Fix an issue with the "Paste" action. For urls (when copying file/files), the Paste action was broken and didn't correctly pass the data to the sharedialog, so that the only way to share files previously was to use drag/drop. This patch fixes this.
  1. Fix a crash that happens when the plasmoid is activated with an empty clipboard. The crash actually happens in kquickcontrolsaddons.clipboard, which probably could use a patch so it handles empty-clipboard situations more gracefully, but here I have just avoided trying to access the clipboard if it is empty in the plasmoid. This might be related to bug 358268.

Diff Detail

R495 Purpose Library
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
yuenlim created this revision.Feb 26 2017, 7:07 AM
Restricted Application added a project: Plasma. · View Herald TranscriptFeb 26 2017, 7:07 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
yuenlim updated this revision to Diff 11839.Feb 26 2017, 7:25 AM
yuenlim retitled this revision from Keyboard support + improvements to QuickShare plasmoid to Basic keyboard support + fixes to QuickShare plasmoid.
yuenlim edited the summary of this revision. (Show Details)
yuenlim added a reviewer: apol.

Oops, excuse me :( I was trying to add diffs for two repositories into one differential but it looks like that does not work. I'll create one more differential for the changes in plasma-addons then.

mart requested changes to this revision.Feb 28 2017, 1:18 PM
mart added a subscriber: mart.

almost there


this should be a PlasmaComponents.Highlight instead

This revision now requires changes to proceed.Feb 28 2017, 1:18 PM
yuenlim marked an inline comment as done.Feb 28 2017, 5:13 PM
yuenlim added inline comments.

after discussion, should avoid using Plasma-specific components here (in purpose) for now. To use Rectangle without custom radius instead.

yuenlim updated this revision to Diff 11963.Feb 28 2017, 5:15 PM
yuenlim edited edge metadata.
yuenlim marked an inline comment as done.

Added onEnterPressed and removed Radius on Rectangle highligh as requested

apol edited edge metadata.Mar 1 2017, 12:36 AM

The rest is fine, please fix this.


That doesn't make sense, this is not Purpose code, this is the plasmoid. This should use Highlight as Marco suggested.

yuenlim updated this revision to Diff 11996.Mar 1 2017, 11:03 AM

Use PlasmaComponents.Highlight

yuenlim marked an inline comment as done.Mar 1 2017, 11:03 AM
apol accepted this revision.Mar 1 2017, 2:53 PM
Closed by commit R495:7ce9b21d871e: Basic keyboard navigation for AlternativesView (authored by Lim Yuen Hoe <>). · Explain WhyMar 1 2017, 4:27 PM
This revision was automatically updated to reflect the committed changes.