Registered Member
|
Hello,
i am currently playing with d-bus and the systemsettings module input actions. My task is to define a keyboard shortcut that opens a new kmail composer window to directly write a new mail. Yes, i know, that can be done via simple kmail --composer, but i'd like to learn to do this via d-bus for future purposes. My Problem is, that i don't know how to call the method correctly from inside the input actions module or via qdbus. As i found out, the method path is something like this:
If i use qdbusviewer this call opens a new composer window as expected. But if i simply use qdbus and call this via command line, i get nothing back. I found out, the method newMessage returns a so called object path. Same is, if i use the input actions module. Still nothing appears or happens. So my question is, how to call this d-bus method correctly from inside the input actions module of systemsettings and/or from qdbus? cu |
KDE Developer
|
newMessage seems to create a composer in a hidden state. Try openComposer instead.
Cheers, _
anda_skoa, proud to be a member of KDE forums since 2008-Oct.
|
Registered Member
|
Thanks for response. I'd really like to test the newComposer method and it works well with qdbusviewer but i have a problem with it
This method requires an array/QStringList as parameter 8 and 9. I dont know how to apply this to the command line with qdbus. It is not "" or array or None. I found nothing on the web on this. Do you know how to apply these parameters? cu |
KDE Developer
|
Right.
I currently don't have the sources of qdbus and its documentation is non existant. You can, however, use the dbus-send command instead:
Cheers, _
anda_skoa, proud to be a member of KDE forums since 2008-Oct.
|
Registered Member
|
Yes, thanks, that works.
But I'd like to avoid two syntax types and the one from dbus-send is not accepted by the input actions module from systemsettings. And usage of this was my primary goal cu |
KDE Developer
|
You are out of luck then.
I figured out how to do lists with qdbus, but unfortunately it tries to invoke one of the other variants of openComposer (there are three) thus resulting in an error about mismatching number of arguments. dbus-send works because it does not do any introspection, it just builds the message and sends it. The receiver then decides what to do with it. If you ever need it for something else, string list for qdbus work like this
Cheers, _
anda_skoa, proud to be a member of KDE forums since 2008-Oct.
|
Registered Member
|
Ah, okay.
so dbus-send has to do it as command in input actions module of systemsettings! I will write a small bug report to clear the situation. Thank you very much! You helped me a lot. cu |
Registered Member
|
Was this ever resolved? I've tried with both newMessage and with openComposer and I am not getting anywhere. However this is a bit beyond me so I figured I would ask here, even if it is an older thread.
Here is my settings in Input Actions:
I have also tried changing things to lowercase as I've read that matters for the Remote Object; I have also used Function as this without success:
|
Registered Member
|
I'm not sure about your exact requirements, but something like this works for me:
Remote application: org.kde.kmail Remote object: /KMail Function: openComposer Arguments: "to" "cc" "bcc" "subject" "body" false The number of arguments must be the same or it won't work - but you can use empty strings. Hope this helps. |
Registered Member
|
Thank you for the reply, onety-three. I have it working with this:
Why does it not work when I include the remaining three parts that are listed in QDBus Browser (messageFile, attachmentPaths, customHeaders) ? That right there makes the Arguments not line up as it says they should. Thanks again! |
Administrator
|
This is possibly due to a bug in QDBus, which causes it to only use the first item that matches the function you have specified rather than other, overloaded items.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], q.ignora, watchstar