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 idea would be to have the entry view hidden until it has been
downloaded at least once, and have some kind of "MagnaTune intro"
displayed instead.

Displaying an empty track list probably isn't useful, so maybe we could
have something displayed instead which said what MagnaTune was, a
download progress indicator, and a "continue to track list" button
(which would only be enabled once the download had finished).


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

For Python plugins, it's easier to embed the GtkUIManager XML directly
into the .py file, see plugins/pythonconsole/pythonconsole.py for an
example of how to do it. You'd probably want something like the
following (which I've based on BrowserSourceViewPopup)

<ui>
  <popup name="BrowserSourceViewPopup">
    <menuitem name="AddToQueueLibraryPopup" action="AddToQueue"/>
    <menuitem name="MagnatunePurchaseTrack" action="MagnatunePurchase"/>
    <separator/>
    <menuitem name="BrowseGenreLibraryPopup"
action="BrowserSrcChooseGenre"/>
    <menuitem name="BrowseArtistLibraryPopup"
action="BrowserSrcChooseArtist"/>
    <menuitem name="BrowseAlbumLibraryPopup"
action="BrowserSrcChooseAlbum"/>
    <separator/>
    <menuitem name="PropertiesLibraryPopup" action="MusicProperties"/>
  </popup>
</ui>

The "MagnatunePurchase" action would get the list of selected tracks
from the entry view, and then do the purchasing stuff.



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

The int is the 0 that you passed to connect_object(), and the boolean is
"over_entry" which indicates whether the context menu is for an entry,
or a click in "empty space". Basically if it's false you pop up the same
menu you would for the impl_show_popup virtual function, and if it's
true you pop up the "track context menu".


Cheers,

James "Doc" Livingston
-- 
In God we Trust. All others must submit an X.509 certificate.




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