![]() |
Changing ambience favorites using dbus in qml
I'm trying to use dbus in qml to change the favorite ambience. I tried using the setFavorite method using the url to the ambience but it returns false. I used dbus monitor and found that the saveAttributes method is called when a favorite is changed in settings:
method call time=1532323566.490406 sender=:1.384 -> d estination=com.jolla.ambienced serial=27 path=/com/jo lla/ambienced; interface=com.jolla.ambienced; member= saveAttributes int32 1 int64 7 array [ dict entry( string "favorite" variant boolean true ) ] The last argument is an array of dicts, a{sv}, how can I send that using the typedcall method in qml? Thanks. |
Re: Changing ambience favorites using dbus in qml
This has already been partially answered but on TJC; https://together.jolla.com/question/...mbient-change/
Example (assumes you have "Flow" ambience installed and set as a favourite); Code:
dbus-send --session --dest=com.jolla.ambienced --type=method_call /com/jolla/ambienced com.jolla.ambienced.setAmbience string:"file:///usr/share/ambience/flow/flow.ambience" |
Re: Changing ambience favorites using dbus in qml
Quote:
|
Re: Changing ambience favorites using dbus in qml
Quote:
|
Re: Changing ambience favorites using dbus in qml
Quote:
Maybe something similar to this? Code:
var valueVariant = true; |
Re: Changing ambience favorites using dbus in qml
Not answering directly your question, but looking for ambience in /usr/share where all the qml files of Sailfish are stored, I found this file:
/usr/share/lipstick-jolla-home-qt5/powerkey/PowerKeyMenu.qml In which you can find the following line to remove from favorites: Quote:
It uses the object "AmbienceModel", that should come from the import Sailfish.Ambience. Some other files are related to the AmbienceModel too, which could give you some other examples. Hope this can help. |
Re: Changing ambience favorites using dbus in qml
Thanks for the responses. I've tried many different permutations including the one above but they don't work.
I initially did try using AmbienceModel but it kept giving me an qsqlerror about could not open database, out of memory. I don't think it is a genuine out of memory issue but actually because the ambience database is a priviliged one. That is why I tried to then use dbus. |
Re: Changing ambience favorites using dbus in qml
I can try to write qt code which you maybe could implement in your qml code or I could make a binary with parameter input which you could call from you qml code.
But this could take a bit because I am overloaded with jobs to get done. Sadly I can't "speak" qml. |
Re: Changing ambience favorites using dbus in qml
Quote:
|
Re: Changing ambience favorites using dbus in qml
Quote:
|
All times are GMT. The time now is 23:00. |
vBulletin® Version 3.8.8