changed the strategy of the preferences library in the framework to use a different key at the file.ss level (and thus save the prefs on each call to preferences:set)

svn: r5058

original commit: d47247507f6dd55cf3d628a83570096137cda406
This commit is contained in:
Robby Findler 2006-12-07 22:32:31 +00:00
parent 4068a307bf
commit 398113d503
5 changed files with 820 additions and 893 deletions

View File

@ -238,19 +238,7 @@
", "
"@flink preferences:set %"
".")
(preferences:save
(-> boolean?)
()
"\\rawscm{(preferences:save-user-preferences)} saves the user's preferences to disk,"
"potentially marshalling some of the preferences."
""
"Returns \\scm{\\#f} if saving the preferences fails and \\scm{\\#t} otherwise.")
(preferences:silent-save
(-> boolean?)
()
"Same as"
"@flink preferences:save"
"except that it does not put display a message if it fails.")
(preferences:restore-defaults
(-> void?)
()

View File

@ -296,22 +296,8 @@
(exit:insert-on-callback
(λ ()
(send (group:get-the-frame-group) on-close-all)
(preferences:silent-save) ;; the prefs may have changed as a result of closing the windows...
))
(send (group:get-the-frame-group) on-close-all)))
(exit:insert-can?-callback
(λ ()
(or (preferences:save)
(exit-anyway?))))
(define (exit-anyway?)
(gui-utils:get-choice
(string-constant still-locked-exit-anyway?)
(string-constant yes)
(string-constant no)
(string-constant drscheme)))
;; reset these -- they are only for the test suite.
;; they do not need to be set across starting up and shutting down
;; the application.

File diff suppressed because it is too large Load Diff

View File

@ -80,8 +80,6 @@
set-default
set-un/marshall
save
silent-save
restore-defaults
add-panel

View File

@ -49,8 +49,7 @@
(lambda (f) (f))
(lambda (v) (lambda () v)))
(begin0 ((preferences:get ',marshalling-pref-sym))
(preferences:set ',marshalling-pref-sym (lambda () 2))
(preferences:save))))
(preferences:set ',marshalling-pref-sym (lambda () 2)))))
(shutdown-mred)
(test 'preference-marshalling
(check-eq? 2)
@ -79,13 +78,11 @@
(check-eq? 'stage1)
`(begin (preferences:set-default ',default-test-sym 'default symbol?)
(preferences:set ',default-test-sym 'new-value)
(preferences:save)
'stage1))
(shutdown-mred)
(test 'preference-no-set-default-stage2
(check-eq? 'stage2)
`(begin (preferences:save)
'stage2))
`(begin 'stage2))
(shutdown-mred)
(test 'preference-no-set-default-stage3
(check-eq? 'new-value)