Issue 5969 in pharo: [ENH]: Clean SystemProgressMorph and friends (Part 2)

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

Issue 5969 in pharo: [ENH]: Clean SystemProgressMorph and friends (Part 2)

pharo
Status: Accepted
Owner: [hidden email]
Labels: Type-Enh Milestone-2.0

New issue 5969 by [hidden email]: [ENH]: Clean SystemProgressMorph  
and friends (Part 2)
http://code.google.com/p/pharo/issues/detail?id=5969

A continuation of "Issue 5897: [ENH]: Clean SystemProgressMorph and  
friends":

* Cleanup NewSystemProgressMorph
* Replace SystemProgressMorph with NewSystemProgressMorph throughout system


_______________________________________________
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 5969 in pharo: [ENH]: Clean SystemProgressMorph and friends (Part 2)

pharo

Comment #1 on issue 5969 by [hidden email]: [ENH]: Clean  
SystemProgressMorph and friends (Part 2)
http://code.google.com/p/pharo/issues/detail?id=5969

Issue 5968 has been merged into this issue.


_______________________________________________
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 5969 in pharo: [ENH]: Clean SystemProgressMorph and friends (Part 2)

pharo
Updates:
        Status: FixReviewNeeded

Comment #2 on issue 5969 by [hidden email]: [ENH]: Clean  
SystemProgressMorph and friends (Part 2)
http://code.google.com/p/pharo/issues/detail?id=5969

This version is much cleaner and seems to work well. I tested it loading a  
few Metacello configurations. There is a small issue where long labels make  
the morph off-center for an instant, but it seems like we're moving toward  
putting it in a corner anyway  
(http://forum.world.st/Progress-bar-in-the-top-left-td4631530.html), so I  
won't spend time fixing it now...

Fix in inbox:  
SLICE-Issue-5969-ENH-Clean-SystemProgressMorph-and-friends-Part-2-SeanDeNigris.1

* Cleanup new classes
        - categorize all uncategorized methods
        - a lot of little cleanups, refactors
        - NewSystemProgressMorph
                - remove forking
                - fix recentering when long labels are added
* Integrate new classes with the system
        - Replace SystemProgressMorph with NewSystemProgressMorph (i.e. remove  
SystemProgressMorph and rename NewSystemProgressMorph to  
SystemProgressMorph)
        - SystemProgressBarMorph -> ProgressBarMorph (there is  
nothing "system"-specific about it. It is generally useful
        - ProgressInitiationException>>defaultMorphicAction - update to new  
classes/functionality
* related changes
        - Collection>>do:displayingProgress:every:
                - return immediately for empty collections
                - if aStringOrBlock is aString, use it right away
        - Polymorph - fixed some formatting (e.g. double spaces)


_______________________________________________
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 5969 in pharo: [ENH]: Clean SystemProgressMorph and friends (Part 2)

pharo

Comment #3 on issue 5969 by [hidden email]: [ENH]: Clean  
SystemProgressMorph and friends (Part 2)
http://code.google.com/p/pharo/issues/detail?id=5969

I could not load the slice because the progress bar. Sean probably we  
should nuke the progress bar then modify then load.



_______________________________________________
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 5969 in pharo: [ENH]: Clean SystemProgressMorph and friends (Part 2)

pharo

Comment #4 on issue 5969 by [hidden email]: [ENH]: Clean  
SystemProgressMorph and friends (Part 2)
http://code.google.com/p/pharo/issues/detail?id=5969

I will try to have a look.



_______________________________________________
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 5969 in pharo: [ENH]: Clean SystemProgressMorph and friends (Part 2)

pharo

Comment #5 on issue 5969 by [hidden email]: [ENH]: Clean  
SystemProgressMorph and friends (Part 2)
http://code.google.com/p/pharo/issues/detail?id=5969

sean did you succeed to load your slice in your image?



_______________________________________________
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 5969 in pharo: [ENH]: Clean SystemProgressMorph and friends (Part 2)

pharo

Comment #6 on issue 5969 by [hidden email]: [ENH]: Clean  
SystemProgressMorph and friends (Part 2)
http://code.google.com/p/pharo/issues/detail?id=5969

I tried to cut the notification for loading your changes but it did not work


_______________________________________________
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 5969 in pharo: [ENH]: Clean SystemProgressMorph and friends (Part 2)

pharo

Comment #7 on issue 5969 by [hidden email]: [ENH]: Clean  
SystemProgressMorph and friends (Part 2)
http://code.google.com/p/pharo/issues/detail?id=5969

I thought so... let me take a look...


_______________________________________________
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 5969 in pharo: [ENH]: Clean SystemProgressMorph and friends (Part 2)

pharo

Comment #8 on issue 5969 by [hidden email]: [ENH]: Clean  
SystemProgressMorph and friends (Part 2)
http://code.google.com/p/pharo/issues/detail?id=5969

I could hack it in order to succeed and load :)

ProgressInitiationException>>defaultMorphicAction
        | result progress |
        [[ result := workBlock value: [ :a | 1 ] ] on: ProgressNotification do:  
#resume.] ensure: [ SystemProgressMorph uniqueInstance delete ].
        self resume: result.

In latest clean 2.0
I put it here for documentation :P


_______________________________________________
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 5969 in pharo: [ENH]: Clean SystemProgressMorph and friends (Part 2)

pharo

Comment #9 on issue 5969 by [hidden email]: [ENH]: Clean  
SystemProgressMorph and friends (Part 2)
http://code.google.com/p/pharo/issues/detail?id=5969

Great! I developed in a separate class and renamed, so I probably never had  
to load it...


_______________________________________________
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 5969 in pharo: [ENH]: Clean SystemProgressMorph and friends (Part 2)

pharo

Comment #10 on issue 5969 by [hidden email]: [ENH]: Clean  
SystemProgressMorph and friends (Part 2)
http://code.google.com/p/pharo/issues/detail?id=5969

guille proposed to load the code but ... does not work with merging.

defaultMorphicAction
     | result progress |
     "progress := SystemProgressMorph label: progressTitle min: minVal max:  
maxVal.
     [[result := workBlock value: progress] on: ProgressNotification do:  
[:ex|
         ex extraParam isString
             ifTrue: [SystemProgressMorph uniqueInstance labelAt: progress  
put: ex extraParam].
         ex resume]] ensure: [SystemProgressMorph close: progress]."
     [[ result := workBlock value: [ :a | 1 ] ] on: ProgressNotification  
do:  #resume.] ensure: [ SystemProgressMorph uniqueInstance delete ].
     self resume: result




_______________________________________________
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 5969 in pharo: [ENH]: Clean SystemProgressMorph and friends (Part 2)

pharo

Comment #11 on issue 5969 by [hidden email]: [ENH]: Clean  
SystemProgressMorph and friends (Part 2)
http://code.google.com/p/pharo/issues/detail?id=5969

I'm looking now... just dl-ing a fresh 2.0...


_______________________________________________
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 5969 in pharo: [ENH]: Clean SystemProgressMorph and friends (Part 2)

pharo

Comment #12 on issue 5969 by [hidden email]: [ENH]: Clean  
SystemProgressMorph and friends (Part 2)
http://code.google.com/p/pharo/issues/detail?id=5969

argh this does not work because

do: aBlock displayingProgress: aStringOrBlock every: msecs
        "Enumerate aBlock displaying progress information.
        If the argument is a string, use a static label for the process.
        If the argument is a block, evaluate it with the element to retrieve  
the label.
        The msecs argument ensures that updates happen at most every msecs.
        Example:
                Smalltalk allClasses
                        do:[:aClass| (Delay forMilliseconds: 1) wait]
                        displayingProgress:[:aClass| 'Processing ', aClass  
name]
                        every: 0."

        | size labelBlock count oldLabel lastUpdate |
        self isEmpty ifTrue: [ ^ self ].
        oldLabel := nil.
        count := lastUpdate := 0.
        size := self size.
        '' displayProgressFrom: 0 to: size during: [:bar |
                labelBlock := aStringOrBlock isString
                        ifTrue: [
                                bar label: aStringOrBlock.
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
expect something that accept a label


                                [ :item | aStringOrBlock]]
                        ifFalse: [aStringOrBlock].
                self do: [:each| | newLabel |
                                "Special handling for first and last element"
                                (count = 0 or: [count+1 = size
                                        or: [(Time millisecondsSince: lastUpdate) >= msecs]])
                                                ifTrue: [
                                                        bar value: count.
                                                        oldLabel = (newLabel := (labelBlock value: each) ifNil: [oldLabel])
                                                                ifFalse: [ProgressNotification signal: '' extra: (oldLabel :=  
newLabel)].
                                lastUpdate := Time millisecondClockValue ].
                        aBlock value: each.
                        count := count + 1]]


_______________________________________________
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 5969 in pharo: [ENH]: Clean SystemProgressMorph and friends (Part 2)

pharo

Comment #13 on issue 5969 by [hidden email]: [ENH]: Clean  
SystemProgressMorph and friends (Part 2)
http://code.google.com/p/pharo/issues/detail?id=5969

Sean

could you split a bit your changes because I'm just losing time on this  
one. Since I do not know what you did
it is like working in the dark.




_______________________________________________
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 5969 in pharo: [ENH]: Clean SystemProgressMorph and friends (Part 2)

pharo

Comment #14 on issue 5969 by [hidden email]: [ENH]: Clean  
SystemProgressMorph and friends (Part 2)
http://code.google.com/p/pharo/issues/detail?id=5969

I'm still trying a last time. Loading instead of merging seems to work.


_______________________________________________
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 5969 in pharo: [ENH]: Clean SystemProgressMorph and friends (Part 2)

pharo

Comment #15 on issue 5969 by [hidden email]: [ENH]: Clean  
SystemProgressMorph and friends (Part 2)
http://code.google.com/p/pharo/issues/detail?id=5969

Loading seems to work. Running the tests....


_______________________________________________
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 5969 in pharo: [ENH]: Clean SystemProgressMorph and friends (Part 2)

pharo
Updates:
        Status: Integrated

Comment #16 on issue 5969 by [hidden email]: [ENH]: Clean  
SystemProgressMorph and friends (Part 2)
http://code.google.com/p/pharo/issues/detail?id=5969

in 20120.
Sean can you verify that this is ok.


_______________________________________________
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 5969 in pharo: [ENH]: Clean SystemProgressMorph and friends (Part 2)

pharo

Comment #17 on issue 5969 by [hidden email]: [ENH]: Clean  
SystemProgressMorph and friends (Part 2)
http://code.google.com/p/pharo/issues/detail?id=5969

Yes! I am nervous about this one because everything uses progress bar...


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