expose contextMenu data through dbus

pull/2/head
Michail Vourlakos 7 years ago
parent 028f2c5fe8
commit e07f6e207e

@ -13,5 +13,8 @@
<method name="showSettingsWindow">
<arg name="page" type="i" direction="in"/>
</method>
<method name="contextMenuData">
<arg name="data" type="as" direction="out"/>
</method>
</interface>
</node>

@ -861,6 +861,24 @@ void DockCorona::showSettingsWindow(int page)
m_layoutManager->showLatteSettingsDialog(p);
}
QStringList DockCorona::contextMenuData()
{
QStringList data;
data << QString::number((int)m_layoutManager->memoryUsage());
data << m_layoutManager->currentLayoutName();
foreach (auto layoutName, m_layoutManager->menuLayouts()) {
if (m_layoutManager->activeLayout(layoutName)) {
data << QString("1," + layoutName);
} else {
data << QString("0," + layoutName);
}
}
return data;
}
inline void DockCorona::qmlRegisterTypes() const
{
qmlRegisterType<QScreen>();

@ -104,8 +104,10 @@ public:
KWayland::Client::PlasmaShell *waylandDockCoronaInterface() const;
//! these functions are used from context menu through containmentactions
void switchToLayout(QString layout);
void showSettingsWindow(int page);
QStringList contextMenuData();
public slots:
void aboutApplication();

Loading…
Cancel
Save