Give user feedback during the rendering of a report.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7691 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
David Hampton 2002-12-16 01:41:45 +00:00
parent 66b943f4c8
commit 18ac421c7c
3 changed files with 20 additions and 3 deletions

View File

@ -115,13 +115,17 @@
;; otherwise, do the trivial render.
(let* ((retval '())
(push (lambda (l) (set! retval (cons l retval)))))
(push (lambda (l) (set! retval (cons l retval))))
(objs (gnc:html-document-objects doc))
(work-to-do (length objs))
(work-done 0))
;; compile the doc style
(gnc:html-style-table-compile (gnc:html-document-style doc)
(gnc:html-document-style-stack doc))
;; push it
(gnc:html-document-push-style doc (gnc:html-document-style doc))
(gnc:report-render-starting (gnc:html-document-title doc))
(if (not (null? headers?))
(begin
(push "<html>\n")
@ -138,14 +142,18 @@
;; now render the children
(for-each
(lambda (child)
(push (gnc:html-object-render child doc)))
(gnc:html-document-objects doc))
(begin
(push (gnc:html-object-render child doc))
(set! work-done (+ 1 work-done))
(gnc:report-percent-done (* 100 (/ work-done work-to-do)))))
objs)
(if (not (null? headers?))
(begin
(push "</body>\n")
(push "</html>\n")))
(gnc:report-finished)
(gnc:html-document-pop-style doc)
(gnc:html-style-table-uncompile (gnc:html-document-style doc))

View File

@ -545,6 +545,7 @@
(export gnc:query-set-match-voids-only!)
(export gnc:split-voided?)
(export gnc:report-starting)
(export gnc:report-render-starting)
(export gnc:report-percent-done)
(export gnc:report-finished)
(export gnc:accounts-count-splits)

View File

@ -674,6 +674,14 @@
(gnc:gettext report-name))
0))
(define (gnc:report-render-starting report-name)
(gnc:mdi_show_progress (sprintf #f
(_ "Rendering '%s' report ...")
(if (string-null? report-name)
(gnc:gettext "Untitled")
(gnc:gettext report-name)))
0))
(define (gnc:report-percent-done percent)
(gnc:mdi_show_progress #f (truncate percent)))