Re: [Rhythmbox-devel] Magnatune catalog/purchasing plugin

On Fri, 2006-06-23 at 16:16 -0700, Adam Zimmerman wrote:
> I'm not sure whether I want to keep it so that the source is added to as
> song_info.xml is being downloaded. It seems like it takes a long time to
> add all the tracks (though it may just be my perception as to whether
> it's slower than adding after downloading), but on the other hand, the
> source doesn't sit empty for 2 minutes.

One option would be to hide entry entry view while this is happening,
and have some "downloading music store info, please wait screen

Something like that may be useful anyway, if we wanted/needed to show
some info about what MagnaTune is, tell people to be careful with their
CC details, etc.

> I'm not quite certain how to associate an action with a popup menu. I
> can see that I need to add some glade bits to rhythmbox-ui.xml and then
> call source.show_popup("mygladestuff") in the show_popup callback,
> right? So how do I associate a method call with that popup menu item?
> And how do I pass arguments to it? Is it like gobject.add_idle, where I
> just add arguments after the method?

Take a look at plugins/pythonconsole/, it adds a menu
item to show the console. The only real difference is the UI data, e.g.:

  <popup name="MagnatuneSourceViewPopup">
    <menuitem name="AddToQueueLibraryPopup" action="AddToQueue"/>
    <menuitem name="MagnaTuneDownloadPopup" action="MagnaTuneDownload"/>
    <menuitem name="BrowseGenreLibraryPopup"
    <menuitem name="BrowseArtistLibraryPopup"
    <menuitem name="BrowseAlbumLibraryPopup"
    <menuitem name="PropertiesLibraryPopup" action="MusicProperties"/>

Then add an action "MagnaTuneDownload".

> PS: does anyone know what the int and bool passed to the show_popup
> callback are?

With the current code:
  ev.connect_object("show_popup", self.show_popup_cb, self.source, 0)

The int is the number 0 that you're passing, and the boolean is:
true = right mouse button clicked on an entry, or menu button pressed
false = rmb clicked on "empty space" in the entry view

Usually you'd treat the case of it being false by showing the same menu
as if you'd right-clicked on the source in the source list.

I've got a patch for python entry-data working, and it's on bug
345795[0]. With that applied, you should be able to do
"['sku'] = whatever" for any entry whose entry-type was
registered from Python.

The only issue I've noticed is overhead - it created a dictionary for
every entry that you have accessed the "data" attribute on. For the
number of tracks currently in MagnaTune, that would mean just under 1Mb
of overhead.

Another option would be to create you own diction for SKUs, and then do
"sku_dict[entry] = whatever". That would only need one dictionary,
instead of 6000.



James "Doc" Livingston
If USENET is anarchy, IRC is a paranoid schizophrenic after 6 days on
speed. -- Chris "Saundo" Saunderson in asr.

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