![]() Registered Member ![]()
|
Greetings, this is my first post.
My problem is that I want to add various global shortcuts to my plasmoid written in QML, and also a configuration UI KShorcutsEditor in order to configure my shortcuts to my liking. Try it with KCM module written in C++ and export the plasmoid as a [X-Plasma-ConfigPlugins] but did not work as wanted. Because global shortcuts only work if open UI settings, but when I close it no longer work. ![]() My question is how it's done for global shortcuts to work even KCM module is closed?. Thanks for your help, and sorry for my ugly English.
|
![]() Administrator ![]()
|
While i'm not familiar with how shortcut configuration is handled in other applications, my guess would be you need to have the KAction and KActionCollection instances exist for the lifetime of your applet. Also make sure you handle the import and export configuration actions - otherwise the changes won't be preserved I suspect.
See http://lxr.kde.org/source/kde/applicati ... temain.cpp for instance. actionCollection() is a function provided by the KParts class KWrite derives from - if you create your action collection at the applet level and then make it accessible to the control module you should be fine.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
It was what I suspected from the beginning, but then now I have a question more, as do a global action in QML?. I have read many times the documentation for QML and Plasma Runtime, although I create these shortcuts are not global. See it http://qt-project.org/doc/qt-4.8/qdecla ... l#qmlfocus In Python for example is easy because I have access to almost all KDE API (action collection). But it's not the same with QML, for example I can not use the KAction Class. Not if I'm right, but I can not create global shortcuts for a Plasmoid written in QML 1.1. |
![]() Administrator ![]()
|
To my knowledge, QAction has no support for interacting with the KDE infrastructure necessary to support global shortcuts. I'd suggest verifying this through plasma-devel@kde.org - however I suspect it is intended that applet's using the Plasma JS / QML interfaces are not allowed to create global shortcuts.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
Thanks a lot. Already wrote to the mailing list plasma-devel, but still do not give response. For now I have solved my problem through a Plasma Engine, it may not be the most elegant solution but it works. :/ (Of course with limitations).
|
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]