[report] display gnc-error-dialog only when UI is running

This is preparation work for creating report.scm tests.
This commit is contained in:
Christopher Lam 2019-02-26 14:00:15 +08:00
parent 0ce6999ff6
commit d980bb50f7

View File

@ -398,8 +398,10 @@
)
report-id
)
(begin
(gnc-error-dialog '() (string-append "Report Failed! One of your previously opened reports has failed to open. The template on which it was based: " template-name ", was not found."))
(let ((errmsg (string-append "Report Failed! One of your previously opened reports has failed to open. The template on which it was based: " template-name ", was not found.")))
(if (gnucash-ui-is-running)
(gnc-error-dialog '() errmsg)
(gnc:warn errmsg))
#f))
)
@ -415,8 +417,10 @@
)
report-id
)
(begin
(gnc-error-dialog '() (string-append "Report Failed! One of your previously opened reports has failed to open. The template on which it was based: " template-name ", was not found."))
(let ((errmsg (string-append "Report Failed! One of your previously opened reports has failed to open. The template on which it was based: " template-name ", was not found.")))
(if (gnucash-ui-is-running)
(gnc-error-dialog '() errmsg)
(gnc:warn errmsg))
#f))
)
@ -934,6 +938,8 @@
(set! gnc:old-style-restore-warned #t)
(gnc-warning-dialog '() (string-append (_ "Some reports stored in a legacy format were found. This format is not supported anymore so these reports may not have been restored properly.")))))
(gnc-report-add r))
(begin
(gnc-error-dialog '() (string-append "Report Failed! One of your previously opened reports has failed to open. The template on which it was based: " template-name ", was not found."))
(let ((errmsg (string-append "Report Failed! One of your previously opened reports has failed to open. The template on which it was based: " template-name ", was not found.")))
(if (gnucash-ui-is-running)
(gnc-error-dialog '() errmsg)
(gnc:warn errmsg))
#f)))