Re: [Rhythmbox-devel] rb applet

Colin Walters wrote:
> Cool!  Thanks for working on this.  I haven't been able to actually get
> it to run, mainly because I can't figure out how to run applets built in
> a different prefix than my main GNOME installation.

Maybe something like:
bonobo-activation-sysconf --add-directory="/usr/local/bonobo-servers"

> Right...I think what you really want is for the applet buttons to match
> the rb buttons exactly.  So that would probably mean hooking a signal
> into rb-shell-player.c:rb_shell_player_sync_buttons.  You could have it
> pass a structure back like
> struct RBPlayButtonState 
> {
>     gboolean prev_enabled;
>     enum {
>     } state;
>     gboolean next_enabled;
> }
> Or maybe alternatively you could pass this as three parameters instead
> of using a structure.   Anyways after doing that, then add a handler for
> this signal in rb-shell.c, which will then emit it via Bonobo.  Or
> something like that.

Yes.  That sounds like a good approach.  I will try to implement this as 
soon as I learn a bit more about bonobo.  Maybe someone can give some 

>>* When the applet is added to the panel, RB will restart after it is exited.
> Hm, I think you might be able to ask bonobo-activation whether rb is
> running before calling a method on it.  

Right.  I have added this now.  However, I'm seeing some strange 
behavior.  When I query bonobo from the applet it only reports servers 
that were started before the applet was started and doesn't report 
changes.  For example when I start RB and then add the applet to the 
panel a bonobo query reports one RB server active.  When I exit RB 
bonobo still reports one server active.  On the other hand, if I add the 
applet to the panel and then start RB then it does not report an active 
RB server.

The command line bonobo-activation-run-query 
"((repo_ids.has('IDL:GNOME/Rhythmbox:1.0')) AND (_active == TRUE))" 
reports the correct information.

I am using the following in the applet:

	CORBA_exception_init (&ev);
	result = bonobo_activation_query
		("((repo_ids.has('IDL:GNOME/Rhythmbox:1.0')) AND (_active == TRUE))", 
NULL, &ev);
	if (ev._major != CORBA_NO_EXCEPTION) {
	} else if (result != NULL) {
		g_message ("number of results: %d\n", result->_length);
		CORBA_free (result);
	CORBA_exception_free (&ev);

I noticed that bonobo_activation_query does some caching.  Could this be 
related to that?  Any ideas?

> In general it looks fairly good.  The only issues I really have are that
> it doesn't compile with -Wall -Werror, and the code is fairly
> procedural, but in rb we use a highly GObject-oriented style.  You don't
> have to do this right away, but using GObject makes things a lot more
> understandable, even if it is a little bit of a pain to make new
> objects.

I have fixed the warnings.  I think I would like to get the applet 
working a bit better with the current design, get it checked in, and 
then redesign it, if that is ok.

> Oh and would be nice if you could add an arch-tag: thing to
> ... 

How about?
arch-tag: Implementation of Rhythmbox panel applet

> So anyways, I'd definitely be happy if you committed this to CVS, after
> fixing the -Wall -Werror issue.

Cool. I will as soon as I get the pause/play state working a bit better. 
  So I can add these to CVS directly and not cause any problems with arch?


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]