Changeset 206918d2908f…
Parent a8b2f0d46bde…
by
Changes to 4 files · Browse files at 206918d2908f Showing diff from parent a8b2f0d46bde Diff from another changeset...
@@ -9,37 +9,14 @@ import os
import sys
import gtk
-import threading
from tortoisehg.util.i18n import _
-from tortoisehg.util import version, paths, hglib
+from tortoisehg.util import version, paths, hglib, shlib
from tortoisehg.hgtk import gtklib, hgtk
-def browse_url(url):
- def start_browser():
- if os.name == 'nt':
- import win32api, win32con
- win32api.ShellExecute(0, "open", url, None, "",
- win32con.SW_SHOW)
- elif sys.platform == 'darwin':
- # use Mac OS X internet config module (removed in Python 3.0)
- import ic
- ic.launchurl(url)
- else:
- try:
- import gconf
- client = gconf.client_get_default()
- browser = client.get_string(
- '/desktop/gnome/url-handlers/http/command') + '&'
- os.system(browser % url)
- except ImportError:
- # If gconf is not found, fall back to old standard
- os.system('firefox ' + url)
- threading.Thread(target=start_browser).start()
-
def url_handler(dialog, link, user_data):
- browse_url(link)
+ shlib.browse_url(link)
gtk.about_dialog_set_url_hook(url_handler, None)
|
@@ -17,7 +17,7 @@ from tortoisehg.util.i18n import _
from tortoisehg.util import shlib, hglib
-from tortoisehg.hgtk import csinfo, gdialog, gtklib, hgcmd, statusbar, about
+from tortoisehg.hgtk import csinfo, gdialog, gtklib, hgcmd, statusbar
class ChangeSet(gdialog.GDialog):
'GTK+ based dialog for displaying repository logs'
@@ -776,7 +776,7 @@ groups[int(m.group(1))], link)
if not num:
link += text
- about.browse_url(link)
+ shlib.browse_url(link)
def csetlink_event(self, tag, widget, event, liter):
if event.type != gtk.gdk.BUTTON_RELEASE:
|
@@ -18,7 +18,7 @@ from mercurial import cmdutil, util, ui, hg, commands
from tortoisehg.util.i18n import _
-from tortoisehg.util import settings, hglib, paths
+from tortoisehg.util import settings, hglib, paths, shlib
from tortoisehg.hgtk import gtklib
@@ -387,8 +387,7 @@ return
if not url.startswith('http'):
url = 'http://tortoisehg.bitbucket.org/manual/0.9/' + url
- from tortoisehg.hgtk import about
- about.browse_url(url)
+ shlib.browse_url(url)
def launch(self, item, app):
import sys
|
@@ -9,6 +9,7 @@ import os
import sys
import time
+import threading
from mercurial.i18n import _
from mercurial import hg
@@ -19,6 +20,12 @@ return t
if os.name == 'nt':
+ def browse_url(url):
+ def start_browser():
+ import win32api, win32con
+ win32api.ShellExecute(0, "open", url, None, "", win32con.SW_SHOW)
+ threading.Thread(target=start_browser).start()
+
def shell_notify(paths):
try:
from win32com.shell import shell, shellcon
@@ -136,3 +143,22 @@
def update_thgstatus(*args, **kws):
pass
+
+ def browse_url(url):
+ def start_browser():
+ if sys.platform == 'darwin':
+ # use Mac OS X internet config module (removed in Python 3.0)
+ import ic
+ ic.launchurl(url)
+ else:
+ try:
+ import gconf
+ client = gconf.client_get_default()
+ browser = client.get_string(
+ '/desktop/gnome/url-handlers/http/command') + '&'
+ os.system(browser % url)
+ except ImportError:
+ # If gconf is not found, fall back to old standard
+ os.system('firefox ' + url)
+ threading.Thread(target=start_browser).start()
+
|
Loading...