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 1.1
22import Ubuntu.Components.Popups 0.1
27 signal powerOffClicked();
29 property bool dialogShown: false
31 function showPowerDialog() {
34 PopupUtils.open(powerDialog, root, {"z": root.z});
42 title: i18n.tr("Log out")
43 text: i18n.tr("Are you sure you want to log out?")
47 PopupUtils.close(dialogueLogout);
48 d.dialogShown = false;
54 DBusUnitySessionService.Logout();
55 PopupUtils.close(dialogueLogout);
56 d.dialogShown = false;
66 title: i18n.tr("Shut down")
67 text: i18n.tr("Are you sure you want to shut down?")
71 PopupUtils.close(dialogueShutdown);
72 d.dialogShown = false;
78 dBusUnitySessionServiceConnection.closeAllApps();
79 DBusUnitySessionService.Shutdown();
80 PopupUtils.close(dialogueShutdown);
81 d.dialogShown = false;
91 title: i18n.tr("Reboot")
92 text: i18n.tr("Are you sure you want to reboot?")
96 PopupUtils.close(dialogueReboot)
97 d.dialogShown = false;
103 dBusUnitySessionServiceConnection.closeAllApps();
104 DBusUnitySessionService.Reboot();
105 PopupUtils.close(dialogueReboot);
106 d.dialogShown = false;
116 title: i18n.tr("Power")
117 text: i18n.tr("Are you sure you would like\nto power off?")
119 text: i18n.tr("Power off")
121 dBusUnitySessionServiceConnection.closeAllApps();
122 PopupUtils.close(dialoguePower);
123 d.dialogShown = false;
124 root.powerOffClicked();
126 color: UbuntuColors.red
129 text: i18n.tr("Restart")
131 dBusUnitySessionServiceConnection.closeAllApps();
132 DBusUnitySessionService.Reboot();
133 PopupUtils.close(dialoguePower);
134 d.dialogShown = false;
136 color: UbuntuColors.green
139 text: i18n.tr("Cancel")
141 PopupUtils.close(dialoguePower);
142 d.dialogShown = false;
144 color: UbuntuColors.coolGrey
151 id: dBusUnitySessionServiceConnection
152 objectName: "dBusUnitySessionServiceConnection"
153 target: DBusUnitySessionService
155 function closeAllApps() {
157 var app = ApplicationManager.get(0);
161 ApplicationManager.stopApplication(app.appId);
166 // Display a dialog to ask the user to confirm.
167 if (!d.dialogShown) {
168 d.dialogShown = true;
169 PopupUtils.open(logoutDialog, root, {"z": root.z});
173 onShutdownRequested: {
174 // Display a dialog to ask the user to confirm.
175 if (!d.dialogShown) {
176 d.dialogShown = true;
177 PopupUtils.open(shutdownDialog, root, {"z": root.z});
182 // Display a dialog to ask the user to confirm.
183 if (!d.dialogShown) {
184 d.dialogShown = true;
185 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