diff options
author | 2010-03-23 06:42:09 -0400 | |
---|---|---|
committer | 2010-03-23 06:42:09 -0400 | |
commit | 025d0b188daae6f5d8210883407a70fbb8e8a085 (patch) | |
tree | 0515e0df6a128da45f9ca751ebcf18619f2e5fe5 /core | |
parent | b2d5d12254f9b1212aaf2174befe8ab54486841d (diff) |
Open help browser-agnostically for all platforms.
Diffstat (limited to 'core')
-rw-r--r-- | core/ext/menu.lua | 13 | ||||
-rw-r--r-- | core/locale.conf | 4 |
2 files changed, 8 insertions, 9 deletions
diff --git a/core/ext/menu.lua b/core/ext/menu.lua index b8391d6b..703910e7 100644 --- a/core/ext/menu.lua +++ b/core/ext/menu.lua @@ -325,15 +325,14 @@ local function set_lexer(lexer) end local function open_webpage(url) local cmd - if not WIN32 then - cmd = - string.format('"%s" "file://%s"', not MAC and 'firefox' or 'open', url) + if WIN32 then + cmd = string.format('start "" "%s"', url) + local p = io.popen(cmd) + if not p then error(l.MENU_BROWSER_ERROR..url) else p:close() end else - cmd = - string.format('"%s" %s', - 'c:/program files/internet explorer/iexplore.exe', url) + cmd = string.format(MAC and 'open "file://%s"' or 'xdg-open "%s"', url) + if os.execute(cmd) ~= 0 then error(l.MENU_BROWSER_ERROR..url) end end - if os.execute(cmd) ~= 0 then error(l.MENU_BROWSER_ERROR) end end local actions = { diff --git a/core/locale.conf b/core/locale.conf index 2a5720da..ffd03818 100644 --- a/core/locale.conf +++ b/core/locale.conf @@ -620,8 +620,8 @@ MENU_HELP_MANUAL "_Manual" MENU_HELP_LUADOC "_LuaDoc" % core/ext/menu.lua -% "Error loading webpage.\nCheck the browser path in core/ext/menu.lua" -MENU_BROWSER_ERROR "Error loading webpage.\nCheck the browser path in core/ext/menu.lua" +% "Error loading webpage: " +MENU_BROWSER_ERROR "Error loading webpage: " % core/ext/menu.lua % "Load Session" |