~mterry/unity8/notify-authenticated

« back to all changes in this revision

Viewing changes to qml/Components/Dialogs.qml

  • Committer: Michael Terry
  • Date: 2014-08-21 12:53:29 UTC
  • mfrom: (1161.1.23 unity8)
  • Revision ID: michael.terry@canonical.com-20140821125329-8c14utjip4id3e7m
MergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
import Unity.Application 0.1
20
20
import Unity.Session 0.1
21
 
import Ubuntu.Components 0.1
 
21
import Ubuntu.Components 1.1
22
22
import Ubuntu.Components.Popups 0.1
23
23
 
24
24
Item {
25
25
    id: root
26
26
 
27
27
    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
28
31
        if (!powerKeyTimer.running) {
29
 
            powerKeyTimer.start();
 
32
            powerKeyTimer.restart();
30
33
        }
31
34
    }
32
35
 
64
67
        id: logoutDialog
65
68
        Dialog {
66
69
            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?")
69
72
            Button {
70
 
                text: "Cancel"
 
73
                text: i18n.tr("No")
71
74
                onClicked: {
72
75
                    PopupUtils.close(dialogueLogout);
73
76
                    d.dialogShown = false;
74
77
                }
75
78
            }
76
79
            Button {
77
 
                text: "Yes"
 
80
                text: i18n.tr("Yes")
78
81
                onClicked: {
79
82
                    DBusUnitySessionService.Logout();
80
83
                    PopupUtils.close(dialogueLogout);
88
91
        id: shutdownDialog
89
92
        Dialog {
90
93
            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?")
93
96
            Button {
94
 
                text: "Cancel"
 
97
                text: i18n.tr("No")
95
98
                onClicked: {
96
99
                    PopupUtils.close(dialogueShutdown);
97
100
                    d.dialogShown = false;
98
101
                }
99
102
            }
100
103
            Button {
101
 
                text: "Yes"
 
104
                text: i18n.tr("Yes")
102
105
                onClicked: {
103
106
                    dBusUnitySessionServiceConnection.closeAllApps();
104
107
                    DBusUnitySessionService.Shutdown();
113
116
        id: rebootDialog
114
117
        Dialog {
115
118
            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?")
118
121
            Button {
119
 
                text: "Cancel"
 
122
                text: i18n.tr("No")
120
123
                onClicked: {
121
124
                    PopupUtils.close(dialogueReboot)
122
125
                    d.dialogShown = false;
123
126
                }
124
127
            }
125
128
            Button {
126
 
                text: "Yes"
 
129
                text: i18n.tr("Yes")
127
130
                onClicked: {
128
131
                    dBusUnitySessionServiceConnection.closeAllApps();
129
132
                    DBusUnitySessionService.Reboot();
138
141
        id: powerDialog
139
142
        Dialog {
140
143
            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?")
143
146
            Button {
144
147
                text: i18n.tr("Power off")
145
148
                onClicked: {
148
151
                    d.dialogShown = false;
149
152
                    root.powerOffClicked();
150
153
                }
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
160
155
            }
161
156
            Button {
162
157
                text: i18n.tr("Cancel")
164
159
                    PopupUtils.close(dialoguePower);
165
160
                    d.dialogShown = false;
166
161
                }
 
162
                color: UbuntuColors.coolGrey
167
163
            }
168
164
        }
169
165
    }