Changeset View
Changeset View
Standalone View
Standalone View
lookandfeel/contents/logout/Logout.qml
Show All 22 Lines | |||||
23 | 23 | | |||
24 | import org.kde.plasma.core 2.0 as PlasmaCore | 24 | import org.kde.plasma.core 2.0 as PlasmaCore | ||
25 | import org.kde.plasma.components 2.0 as PlasmaComponents | 25 | import org.kde.plasma.components 2.0 as PlasmaComponents | ||
26 | import org.kde.kcoreaddons 1.0 as KCoreAddons | 26 | import org.kde.kcoreaddons 1.0 as KCoreAddons | ||
27 | 27 | | |||
28 | import "../components" | 28 | import "../components" | ||
29 | import "timer.js" as AutoTriggerTimer | 29 | import "timer.js" as AutoTriggerTimer | ||
30 | 30 | | |||
31 | import org.kde.plasma.private.sessions 2.0 | ||||
32 | | ||||
31 | PlasmaCore.ColorScope { | 33 | PlasmaCore.ColorScope { | ||
32 | id: root | 34 | id: root | ||
33 | colorGroup: PlasmaCore.Theme.ComplementaryColorGroup | 35 | colorGroup: PlasmaCore.Theme.ComplementaryColorGroup | ||
34 | height: screenGeometry.height | 36 | height: screenGeometry.height | ||
35 | width: screenGeometry.width | 37 | width: screenGeometry.width | ||
36 | 38 | | |||
37 | signal logoutRequested() | 39 | signal logoutRequested() | ||
38 | signal haltRequested() | 40 | signal haltRequested() | ||
Show All 21 Lines | 61 | default: | |||
60 | return root.logoutRequested; | 62 | return root.logoutRequested; | ||
61 | } | 63 | } | ||
62 | } | 64 | } | ||
63 | 65 | | |||
64 | KCoreAddons.KUser { | 66 | KCoreAddons.KUser { | ||
65 | id: kuser | 67 | id: kuser | ||
66 | } | 68 | } | ||
67 | 69 | | |||
70 | // For showing a "other users are logged in" hint | ||||
71 | SessionsModel { | ||||
72 | id: sessionsModel | ||||
73 | includeUnusedSessions: false | ||||
74 | } | ||||
75 | | ||||
68 | Controls.Action { | 76 | Controls.Action { | ||
69 | onTriggered: root.cancelRequested() | 77 | onTriggered: root.cancelRequested() | ||
70 | shortcut: "Escape" | 78 | shortcut: "Escape" | ||
71 | } | 79 | } | ||
72 | 80 | | |||
73 | onRemainingTimeChanged: { | 81 | onRemainingTimeChanged: { | ||
74 | if (remainingTime <= 0) { | 82 | if (remainingTime <= 0) { | ||
75 | root.currentAction(); | 83 | root.currentAction(); | ||
▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Line(s) | 129 | anchors { | |||
123 | topMargin: units.gridUnit * 2 | 131 | topMargin: units.gridUnit * 2 | ||
124 | horizontalCenter: parent.horizontalCenter | 132 | horizontalCenter: parent.horizontalCenter | ||
125 | } | 133 | } | ||
126 | spacing: units.largeSpacing | 134 | spacing: units.largeSpacing | ||
127 | 135 | | |||
128 | height: Math.max(implicitHeight, units.gridUnit * 10) | 136 | height: Math.max(implicitHeight, units.gridUnit * 10) | ||
129 | width: Math.max(implicitWidth, units.gridUnit * 16) | 137 | width: Math.max(implicitWidth, units.gridUnit * 16) | ||
130 | 138 | | |||
139 | PlasmaComponents.Label { | ||||
140 | Layout.maximumWidth: units.gridUnit * 16 | ||||
141 | Layout.alignment: Qt.AlignHCenter | ||||
142 | Layout.fillWidth: true | ||||
143 | horizontalAlignment: Text.AlignHCenter | ||||
144 | wrapMode: Text.WordWrap | ||||
145 | font.italic: true | ||||
146 | text: i18ndp("plasma_lookandfeel_org.kde.lookandfeel", | ||||
147 | "One other user is currently logged in. If the computer is shut down or rebooted, that user may lose work.", | ||||
ngraham: How about also adding something that reinforces why there's a risk. How about this:
"One other… | |||||
148 | "%1 other users are currently logged in. If the computer is shut down or rebooted, those users may lose work.", | ||||
149 | sessionsModel.count) | ||||
150 | visible: sessionsModel.count > 0 | ||||
151 | } | ||||
152 | | ||||
131 | RowLayout { | 153 | RowLayout { | ||
132 | spacing: units.largeSpacing * 2 | 154 | spacing: units.largeSpacing * 2 | ||
133 | Layout.alignment: Qt.AlignHCenter | 155 | Layout.alignment: Qt.AlignHCenter | ||
134 | LogoutButton { | 156 | LogoutButton { | ||
135 | id: suspendButton | 157 | id: suspendButton | ||
136 | iconSource: "system-suspend" | 158 | iconSource: "system-suspend" | ||
137 | text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Suspend") | 159 | text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Suspend") | ||
138 | action: root.sleepRequested | 160 | action: root.sleepRequested | ||
▲ Show 20 Lines • Show All 72 Lines • Show Last 20 Lines |
How about also adding something that reinforces why there's a risk. How about this:
"One other user is currently logged in. If the computer shut down or rebooted, that user may lose work."