~mterry/+junk/u8.2

« back to all changes in this revision

Viewing changes to qml/Components/Dialogs.qml

  • Committer: Michael Terry
  • Date: 2014-11-17 14:56:04 UTC
  • mfrom: (1317.1.118 unity8)
  • Revision ID: michael.terry@canonical.com-20141117145604-96dn9p5nwkifq2f4
MergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
Item {
25
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
    readonly property string domain: "unity8"
 
30
 
27
31
    function onPowerKeyPressed() {
28
32
        // FIXME: event.isAutoRepeat is always false on Nexus 4.
29
33
        // So we use powerKeyTimer.running to avoid the PowerOff key repeat
67
71
        id: logoutDialog
68
72
        Dialog {
69
73
            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?")
72
76
            Button {
73
 
                text: i18n.tr("No")
 
77
                text: i18n.dtr(root.domain, "No")
74
78
                onClicked: {
75
79
                    PopupUtils.close(dialogueLogout);
76
80
                    d.dialogShown = false;
77
81
                }
78
82
            }
79
83
            Button {
80
 
                text: i18n.tr("Yes")
 
84
                text: i18n.dtr(root.domain, "Yes")
81
85
                onClicked: {
82
86
                    DBusUnitySessionService.Logout();
83
87
                    PopupUtils.close(dialogueLogout);
91
95
        id: shutdownDialog
92
96
        Dialog {
93
97
            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?")
96
100
            Button {
97
 
                text: i18n.tr("No")
 
101
                text: i18n.dtr(root.domain, "No")
98
102
                onClicked: {
99
103
                    PopupUtils.close(dialogueShutdown);
100
104
                    d.dialogShown = false;
101
105
                }
102
106
            }
103
107
            Button {
104
 
                text: i18n.tr("Yes")
 
108
                text: i18n.dtr(root.domain, "Yes")
105
109
                onClicked: {
106
110
                    dBusUnitySessionServiceConnection.closeAllApps();
107
111
                    DBusUnitySessionService.Shutdown();
116
120
        id: rebootDialog
117
121
        Dialog {
118
122
            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?")
121
125
            Button {
122
 
                text: i18n.tr("No")
 
126
                text: i18n.dtr(root.domain, "No")
123
127
                onClicked: {
124
128
                    PopupUtils.close(dialogueReboot)
125
129
                    d.dialogShown = false;
126
130
                }
127
131
            }
128
132
            Button {
129
 
                text: i18n.tr("Yes")
 
133
                text: i18n.dtr(root.domain, "Yes")
130
134
                onClicked: {
131
135
                    dBusUnitySessionServiceConnection.closeAllApps();
132
136
                    DBusUnitySessionService.Reboot();
141
145
        id: powerDialog
142
146
        Dialog {
143
147
            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?")
146
150
            Button {
147
 
                text: i18n.tr("Power off")
 
151
                text: i18n.dtr(root.domain, "Power off")
148
152
                onClicked: {
149
153
                    dBusUnitySessionServiceConnection.closeAllApps();
150
154
                    PopupUtils.close(dialoguePower);
154
158
                color: UbuntuColors.red
155
159
            }
156
160
            Button {
157
 
                text: i18n.tr("Restart")
 
161
                text: i18n.dtr(root.domain, "Restart")
158
162
                onClicked: {
159
163
                    dBusUnitySessionServiceConnection.closeAllApps();
160
164
                    DBusUnitySessionService.Reboot();
164
168
                color: UbuntuColors.green
165
169
            }
166
170
            Button {
167
 
                text: i18n.tr("Cancel")
 
171
                text: i18n.dtr(root.domain, "Cancel")
168
172
                onClicked: {
169
173
                    PopupUtils.close(dialoguePower);
170
174
                    d.dialogShown = false;