on xenial help sign in
Set domain explicitly for the Dialogs component because the welcome wizard wants to import it. Fixes: 1381731
41806abMichael Terry
qml/Components/Dialogs.qml+21−17
@@ -24,6 +24,10 @@ import Ubuntu.Components.Popups 0.1
24Item {
24Item {
25 id: root
25 id: root
26
26
27+ // Explicitly use the right domain for this widget because it might be used
28+ // in other applications like the welcome wizard.
29+ property string domain: "unity8"
30+
27 function onPowerKeyPressed() {
31 function onPowerKeyPressed() {
28 // FIXME: event.isAutoRepeat is always false on Nexus 4.
32 // FIXME: event.isAutoRepeat is always false on Nexus 4.
29 // So we use powerKeyTimer.running to avoid the PowerOff key repeat
33 // So we use powerKeyTimer.running to avoid the PowerOff key repeat
@@ -67,17 +71,17 @@ Item {
67 id: logoutDialog
71 id: logoutDialog
68 Dialog {
72 Dialog {
69 id: dialogueLogout
73 id: dialogueLogout
70− title: i18n.tr("Log out")
74+ title: i18n.dtr(root.domain, "Log out")
71− text: i18n.tr("Are you sure you want to log out?")
75+ text: i18n.dtr(root.domain, "Are you sure you want to log out?")
72 Button {
76 Button {
73− text: i18n.tr("No")
77+ text: i18n.dtr(root.domain, "No")
74 onClicked: {
78 onClicked: {
75 PopupUtils.close(dialogueLogout);
79 PopupUtils.close(dialogueLogout);
76 d.dialogShown = false;
80 d.dialogShown = false;
77 }
81 }
78 }
82 }
79 Button {
83 Button {
80− text: i18n.tr("Yes")
84+ text: i18n.dtr(root.domain, "Yes")
81 onClicked: {
85 onClicked: {
82 DBusUnitySessionService.Logout();
86 DBusUnitySessionService.Logout();
83 PopupUtils.close(dialogueLogout);
87 PopupUtils.close(dialogueLogout);
@@ -91,17 +95,17 @@ Item {
91 id: shutdownDialog
95 id: shutdownDialog
92 Dialog {
96 Dialog {
93 id: dialogueShutdown
97 id: dialogueShutdown
94− title: i18n.tr("Shut down")
98+ title: i18n.dtr(root.domain, "Shut down")
95− text: i18n.tr("Are you sure you want to shut down?")
99+ text: i18n.dtr(root.domain, "Are you sure you want to shut down?")
96 Button {
100 Button {
97− text: i18n.tr("No")
101+ text: i18n.dtr(root.domain, "No")
98 onClicked: {
102 onClicked: {
99 PopupUtils.close(dialogueShutdown);
103 PopupUtils.close(dialogueShutdown);
100 d.dialogShown = false;
104 d.dialogShown = false;
101 }
105 }
102 }
106 }
103 Button {
107 Button {
104− text: i18n.tr("Yes")
108+ text: i18n.dtr(root.domain, "Yes")
105 onClicked: {
109 onClicked: {
106 dBusUnitySessionServiceConnection.closeAllApps();
110 dBusUnitySessionServiceConnection.closeAllApps();
107 DBusUnitySessionService.Shutdown();
111 DBusUnitySessionService.Shutdown();
@@ -116,17 +120,17 @@ Item {
116 id: rebootDialog
120 id: rebootDialog
117 Dialog {
121 Dialog {
118 id: dialogueReboot
122 id: dialogueReboot
119− title: i18n.tr("Reboot")
123+ title: i18n.dtr(root.domain, "Reboot")
120− text: i18n.tr("Are you sure you want to reboot?")
124+ text: i18n.dtr(root.domain, "Are you sure you want to reboot?")
121 Button {
125 Button {
122− text: i18n.tr("No")
126+ text: i18n.dtr(root.domain, "No")
123 onClicked: {
127 onClicked: {
124 PopupUtils.close(dialogueReboot)
128 PopupUtils.close(dialogueReboot)
125 d.dialogShown = false;
129 d.dialogShown = false;
126 }
130 }
127 }
131 }
128 Button {
132 Button {
129− text: i18n.tr("Yes")
133+ text: i18n.dtr(root.domain, "Yes")
130 onClicked: {
134 onClicked: {
131 dBusUnitySessionServiceConnection.closeAllApps();
135 dBusUnitySessionServiceConnection.closeAllApps();
132 DBusUnitySessionService.Reboot();
136 DBusUnitySessionService.Reboot();
@@ -141,10 +145,10 @@ Item {
141 id: powerDialog
145 id: powerDialog
142 Dialog {
146 Dialog {
143 id: dialoguePower
147 id: dialoguePower
144− title: i18n.tr("Power")
148+ title: i18n.dtr(root.domain, "Power")
145− text: i18n.tr("Are you sure you would like\nto power off?")
149+ text: i18n.dtr(root.domain, "Are you sure you would like\nto power off?")
146 Button {
150 Button {
147− text: i18n.tr("Power off")
151+ text: i18n.dtr(root.domain, "Power off")
148 onClicked: {
152 onClicked: {
149 dBusUnitySessionServiceConnection.closeAllApps();
153 dBusUnitySessionServiceConnection.closeAllApps();
150 PopupUtils.close(dialoguePower);
154 PopupUtils.close(dialoguePower);
@@ -154,7 +158,7 @@ Item {
154 color: UbuntuColors.red
158 color: UbuntuColors.red
155 }
159 }
156 Button {
160 Button {
157− text: i18n.tr("Restart")
161+ text: i18n.dtr(root.domain, "Restart")
158 onClicked: {
162 onClicked: {
159 dBusUnitySessionServiceConnection.closeAllApps();
163 dBusUnitySessionServiceConnection.closeAllApps();
160 DBusUnitySessionService.Reboot();
164 DBusUnitySessionService.Reboot();
@@ -164,7 +168,7 @@ Item {
164 color: UbuntuColors.green
168 color: UbuntuColors.green
165 }
169 }
166 Button {
170 Button {
167− text: i18n.tr("Cancel")
171+ text: i18n.dtr(root.domain, "Cancel")
168 onClicked: {
172 onClicked: {
169 PopupUtils.close(dialoguePower);
173 PopupUtils.close(dialoguePower);
170 d.dialogShown = false;
174 d.dialogShown = false;