Replaced the launcher pinning action with a per-activity meny
ClosedPublic

Authored by ivan on Oct 18 2016, 10:25 PM.

Diff Detail

Repository
R119 Plasma Desktop
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ivan updated this revision to Diff 7525.Oct 18 2016, 10:25 PM
ivan retitled this revision from to Replaced the launcher pinning action with a per-activity meny.
ivan updated this object.
ivan edited the test plan for this revision. (Show Details)
ivan added reviewers: Plasma, mart, hein.
Restricted Application added a project: Plasma. · View Herald TranscriptOct 18 2016, 10:25 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript

What happens if there is only one activity? I don't use activities and I don't want a complicated submenu for pinning applications in this case.

applets/taskmanager/package/contents/ui/ContextMenu.qml
416

Imho this should be a regular function() like the others

418

Don't you keep adding a connection everytime you call refresh()?

425
result.checked = activities.some(function(activity) {
    return activity === id
})
440
runningActivities.forEach(function(activity) {
    createNewItem(activity, name, ...)
})
mart edited edge metadata.Oct 19 2016, 9:26 AM

What happens if there is only one activity? I don't use activities and I don't want a complicated submenu for pinning applications in this case.

probably in that case there should be the simple "add launcher when not running"
now, i don't know wether that action should add to the current or to all of them.
to all is probably safest for new users

ivan added a comment.Oct 19 2016, 11:27 AM

probably in that case there should be the simple "add launcher when not running"

Yes, and adding to all activities would be the smartest choice I'd say.

> probably in that case there should be the simple "add launcher when not running"

Yes, and adding to all activities would be the smartest choice I'd say.

+1

ivan updated this revision to Diff 7548.Oct 19 2016, 2:34 PM
ivan marked 3 inline comments as done.
ivan edited edge metadata.
  • Created a special case for when there is only one activity
applets/taskmanager/package/contents/ui/ContextMenu.qml
416

I didn't want to pollute the outside world - it should be as efficient as if it was a regular function (if qt jit is sane - it could even be inlined).

418

Fixed

425

Thanks for this. The last time I tried 'modern' JS features in Qt, they did not work, and I stopped re-testing. It is nice to know this works, JS is a bit less ugly now ;)

mart accepted this revision.Oct 20 2016, 9:46 AM
mart edited edge metadata.

for me good to go (maybe wait for eike's ship it as well)

This revision is now accepted and ready to land.Oct 20 2016, 9:46 AM
hein accepted this revision.Oct 21 2016, 4:08 AM
hein edited edge metadata.
This revision was automatically updated to reflect the committed changes.