On Thu, Jan 08, 2009 at 02:46:26PM -0700, Bartosz Sawicki wrote:
Class Progress is brilliant. I really love it, but sometimes progress
meter is too talkative for me. I think that if the time needed to
compute something is very short, we don't need any extra information
about it. Progress bar should be completely silent in such cases.
On the other hand progress bar is used too rarely. Mesh connectivity
computation, assembling usually takes a lot of time for bigger meshes.
It would be great to use Progress in such places.
So I've prepared patch which changes behavior of Progress class. I
introduced some logical flags which control when to display information.
Nothing special, but now you can use Progress as much as you want,
without worry that there will be too much messages.
regrds.
BArtek
ps.
Progress class destructor shouldn't display anything. It is inconvenient
to call destructor when you want to close progress bar.
ps1.
If user really wants progress bar even when the task takes 1ms, I give
him new constructor Progress p(string, int, bool always). If last
argument is true, progress bar always will be displayed.
Would it be better to make it a global option? Something like
dolfin_set("always display progress", true/false);