From 76bf286a521f8ab866ba91e3d409a5aac570d844 Mon Sep 17 00:00:00 2001 From: Alex Dedul Date: Wed, 18 Jul 2007 09:46:27 +0000 Subject: [PATCH] Open urls in browser from UI without threading for now until we find out why it causes up to 1 minute delays. --- src/common.py | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/common.py b/src/common.py index c847deaa3..9600600ed 100644 --- a/src/common.py +++ b/src/common.py @@ -29,8 +29,6 @@ # statement from all source files in the program, then also delete it here. import os.path -import threading -import webbrowser import xdg.BaseDirectory PROGRAM_NAME = "Deluge" @@ -114,13 +112,22 @@ def get_pixmap(fname): return os.path.join(PIXMAP_DIR, fname) def open_url_in_browser(link): - class LaunchBrowser(threading.Thread): - def run(self): - try: - webbrowser.open(link) - except webbrowser.Error: - print _("Error: no webbrowser found") - LaunchBrowser().start() + import webbrowser + + # why this method with causes up to 1 minutes delays when opening url in + # deluge ? when you run it from console - works instantly. maybe it has + # something to do with libtorrent's threads or with boost mt/nomt ? + + #import threading + #class LaunchBrowser(threading.Thread): + # def run(self): + # try: + # webbrowser.open(link) + # except webbrowser.Error: + # print _("Error: no webbrowser found") + #LaunchBrowser().start() + + webbrowser.open(link) def is_url(url): import re