Add save-options hook and use it to save style sheets.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@5392 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas 2001-09-20 09:31:47 +00:00
parent 0a8c78bcc1
commit 69f1430864
3 changed files with 11 additions and 4 deletions

View File

@ -111,6 +111,7 @@
(export gnc:get-credit-string)
(export gnc:*options-entries*)
(export gnc:config-file-format-version)
(export gnc:*save-options-hook*)
;; date-utilities.scm
@ -236,8 +237,8 @@
(load-from-path "c-interface.scm")
(load-from-path "config-var.scm")
(load-from-path "options.scm")
(load-from-path "prefs.scm")
(load-from-path "hooks.scm")
(load-from-path "prefs.scm")
(load-from-path "date-utilities.scm")
(load-from-path "utilities.scm")

View File

@ -69,13 +69,18 @@
(define (gnc:global-options-clear-changes)
(gnc:options-clear-changes gnc:*options-entries*))
(define gnc:*save-options-hook*
(gnc:hook-define
'ui-shutdown-hook
"Functions to run at ui shutdown. Hook args: ()"))
;; save-all-options: this is the actual hook that gets called at
;; shutdown. right now, we put all the options in the same file so
;; it's important to make sure it happens in this order. later the
;; hook should probably revert back to just save-global-options.
(define (gnc:save-all-options)
(gnc:save-global-options))
; (gnc:save-style-sheet-options))
(gnc:save-global-options)
(gnc:hook-run-danglers gnc:*save-options-hook*))
(define (gnc:save-global-options)
(gnc:make-home-dir)

View File

@ -385,7 +385,6 @@
(export gnc:html-style-sheet-set-renderer!)
(export gnc:make-html-style-sheet-internal)
(export gnc:html-style-sheet-style)
(export gnc:save-style-sheet-options)
(export gnc:html-style-sheet-set-style!)
(export gnc:make-html-style-sheet)
(export gnc:restore-html-style-sheet)
@ -551,3 +550,5 @@
(load-from-path "options-utilities.scm")
(load-from-path "report-utilities.scm")
(load-from-path "report.scm")
(gnc:hook-add-dangler gnc:*save-options-hook* gnc:save-style-sheet-options)