@@ -18,15 +18,18 @@ import QtQuick 2.0
19import Unity.Application 0.1
19import Unity.Application 0.1
20import Unity.Session 0.1
20import Unity.Session 0.1
21−import Ubuntu.Components 0.1
21+import Ubuntu.Components 1.1
22import Ubuntu.Components.Popups 0.1
22import Ubuntu.Components.Popups 0.1
27 function onPowerKeyPressed() {
27 function onPowerKeyPressed() {
28+ // FIXME: event.isAutoRepeat is always false on Nexus 4.
29+ // So we use powerKeyTimer.running to avoid the PowerOff key repeat
30+ // https://launchpad.net/bugs/1349416
28 if (!powerKeyTimer.running) {
31 if (!powerKeyTimer.running) {
29− powerKeyTimer.start();
32+ powerKeyTimer.restart();
@@ -64,17 +67,17 @@ Item {
64 id: logoutDialog
67 id: logoutDialog
66 id: dialogueLogout
69 id: dialogueLogout
67− title: "Logout"
70+ title: i18n.tr("Log out")
68− text: "Are you sure that you want to logout?"
71+ text: i18n.tr("Are you sure you want to log out?")
70− text: "Cancel"
73+ text: i18n.tr("No")
71 onClicked: {
74 onClicked: {
72 PopupUtils.close(dialogueLogout);
75 PopupUtils.close(dialogueLogout);
73 d.dialogShown = false;
76 d.dialogShown = false;
77− text: "Yes"
80+ text: i18n.tr("Yes")
78 onClicked: {
81 onClicked: {
79 DBusUnitySessionService.Logout();
82 DBusUnitySessionService.Logout();
80 PopupUtils.close(dialogueLogout);
83 PopupUtils.close(dialogueLogout);
@@ -88,17 +91,17 @@ Item {
88 id: shutdownDialog
91 id: shutdownDialog
90 id: dialogueShutdown
93 id: dialogueShutdown
91− title: "Shutdown"
94+ title: i18n.tr("Shut down")
92− text: "Are you sure that you want to shutdown?"
95+ text: i18n.tr("Are you sure you want to shut down?")
94− text: "Cancel"
97+ text: i18n.tr("No")
95 onClicked: {
98 onClicked: {
96 PopupUtils.close(dialogueShutdown);
99 PopupUtils.close(dialogueShutdown);
97 d.dialogShown = false;
100 d.dialogShown = false;
101− text: "Yes"
104+ text: i18n.tr("Yes")
102 onClicked: {
105 onClicked: {
103 dBusUnitySessionServiceConnection.closeAllApps();
106 dBusUnitySessionServiceConnection.closeAllApps();
104 DBusUnitySessionService.Shutdown();
107 DBusUnitySessionService.Shutdown();
@@ -113,17 +116,17 @@ Item {
113 id: rebootDialog
116 id: rebootDialog
115 id: dialogueReboot
118 id: dialogueReboot
116− title: "Reboot"
119+ title: i18n.tr("Reboot")
117− text: "Are you sure that you want to reboot?"
120+ text: i18n.tr("Are you sure you want to reboot?")
119− text: "Cancel"
122+ text: i18n.tr("No")
120 onClicked: {
123 onClicked: {
121 PopupUtils.close(dialogueReboot)
124 PopupUtils.close(dialogueReboot)
122 d.dialogShown = false;
125 d.dialogShown = false;
126− text: "Yes"
129+ text: i18n.tr("Yes")
127 onClicked: {
130 onClicked: {
128 dBusUnitySessionServiceConnection.closeAllApps();
131 dBusUnitySessionServiceConnection.closeAllApps();
129 DBusUnitySessionService.Reboot();
132 DBusUnitySessionService.Reboot();
@@ -138,8 +141,8 @@ Item {
138 id: powerDialog
141 id: powerDialog
140 id: dialoguePower
143 id: dialoguePower
141− title: "Power"
144+ title: i18n.tr("Power")
142− text: i18n.tr("Are you sure you would like to turn power off?")
145+ text: i18n.tr("Are you sure you would like\nto power off?")
144 text: i18n.tr("Power off")
147 text: i18n.tr("Power off")
145 onClicked: {
148 onClicked: {
@@ -148,15 +151,7 @@ Item {
148 d.dialogShown = false;
151 d.dialogShown = false;
149 root.powerOffClicked();
152 root.powerOffClicked();
151− }
154+ color: UbuntuColors.red
153− text: i18n.tr("Restart")
155− dBusUnitySessionServiceConnection.closeAllApps();
156− DBusUnitySessionService.Reboot();
157− PopupUtils.close(dialoguePower);
158− d.dialogShown = false;
162 text: i18n.tr("Cancel")
157 text: i18n.tr("Cancel")
@@ -164,6 +159,7 @@ Item {
164 PopupUtils.close(dialoguePower);
159 PopupUtils.close(dialoguePower);
165 d.dialogShown = false;
160 d.dialogShown = false;
162+ color: UbuntuColors.coolGrey