Re: [Rhythmbox-devel] How to add an entry to a source?
- From: Jannik Heller <scrawl baseoftrash de>
- To: Jonathan Matthew <jonathan d14n org>
- Cc: rhythmbox-devel gnome org
- Subject: Re: [Rhythmbox-devel] How to add an entry to a source?
- Date: Thu, 06 May 2010 16:22:19 +0200
Thanks, it works!
Next question: How do I add a context menu to the source? Here is my
current code, it's "inspired" by the jamendo code, but something seems
to be missing
popup_ui = """
<ui>
<popup name="DuplicateSourceViewPopup">
<menuitem name="DuplicateMarkNonDuplicate"
action="DuplicateMarkNonDuplicate"/>
<separator/>
<menuitem name="DuplicateMoveToTrash"
action="DuplicateMoveToTrash"/>
<menuitem name="DuplicateRemove" action="DuplicateRemove"/>
<separator/>
<menuitem name="PropertiesLibraryPopup" action="MusicProperties"/>
</popup>
</ui>
"""
manager = shell.get_player().get_property('ui-manager')
action = gtk.Action('DuplicateMarkNonDuplicate', _('Mark as
non-duplicate'),
_(""),
'gtk-ok')
#action.connect('activate', )
self.action_group = gtk.ActionGroup('DuplicateSourcePluginActions')
self.action_group.add_action(action)
action = gtk.Action('DuplicateMoveToTrash', _('Move file to trash'),
_(""),
'gtk-trash')
#action.connect('activate', )
self.action_group.add_action(action)
action = gtk.Action('DuplicateRemove', _('Remove from library'),
_(""),
'gtk-remove')
#action.connect('activate', )
self.action_group.add_action(action)
manager.insert_action_group(self.action_group, 0)
self.ui_id = manager.add_ui_from_string(popup_ui)
manager.ensure_update()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]