21
21
#include "dashadaptor.h"
24
#include <shelldeclarativeview.h>
24
#include <shellmanager.h>
27
27
#include <QtDBus/QDBusConnection>
29
static const char* DASH_DBUS_SERVICE = "com.canonical.Unity2d.Dash";
30
static const char* DASH_DBUS_OBJECT_PATH = "/Dash";
32
DashDBus::DashDBus(ShellDeclarativeView* view, QObject* parent)
28
#include <QGraphicsObject>
30
DashDBus::DashDBus(ShellManager* manager, QObject* parent)
36
connect(m_view, SIGNAL(dashActiveChanged(bool)), SIGNAL(activeChanged(bool)));
37
connect(m_view, SIGNAL(activeLensChanged(QString)), SIGNAL(activeLensChanged(QString)));
42
QDBusConnection::sessionBus().unregisterService(DASH_DBUS_SERVICE);
46
DashDBus::connectToBus()
48
bool ok = QDBusConnection::sessionBus().registerService(DASH_DBUS_SERVICE);
34
connect(m_manager, SIGNAL(dashActiveChanged(bool)), SIGNAL(activeChanged(bool)));
35
connect(m_manager, SIGNAL(dashAlwaysFullScreenChanged(bool)), SIGNAL(alwaysFullScreenChanged(bool)));
36
connect(m_manager, SIGNAL(dashActiveLensChanged(QString)), SIGNAL(activeLensChanged(QString)));
38
connect(m_manager, SIGNAL(dashScreenChanged(int)), SIGNAL(screenChanged(int)));
52
40
new DashAdaptor(this);
53
QDBusConnection::sessionBus().registerObject(DASH_DBUS_OBJECT_PATH, this);
59
44
DashDBus::activateHome()
61
Q_EMIT m_view->activateHome();
46
Q_EMIT m_manager->dashActivateHome();
65
50
DashDBus::activateLens(const QString& lensId)
67
Q_EMIT m_view->activateLens(lensId);
52
Q_EMIT m_manager->dashActivateLens(lensId);
71
56
DashDBus::active() const
73
return m_view->dashActive();
58
return m_manager->dashActive();
77
62
DashDBus::setActive(bool active)
79
m_view->setDashActive(active);
64
m_manager->setDashActive(active);
68
DashDBus::alwaysFullScreen() const
70
return m_manager->dashAlwaysFullScreen();
83
74
DashDBus::activeLens() const
85
return m_view->activeLens();
76
return m_manager->dashActiveLens();
89
80
DashDBus::setActiveLens(QString activeLens)
91
m_view->setActiveLens(activeLens);
82
m_manager->setDashActiveLens(activeLens);
86
DashDBus::screen() const
88
return m_manager->dashScreen();