From 9541f02fb46ae7464523dfb3f4f2588e924f1a70 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Thu, 31 Jan 2008 07:25:13 +0000 Subject: [PATCH] Remove some Anonymous browser cruft in open_url_in_browser(). --- plugins/Search/__init__.py | 2 +- src/common.py | 27 ++++++++++----------------- src/dialogs.py | 2 +- src/interface.py | 10 +++++----- 4 files changed, 17 insertions(+), 24 deletions(-) diff --git a/plugins/Search/__init__.py b/plugins/Search/__init__.py index 5dabc004a..058388e06 100644 --- a/plugins/Search/__init__.py +++ b/plugins/Search/__init__.py @@ -177,7 +177,7 @@ class Search: url = url.replace('${query}', entry) print 'URL =', url print 'Entry =', entry - common.open_url_in_browser(url, self.interface.plugins) + common.open_url_in_browser(url) def populate_search_menu(self): import gtk diff --git a/src/common.py b/src/common.py index 0dddcce8d..35fe0e411 100644 --- a/src/common.py +++ b/src/common.py @@ -153,23 +153,16 @@ def get_logo(size): return gtk.gdk.pixbuf_new_from_file_at_size(get_pixmap("deluge.svg"), \ size, size) -def open_url_in_browser(link, plugins, force_ext=None): - import pref - config = pref.Preferences(os.path.join(os.path.expanduser("~"), 'deluge', "prefs.state")) - enabled = config.get('enabled_plugins').split(':') - if ("Anonymizing Browser" in enabled) and not force_ext and plugins: - plugins.launch_site(link) - plugins.show_all() - else: - import threading - import webbrowser - class BrowserThread(threading.Thread): - def __init__(self, link): - threading.Thread.__init__(self) - self.url = link - def run(self): - webbrowser.open(self.url) - BrowserThread(link).start() +def open_url_in_browser(link): + import threading + import webbrowser + class BrowserThread(threading.Thread): + def __init__(self, link): + threading.Thread.__init__(self) + self.url = link + def run(self): + webbrowser.open(self.url) + BrowserThread(link).start() def is_url(url): import re diff --git a/src/dialogs.py b/src/dialogs.py index f85852776..d1e16d6c3 100644 --- a/src/dialogs.py +++ b/src/dialogs.py @@ -330,7 +330,7 @@ class PreferencesDlg: self.plugins.configure_plugin(plugin_name, self.dialog) def TestPort(self, widget): - common.open_url_in_browser('http://www.deluge-torrent.org/test-port.php?port=%s' % self.active_port, self.plugins, force_ext=True) + common.open_url_in_browser('http://www.deluge-torrent.org/test-port.php?port=%s' % self.active_port) def toggle_ui(self, widget): value = widget.get_active() diff --git a/src/interface.py b/src/interface.py index 1b5e0d3e2..74d45f826 100644 --- a/src/interface.py +++ b/src/interface.py @@ -1446,19 +1446,19 @@ nice_need + "\n" + _("Available Space:") + " " + nice_free) def launchpad(self, obj=None): common.open_url_in_browser('https://translations.launchpad.net/deluge/\ -trunk/+pots/deluge', self.plugins) +trunk/+pots/deluge') def launch_faq(self, obj=None): - common.open_url_in_browser('http://deluge-torrent.org/faq.php', self.plugins) + common.open_url_in_browser('http://deluge-torrent.org/faq.php') def launch_donate(self, obj=None): - common.open_url_in_browser('http://deluge-torrent.org/downloads.php', self.plugins) + common.open_url_in_browser('http://deluge-torrent.org/downloads.php') def launch_community(self, obj=None): - common.open_url_in_browser('http://forum.deluge-torrent.org/', self.plugins) + common.open_url_in_browser('http://forum.deluge-torrent.org/') def launch_homepage(self, obj=None): - common.open_url_in_browser('http://deluge-torrent.org/', self.plugins) + common.open_url_in_browser('http://deluge-torrent.org/') def add_torrent_clicked(self, obj=None): torrent = dialogs.show_file_open_dialog(self.window)