original commit: fd385a13472e28a0ebbdadf53cbeaa00dea9f062
This commit is contained in:
Paul Steckler 2002-09-20 17:55:52 +00:00
parent 117050fbc2
commit b943095385

View File

@ -15,15 +15,15 @@
"help-desk" "help-desk"
(current-command-line-arguments) (current-command-line-arguments)
(once-each (once-each
[("-n" "--no-browser") "Do not launch browser" [("-n" "--no-browser") "Do not launch browser (ignored for PLT browser)"
(set! launch-browser? #f)] (set! launch-browser? #f)]
[("-x" "--external-connections") "Allow external connections" [("-x" "--external-connections") "Allow external connections (ignored for PLT browser)"
(set! external-connections? #t)] (set! external-connections? #t)]
[("-i" "--iconize") "Iconize the control panel" [("-i" "--iconize") "Iconize the control panel"
(set! iconize? #t)] (set! iconize? #t)]
[("-q" "--quiet") "Don't show the control panel" [("-q" "--quiet") "Don't show the control panel"
(set! quiet? #t)] (set! quiet? #t)]
[("-p" "--port") number "Use given port number" [("-p" "--port") number "Use given port number (ignored for PLT browser)"
(with-handlers (with-handlers
((void (lambda _ ((void (lambda _
(error "Help Desk: expected exact integer for port")))) (error "Help Desk: expected exact integer for port"))))
@ -35,8 +35,12 @@
(define hd-cookie (start-help-server port external-connections?)) (define hd-cookie (start-help-server port external-connections?))
(define help-desk-port (hd-cookie->port hd-cookie)) (define help-desk-port (hd-cookie->port hd-cookie))
(define internal-browser? (use-plt-browser?))
(if internal-browser?
(set! launch-browser? #t) ; always launch
; allow server startup time ; allow server startup time
(wait-for-connection help-desk-port) (wait-for-connection help-desk-port))
(when launch-browser? (when launch-browser?
(with-handlers (with-handlers
@ -54,8 +58,10 @@
; allow browser startup time ; allow browser startup time
(sleep 2))) (sleep 2)))
(if quiet? (cond
(semaphore-wait (make-semaphore 0)) [internal-browser? (void)]
[quiet? (semaphore-wait (make-semaphore 0))]
[else
(let* ([hd-frame% (let* ([hd-frame%
(class frame% (class frame%
(inherit show) (inherit show)
@ -126,16 +132,5 @@
(send frame center) (send frame center)
(send frame show #t) (send frame show #t)
(when iconize? (when iconize?
(send frame iconize #t))))) (send frame iconize #t)))]))