@@ -18,15 +18,18 @@ import QtQuick 2.0
1818
1919import Unity.Application 0.1
2020import Unity.Session 0.1
21−import Ubuntu.Components 0.1
21+import Ubuntu.Components 1.1
2222import Ubuntu.Components.Popups 0.1
2323
2424Item {
2525 id: root
2626
2727 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
2831 if (!powerKeyTimer.running) {
29− powerKeyTimer.start();
32+ powerKeyTimer.restart();
3033 }
3134 }
3235
@@ -148,15 +151,7 @@ Item {
148151 d.dialogShown = false;
149152 root.powerOffClicked();
150153 }
151− }
152− Button {
153− text: i18n.tr("Restart")
154− onClicked: {
155− dBusUnitySessionServiceConnection.closeAllApps();
156− DBusUnitySessionService.Reboot();
157− PopupUtils.close(dialoguePower);
158− d.dialogShown = false;
159− }
154+ color: UbuntuColors.red
160155 }
161156 Button {
162157 text: i18n.tr("Cancel")
@@ -164,6 +159,7 @@ Item {
164159 PopupUtils.close(dialoguePower);
165160 d.dialogShown = false;
166161 }
162+ color: UbuntuColors.coolGrey
167163 }
168164 }
169165 }