[maemo-developers] Bringing up the accounts UI using DBus
From: Jamie Thompson lists.maemo-developers at jamie-thompson.co.ukDate: Sun Jul 10 02:30:42 EEST 2011
- Previous message: I am attempting to clone the mce libvibrator.so plugin, help wanted
- Next message: Bringing up the accounts UI using DBus
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I'm trying to bring up the Accounts UI using DBus in a Qt application:
> const char * NOKIA_SERVICE_ACCOUNTS_UI("com.nokia.AccountsUI");
> const char * NOKIA_PATH_ACCOUNTS_UI("/com/nokia/AccountsUI");
> const char * NOKIA_IFACE_ACCOUNTS_UI("com.nokia.Accounts");
>
> QDBusInterface nokiaAccountsUI(NOKIA_SERVICE_ACCOUNTS_UI, NOKIA_PATH_ACCOUNTS_UI, NOKIA_IFACE_ACCOUNTS_UI);
> if (nokiaAccountsUI.isValid())
> {
> QDBusReply<void> showAccountsUIReply = nokiaAccountsUI.call("OpenAccountsList", (uint)winId());
>
> if(!showAccountsUIReply.isValid())
> qDebug() << showAccountsUIReply.error().message();
> }
> else
> qDebug() << nokiaAccountsUI.lastError().message();
...but it doesn't seem to work properly.
I'm basing this on the command:
> dbus-send --print-reply --dest=com.nokia.AccountsUI /com/nokia/AccountsUI com.nokia.Accounts.OpenAccountsList uint32:0
...which works perfectly every time.
The first time I create the QDBusInterface, it returns an invalid object
(isValid() == false), and the error message is an empty string.
In the meantime, DBus has activated the rtcom-accounts-ui service, and
dbus-monitor shows introspection going on (which is how I know the
argument is the parent window xid), suggesting that Qt is preparing the
proxy and caching it somewhere (can I not get Qt to wait for the service
to start without bodging this myself?).
The second call (when the rtcom-accounts-ui process is already running)
succeeds, and the UI is displayed. When the UI is closed, after about a
minute or so the rtcom-accounts-ui process terminates, as is reasonable.
However, if I then try to create an instance of the interface again, it
all falls apart, and I get informed:
> "Could not get owner of name 'com.nokia.AccountsUI': no such name"
...and DBus makes no attempt to start the service.
Once I restart my application, it works again. So I basically get one
try per instance...which is clearly not acceptable.
What on earth am I doing wrong here?
- Jamie
- Previous message: I am attempting to clone the mce libvibrator.so plugin, help wanted
- Next message: Bringing up the accounts UI using DBus
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
