v201 stuff

original commit: 7003d9afc3b833c6e3015099e665ac8735fbb3db
This commit is contained in:
Paul Steckler 2002-06-25 20:37:43 +00:00
parent d54711c88b
commit c3cb1cc21c

View File

@ -1,69 +1,40 @@
#|
TODO:
* demonstrate setup-plt launcher
* manuals as `doc' sub-collections?
|#
(module help mzscheme (module help mzscheme
(require (lib "class.ss")
(lib "unitsig.ss")
"startup-url.ss"
"help-unit.ss"
"help-sig.ss"
"proxy-prefs.ss"
(lib "string-constant.ss" "string-constants")
(lib "framework.ss" "framework")
(lib "framework-sig.ss" "framework")
(lib "plt-installer.ss" "setup")
(lib "plt-installer-sig.ss" "setup")
(lib "mred-sig.ss" "mred")
(lib "mred.ss" "mred"))
(preferences:add-editor-checkbox-panel)
(preferences:add-warnings-checkbox-panel)
;; don't call preferences:add-scheme-checkbox-panel
;; here since those prefs don't really apply to Help Desk
(add-proxy-prefs-panel)
(define (frame-mixin %) (require (lib "web-server.ss" "web-server")
(class % (lib "util.ss" "web-server")
(define/override (help-menu:about-string) (lib "configuration.ss" "web-server")
(string-constant about-help-desk)) (lib "configuration-structures.ss" "web-server")
(define/override (help-menu:about-callback i e) (lib "server.ss" "help")
(message-box (string-constant about-help-desk) (lib "browser.ss" "help"))
(format
(string-constant help-desk-about-string) (require (lib "exit.ss" "doc" "help" "servlets" "private"))
(version:version))
this)) (define hd-cookie (start-help-server))
(define/override (help-menu:create-about?) #t) (define help-desk-port (hd-cookie->port hd-cookie))
(define/override (help-menu:after-about menu)
(make-object menu-item% (string-constant help-on-help) menu (define exit-sem (make-semaphore 0))
(lambda (i e) (set-box! exit-box (lambda () (semaphore-post exit-sem)))
(message-box
(string-constant help-on-help) ; allow server startup time
(string-constant help-on-help-details) (let loop ()
this)))) (with-handlers
(super-instantiate ()))) ([void (lambda _ (sleep 1) (loop))])
(let-values
(define (user-defined-doc-position x) #f) ([(iport oport) (tcp-connect "127.0.0.1" help-desk-port)])
(sleep 1)
(close-output-port oport)
(close-input-port iport))))
(help-desk-browser hd-cookie)
; wait until shutdown
(semaphore-wait/enable-break exit-sem))
;; just in case drscheme hasn't been run before, we
;; need a default for this preference.
(preferences:set-default
'drscheme:font-size
(send (send (send (make-object text%)
get-style-list)
basic-style)
get-size)
(lambda (x) (and (number? x) (exact? x) (= x (floor x)))))
(define-values/invoke-unit/sig help^
help@
#f
setup:plt-installer^
mred^
framework^
(frame-mixin)
help:doc-position^)
(new-help-frame startup-url))