Re: better way to detect when rhythmbox has started?
David Mohammed <[email protected]> Wed, 29 Jul 2015 13:24:02 +0100
| Newsgroups | gmane.comp.gnome.apps.rhythmbox.devel |
|---|---|
| Message-ID | <CAMwPnjdND52yc-0iQUdtJHNyUXkY2RkyqkB9omPCSwXt60cJ=Q@mail.gmail.com> |
--===============7707177722838638169== Content-Type: multipart/alternative; boundary=001a11378f348106ed051c02a9f9 --001a11378f348106ed051c02a9f9 Content-Type: text/plain; charset=UTF-8 thanks Jonathan for the reply, Re "Such as?" - an example is my alternative-toolbar plugin where some parts of the GUI are not available to be modified until the database has been loaded - i.e.. I'm fiddling with what parts of the source-toolbar should be shown. Coverart Browser has similar requirements to add to the interface once the database has been loaded. The suggestion to look at the playlists property looks good. Also looking at the "selected_page" property on the shell seems to also work for what I want. thanks again - very useful advice. On 26 July 2015 at 10:34, Jonathan Matthew <[email protected]> wrote: > On Sat, May 23, 2015 at 10:56:34AM +0100, David Mohammed wrote: > > Several of my plugins need to perform some processing after rhythmbox has > > fully started up (i.e. the database has been fully loaded). > > Such as? > > > > > Currently I'm using the load-complete signal on RB.RhythmDB. > > > > However - the obvious issue is that when a user first activates a plugin, > > the load-complete signal has long ago been fired. > > > > Thus I'm using a hack - wait for 3 seconds and if load-complete has not > > been detected, then do the processing anyway. > > > > Thus to my question - is there a better way to detect when rhythmbox has > > started? > > I'm a bit reluctant to call this a better way, but once the database is > loaded, > the display page group for playlists is also set to loaded. Since that's > a gobject > property on something you can easily find (RB_DISPLAY_PAGE_GROUP_PLAYLISTS > from c, > RB.DisplayPageGroup.get_by_id("playlists") in python, probably) you can > use that as > a proxy for determining whether the database is loaded. > > > > > i.e. some kind of property that maybe I can regulary poll for to see if > it > > has been set post load-complete? > > Properly implemented GObject properties also emit a notify::propertyname > signal > on the containing object when they're changed, so you don't need to poll. > > --001a11378f348106ed051c02a9f9 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div><div><div>thanks Jonathan for the reply,<br><br></div= >=C2=A0Re "Such as?" - an example is my alternative-toolbar plugi= n where some parts of the GUI are not available to be modified until the da= tabase has been loaded - i.e.. I'm fiddling with what parts of the sour= ce-toolbar should be shown.=C2=A0 Coverart Browser has similar requirements= to add to the interface once the database has been loaded.<br><br></div>Th= e suggestion to look at the playlists property looks good.=C2=A0 Also looki= ng at the "selected_page" property on the shell seems to also wor= k for what I want.<br><br></div>thanks again - very useful advice.<br></div= ><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">On 26 July 2015 = at 10:34, Jonathan Matthew <span dir=3D"ltr"><<a href=3D"mailto:jonathan= @d14n.org" target=3D"_blank">[email protected]</a>></span> wrote:<br><bl= ockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #= ccc solid;padding-left:1ex"><span class=3D"">On Sat, May 23, 2015 at 10:56:= 34AM +0100, David Mohammed wrote:<br> > Several of my plugins need to perform some processing after rhythmbox = has<br> > fully started up (i.e. the database has been fully loaded).<br> <br> </span>Such as?<br> <span class=3D""><br> ><br> > Currently I'm using the load-complete signal=C2=A0 on RB.RhythmDB.= <br> ><br> > However - the obvious issue is that when a user first activates a plug= in,<br> > the load-complete signal has long ago been fired.<br> ><br> > Thus I'm using a hack - wait for 3 seconds and if load-complete ha= s not<br> > been detected, then do the processing anyway.<br> ><br> > Thus to my question - is there a better way to detect when rhythmbox h= as<br> > started?<br> <br> </span>I'm a bit reluctant to call this a better way, but once the data= base is loaded,<br> the display page group for playlists is also set to loaded.=C2=A0 Since tha= t's a gobject<br> property on something you can easily find (RB_DISPLAY_PAGE_GROUP_PLAYLISTS = from c,<br> RB.DisplayPageGroup.get_by_id("playlists") in python, probably) y= ou can use that as<br> a proxy for determining whether the database is loaded.<br> <span class=3D""><br> ><br> > i.e. some kind of property that maybe I can regulary poll for to see i= f it<br> > has been set post load-complete?<br> <br> </span>Properly implemented GObject properties also emit a notify::property= name signal<br> on the containing object when they're changed, so you don't need to= poll.<br> <br> </blockquote></div><br></div> --001a11378f348106ed051c02a9f9-- --===============7707177722838638169== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ rhythmbox-devel mailing list [email protected] https://mail.gnome.org/mailman/listinfo/rhythmbox-devel --===============7707177722838638169==--