[rhythmbox] remove rb.show_uri(), call gtk.show_uri() directly
- From: Jonathan Matthew <jmatthew src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [rhythmbox] remove rb.show_uri(), call gtk.show_uri() directly
- Date: Wed, 10 Feb 2010 13:07:14 +0000 (UTC)
commit 62b30044fa5f591ac1614a65f7a09f1af8925012
Author: Jonathan Matthew <jonathan d14n org>
Date: Wed Feb 10 23:04:01 2010 +1000
remove rb.show_uri(), call gtk.show_uri() directly
As a tiny bonus, we now pass in the screen parameter correctly.
plugins/context/context/ContextView.py | 2 +-
plugins/jamendo/jamendo/JamendoSource.py | 4 ++--
plugins/magnatune/magnatune/MagnatuneSource.py | 6 ++++--
plugins/rb/__init__.py | 8 --------
4 files changed, 7 insertions(+), 13 deletions(-)
---
diff --git a/plugins/context/context/ContextView.py b/plugins/context/context/ContextView.py
index 8d19650..160d385 100644
--- a/plugins/context/context/ContextView.py
+++ b/plugins/context/context/ContextView.py
@@ -203,7 +203,7 @@ class ContextView (gobject.GObject):
# open HTTP URIs externally. this isn't a web browser.
if request.get_uri().startswith('http'):
print "opening uri %s" % request.get_uri()
- rb.show_uri(request.get_uri())
+ gtk.show_uri(self.shell.props.window.get_screen(), request.get_uri(), gtk.gdk.CURRENT_TIME)
return 1 # WEBKIT_NAVIGATION_RESPONSE_IGNORE
else:
return 0 # WEBKIT_NAVIGATION_RESPONSE_ACCEPT
diff --git a/plugins/jamendo/jamendo/JamendoSource.py b/plugins/jamendo/jamendo/JamendoSource.py
index b81e8a3..0e2f2b0 100644
--- a/plugins/jamendo/jamendo/JamendoSource.py
+++ b/plugins/jamendo/jamendo/JamendoSource.py
@@ -307,7 +307,7 @@ class JamendoSource(rb.BrowserSource):
gtk.MessageDialog(None, 0, gtk.MESSAGE_INFO, gtk.BUTTONS_OK, emsg).run()
return
- rb.show_uri(result)
+ gtk.show_uri(self.shell.props.window.get_screen(), result, gtk.gdk.CURRENT_TIME)
# Donate to Artist
def launch_donate (self):
@@ -330,7 +330,7 @@ class JamendoSource(rb.BrowserSource):
emsg = _("Error looking up artist %s on jamendo.com") % (artist)
gtk.MessageDialog(None, 0, gtk.MESSAGE_INFO, gtk.BUTTONS_OK, emsg).run()
return
- rb.show_uri(result + "donate/")
+ gtk.show_uri(self.shell.props.window.get_screen(), result + "donate/", gtk.gdk.CURRENT_TIME)
def playing_entry_changed (self, entry):
if not self.__db or not entry:
diff --git a/plugins/magnatune/magnatune/MagnatuneSource.py b/plugins/magnatune/magnatune/MagnatuneSource.py
index a90d4bf..5067880 100644
--- a/plugins/magnatune/magnatune/MagnatuneSource.py
+++ b/plugins/magnatune/magnatune/MagnatuneSource.py
@@ -194,6 +194,7 @@ class MagnatuneSource(rb.BrowserSource):
#
def display_artist_info(self):
+ screen = self.props.shell.props.window.get_screen()
tracks = self.get_entry_view().get_selected_entries()
urls = set([])
@@ -201,10 +202,11 @@ class MagnatuneSource(rb.BrowserSource):
sku = self.__sku_dict[self.__db.entry_get(tr, rhythmdb.PROP_LOCATION)]
url = self.__home_dict[sku]
if url not in urls:
- rb.show_uri(url)
+ gtk.show_uri(screen, url, gtk.gdk.CURRENT_TIME)
urls.add(url)
def buy_cd(self):
+ screen = self.props.shell.props.window.get_screen()
tracks = self.get_entry_view().get_selected_entries()
urls = set([])
@@ -212,7 +214,7 @@ class MagnatuneSource(rb.BrowserSource):
sku = self.__sku_dict[self.__db.entry_get(tr, rhythmdb.PROP_LOCATION)]
url = self.__buy_dict[sku]
if url not in urls:
- rb.show_uri(url)
+ gtk.show_uri(screen, url, gtk.gdk.CURRENT_TIME)
urls.add(url)
def radio_toggled(self, builder):
diff --git a/plugins/rb/__init__.py b/plugins/rb/__init__.py
index 7b65e61..5f616c6 100644
--- a/plugins/rb/__init__.py
+++ b/plugins/rb/__init__.py
@@ -64,14 +64,6 @@ def append_plugin_source_path(theme, iconpath):
icondir = plugindir + iconpath
theme.append_search_path(icondir)
-def show_uri(uri):
- # use gtk_show_uri if available, otherwise use gnome-vfs
- if hasattr(gtk, 'show_uri'):
- gtk.show_uri(gtk.gdk.Screen(), uri, 0)
- else:
- import gnomevfs
- gnomevfs.url_show(uri)
-
class _rbdebugfile:
def __init__(self, fn):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]