Open urls in browser from UI without threading for now until we find out why
it causes up to 1 minute delays.
This commit is contained in:
parent
6a22d12975
commit
76bf286a52
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue