Johannes Meixner wrote:
On Jan 23 09:17 Ladislav Slezak wrote (shortened):
The new functionality allows you to create a
"parent progress" which has two
stages. The progress values will be recalculated so that the first Write() call
will display progress from 0% to 50% the second one from 50% to 100%.
Can the "parent progress" only have two stages?
What about three or more stages?
No, problem, "any" number of stages is supported, each stage is dynamically
partitioned at runtime if a nested progress is started.
The level is
"unlimited", the first Write() can call another nested two Write()
functions which will be recalculated to 0%-25% and to 25%-50%, and so on...
I wonder whether this recalculation is really right.
Assume the hierarchy is:
parent -> child1, child2 -> child1, grandchild1, grandchild2
If I understand you correctly, the recalculated progress values are:
child1: 0% to 50%
grandchild1: 50% to 75%
grandchild2: 75% to 100%
Yes, your assumption is right.
I think that usually the user assumes that the
match to the time it takes to do the task.
But because of your recalculation it looks as if child1 needs
twice the time of a grandchild.
I think a better recalculation would be to devide it equally
regardless if it is a child or grandchild, i.e:
child1: 0% to 33%
grandchild1: 33% to 66%
grandchild2: 66% to 100%
In this case you need to know how many children there will be _before_ the
progress is started. And this is the problem. If you call Foo::Write() function
you do not know how many nested progresses there will be and how many steps they
will have (and even you know that it can be changed in the future).
I think the current implementation is good enough, the most important thing for
user is usually to see a change in the progress. The exact amount of the change
is usually not very important.
SUSE LINUX, s.r.o. e-mail: lslezak(a)suse.cz
Lihovarská 1060/12 tel: +420 284 028 960
190 00 Prague 9 fax: +420 284 028 951
Czech Republic http://www.suse.cz/
To unsubscribe, e-mail: yast-devel+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-devel+help(a)opensuse.org