Re: Issue 6099 in pharo: Deprecate #value: for system progress (was red cross during updates)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Issue 6099 in pharo: Deprecate #value: for system progress (was red cross during updates)

pharo
Updates:
        Summary: Deprecate #value: for system progress (was red cross during  
updates)

Comment #1 on issue 6099 by [hidden email]: Deprecate #value: for  
system progress (was red cross during updates)
http://code.google.com/p/pharo/issues/detail?id=6099

(No comment was entered for this change.)


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 6099 in pharo: Deprecate #value: for system progress (was red cross during updates)

pharo
Updates:
        Status: FixReviewNeeded

Comment #2 on issue 6099 by [hidden email]: Deprecate #value: for  
system progress (was red cross during updates)
http://code.google.com/p/pharo/issues/detail?id=6099

Fix in inbox:  
SLICE-Issue-6099-Deprecate-value-for-system-progress-was-red-cross-during-updates-SeanDeNigris.1

Loads successfully in Pharo2.0a Latest update: #20149

MOTIVATION:
The old system progress worked like this (for example)...

        SystemProgressMorph show: 'Doing...' from: 1 to: 100 during: [ :bar |
                1 to: 100 do: [ :x |
                        bar value: x.
                        bar value: 'On iteration ', x asString.
                        (Delay forMilliseconds: 20) wait "Just to slow it down so we can see  
what's going on" ] ].

* The work block ([ :bar | ... ] above) would accept one argument
* That argument (:bar above) would be a block, that would act as a  
pseudo-class. Depending on what was passed to #value:, it would perform  
different functions. Two are illustrated above:
   - #value: aNumber; where aNumber is between the min and max of the  
progress range -> Set the bar's current progress mark to that position. For  
example, 'bar value: 50' above would show the operation half complete
   - #value: aString -> Set the label of the progress morph to aString

This was very confusing, so we created a real class,  
SystemProgressItemMorph, which now gets passed to the work block, and has a  
real API. So, for example, the following becomes:

        SystemProgressMorph show: 'Doing...' from: 1 to: 100 during: [ :bar |
                1 to: 100 do: [ :x |
                        bar current: x.
                        bar label: 'On iteration ', x asString.
                        (Delay forMilliseconds: 20) wait "Just to slow it down so we can see  
what's going on" ] ].
       
As you can see, '#value: newValue' has become '#current: newValue',  
and '#value: newLabel' has become '#label: newLabel'.

One wrinkle is that some users were passing a nil-like block instead of the  
the pseudo-class to suppress the system progress bar. For example:
        informUserDuring: aBlock
                aBlock value: [:string | ].

Above, [:string | ] would now cause a DNU when sent, for example,  
#current:, which obviously blocks don't understand. So, these cases were  
changed like so:
        informUserDuring: aBlock
                aBlock value: DummySystemProgressItem new.

Where DummySystemProgressItem simply ignores all messages without signaling  
an error

CHANGES:
* fix all uses of the old api (#value:) in the image
* deprecate #value: to ease the transition of users
* fix uses that were passing a nil-like block as the pseudo-class, which  
now causes errors when receiving messages understood by  
SystemProgressItemMorph. Instead, pass aDummySystemProgressItem, which  
simply ignores all messages without signaling an error.
* fix #sendNotificationsTo: to take anObject conforming to the  
SystemProgressItemMorph API instead of a block. This works for the known  
uses in the image, but is not nearly as flexible as the old behavior. It's  
a bigger burden to have to create an entire object, than just to pass in a  
block. But let's wait and see if anyone complains...


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 6099 in pharo: Deprecate #value: for system progress (was red cross during updates)

pharo

Comment #3 on issue 6099 by [hidden email]: Deprecate #value: for  
system progress (was red cross during updates)
http://code.google.com/p/pharo/issues/detail?id=6099

It'd be *great* if this fix is reviewed quickly because it touches quite a  
few packages and will rot quickly


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 6099 in pharo: Deprecate #value: for system progress (was red cross during updates)

pharo

Comment #4 on issue 6099 by [hidden email]: Deprecate #value: for  
system progress (was red cross during updates)
http://code.google.com/p/pharo/issues/detail?id=6099

I will look at it now.
My first fix was not good to me.


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 6099 in pharo: Deprecate #value: for system progress (was red cross during updates)

pharo
Updates:
        Status: Integrated

Comment #5 on issue 6099 by [hidden email]: Deprecate #value: for  
system progress (was red cross during updates)
http://code.google.com/p/pharo/issues/detail?id=6099

in 20151.



_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker