add a checkbox to the 'evaluation terminated' dialog to avoid seeing that dialog

closes PR 6575

don't include in 5.2
This commit is contained in:
Robby Findler 2011-10-09 16:37:17 -05:00
parent ca64179b63
commit fa98274aed
3 changed files with 50 additions and 34 deletions

View File

@ -352,7 +352,11 @@
warnings-panel)
(make-check-box 'drracket:test-coverage-ask-about-clearing?
(string-constant test-coverage-ask?)
warnings-panel)
(make-check-box 'drracket:show-killed-dialog
(string-constant show-evaluation-terminated-dialog)
warnings-panel))))
(drracket:debug:add-prefs-panel)
(install-help-browser-preference-panel)
(drracket:tools:add-prefs-panel)
@ -504,6 +508,8 @@
'margin
(or/c 'margin 'gold))
(preferences:set-default 'drracket:show-killed-dialog #t boolean?)
(drr:set-default 'drracket:multi-file-search:recur? #t boolean?)
(drr:set-default 'drracket:multi-file-search:filter? #t boolean?)
(drr:set-default 'drracket:multi-file-search:filter-regexp "\\.(rkt.?|scrbl|ss|scm)$" string?)

View File

@ -905,37 +905,43 @@ TODO
(field (need-interaction-cleanup? #f))
(define/private (no-user-evaluation-message frame exit-code memory-killed?)
(let* ([new-limit (and custodian-limit (+ custodian-limit custodian-limit))]
[ans (message-box/custom
(string-constant evaluation-terminated)
(string-append
(string-constant evaluation-terminated-explanation)
(if exit-code
(string-append
"\n\n"
(if (zero? exit-code)
(string-constant exited-successfully)
(format (string-constant exited-with-error-code) exit-code)))
"")
(if memory-killed?
(string-append
"\n\n"
(string-constant program-ran-out-of-memory))
""))
(string-constant ok)
#f
(and memory-killed?
new-limit
(format "Increase memory limit to ~a megabytes"
(floor (/ new-limit 1024 1024))))
frame
'(default=1 stop)
#:dialog-mixin frame:focus-table-mixin)])
(when (equal? ans 3)
(set-custodian-limit new-limit)
(preferences:set 'drracket:child-only-memory-limit new-limit))
(set-insertion-point (last-position))
(insert-warning "\nInteractions disabled")))
(define new-limit (and custodian-limit (+ custodian-limit custodian-limit)))
(define-values (ans checked?)
(if (preferences:get 'drracket:show-killed-dialog)
(message+check-box/custom
(string-constant evaluation-terminated)
(string-append
(string-constant evaluation-terminated-explanation)
(if exit-code
(string-append
"\n\n"
(if (zero? exit-code)
(string-constant exited-successfully)
(format (string-constant exited-with-error-code) exit-code)))
"")
(if memory-killed?
(string-append
"\n\n"
(string-constant program-ran-out-of-memory))
""))
(string-constant evaluation-terminated-ask)
(string-constant ok)
#f
(and memory-killed?
new-limit
(format "Increase memory limit to ~a megabytes"
(floor (/ new-limit 1024 1024))))
frame
'(default=1 stop checked)
#:dialog-mixin frame:focus-table-mixin)
(values 1 #t)))
(unless checked?
(preferences:set 'drracket:show-killed-dialog #f))
(when (equal? ans 3)
(set-custodian-limit new-limit)
(preferences:set 'drracket:child-only-memory-limit new-limit))
(set-insertion-point (last-position))
(insert-warning "\nInteractions disabled"))
(define/private (cleanup-interaction) ; =Kernel=, =Handler=
(set! need-interaction-cleanup? #f)

View File

@ -1219,9 +1219,13 @@ please adhere to these guidelines:
(exited-successfully "Exited successfully.")
(exited-with-error-code "Exited with error code ~a.") ;; ~a is filled in with a number between 1 and 255
(program-ran-out-of-memory "The program ran out of memory.")
(last-stack-frame "show the last stack frame")
(last-stack-frames "show the last ~a stack frames")
(next-stack-frames "show the next ~a stack frames")
(show-evaluation-terminated-dialog "Show the evaluation terminated dialog")
(evaluation-terminated-ask "Show this dialog next time?")
(last-stack-frame "show the last stack frame")
(last-stack-frames "show the last ~a stack frames")
(next-stack-frames "show the next ~a stack frames")
;;; welcoming message in repl
(language "Language")