2 * Copyright (C) 2014 Canonical, Ltd.
4 * This program is free software: you can redistribute it and/or modify it under
5 * the terms of the GNU Lesser General Public License version 3, as published by
6 * the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
10 * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18#include "dbusunitysessionservice.h"
21#include <QDBusConnection>
22#include <QDBusInterface>
24DBusUnitySessionService::DBusUnitySessionService() : QObject()
26 QDBusConnection connection = QDBusConnection::sessionBus();
28 connection.registerService("com.canonical.Unity");
29 connection.registerObject("/com/canonical/Unity/Session", this,
30 QDBusConnection::ExportScriptableSignals
31 | QDBusConnection::ExportScriptableSlots
32 | QDBusConnection::ExportScriptableInvokables);
35DBusUnitySessionService::~DBusUnitySessionService()
39void DBusUnitySessionService::Logout()
44void DBusUnitySessionService::RequestLogout()
46 Q_EMIT logoutRequested(false);
49void DBusUnitySessionService::Reboot()
51 QDBusConnection connection = QDBusConnection::systemBus();
52 QDBusInterface iface1 ("org.freedesktop.login1",
53 "/org/freedesktop/login1",
54 "org.freedesktop.login1.Manager",
57 iface1.call("Reboot", false);
60void DBusUnitySessionService::RequestReboot()
62 Q_EMIT rebootRequested(false);
65void DBusUnitySessionService::Shutdown()
67 QDBusConnection connection = QDBusConnection::systemBus();
68 QDBusInterface iface1 ("org.freedesktop.login1",
69 "/org/freedesktop/login1",
70 "org.freedesktop.login1.Manager",
73 iface1.call("PowerOff", false);
76void DBusUnitySessionService::RequestShutdown()
78 Q_EMIT shutdownRequested(false);
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