mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-19 15:59:57 +00:00
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.
|
# statement from all source files in the program, then also delete it here.
|
||||||
|
|
||||||
import os.path
|
import os.path
|
||||||
import threading
|
|
||||||
import webbrowser
|
|
||||||
import xdg.BaseDirectory
|
import xdg.BaseDirectory
|
||||||
|
|
||||||
PROGRAM_NAME = "Deluge"
|
PROGRAM_NAME = "Deluge"
|
||||||
@ -114,13 +112,22 @@ def get_pixmap(fname):
|
|||||||
return os.path.join(PIXMAP_DIR, fname)
|
return os.path.join(PIXMAP_DIR, fname)
|
||||||
|
|
||||||
def open_url_in_browser(link):
|
def open_url_in_browser(link):
|
||||||
class LaunchBrowser(threading.Thread):
|
import webbrowser
|
||||||
def run(self):
|
|
||||||
try:
|
# why this method with causes up to 1 minutes delays when opening url in
|
||||||
webbrowser.open(link)
|
# deluge ? when you run it from console - works instantly. maybe it has
|
||||||
except webbrowser.Error:
|
# something to do with libtorrent's threads or with boost mt/nomt ?
|
||||||
print _("Error: no webbrowser found")
|
|
||||||
LaunchBrowser().start()
|
#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):
|
def is_url(url):
|
||||||
import re
|
import re
|
||||||
|
Loading…
x
Reference in New Issue
Block a user