2 * Copyright (C) 2013,2016 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/>.
17#include "SessionBroadcast.h"
18#include <QDBusConnection>
19#include <QDBusConnectionInterface>
20#include <QDBusInterface>
24SessionBroadcast::SessionBroadcast(QObject* parent)
27 m_username = QString::fromUtf8(g_get_user_name());
29 auto connection = QDBusConnection::SM_BUSNAME();
30 auto interface = connection.interface();
31 interface->startService(QStringLiteral("com.canonical.Unity.Greeter.Broadcast"));
33 m_broadcaster = new QDBusInterface(QStringLiteral("com.canonical.Unity.Greeter.Broadcast"),
34 QStringLiteral("/com/canonical/Unity/Greeter/Broadcast"),
35 QStringLiteral("com.canonical.Unity.Greeter.Broadcast"),
38 connect(m_broadcaster, SIGNAL(StartUrl(const QString &, const QString &)),
39 this, SLOT(onStartUrl(const QString &, const QString &)));
41 connect(m_broadcaster, SIGNAL(ShowHome(const QString &)),
42 this, SLOT(onShowHome(const QString &)));
45void SessionBroadcast::requestUrlStart(const QString &username, const QString &url)
47 m_broadcaster->asyncCall(QStringLiteral("RequestUrlStart"), username, url);
50void SessionBroadcast::requestHomeShown(const QString &username)
52 m_broadcaster->asyncCall(QStringLiteral("RequestHomeShown"), username);
55void SessionBroadcast::onStartUrl(const QString &username, const QString &url)
57 // Since this signal is just used for testing, we don't *really* care if
58 // username matches, but just in case we do eventually use the signal, we
59 // should only listen to our own requests.
60 if (username == m_username) {
65void SessionBroadcast::onShowHome(const QString &username)
67 // Only listen to requests meant for us
68 if (username == m_username) {
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