Merge lp:~dobey/rhythmbox-ubuntuone/oh-a-store into lp:rhythmbox-ubuntuone

Proposed by dobey
Status: Merged
Approved by: dobey
Approved revision: 108
Merged at revision: 107
Proposed branch: lp:~dobey/rhythmbox-ubuntuone/oh-a-store
Merge into: lp:rhythmbox-ubuntuone
Diff against target: 132 lines (+22/-25)
3 files modified
setup.py (+0/-1)
ubuntuone/MusicStoreWidget.py (+16/-18)
ubuntuone/ubuntuone.py (+6/-6)
To merge this branch: bzr merge lp:~dobey/rhythmbox-ubuntuone/oh-a-store
Reviewer Review Type Date Requested Status
Roberto Alsina (community) Approve
Manuel de la Peña (community) Approve
Review via email: mp+90551@code.launchpad.net

Commit message

Use the new UbuntuOneUI library for a gtk+ 3.0 based plug-in

Description of the change

This is a fully working Ubuntu One plug-in for Rhythmbox 3.0. It requires lp:~dobey/libubuntuone/split-ui-lib to work. To test you can do the following, inside a branch of lp:~dobey/rhythmbox-ubuntuone/oh-a-store:

bzr branch lp:~dobey/libubuntuone/split-ui-lib
(cd split-ui-lib && ./autogen.sh && make U1_JAVASCRIPT_DIR=`pwd`/data)
./setup.py build
mkdir -p ~/.local/share/rhythmbox/plugins
cp -a ubuntuone ~/.local/share/rhythmbox/plugins
cp build/lib/rhythmbox/plugins/ubuntuone/ubuntuone.plugin ~/.local/share/rhythmbox/plugins/ubuntuone/
LD_PRELOAD=`pwd`/split-ui-lib/libubuntuoneui/.libs/libubuntuoneui-3.0.so.1.0.0 GI_TYPELIB_PATH=`pwd`/split-ui-lib/libubuntuoneui rhythmbox

Then enable the plug-in in Edit->Plugins in rhythmbox, and Ubuntu One should appear in the tree on the left. Once you click on it, you should see the music store come up.

Note: For some reason, the MP3 warning comes up regardless of whether MP3s are playable. I am not sure why this is, but will debug it later, and simply consider it a bug that needs to be fixed before 12.04 freeze. I will open a bug on it.

To post a comment you must log in.
108. By dobey

Add a FIXME? re: source.delete_thyself() which no longer exists

Revision history for this message
Manuel de la Peña (mandel) wrote :

Got it working.

