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
27 // to be set from outside, useful mostly for testing purposes
28 property var unitySessionService: DBusUnitySessionService
29 property var closeAllApps: function() {
31 var app = ApplicationManager.get(0);
35 ApplicationManager.stopApplication(app.appId);
39 signal powerOffClicked();
41 function showPowerDialog() {
46 id: d // private stuff
47 objectName: "dialogsPrivate"
50 function showPowerDialog() {
51 if (!dialogLoader.active) {
52 dialogLoader.sourceComponent = powerDialogComponent;
53 dialogLoader.active = true;
54 dialogLoader.item.forceActiveFocus();
60 objectName: "dialogLoader"
65 LightDM{id: lightDM} // Provide backend access
67 id: logoutDialogComponent
70 title: i18n.ctr("Title: Lock/Log out dialog", "Log out")
71 text: i18n.tr("Are you sure you want to log out?")
73 text: i18n.ctr("Button: Lock the system", "Lock")
75 lightDM.greeter.showGreeter()
80 text: i18n.ctr("Button: Log out from the system", "Log Out")
82 unitySessionService.logout();
87 text: i18n.tr("Cancel")
96 id: shutdownDialogComponent
99 title: i18n.ctr("Title: Reboot/Shut down dialog", "Shut down")
100 text: i18n.tr("Are you sure you want to shut down?")
102 text: i18n.ctr("Button: Reboot the system", "Reboot")
105 unitySessionService.reboot();
106 shutdownDialog.hide();
110 text: i18n.ctr("Button: Shut down the system", "Shut down")
113 unitySessionService.shutdown();
114 shutdownDialog.hide();
118 text: i18n.tr("Cancel")
120 shutdownDialog.hide();
127 id: rebootDialogComponent
130 title: i18n.ctr("Title: Reboot dialog", "Reboot")
131 text: i18n.tr("Are you sure you want to reboot?")
142 unitySessionService.reboot();
150 id: powerDialogComponent
153 title: i18n.ctr("Title: Power off/Restart dialog", "Power")
154 text: i18n.tr("Are you sure you would like\nto power off?")
156 text: i18n.ctr("Button: Power off the system", "Power off")
160 root.powerOffClicked();
162 color: UbuntuColors.red
165 text: i18n.ctr("Button: Restart the system", "Restart")
168 unitySessionService.reboot();
171 color: UbuntuColors.green
174 text: i18n.tr("Cancel")
178 color: UbuntuColors.coolGrey
184 target: root.unitySessionService
187 // Display a dialog to ask the user to confirm.
188 if (!dialogLoader.active) {
189 dialogLoader.sourceComponent = logoutDialogComponent;
190 dialogLoader.active = true;
194 onShutdownRequested: {
195 // Display a dialog to ask the user to confirm.
196 if (!dialogLoader.active) {
197 dialogLoader.sourceComponent = shutdownDialogComponent;
198 dialogLoader.active = true;
203 // Display a dialog to ask the user to confirm.
204 if (!dialogLoader.active) {
205 dialogLoader.sourceComponent = rebootDialogComponent;
206 dialogLoader.active = true;
213 unitySessionService.endSession();
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