Commit 2210d948 authored by David Edmundson's avatar David Edmundson
Browse files

[applets/lock_logout] Add explicit options for logout and reboot

With the UI changes in Kicker and the logout screen over the past years
the concept of "leave" with a default shutodwn action has gotten muddy.

Kicker shows all the options explicitly, the logout applet has got left
behind, and is currently a bit broken. The leave option currently always
shutdown regardless.

It's perfectly valid to want to have a short applet shortcut to log out
sometimes, and shutdown in other times.

This patch adds explicit options for logout and reboot, and clarified
the UI presentation of shutdown to match what it currently actually

BUG: 424426
BUG: 402081
parent 5df37be9
......@@ -10,6 +10,14 @@
<label>Show an option to shut down the system.</label>
<entry name="show_requestReboot" type="Bool">
<label>Show an option to reboot the system.</label>
<entry name="show_requestLogout" type="Bool">
<label>Show an option to logout.</label>
<entry name="show_lockScreen" type="Bool">
<label>Show an option to lock the system.</label>
......@@ -28,9 +28,12 @@ Kirigami.FormLayout {
anchors.left: parent.left
anchors.right: parent.right
readonly property int checkedOptions: leave.checked + lock.checked + switchUser.checked + hibernate.checked + sleep.checked
readonly property int checkedOptions: logout.checked + shutdown.checked + reboot.checked + lock.checked + switchUser.checked + hibernate.checked + sleep.checked
property alias cfg_show_requestLogout: logout.checked
property alias cfg_show_requestShutDown: shutdown.checked
property alias cfg_show_requestReboot: reboot.checked
property alias cfg_show_requestShutDown: leave.checked
property alias cfg_show_lockScreen: lock.checked
property alias cfg_show_switchUser: switchUser.checked
property alias cfg_show_suspendToDisk: hibernate.checked
......@@ -41,11 +44,21 @@ Kirigami.FormLayout {
QtControls.CheckBox {
id: leave
id: logout
Kirigami.FormData.label: i18nc("Heading for a list of actions (leave, lock, switch user, hibernate, suspend)", "Show actions:")
text: i18n("Leave")
text: i18n("Logout")
// ensure user cannot have all options unchecked
enabled: checkedOptions > 1 || !checked
enabled: session.canLogout && (checkedOptions > 1 || !checked)
QtControls.CheckBox {
id: shutdown
text: i18n("Shutdown")
enabled: session.canShutdown && (checkedOptions > 1 || !checked)
QtControls.CheckBox {
id: reboot
text: i18n("Reboot")
enabled: session.canReboot && (checkedOptions > 1 || !checked)
QtControls.CheckBox {
id: lock
......@@ -12,9 +12,21 @@ var data = [{
}, {
icon: "system-shutdown",
operation: "requestShutdown",
tooltip_mainText: i18n("Leave..."),
tooltip_subText: i18n("Log out, turn off or restart the computer"),
tooltip_mainText: i18n("Shutdown..."),
tooltip_subText: i18n("Turn off the computer"),
requires: "Shutdown"
}, {
icon: "system-reboot",
operation: "requestReboot",
tooltip_mainText: i18n("Restart..."),
tooltip_subText: i18n("Reboot the computer"),
requires: "Reboot"
}, {
icon: "system-log-out",
operation: "requestLogout",
tooltip_mainText: i18n("Logout..."),
tooltip_subText: i18n("End the session"),
requires: "Logout"
}, {
icon: "system-suspend",
operation: "suspend",
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment