Merge lp:~mterry/ubuntu-system-settings/shutdown-dialog-in-wizard-rtm into lp:ubuntu-system-settings/rtm-14.09

Proposed by Michael Terry
Status: Merged
Approved by: Ken VanDine
Approved revision: 932
Merged at revision: 940
Proposed branch: lp:~mterry/ubuntu-system-settings/shutdown-dialog-in-wizard-rtm
Merge into: lp:ubuntu-system-settings/rtm-14.09
Diff against target: 74 lines (+52/-0)
1 file modified
wizard/qml/main.qml (+52/-0)
To merge this branch: bzr merge lp:~mterry/ubuntu-system-settings/shutdown-dialog-in-wizard-rtm
Reviewer Review Type Date Requested Status
Ubuntu Touch System Settings Pending
Review via email: mp+240272@code.launchpad.net

Commit message

When the power button is held down, show the shutdown dialog like we do in the unity8 shell.

Description of the change

When the power button is held down, show the shutdown dialog like we do in the unity8 shell.

== Checklist ==

 * Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes)
 Yes

 * Did you build your software in a clean sbuild/pbuilder chroot or ppa?
 NA, just qml changes

 * Did you build your software in a clean sbuild/pbuilder armhf chroot or ppa?
 NA, just qml changes

 * Has your component "TestPlan” been executed successfully on emulator, N4?
 Yes

 * Has a 5 minute exploratory testing run been executed on N4?
 Yes

 * If you changed the packaging (debian), did you subscribe a core-dev to this MP?
 NA

 * If you changed the UI, did you subscribe the design-reviewers to this MP?
 NA

 * What components might get impacted by your changes?
 Just the wizard

 * Have you requested review by the teams of these owning components?
 Yup

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'wizard/qml/main.qml'
--- wizard/qml/main.qml 2014-09-29 20:45:30 +0000
+++ wizard/qml/main.qml 2014-10-31 14:21:33 +0000
@@ -20,13 +20,16 @@
20import Ubuntu.SystemSettings.SecurityPrivacy 1.020import Ubuntu.SystemSettings.SecurityPrivacy 1.0
21import Unity.Application 0.121import Unity.Application 0.1
22import Unity.Notifications 1.0 as NotificationBackend22import Unity.Notifications 1.0 as NotificationBackend
23import Unity.Session 0.1
23import "Components"24import "Components"
24import "file:///usr/share/unity8/Notifications" as Notifications // FIXME This should become a module or go away25import "file:///usr/share/unity8/Notifications" as Notifications // FIXME This should become a module or go away
26import "file:///usr/share/unity8/Components" as UnityComponents
2527
26Item {28Item {
27 id: root29 id: root
28 width: units.gu(40)30 width: units.gu(40)
29 height: units.gu(71)31 height: units.gu(71)
32 focus: true
3033
31 // These should be set by a security page and we apply the settings when34 // These should be set by a security page and we apply the settings when
32 // the user exits the wizard.35 // the user exits the wizard.
@@ -191,4 +194,53 @@
191 }194 }
192 ]195 ]
193 }196 }
197
198 UnityComponents.Dialogs {
199 id: dialogs
200 anchors.fill: parent
201 z: 10
202 onPowerOffClicked: {
203 shutdownFadeOutRectangle.enabled = true;
204 shutdownFadeOutRectangle.visible = true;
205 shutdownFadeOut.start();
206 }
207 }
208
209 Rectangle {
210 id: shutdownFadeOutRectangle
211 z: dialogs.z + 10
212 enabled: false
213 visible: false
214 color: "black"
215 anchors.fill: parent
216 opacity: 0.0
217 NumberAnimation on opacity {
218 id: shutdownFadeOut
219 from: 0.0
220 to: 1.0
221 onStopped: {
222 if (shutdownFadeOutRectangle.enabled && shutdownFadeOutRectangle.visible) {
223 DBusUnitySessionService.Shutdown();
224 }
225 }
226 }
227 }
228
229 Keys.onPressed: {
230 if (event.key == Qt.Key_PowerOff || event.key == Qt.Key_PowerDown) {
231 dialogs.onPowerKeyPressed();
232 event.accepted = true;
233 } else {
234 event.accepted = false;
235 }
236 }
237
238 Keys.onReleased: {
239 if (event.key == Qt.Key_PowerOff || event.key == Qt.Key_PowerDown) {
240 dialogs.onPowerKeyReleased();
241 event.accepted = true;
242 } else {
243 event.accepted = false;
244 }
245 }
194}246}

Subscribers

People subscribed via source and target branches