on xenial help sign in
Add button colors and i18n for power off dialog. Fixes: 1354506

Approved by: Michał Sawicz

commitd3ba6f80b5cb3dc7a16fc4af0e17ac029af56a6d authorYing-Chun Liu <paul.liu@canonical.com> dateFri 15 Aug 2014, 17:36 (12 years ago) parent778dcd481daf5a
1 file changed+21−25
qml/Components/Dialogs.qml+21−25
qml/Components/Dialogs.qml+21−25
@@ -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
@@ -64,17 +67,17 @@ Item {
6467 id: logoutDialog
6568 Dialog {
6669 id: dialogueLogout
67− title: "Logout"
68− text: "Are you sure that you want to logout?"
70+ title: i18n.tr("Log out")
71+ text: i18n.tr("Are you sure you want to log out?")
6972 Button {
70− text: "Cancel"
73+ text: i18n.tr("No")
7174 onClicked: {
7275 PopupUtils.close(dialogueLogout);
7376 d.dialogShown = false;
7477 }
7578 }
7679 Button {
77− text: "Yes"
80+ text: i18n.tr("Yes")
7881 onClicked: {
7982 DBusUnitySessionService.Logout();
8083 PopupUtils.close(dialogueLogout);
@@ -88,17 +91,17 @@ Item {
8891 id: shutdownDialog
8992 Dialog {
9093 id: dialogueShutdown
91− title: "Shutdown"
92− text: "Are you sure that you want to shutdown?"
94+ title: i18n.tr("Shut down")
95+ text: i18n.tr("Are you sure you want to shut down?")
9396 Button {
94− text: "Cancel"
97+ text: i18n.tr("No")
9598 onClicked: {
9699 PopupUtils.close(dialogueShutdown);
97100 d.dialogShown = false;
98101 }
99102 }
100103 Button {
101− text: "Yes"
104+ text: i18n.tr("Yes")
102105 onClicked: {
103106 dBusUnitySessionServiceConnection.closeAllApps();
104107 DBusUnitySessionService.Shutdown();
@@ -113,17 +116,17 @@ Item {
113116 id: rebootDialog
114117 Dialog {
115118 id: dialogueReboot
116− title: "Reboot"
117− text: "Are you sure that you want to reboot?"
119+ title: i18n.tr("Reboot")
120+ text: i18n.tr("Are you sure you want to reboot?")
118121 Button {
119− text: "Cancel"
122+ text: i18n.tr("No")
120123 onClicked: {
121124 PopupUtils.close(dialogueReboot)
122125 d.dialogShown = false;
123126 }
124127 }
125128 Button {
126− text: "Yes"
129+ text: i18n.tr("Yes")
127130 onClicked: {
128131 dBusUnitySessionServiceConnection.closeAllApps();
129132 DBusUnitySessionService.Reboot();
@@ -138,8 +141,8 @@ Item {
138141 id: powerDialog
139142 Dialog {
140143 id: dialoguePower
141− title: "Power"
142− text: i18n.tr("Are you sure you would like to turn power off?")
144+ title: i18n.tr("Power")
145+ text: i18n.tr("Are you sure you would like\nto power off?")
143146 Button {
144147 text: i18n.tr("Power off")
145148 onClicked: {
@@ -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 }