Where to start

Tony Houghton h at realh.co.uk
Sat Mar 26 07:21:10 PST 2005


In <1111845362.15388.32.camel at localhost.localdomain>, you wrote:

> On Sat, 2005-03-26 at 13:25 +0000, Tony Houghton wrote:
> 
> > I'm writing my program as a main application and a separate config
> > applet. The capplet needs to be able to send messages to multiple
> > instances of the main application.
> >  I know gconf would make that easier
> > on the face of it, but using my own storage scheme makes it easier to
> > manage the storage of arbitrary named profiles. Also, the main program
> > needs to be able to start the capplet or, if it's running already, send
> > it a message to start configuring a set of options.
> 
> You can use dbus activation to start services.

How can I find out more about that? It's yet another aspect of dbus I
can't find documentation for.

> > 
> > I guess I need to run my own dbus service, but how? Is it as simple as
> > calling dbus_g_proxy_new_for_name in each instance of the application
> > and in the capplet, and calling dbus_g_proxy_send automatically sends
> > the message to all other programs with a proxy for the same name?
> 
> What version of d-bus are you using?  The glib bindings have changed
> tremendously in CVS. 

0.22 in Debian unstable.

> > Or do I have to explicitly start the service name? I can't see how to do
> > that. And if I do, is it OK just to start it in the capplet, while the
> > main instances only have to register their proxy once and can still
> > continue to receive messages OK, no matter if the service is stopped and
> > restarted?
> 
> This is a complicated issue.  For your use I would suspect that you
> would request a name for your capplet and not for your multiple instance
> app since d-bus names are unique on a bus.  You would then have you app
> subscribe to signals from the capplet.

Good, I was sort of hoping it would work that way. But how does the
capplet request a name? It doesn't seem to be supported in 0.22's glib
bindings. And can I simply hook each instance up to that name with a
DBusGProxy without worrying about whether the capplet gets stopped and
restarted, or will all the instances have to keep track of what owns the
name? If so, how is that ownership transferred?

> If you are going to use the dbus from CVS or the one I should be
> releasing soon (0.32) which I highly recommend there should be some
> sample glib binding code in the tarball.

It would be nice to be able to just use that if it's improved, but I
think I need to support 0.22 as well to make sure my application is more
accessible. I wouldn't be surprised if 0.22 gets frozen into Debian
sarge (the next stable). Does 0.22 include the activation stuff?

-- 
TH * http://www.realh.co.uk


More information about the dbus mailing list