Re: [Rhythmbox-devel] How to import RBIRadioSource reference



Am Montag, den 14.12.2009, 11:55 +1000 schrieb Jonathan Matthew:
> On Mon, Dec 7, 2009 at 12:15 AM, Jannik Heller <scrawl baseoftrash de> wrote:
> > Hi,
> >
> > I want to get a reference to the "Radio" source in my plugin. I want to
> > use this code:
> >
> > for group in shell.props.sourcelist_model:
> >      for source in group.iterchildren():
> >         for props in source:
> >             if isinstance(props, RBIRadioSource):
> >                 radio_source = props
> >
> > However, I get
> >
> > NameError: global name 'RBIRadioSource' is not defined
> >
> > So how to import the RBIRadioSource that I can access it? Or does
> > someone know another way to get the Radio source?
> 
> You'd have to check the source name or maybe its entry type.
That's what I tried at first. But it seems the "name" Property is
translated in the user's language, so that won't work with all
languages. Currently I'm using a workaround, importing the Rhythmbox
translation file and comparing the Radio translation to the name
property.
>  There
> isn't much you can do with the source object, though. What does your
> plugin do?
It's a radio recording plugin with streamripper. I want to have a
toolbar button that changes it "active" status, depending on the
recording status of the current selection in the source, and therefore I
need the radio source.



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