Skip to content

Expose part actions in KParts::MainWindow DBus interface

Nicolas Fella requested to merge work/partactiondbus into master

KMainWindow exposes the actions known to KXmlGui in the org.kde.KMainWindow DBus interface. This allows to trigger actions from the outside via DBus which allows for all kinds of scripting/automation.

Some apps like Okular have their main functionality implemented in a KPart and the app is just a thin wrapper around that. In this case only the actions from the wrapper window are accessible via DBus and the actions defined by the part are not, severly limiting the usefulness of the DBus API.

This patch adds the same set of functions that are available on the org.kde.KMainWindow to the interface exposed by the KParts::MainWindow class to query and interact with the part actions.

This enables calls like qdbus org.kde.okular-$(pidof okular) /okular/okular__Shell_1 org.kde.okular.KParts.MainWindow.activatePartAction go_next which weren't previously possible.

Merge request reports