Overview
| Artifact ID: | 5d078cda74aed749158bec199537a987da701825 |
|---|---|
| Ticket: | 1344350fffffffffffffffffffffffffffffffff |
| Date: | 2005-11-01 05:47:11 |
| User: | treincke |
| Artifact Attached: | 68b9a3886f5608086400d2838fd810509e32538e |
| Filename: | tkchat-diff-u.txt |
| Description: | patch for MacOS X to tkchat.tcl |
Content:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81--- tkchat.vfs/bin/tkchat.tcl 2005-10-31 23:27:59.000000000 +0100 +++ tkchat-patched.tcl 2005-10-31 23:32:28.000000000 +0100 @@ -1158,34 +1158,52 @@ # this code from http://purl.org/mini/tcl/557.html switch -- $tcl_platform(platform) { "unix" { - expr { - [info exists Options(BROWSER)] - || [findExecutable mozilla Options(BROWSER)] - || [findExecutable mozilla-firefox Options(BROWSER)] - || [findExecutable mozilla-firebird Options(BROWSER)] - || [findExecutable konqueror Options(BROWSER)] - || [findExecutable netscape Options(BROWSER)] - || [findExecutable iexplorer Options(BROWSER)] - || [findExecutable lynx Options(BROWSER)] - } + # special case for MacOS X: + if {$tcl_platform(os) == "Darwin"} { + # assume all goes well: + set notOK 0 + if {[info exists Options(BROWSER)]} { + set noOK [catch {exec open -a $Options(BROWSER) $url} emsg] + + } + if {$notOK} { + # Safari should always be there: + set notOK [catch {exec open -a Safari $url} emsg] + if {$notOK} { + tk_messageBox -message \ + "Error displaying $url in browser\n$emsg" + } + } + } else { + expr { + [info exists Options(BROWSER)] + || [findExecutable mozilla Options(BROWSER)] + || [findExecutable mozilla-firefox Options(BROWSER)] + || [findExecutable mozilla-firebird Options(BROWSER)] + || [findExecutable konqueror Options(BROWSER)] + || [findExecutable netscape Options(BROWSER)] + || [findExecutable iexplorer Options(BROWSER)] + || [findExecutable lynx Options(BROWSER)] + } - # lynx can also output formatted text to a variable - # with the -dump option, as a last resort: - # set formatted_text [ exec lynx -dump $url ] - PSE - # - # -remote argument might need formatting as a command - # Try that first - if { [catch { - exec $Options(BROWSER) -remote openURL($url) 2> /dev/null - }] } then { - # Try -remote with raw URL argument + # lynx can also output formatted text to a variable + # with the -dump option, as a last resort: + # set formatted_text [ exec lynx -dump $url ] - PSE + # + # -remote argument might need formatting as a command + # Try that first if { [catch { - exec $Options(BROWSER) -remote $url 2> /dev/null - }]} then { - # perhaps browser doesn't understand -remote flag - if { [catch { exec $Options(BROWSER) $url & } emsg] } { - tk_messageBox -message \ - "Error displaying $url in browser\n$emsg" + exec $Options(BROWSER) -remote openURL($url) 2> /dev/null + }] } then { + # Try -remote with raw URL argument + if { [catch { + exec $Options(BROWSER) -remote $url 2> /dev/null + }]} then { + # perhaps browser doesn't understand -remote flag + if { [catch { exec $Options(BROWSER) $url & } emsg] } { + tk_messageBox -message \ + "Error displaying $url in browser\n$emsg" + } } } }
