Where to start

John (J5) Palmieri johnp at redhat.com
Sat Mar 26 05:56:01 PST 2005


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.

> 
> 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. 

> 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.

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.
  
-- 



More information about the dbus mailing list