restored the 'add teachpack' menu item in non-teaching languages, but with a message saying that teachpacks don't work and listing the languages where they do.

svn: r7007
This commit is contained in:
Robby Findler 2007-08-03 02:18:46 +00:00
parent b01f462894
commit e467e8681a
2 changed files with 23 additions and 1 deletions

View File

@ -2834,7 +2834,26 @@ module browser threading seems wrong.
(update-settings ((teachpack-callbacks-remove tp-callbacks) settings name)))]))
tp-names))))]
[else
(set! teachpack-items '())])))
(set! teachpack-items
(list
(new menu:can-restore-menu-item%
[label (string-constant add-teachpack-menu-item-label)]
[parent language-menu]
[callback
(λ (_1 _2)
(message-box (string-constant drscheme)
(format (string-constant teachpacks-only-in-languages)
(apply
string-append
(reverse
(filter
values
(map (λ (l)
(and
(send l capability-value 'drscheme:teachpack-menu-items)
(format "\n ~a" (send l get-language-name))))
(drscheme:language-configuration:get-languages))))))
this))])))])))
(define/private (initialize-menus)
(let* ([mb (get-menu-bar)]

View File

@ -920,6 +920,9 @@ please adhere to these guidelines:
(teachpack-user-installed "User-installed Teachpacks")
(install-teachpack... "Install Teachpack...")
(teachpack-already-installed "A teachpack with the name '~a' has already been installed. Overwrite it?")
; ~a is filled with a list of language names. Each name is separated by a newline and is indented two spaces (no commas, no 'and')
(teachpacks-only-in-languages "Teachpacks are only available in these languages: ~a")
;;; Language dialog
(introduction-to-language-dialog