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)
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

View File

@ -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

View File

@ -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()

View File

@ -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)