mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Export debugging state from C to guile.
Remove obsolete guile command line options. Remove guile setting of add-extension hooks that were apparently obsoleted by C code a while ago. Remove guile's access to application lifecycle function hooks. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@12976 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -233,11 +233,6 @@
|
||||
(export gnc:hook-run-danglers) ;; from hooks.scm
|
||||
(re-export gnc:hook-add-dangler)
|
||||
(re-export gnc:hook-remove-dangler)
|
||||
(re-export gnc:*startup-hook*)
|
||||
(re-export gnc:*shutdown-hook*)
|
||||
(re-export gnc:*ui-startup-hook*)
|
||||
(re-export gnc:*ui-post-startup-hook*)
|
||||
(re-export gnc:*ui-shutdown-hook*)
|
||||
(re-export gnc:*book-opened-hook*)
|
||||
(re-export gnc:*new-book-hook*)
|
||||
(re-export gnc:*book-closed-hook*)
|
||||
|
||||
@@ -24,7 +24,8 @@
|
||||
ws
|
||||
(lambda (wrapset client-wrapset)
|
||||
(list
|
||||
"#include <gnc-gconf-utils.h>\n")))
|
||||
"#include <gnc-gconf-utils.h>\n"
|
||||
"#include <gnc-main.h>\n")))
|
||||
|
||||
(gw:wrap-function
|
||||
ws
|
||||
@@ -34,4 +35,13 @@
|
||||
'(((<gw:mchars> caller-owned) section)
|
||||
((<gw:mchars> caller-owned) name))
|
||||
"Get a boolean value from gconf.")
|
||||
|
||||
(gw:wrap-function
|
||||
ws
|
||||
'gnc:debugging?
|
||||
'<gw:bool>
|
||||
"gnc_is_debugging"
|
||||
'()
|
||||
"Is debugging mode on?")
|
||||
|
||||
)
|
||||
|
||||
@@ -2621,24 +2621,12 @@ the timepair representing midday on that day")
|
||||
"Run the danglers on a hook.")
|
||||
|
||||
; Now wrap all the 'known' hooks
|
||||
(gw:wrap-value ws 'gnc:*startup-hook*
|
||||
'(<gw:mchars> callee-owned) "HOOK_STARTUP")
|
||||
(gw:wrap-value ws 'gnc:*shutdown-hook*
|
||||
'(<gw:mchars> callee-owned) "HOOK_SHUTDOWN")
|
||||
(gw:wrap-value ws 'gnc:*ui-startup-hook*
|
||||
'(<gw:mchars> callee-owned) "HOOK_UI_STARTUP")
|
||||
(gw:wrap-value ws 'gnc:*ui-post-startup-hook*
|
||||
'(<gw:mchars> callee-owned) "HOOK_UI_POST_STARTUP")
|
||||
(gw:wrap-value ws 'gnc:*ui-shutdown-hook*
|
||||
'(<gw:mchars> callee-owned) "HOOK_UI_SHUTDOWN")
|
||||
(gw:wrap-value ws 'gnc:*new-book-hook*
|
||||
'(<gw:mchars> callee-owned) "HOOK_NEW_BOOK")
|
||||
(gw:wrap-value ws 'gnc:*report-hook*
|
||||
'(<gw:mchars> callee-owned) "HOOK_REPORT")
|
||||
(gw:wrap-value ws 'gnc:*save-options-hook*
|
||||
'(<gw:mchars> callee-owned) "HOOK_SAVE_OPTIONS")
|
||||
(gw:wrap-value ws 'gnc:*add-extension-hook*
|
||||
'(<gw:mchars> callee-owned) "HOOK_ADD_EXTENSION")
|
||||
(gw:wrap-value ws 'gnc:*book-opened-hook*
|
||||
'(<gw:mchars> callee-owned) "HOOK_BOOK_OPENED")
|
||||
(gw:wrap-value ws 'gnc:*book-closed-hook*
|
||||
|
||||
@@ -53,13 +53,3 @@
|
||||
|
||||
(define (gnc:make-separator path)
|
||||
(gnc:make-extension 'separator "" "" path #f))
|
||||
|
||||
(define (gnc:extensions-menu-setup)
|
||||
(define menu (gnc:make-menu (N_ "Extensions") (list "_Tools")))
|
||||
(gnc:add-extension menu)
|
||||
(gnc:hook-run-danglers gnc:*add-extension-hook*)
|
||||
#f)
|
||||
|
||||
(if (gnc:debugging?)
|
||||
(gnc:hook-add-dangler gnc:*ui-startup-hook*
|
||||
gnc:extensions-menu-setup))
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
(export gnc:make-menu-item)
|
||||
(export gnc:make-menu)
|
||||
(export gnc:make-separator)
|
||||
(re-export gnc:*add-extension-hook*)
|
||||
|
||||
(export gnc:kvp-option-dialog)
|
||||
|
||||
|
||||
@@ -22,8 +22,6 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;; Configuration variables
|
||||
|
||||
(define gnc:*loglevel* #f)
|
||||
|
||||
(define gnc:*doc-path* #f)
|
||||
|
||||
(define (gnc:expand-path new-list current-list default-generator)
|
||||
@@ -67,23 +65,6 @@
|
||||
;; We use a function so we don't do this at file load time.
|
||||
|
||||
;; Convert the temporary startup value into a config var.
|
||||
(let ((current-value gnc:*debugging?*))
|
||||
(set!
|
||||
gnc:*debugging?*
|
||||
(gnc:make-config-var
|
||||
(N_ "Enable debugging code.")
|
||||
(lambda (var value) (if (boolean? value) (list value) #f))
|
||||
eq?
|
||||
#f))
|
||||
(gnc:config-var-value-set! gnc:*debugging?* #f current-value))
|
||||
|
||||
(set! gnc:*loglevel*
|
||||
(gnc:make-config-var
|
||||
(N_ "Logging level from 0 (least logging) to 5 (most logging).")
|
||||
(lambda (var value) (if (exact? value) (list value) #f))
|
||||
eq?
|
||||
#f))
|
||||
|
||||
(set! gnc:*doc-path*
|
||||
(gnc:make-path-config-var
|
||||
(N_ "A list of directories (strings) indicating where to look for html and parsed-html files. \
|
||||
@@ -111,20 +92,6 @@ the current value of the path.")
|
||||
;; for now since it doesn't depend on running any code.
|
||||
(define gnc:*arg-defs*
|
||||
(list
|
||||
(list "debug"
|
||||
'boolean
|
||||
(lambda (val)
|
||||
(gnc:config-var-value-set! gnc:*debugging?* #f val))
|
||||
#f
|
||||
(N_ "Enable debugging mode"))
|
||||
|
||||
(list "loglevel"
|
||||
'integer
|
||||
(lambda (val)
|
||||
(gnc:config-var-value-set! gnc:*loglevel* #f val))
|
||||
"LOGLEVEL"
|
||||
(N_ "Set the logging level from 0 (least) to 6 (most)"))
|
||||
|
||||
(list "doc-path"
|
||||
'string
|
||||
(lambda (val)
|
||||
|
||||
@@ -45,7 +45,6 @@
|
||||
|
||||
;; from main.scm
|
||||
(export gnc:version)
|
||||
(export gnc:debugging?)
|
||||
(export gnc:warn)
|
||||
(export gnc:error)
|
||||
(export gnc:msg)
|
||||
@@ -89,15 +88,6 @@
|
||||
|
||||
;;(use-modules (ice-9 statprof))
|
||||
|
||||
;; These will be converted to config vars later (see command-line.scm)
|
||||
(define gnc:*debugging?* (if (getenv "GNC_DEBUG") #t #f))
|
||||
|
||||
;; Function to get debugging
|
||||
(define (gnc:debugging?)
|
||||
(if (boolean? gnc:*debugging?*)
|
||||
gnc:*debugging?*
|
||||
(gnc:config-var-value-get gnc:*debugging?*)))
|
||||
|
||||
(define (gnc:setup-debugging)
|
||||
(if (gnc:debugging?)
|
||||
(debug-enable 'backtrace)))
|
||||
|
||||
Reference in New Issue
Block a user