on xenial help sign in
Set the domain explicitly for the Dialog component class
commitb13728b6f6c7f3c7e965a3a3e9c58f3abd63a684 authorMichael Terry <michael.terry@canonical.com> dateWed 15 Oct 2014, 16:35 (12 years ago) parentfadfb1a
1 file changed+21−17
qml/Components/Dialogs.qml+21−17
qml/Components/Dialogs.qml+21−17
@@ -24,6 +24,10 @@ import Ubuntu.Components.Popups 0.1
2424Item {
2525 id: root
2626
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+
2731 function onPowerKeyPressed() {
2832 // FIXME: event.isAutoRepeat is always false on Nexus 4.
2933 // So we use powerKeyTimer.running to avoid the PowerOff key repeat
@@ -67,17 +71,17 @@ Item {
6771 id: logoutDialog
6872 Dialog {
6973 id: dialogueLogout
70− title: i18n.tr("Log out")
71− text: i18n.tr("Are you sure you want to log out?")
74+ title: i18n.dtr(root.domain, "Log out")
75+ text: i18n.dtr(root.domain, "Are you sure you want to log out?")
7276 Button {
73− text: i18n.tr("No")
77+ text: i18n.dtr(root.domain, "No")
7478 onClicked: {
7579 PopupUtils.close(dialogueLogout);
7680 d.dialogShown = false;
7781 }
7882 }
7983 Button {
80− text: i18n.tr("Yes")
84+ text: i18n.dtr(root.domain, "Yes")
8185 onClicked: {
8286 DBusUnitySessionService.Logout();
8387 PopupUtils.close(dialogueLogout);
@@ -91,17 +95,17 @@ Item {
9195 id: shutdownDialog
9296 Dialog {
9397 id: dialogueShutdown
94− title: i18n.tr("Shut down")
95− text: i18n.tr("Are you sure you want to shut down?")
98+ title: i18n.dtr(root.domain, "Shut down")
99+ text: i18n.dtr(root.domain, "Are you sure you want to shut down?")
96100 Button {
97− text: i18n.tr("No")
101+ text: i18n.dtr(root.domain, "No")
98102 onClicked: {
99103 PopupUtils.close(dialogueShutdown);
100104 d.dialogShown = false;
101105 }
102106 }
103107 Button {
104− text: i18n.tr("Yes")
108+ text: i18n.dtr(root.domain, "Yes")
105109 onClicked: {
106110 dBusUnitySessionServiceConnection.closeAllApps();
107111 DBusUnitySessionService.Shutdown();
@@ -116,17 +120,17 @@ Item {
116120 id: rebootDialog
117121 Dialog {
118122 id: dialogueReboot
119− title: i18n.tr("Reboot")
120− text: i18n.tr("Are you sure you want to reboot?")
123+ title: i18n.dtr(root.domain, "Reboot")
124+ text: i18n.dtr(root.domain, "Are you sure you want to reboot?")
121125 Button {
122− text: i18n.tr("No")
126+ text: i18n.dtr(root.domain, "No")
123127 onClicked: {
124128 PopupUtils.close(dialogueReboot)
125129 d.dialogShown = false;
126130 }
127131 }
128132 Button {
129− text: i18n.tr("Yes")
133+ text: i18n.dtr(root.domain, "Yes")
130134 onClicked: {
131135 dBusUnitySessionServiceConnection.closeAllApps();
132136 DBusUnitySessionService.Reboot();
@@ -141,10 +145,10 @@ Item {
141145 id: powerDialog
142146 Dialog {
143147 id: dialoguePower
144− title: i18n.tr("Power")
145− text: i18n.tr("Are you sure you would like\nto power off?")
148+ title: i18n.dtr(root.domain, "Power")
149+ text: i18n.dtr(root.domain, "Are you sure you would like\nto power off?")
146150 Button {
147− text: i18n.tr("Power off")
151+ text: i18n.dtr(root.domain, "Power off")
148152 onClicked: {
149153 dBusUnitySessionServiceConnection.closeAllApps();
150154 PopupUtils.close(dialoguePower);
@@ -154,7 +158,7 @@ Item {
154158 color: UbuntuColors.red
155159 }
156160 Button {
157− text: i18n.tr("Restart")
161+ text: i18n.dtr(root.domain, "Restart")
158162 onClicked: {
159163 dBusUnitySessionServiceConnection.closeAllApps();
160164 DBusUnitySessionService.Reboot();
@@ -164,7 +168,7 @@ Item {
164168 color: UbuntuColors.green
165169 }
166170 Button {
167− text: i18n.tr("Cancel")
171+ text: i18n.dtr(root.domain, "Cancel")
168172 onClicked: {
169173 PopupUtils.close(dialoguePower);
170174 d.dialogShown = false;