Remove some Anonymous browser cruft in open_url_in_browser().

This commit is contained in:
Andrew Resch 2008-01-31 07:25:13 +00:00
parent aed8b1a722
commit 9541f02fb4
4 changed files with 17 additions and 24 deletions

View File

@ -177,7 +177,7 @@ class Search:
url = url.replace('${query}', entry) url = url.replace('${query}', entry)
print 'URL =', url print 'URL =', url
print 'Entry =', entry print 'Entry =', entry
common.open_url_in_browser(url, self.interface.plugins) common.open_url_in_browser(url)
def populate_search_menu(self): def populate_search_menu(self):
import gtk import gtk

View File

@ -153,23 +153,16 @@ def get_logo(size):
return gtk.gdk.pixbuf_new_from_file_at_size(get_pixmap("deluge.svg"), \ return gtk.gdk.pixbuf_new_from_file_at_size(get_pixmap("deluge.svg"), \
size, size) size, size)
def open_url_in_browser(link, plugins, force_ext=None): def open_url_in_browser(link):
import pref import threading
config = pref.Preferences(os.path.join(os.path.expanduser("~"), 'deluge', "prefs.state")) import webbrowser
enabled = config.get('enabled_plugins').split(':') class BrowserThread(threading.Thread):
if ("Anonymizing Browser" in enabled) and not force_ext and plugins: def __init__(self, link):
plugins.launch_site(link) threading.Thread.__init__(self)
plugins.show_all() self.url = link
else: def run(self):
import threading webbrowser.open(self.url)
import webbrowser BrowserThread(link).start()
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): def is_url(url):
import re import re

View File

@ -330,7 +330,7 @@ class PreferencesDlg:
self.plugins.configure_plugin(plugin_name, self.dialog) self.plugins.configure_plugin(plugin_name, self.dialog)
def TestPort(self, widget): 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): def toggle_ui(self, widget):
value = widget.get_active() value = widget.get_active()

View File

@ -1446,19 +1446,19 @@ nice_need + "\n" + _("Available Space:") + " " + nice_free)
def launchpad(self, obj=None): def launchpad(self, obj=None):
common.open_url_in_browser('https://translations.launchpad.net/deluge/\ common.open_url_in_browser('https://translations.launchpad.net/deluge/\
trunk/+pots/deluge', self.plugins) trunk/+pots/deluge')
def launch_faq(self, obj=None): 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): 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): 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): 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): def add_torrent_clicked(self, obj=None):
torrent = dialogs.show_file_open_dialog(self.window) torrent = dialogs.show_file_open_dialog(self.window)