Skip to content

Commit

Permalink
[reports] pulse progress bar in common html-object renderer code
Browse files Browse the repository at this point in the history
... instead of individual html-object renderers as in 63ec05d. We
can also increase pulse tempo (from 2500 calls to 1000 calls) without
significantly affecting performance.
  • Loading branch information
christopherlam committed Sep 15, 2020
1 parent 683fe2f commit 7152b26
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 6 deletions.
4 changes: 2 additions & 2 deletions gnucash/report/html-document.scm
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,7 @@
;; now render the children
(for-each
(lambda (child)
(push (gnc:html-object-render child doc))
(gnc:pulse-progress-bar))
(push (gnc:html-object-render child doc)))
objs)

(when headers?
Expand Down Expand Up @@ -331,6 +330,7 @@
(gnc:html-document-render-data doc obj)) obj))))

(define (gnc:html-object-render obj doc)
(gnc:pulse-progress-bar)
(if (gnc:html-object? obj)
((gnc:html-object-renderer obj) (gnc:html-object-data obj) doc)
(let ((htmlo (gnc:make-html-object obj)))
Expand Down
2 changes: 0 additions & 2 deletions gnucash/report/html-table.scm
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@
(format #f "colspan=\"~a\"" (gnc:html-table-cell-colspan cell))))
(for-each
(lambda (child)
(gnc:pulse-progress-bar)
(push (gnc:html-object-render child doc)))
cell-data)
(push (gnc:html-document-markup-end doc cell-tag))
Expand Down Expand Up @@ -476,7 +475,6 @@
(push (gnc:html-document-markup-end doc rowmarkup))
(when rowstyle (gnc:html-document-pop-style doc))

(gnc:pulse-progress-bar)
(rowloop (cdr rows) (1+ rownum)))))
(push (gnc:html-document-markup-end doc "tbody"))

Expand Down
1 change: 0 additions & 1 deletion gnucash/report/html-text.scm
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@
(gnc:html-document-push-style doc (gnc:html-text-style p))
(for-each
(lambda (elt)
(gnc:pulse-progress-bar)
(cond ((procedure? elt)
(push (elt doc)))
(#t
Expand Down
2 changes: 1 addition & 1 deletion gnucash/report/report-utilities.scm
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ query instead.")
(let ((pulse-idx 0))
(lambda ()
(set! pulse-idx (1+ pulse-idx))
(when (= pulse-idx 2500)
(when (= pulse-idx 1000)
(set! pulse-idx 0)
(gnc-window-show-progress "" 105)))))

Expand Down

0 comments on commit 7152b26

Please sign in to comment.