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
26 // to be set from outside, useful mostly for testing purposes
27 property var unitySessionService: DBusUnitySessionService
28 property var closeAllApps: function() {
30 var app = ApplicationManager.get(0);
34 ApplicationManager.stopApplication(app.appId);
38 signal powerOffClicked();
40 function showPowerDialog() {
45 id: d // private stuff
46 objectName: "dialogsPrivate"
49 function showPowerDialog() {
50 if (!dialogLoader.active) {
51 dialogLoader.sourceComponent = powerDialogComponent;
52 dialogLoader.active = true;
63 id: logoutDialogComponent
66 title: i18n.tr("Log out")
67 text: i18n.tr("Are you sure you want to log out?")
77 unitySessionService.logout();
85 id: shutdownDialogComponent
88 title: i18n.tr("Shut down")
89 text: i18n.tr("Are you sure you want to shut down?")
93 shutdownDialog.hide();
100 unitySessionService.shutdown();
101 shutdownDialog.hide();
108 id: rebootDialogComponent
111 title: i18n.tr("Reboot")
112 text: i18n.tr("Are you sure you want to reboot?")
123 unitySessionService.reboot();
131 id: powerDialogComponent
134 title: i18n.tr("Power")
135 text: i18n.tr("Are you sure you would like\nto power off?")
137 text: i18n.tr("Power off")
141 root.powerOffClicked();
143 color: UbuntuColors.red
146 text: i18n.tr("Restart")
149 unitySessionService.reboot();
152 color: UbuntuColors.green
155 text: i18n.tr("Cancel")
159 color: UbuntuColors.coolGrey
165 target: root.unitySessionService
168 // Display a dialog to ask the user to confirm.
169 if (!dialogLoader.active) {
170 dialogLoader.sourceComponent = logoutDialogComponent;
171 dialogLoader.active = true;
175 onShutdownRequested: {
176 // Display a dialog to ask the user to confirm.
177 if (!dialogLoader.active) {
178 dialogLoader.sourceComponent = shutdownDialogComponent;
179 dialogLoader.active = true;
184 // Display a dialog to ask the user to confirm.
185 if (!dialogLoader.active) {
186 dialogLoader.sourceComponent = rebootDialogComponent;
187 dialogLoader.active = true;
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