restore dbus interface for dashboard
restore old feature from plasma1
This commit is contained in:
parent
449e659ded
commit
359dd09c5d
@ -11,12 +11,14 @@ set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
|
|||||||
|
|
||||||
find_package(Qt5Qml REQUIRED)
|
find_package(Qt5Qml REQUIRED)
|
||||||
find_package(Qt5Quick REQUIRED)
|
find_package(Qt5Quick REQUIRED)
|
||||||
|
find_package(Qt5DBus REQUIRED)
|
||||||
find_package(Qt5Script REQUIRED)
|
find_package(Qt5Script REQUIRED)
|
||||||
find_package(KF5CoreAddons REQUIRED)
|
find_package(KF5CoreAddons REQUIRED)
|
||||||
find_package(KF5Crash REQUIRED)
|
find_package(KF5Crash REQUIRED)
|
||||||
find_package(KF5Solid REQUIRED)
|
find_package(KF5Solid REQUIRED)
|
||||||
find_package(KF5Activities REQUIRED)
|
find_package(KF5Activities REQUIRED)
|
||||||
|
|
||||||
|
|
||||||
set(scripting_SRC
|
set(scripting_SRC
|
||||||
scripting/appinterface.cpp
|
scripting/appinterface.cpp
|
||||||
scripting/applet.cpp
|
scripting/applet.cpp
|
||||||
@ -31,6 +33,9 @@ set(scripting_SRC
|
|||||||
scripting/widget.cpp
|
scripting/widget.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
set(plasmashell_dbusXML dbus/org.kde.PlasmaShell.xml)
|
||||||
|
qt5_add_dbus_adaptor(scripting_SRC ${plasmashell_dbusXML} shellcorona.h ShellCorona plasmashelladaptor)
|
||||||
|
|
||||||
add_executable(plasma-shell
|
add_executable(plasma-shell
|
||||||
activity.cpp
|
activity.cpp
|
||||||
main.cpp
|
main.cpp
|
||||||
@ -52,6 +57,7 @@ add_executable(plasma-shell
|
|||||||
target_link_libraries(plasma-shell
|
target_link_libraries(plasma-shell
|
||||||
Qt5::Quick
|
Qt5::Quick
|
||||||
Qt5::Qml
|
Qt5::Qml
|
||||||
|
Qt5::DBus
|
||||||
KF5::KIOCore
|
KF5::KIOCore
|
||||||
KF5::WindowSystem
|
KF5::WindowSystem
|
||||||
KF5::CoreAddons
|
KF5::CoreAddons
|
||||||
@ -77,5 +83,6 @@ endif()
|
|||||||
|
|
||||||
install(TARGETS plasma-shell ${INSTALL_TARGETS_DEFAULT_ARGS})
|
install(TARGETS plasma-shell ${INSTALL_TARGETS_DEFAULT_ARGS})
|
||||||
install(FILES plasma-shell.desktop DESTINATION ${AUTOSTART_INSTALL_DIR})
|
install(FILES plasma-shell.desktop DESTINATION ${AUTOSTART_INSTALL_DIR})
|
||||||
|
install( FILES dbus/org.kde.PlasmaShell.xml DESTINATION ${DBUS_INTERFACES_INSTALL_DIR} )
|
||||||
|
|
||||||
add_subdirectory(widgetexplorer)
|
add_subdirectory(widgetexplorer)
|
||||||
|
15
src/shell/dbus/org.kde.PlasmaShell.xml
Normal file
15
src/shell/dbus/org.kde.PlasmaShell.xml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
|
||||||
|
<node>
|
||||||
|
<interface name="org.kde.PlasmaShell">
|
||||||
|
<method name="toggleDashboard">
|
||||||
|
</method>
|
||||||
|
<method name="setDashboardShown">
|
||||||
|
<arg name="show" type="b" direction="in"/>
|
||||||
|
</method>
|
||||||
|
<method name="showInteractiveConsole">
|
||||||
|
</method>
|
||||||
|
<method name="loadScriptInInteractiveConsole">
|
||||||
|
<arg name="script" type="s" direction="in"/>
|
||||||
|
</method>
|
||||||
|
</interface>
|
||||||
|
</node>
|
@ -32,7 +32,8 @@
|
|||||||
DesktopView::DesktopView(ShellCorona *corona, QScreen *screen)
|
DesktopView::DesktopView(ShellCorona *corona, QScreen *screen)
|
||||||
: PlasmaQuick::View(corona, 0),
|
: PlasmaQuick::View(corona, 0),
|
||||||
m_stayBehind(false),
|
m_stayBehind(false),
|
||||||
m_fillScreen(false)
|
m_fillScreen(false),
|
||||||
|
m_dashboardShown(false)
|
||||||
{
|
{
|
||||||
setScreen(screen);
|
setScreen(screen);
|
||||||
engine()->rootContext()->setContextProperty("desktop", this);
|
engine()->rootContext()->setContextProperty("desktop", this);
|
||||||
@ -116,6 +117,13 @@ void DesktopView::setDashboardShown(bool shown)
|
|||||||
wpGraphicObject->setProperty("opacity", 1);
|
wpGraphicObject->setProperty("opacity", 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_dashboardShown = shown;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool DesktopView::isDashboardShown() const
|
||||||
|
{
|
||||||
|
return m_dashboardShown;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -43,6 +43,7 @@ public:
|
|||||||
void setFillScreen(bool fillScreen);
|
void setFillScreen(bool fillScreen);
|
||||||
|
|
||||||
void setDashboardShown(bool shown);
|
void setDashboardShown(bool shown);
|
||||||
|
bool isDashboardShown() const;
|
||||||
|
|
||||||
protected Q_SLOTS:
|
protected Q_SLOTS:
|
||||||
/**
|
/**
|
||||||
@ -58,6 +59,7 @@ private:
|
|||||||
QPointer<PlasmaQuick::ConfigView> m_configView;
|
QPointer<PlasmaQuick::ConfigView> m_configView;
|
||||||
bool m_stayBehind : 1;
|
bool m_stayBehind : 1;
|
||||||
bool m_fillScreen : 1;
|
bool m_fillScreen : 1;
|
||||||
|
bool m_dashboardShown : 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DESKTOVIEW_H
|
#endif // DESKTOVIEW_H
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
#include <QDesktopWidget>
|
#include <QDesktopWidget>
|
||||||
#include <QQmlContext>
|
#include <QQmlContext>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
#include <QDBusConnection>
|
||||||
|
|
||||||
#include <kactioncollection.h>
|
#include <kactioncollection.h>
|
||||||
#include <klocalizedstring.h>
|
#include <klocalizedstring.h>
|
||||||
@ -48,6 +49,8 @@
|
|||||||
#include "shellpluginloader.h"
|
#include "shellpluginloader.h"
|
||||||
#include "osd.h"
|
#include "osd.h"
|
||||||
|
|
||||||
|
#include "plasmashelladaptor.h"
|
||||||
|
|
||||||
static const int s_configSyncDelay = 10000; // 10 seconds
|
static const int s_configSyncDelay = 10000; // 10 seconds
|
||||||
|
|
||||||
class ShellCorona::Private {
|
class ShellCorona::Private {
|
||||||
@ -99,6 +102,14 @@ ShellCorona::ShellCorona(QObject *parent)
|
|||||||
{
|
{
|
||||||
d->desktopDefaultsConfig = KConfigGroup(KSharedConfig::openConfig(package().filePath("defaults")), "Desktop");
|
d->desktopDefaultsConfig = KConfigGroup(KSharedConfig::openConfig(package().filePath("defaults")), "Desktop");
|
||||||
|
|
||||||
|
//new PlasmaShellAdaptor(this);
|
||||||
|
|
||||||
|
new PlasmaShellAdaptor(this);
|
||||||
|
|
||||||
|
QDBusConnection dbus = QDBusConnection::sessionBus();
|
||||||
|
dbus.registerObject(QStringLiteral("/PlasmaShell"), this);
|
||||||
|
|
||||||
|
|
||||||
// Look for theme config in plasmarc, if it isn't configured, take the theme from the
|
// Look for theme config in plasmarc, if it isn't configured, take the theme from the
|
||||||
// LookAndFeel package, if either is set, change the default theme
|
// LookAndFeel package, if either is set, change the default theme
|
||||||
|
|
||||||
@ -456,6 +467,23 @@ void ShellCorona::setDashboardShown(bool show)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ShellCorona::toggleDashboard()
|
||||||
|
{
|
||||||
|
foreach (DesktopView *view, d->views) {
|
||||||
|
view->setDashboardShown(!view->isDashboardShown());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ShellCorona::showInteractiveConsole()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void ShellCorona::loadScriptInInteractiveConsole(const QString &script)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void ShellCorona::checkActivities()
|
void ShellCorona::checkActivities()
|
||||||
{
|
{
|
||||||
KActivities::Consumer::ServiceStatus status = d->activityController->serviceStatus();
|
KActivities::Consumer::ServiceStatus status = d->activityController->serviceStatus();
|
||||||
|
@ -45,6 +45,7 @@ class ShellCorona : public Plasma::Corona
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY(QString shell READ shell WRITE setShell)
|
Q_PROPERTY(QString shell READ shell WRITE setShell)
|
||||||
|
Q_CLASSINFO("D-Bus Interface", "org.kde.PlasmaShell")
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ShellCorona(QObject * parent = 0);
|
explicit ShellCorona(QObject * parent = 0);
|
||||||
@ -84,6 +85,12 @@ public Q_SLOTS:
|
|||||||
*/
|
*/
|
||||||
QString shell() const;
|
QString shell() const;
|
||||||
|
|
||||||
|
///DBUS methods
|
||||||
|
void toggleDashboard();
|
||||||
|
void setDashboardShown(bool show);
|
||||||
|
void showInteractiveConsole();
|
||||||
|
void loadScriptInInteractiveConsole(const QString &script);
|
||||||
|
|
||||||
protected Q_SLOTS:
|
protected Q_SLOTS:
|
||||||
void screenAdded(QScreen *screen);
|
void screenAdded(QScreen *screen);
|
||||||
void screenRemoved(QObject *screen);
|
void screenRemoved(QObject *screen);
|
||||||
@ -116,7 +123,6 @@ private Q_SLOTS:
|
|||||||
void toggleWidgetExplorer();
|
void toggleWidgetExplorer();
|
||||||
void toggleActivityManager();
|
void toggleActivityManager();
|
||||||
void syncAppConfig();
|
void syncAppConfig();
|
||||||
void setDashboardShown(bool show);
|
|
||||||
void checkActivities();
|
void checkActivities();
|
||||||
void currentActivityChanged(const QString &newActivity);
|
void currentActivityChanged(const QString &newActivity);
|
||||||
void activityAdded(const QString &id);
|
void activityAdded(const QString &id);
|
||||||
|
Loading…
Reference in New Issue
Block a user