Merge in Iain's xdg-open and bare address handling fixes.
This commit is contained in:
commit
507efa9603
|
@ -171,10 +171,9 @@ class TerminatorTerm (gtk.VBox):
|
||||||
dbg ('openurl: viewing %s'%url)
|
dbg ('openurl: viewing %s'%url)
|
||||||
try:
|
try:
|
||||||
dbg ('openurl: calling xdg-open')
|
dbg ('openurl: calling xdg-open')
|
||||||
if subprocess.call(["xdg-open", url]) != 0:
|
subprocess.Popen(["xdg-open", url])
|
||||||
dbg ('openurl: xdg-open failed')
|
|
||||||
raise
|
|
||||||
except:
|
except:
|
||||||
|
dbg ('openurl: xdg-open failed')
|
||||||
try:
|
try:
|
||||||
dbg ('openurl: calling url_show')
|
dbg ('openurl: calling url_show')
|
||||||
self.terminator.url_show (url)
|
self.terminator.url_show (url)
|
||||||
|
@ -832,6 +831,15 @@ text/plain
|
||||||
|
|
||||||
if url:
|
if url:
|
||||||
if url[1] != self.matches['email']:
|
if url[1] != self.matches['email']:
|
||||||
|
# Add protocol if we launch a URL without it, otherwise xdg-open won't open it
|
||||||
|
if url[1] == self.matches['addr_only']:
|
||||||
|
if url[0][0:3] == "ftp":
|
||||||
|
# "ftp.foo.bar" -> "ftp://ftp.foo.bar"
|
||||||
|
address = "ftp://" + url[0]
|
||||||
|
else:
|
||||||
|
# Assume http
|
||||||
|
address = "http://" + url[0]
|
||||||
|
else:
|
||||||
address = url[0]
|
address = url[0]
|
||||||
nameopen = _("_Open Link")
|
nameopen = _("_Open Link")
|
||||||
namecopy = _("_Copy Link Address")
|
namecopy = _("_Copy Link Address")
|
||||||
|
|
Loading…
Reference in New Issue