review: Approve
Revision history for this message
Roberto Alsina (ralsina) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'setup.py'
2--- setup.py 2012-01-19 15:22:32 +0000
3+++ setup.py 2012-01-31 15:07:52 +0000
4@@ -18,4 +18,3 @@
5 'ubuntuone/MusicStoreWidget.py',
6 ])],
7 )
8-
9
10=== modified file 'ubuntuone/MusicStoreWidget.py'
11--- ubuntuone/MusicStoreWidget.py 2012-01-12 21:34:43 +0000
12+++ ubuntuone/MusicStoreWidget.py 2012-01-31 15:07:52 +0000
13@@ -19,23 +19,19 @@
14 import stat
15 import urlparse
16
17-# pylint: disable=E0611
18+# pylint: disable=E0611,F0401
19 from gi.repository import Gio, GObject, Gtk, RB
20-# pylint: enable=E0611
21+from gi.repository.UbuntuOneUI import MusicStore as U1MusicStore
22+# pylint: enable=E0611,F0401
23
24 from dirspec import basedir
25 from gettext import lgettext as _
26-#from ubuntuone.gtkwidgets import MusicStore as U1MusicStore
27-
28-gettext.bindtextdomain("rhythmbox-ubuntuone-music-store", "/usr/share/locale")
29-gettext.textdomain("rhythmbox-ubuntuone-music-store")
30-
31-MUSIC_STORE_WIDGET = Gtk.EventBox() # keep this around for later
32+
33+gettext.bindtextdomain("rhythmbox-ubuntuone", "/usr/share/locale")
34+gettext.textdomain("rhythmbox-ubuntuone")
35+
36+MUSIC_STORE_WIDGET = U1MusicStore()
37 U1LIBRARYPATH = MUSIC_STORE_WIDGET.get_library_location()
38-RB_LIBRARY_LOCATIONS = "/apps/rhythmbox/library_locations"
39-PARTNER_LIST = "canonical-partner-maverick.list"
40-SOURCES_DIR = "/etc/apt/sources.list.d/"
41-PLUGIN_PACKAGENAME = "gstreamer0.10-fluendo-plugins-mp3-partner"
42
43
44 class U1EntryType(RB.RhythmDBEntryType):
45@@ -66,10 +62,10 @@
46 def activate(self, shell):
47 """Plugin startup."""
48 self.db = shell.get_property("db")
49- group = RB.rb_display_page_group_get_by_id("stores")
50+ group = RB.DisplayPageGroup.get_by_id("stores")
51
52 icon = Gtk.IconTheme.get_default().load_icon(
53- "ubuntuone", Gtk.IconSize.lookup(Gtk.IconSize.MENU)[0], 0)
54+ "ubuntuone", 24, 0)
55
56 self.db.register_entry_type(self.entry_type)
57
58@@ -93,7 +89,9 @@
59 def deactivate(self, shell):
60 """Plugin shutdown."""
61 # remove source
62- self.source.delete_thyself()
63+ # FIXME?: This API changed, but doesn't seem entirely necessary.
64+ # It's not entirely clear which API to use for this now.
65+ #self.source.delete_thyself()
66 # delete held references
67 del self.db
68 del self.source
69@@ -122,7 +120,7 @@
70 library_path = os.path.join(self.u1_library_symlink, subpath)
71 # convert path to URI. Don't use urllib for this; Python and
72 # glib escape URLs differently. gio does it the glib way.
73- library_uri = Gio.File(library_path).get_uri()
74+ library_uri = Gio.File.new_for_path(library_path).get_uri()
75 return library_uri
76
77 def download_finished(self, source, path):
78@@ -198,7 +196,7 @@
79 """A Rhythmbox source widget for the U1 Music Store."""
80 # gproperties required so that rb.Source is instantiable
81 __gproperties__ = {
82- 'plugin': (RB.Plugin, 'plugin', 'plugin',
83+ 'plugin': (GObject.GObject, 'plugin', 'plugin',
84 GObject.PARAM_WRITABLE | GObject.PARAM_CONSTRUCT_ONLY),
85 }
86 # we have the preview-mp3 signal; we receive it from the widget, and
87@@ -286,7 +284,7 @@
88 def re_emit_urlloaded(self, widget, url):
89 """Handle the url-loaded signal and re-emit it."""
90 # pylint: disable=E1101
91- self.signal_emit_by_name("url-loaded", url)
92+ self.emit("url-loaded", url)
93
94 def do_set_property(self, prop, value):
95 """Allow property settings to handle the plug-in call."""
96
97=== modified file 'ubuntuone/ubuntuone.py'
98--- ubuntuone/ubuntuone.py 2012-01-14 01:59:34 +0000
99+++ ubuntuone/ubuntuone.py 2012-01-31 15:07:52 +0000
100@@ -20,9 +20,9 @@
101 from gi.repository import Gio, GLib, GObject, Peas
102 # pylint: enable=E0611
103
104-# We aren't actually providing a music store widget at the moment,
105-# as libu1 needs to be ported to gtk3 first. We may add it back later.
106-#from MusicStoreWidget import U1MusicStoreWidget
107+# pylint: disable=W0403
108+from MusicStoreWidget import U1MusicStoreWidget
109+# pylint: enable=W0403
110
111
112 class UbuntuOnePlugin (GObject.GObject, Peas.Activatable):
113@@ -43,7 +43,7 @@
114 self.rdbconf.connect('changed::locations', self._locations_changed)
115
116 # The Music Store itself
117- #self.music_store_widget = U1MusicStoreWidget(plugin=self)
118+ self.music_store_widget = U1MusicStoreWidget(plugin=self)
119
120 def _locations_changed(self, *args, **kwargs):
121 """Handle the locations setting being changed."""
122@@ -56,8 +56,8 @@
123 """Plug-in startup."""
124 # Add the Ubuntu One purchased music directory if not already added
125 self._locations_changed()
126- #self.music_store_widget.activate(shell)
127+ self.music_store_widget.activate(self.object)
128
129 def do_deactivate(self):
130 """Plug-in shutdown."""
131- #self.music_store_widget.deactivate(shell)
132+ self.music_store_widget.deactivate(self.object)

Subscribers

People subscribed via source and target branches