[Powermanagement Dataengine] Expose "Logout" as Sleep State
ClosedPublic

Authored by broulik on May 13 2016, 6:14 PM.

Details

Summary

This allows to query for whether the user may logout from QML-only parts like the desktop toolbox.

Test Plan

Also use KAuthorized::authorize for the other like it's in the docs! The porting was really messed up; will put that in a separate commit also.

Also, according to ksmserver code, "logout" restriction affects also shutdown/reboot which as of now is not enforced in Kickoff, only really logout is disabled.

Diff Detail

Repository
R120 Plasma Workspace
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik updated this revision to Diff 3814.May 13 2016, 6:14 PM
broulik retitled this revision from to [Powermanagement Dataengine] Expose "Logout" as Sleep State.
broulik updated this object.
broulik edited the test plan for this revision. (Show Details)
broulik added a reviewer: Plasma.
broulik set the repository for this revision to R120 Plasma Workspace.
Restricted Application added a project: Plasma. · View Herald TranscriptMay 13 2016, 6:14 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
davidedmundson accepted this revision.May 13 2016, 9:43 PM
davidedmundson added a reviewer: davidedmundson.
davidedmundson added a subscriber: davidedmundson.

+1 given the rest are there.

but this doesn't help with the toolbox fixing.

the "Leave" option in that menu isn't the same as logout.

This revision is now accepted and ready to land.May 13 2016, 9:43 PM

What else should it be? Leave has logout, reboot, shutdown, all of which are options to quit the session which the user is forbidden in this case. It makes no sense to disallow logging out but then allowing turning off the computer altogether.

Leave calls whatever you have selected in systemsettings -> startup and shutdown -> default leave option

AFAIK this setting isn't exposed to the toolbox.

you can argue that if you can't logout you shouldn't be able to shutdown, but that's not how we do the other settings

also you can argue that if you block shutdown, allow logout then set the default shutdown option to shutdown, you're being a bit weird

but I think we should try and do things technically correct to cover the obscure edge cases.

AFAIK this setting isn't exposed to the toolbox.

The toolbox calls "requestShutdown" on the PM dataengine which ends up calling KWorkspace::requestShutdown which does whatever is configured to happen then (show dialog, shutdown immediately etc)

The only place I see KSMServer enforcing a restriction is on the global shortcuts, ie. Log Out, Log Out Without Confirmation, Halt (lol) Without Confirmation, Reboot Without Confirmation are not added if you disable "logout".

The context menu whose actions the toolbox is supposed to mirror also hides the Leave option if you disable "logout".

This revision was automatically updated to reflect the committed changes.