2 * Copyright (C) 2014 Canonical, Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19import Unity.Application 0.1
20import Unity.Session 0.1
21import Ubuntu.Components 0.1
22import Ubuntu.Components.Popups 0.1
27 function onPowerKeyPressed() {
28 if (!powerKeyTimer.running) {
29 powerKeyTimer.start();
33 function onPowerKeyReleased() {
37 signal powerOffClicked();
40 id: d // private stuff
42 property bool dialogShown: false
44 function showPowerDialog() {
47 PopupUtils.open(powerDialog, root, {"z": root.z});
56 triggeredOnStart: false
68 text: "Are you sure that you want to logout?"
72 PopupUtils.close(dialogueLogout);
73 d.dialogShown = false;
79 DBusUnitySessionService.Logout();
80 PopupUtils.close(dialogueLogout);
81 d.dialogShown = false;
92 text: "Are you sure that you want to shutdown?"
96 PopupUtils.close(dialogueShutdown);
97 d.dialogShown = false;
103 dBusUnitySessionServiceConnection.closeAllApps();
104 DBusUnitySessionService.Shutdown();
105 PopupUtils.close(dialogueShutdown);
106 d.dialogShown = false;
117 text: "Are you sure that you want to reboot?"
121 PopupUtils.close(dialogueReboot)
122 d.dialogShown = false;
128 dBusUnitySessionServiceConnection.closeAllApps();
129 DBusUnitySessionService.Reboot();
130 PopupUtils.close(dialogueReboot);
131 d.dialogShown = false;
142 text: i18n.tr("Are you sure you would like to turn power off?")
144 text: i18n.tr("Power off")
146 dBusUnitySessionServiceConnection.closeAllApps();
147 PopupUtils.close(dialoguePower);
148 d.dialogShown = false;
149 root.powerOffClicked();
153 text: i18n.tr("Restart")
155 dBusUnitySessionServiceConnection.closeAllApps();
156 DBusUnitySessionService.Reboot();
157 PopupUtils.close(dialoguePower);
158 d.dialogShown = false;
162 text: i18n.tr("Cancel")
164 PopupUtils.close(dialoguePower);
165 d.dialogShown = false;
173 id: dBusUnitySessionServiceConnection
174 objectName: "dBusUnitySessionServiceConnection"
175 target: DBusUnitySessionService
177 function closeAllApps() {
179 var app = ApplicationManager.get(0);
183 ApplicationManager.stopApplication(app.appId);
188 // Display a dialog to ask the user to confirm.
189 if (!d.dialogShown) {
190 d.dialogShown = true;
191 PopupUtils.open(logoutDialog, root, {"z": root.z});
195 onShutdownRequested: {
196 // Display a dialog to ask the user to confirm.
197 if (!d.dialogShown) {
198 d.dialogShown = true;
199 PopupUtils.open(shutdownDialog, root, {"z": root.z});
204 // Display a dialog to ask the user to confirm.
205 if (!d.dialogShown) {
206 d.dialogShown = true;
207 PopupUtils.open(rebootDialog, root, {"z": root.z});
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list