The Inbox: Morphic-nice.635.mcz

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

The Inbox: Morphic-nice.635.mcz

commits-2
A new version of Morphic was added to project The Inbox:
http://source.squeak.org/inbox/Morphic-nice.635.mcz

==================== Summary ====================

Name: Morphic-nice.635
Author: nice
Time: 22 January 2013, 10:57:07.833 pm
UUID: 3a69be3a-68a2-47aa-86e5-1aa7147bcb38
Ancestors: Morphic-dtl.634

Let TheWorldMainDockingBar points weakly on opened windows.
Otherwise they won't be garbage collected until next time the 'windows' menu is opened.

=============== Diff against Morphic-dtl.634 ===============

Item was changed:
  ----- Method: TheWorldMainDockingBar>>listWindowsOn: (in category 'submenu - windows') -----
  listWindowsOn: menu
 
  | windows |
  windows := SortedCollection sortBlock: [:winA :winB |
  winA model name = winB model name
  ifTrue: [winA label < winB label]
  ifFalse: [winA model name < winB model name]].
  windows addAll: self allVisibleWindows.
  windows ifEmpty: [
  menu addItem: [ :item |
  item
  contents: 'No Windows' translated;
  isEnabled: false ] ].
  windows do: [ :each |
+ | weak |
+ weak := WeakArray with: each.
  menu addItem: [ :item |
  item
  contents: (self windowMenuItemLabelFor: each);
  icon: (self colorIcon: each model defaultBackgroundColor);
- target: each;
- selector: #comeToFront;
  subMenuUpdater: self
+ selector: #windowMenuFor:on:
+ arguments: { weak };
+ action: [ weak first ifNotNil: [:w | w activateAndForceLabelToShow; expand ] ] ] ].!
- selector: #windowMenuFor:on:
- arguments: { each };
- action: [ each activateAndForceLabelToShow; expand ] ] ].!

Item was changed:
  ----- Method: TheWorldMainDockingBar>>windowMenuFor:on: (in category 'submenu - windows') -----
+ windowMenuFor: weakArray on: menu
+ weakArray first
+ ifNil:
+ [menu
+ addItem: [ :item |
+ item
+ contents: 'already closed...' translated ;
+ isEnabled: false ]]
+ ifNotNil:
+ [:window |
+ menu
+ addItem: [ :item |
+ item
+ contents: 'Close' translated ;
+ target: window;
+ selector: #delete ];
+ addItem: [ :item |
+ item
+ contents: 'Close all like this' translated ;
+ target: self;
+ selector: #closeAllWindowsLike:;
+ arguments: { window } ];
+ addItem: [ :item |
+ item
+ contents: 'Close all but this' translated ;
+ target: self;
+ selector: #closeAllWindowsBut:;
+ arguments: { window } ];
+ addItem: [ :item |
+ item
+ contents: 'Expand or Contract' translated ;
+ target: window;
+ selector: #expandBoxHit ] ]!
- windowMenuFor: window on: menu
- menu
- addItem: [ :item |
- item
- contents: 'Close' translated ;
- target: window;
- selector: #delete ];
- addItem: [ :item |
- item
- contents: 'Close all like this' translated ;
- target: self;
- selector: #closeAllWindowsLike:;
- arguments: { window } ];
- addItem: [ :item |
- item
- contents: 'Close all but this' translated ;
- target: self;
- selector: #closeAllWindowsBut:;
- arguments: { window } ];
- addItem: [ :item |
- item
- contents: 'Expand or Contract' translated ;
- target: window;
- selector: #expandBoxHit ]!


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Morphic-nice.635.mcz

Hannes Hirzel
Ok, this is a different approach from what Bert suggests

http://lists.squeakfoundation.org/pipermail/squeak-dev/2013-January/168158.html

to make it possible that closed Monticello windows are garbage
collected and with them MCDefinitions. Both apply to all windows.

What are the pros and cons?

--Hannes

On Tue, 22 Jan 2013 21:57:54.533 0000, [hidden email]
<[hidden email]> wrote:

> A new version of Morphic was added to project The Inbox:
> http://source.squeak.org/inbox/Morphic-nice.635.mcz
>
> ==================== Summary ====================
>
> Name: Morphic-nice.635
> Author: nice
> Time: 22 January 2013, 10:57:07.833 pm
> UUID: 3a69be3a-68a2-47aa-86e5-1aa7147bcb38
> Ancestors: Morphic-dtl.634
>
> Let TheWorldMainDockingBar points weakly on opened windows.
> Otherwise they won't be garbage collected until next time the 'windows' menu
> is opened.
>
> =============== Diff against Morphic-dtl.634 ===============
>
> Item was changed:
>   ----- Method: TheWorldMainDockingBar>>listWindowsOn: (in category 'submenu
> - windows') -----
>   listWindowsOn: menu
>
>   | windows |
>   windows := SortedCollection sortBlock: [:winA :winB |
>   winA model name = winB model name
>   ifTrue: [winA label < winB label]
>   ifFalse: [winA model name < winB model name]].
>   windows addAll: self allVisibleWindows.
>   windows ifEmpty: [
>   menu addItem: [ :item |
>   item
>   contents: 'No Windows' translated;
>   isEnabled: false ] ].
>   windows do: [ :each |
> + | weak |
> + weak := WeakArray with: each.
>   menu addItem: [ :item |
>   item
>   contents: (self windowMenuItemLabelFor: each);
>   icon: (self colorIcon: each model defaultBackgroundColor);
> - target: each;
> - selector: #comeToFront;
>   subMenuUpdater: self
> + selector: #windowMenuFor:on:
> + arguments: { weak };
> + action: [ weak first ifNotNil: [:w | w activateAndForceLabelToShow;
> expand ] ] ] ].!
> - selector: #windowMenuFor:on:
> - arguments: { each };
> - action: [ each activateAndForceLabelToShow; expand ] ] ].!
>
> Item was changed:
>   ----- Method: TheWorldMainDockingBar>>windowMenuFor:on: (in category
> 'submenu - windows') -----
> + windowMenuFor: weakArray on: menu
> + weakArray first
> + ifNil:
> + [menu
> + addItem: [ :item |
> + item
> + contents: 'already closed...' translated ;
> + isEnabled: false ]]
> + ifNotNil:
> + [:window |
> + menu
> + addItem: [ :item |
> + item
> + contents: 'Close' translated ;
> + target: window;
> + selector: #delete ];
> + addItem: [ :item |
> + item
> + contents: 'Close all like this' translated ;
> + target: self;
> + selector: #closeAllWindowsLike:;
> + arguments: { window } ];
> + addItem: [ :item |
> + item
> + contents: 'Close all but this' translated ;
> + target: self;
> + selector: #closeAllWindowsBut:;
> + arguments: { window } ];
> + addItem: [ :item |
> + item
> + contents: 'Expand or Contract' translated ;
> + target: window;
> + selector: #expandBoxHit ] ]!
> - windowMenuFor: window on: menu
> - menu
> - addItem: [ :item |
> - item
> - contents: 'Close' translated ;
> - target: window;
> - selector: #delete ];
> - addItem: [ :item |
> - item
> - contents: 'Close all like this' translated ;
> - target: self;
> - selector: #closeAllWindowsLike:;
> - arguments: { window } ];
> - addItem: [ :item |
> - item
> - contents: 'Close all but this' translated ;
> - target: self;
> - selector: #closeAllWindowsBut:;
> - arguments: { window } ];
> - addItem: [ :item |
> - item
> - contents: 'Expand or Contract' translated ;
> - target: window;
> - selector: #expandBoxHit ]!
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Morphic-nice.635.mcz

Nicolas Cellier
Bert's solution is simpler, so he shall better commit it to trunk and
I will reject this one in treated inbox.

2013/1/22 H. Hirzel <[hidden email]>:

> Ok, this is a different approach from what Bert suggests
>
> http://lists.squeakfoundation.org/pipermail/squeak-dev/2013-January/168158.html
>
> to make it possible that closed Monticello windows are garbage
> collected and with them MCDefinitions. Both apply to all windows.
>
> What are the pros and cons?
>
> --Hannes
>
> On Tue, 22 Jan 2013 21:57:54.533 0000, [hidden email]
> <[hidden email]> wrote:
>> A new version of Morphic was added to project The Inbox:
>> http://source.squeak.org/inbox/Morphic-nice.635.mcz
>>
>> ==================== Summary ====================
>>
>> Name: Morphic-nice.635
>> Author: nice
>> Time: 22 January 2013, 10:57:07.833 pm
>> UUID: 3a69be3a-68a2-47aa-86e5-1aa7147bcb38
>> Ancestors: Morphic-dtl.634
>>
>> Let TheWorldMainDockingBar points weakly on opened windows.
>> Otherwise they won't be garbage collected until next time the 'windows' menu
>> is opened.
>>
>> =============== Diff against Morphic-dtl.634 ===============
>>
>> Item was changed:
>>   ----- Method: TheWorldMainDockingBar>>listWindowsOn: (in category 'submenu
>> - windows') -----
>>   listWindowsOn: menu
>>
>>       | windows |
>>       windows := SortedCollection sortBlock: [:winA :winB |
>>               winA model name = winB model name
>>                       ifTrue: [winA label < winB label]
>>                       ifFalse: [winA model name < winB model name]].
>>       windows addAll: self allVisibleWindows.
>>       windows ifEmpty: [
>>               menu addItem: [ :item |
>>                       item
>>                               contents: 'No Windows' translated;
>>                               isEnabled: false ] ].
>>       windows do: [ :each |
>> +             | weak |
>> +             weak := WeakArray with: each.
>>               menu addItem: [ :item |
>>                       item
>>                               contents: (self windowMenuItemLabelFor: each);
>>                               icon: (self colorIcon: each model defaultBackgroundColor);
>> -                             target: each;
>> -                             selector: #comeToFront;
>>                               subMenuUpdater: self
>> +                                     selector: #windowMenuFor:on:
>> +                                     arguments: { weak };
>> +                             action: [ weak first ifNotNil: [:w | w activateAndForceLabelToShow;
>> expand ] ] ] ].!
>> -                             selector: #windowMenuFor:on:
>> -                             arguments: { each };
>> -                             action: [ each activateAndForceLabelToShow; expand ] ] ].!
>>
>> Item was changed:
>>   ----- Method: TheWorldMainDockingBar>>windowMenuFor:on: (in category
>> 'submenu - windows') -----
>> + windowMenuFor: weakArray on: menu
>> +     weakArray first
>> +             ifNil:
>> +                     [menu
>> +                             addItem: [ :item |
>> +                                     item
>> +                                             contents: 'already closed...' translated ;
>> +                                             isEnabled: false ]]
>> +             ifNotNil:
>> +                     [:window |
>> +                     menu
>> +                             addItem: [ :item |
>> +                                     item
>> +                                             contents: 'Close' translated ;
>> +                                             target: window;
>> +                                             selector: #delete ];
>> +                             addItem: [ :item |
>> +                                     item
>> +                                             contents: 'Close all like this' translated ;
>> +                                             target: self;
>> +                                             selector: #closeAllWindowsLike:;
>> +                                             arguments: { window } ];
>> +                             addItem: [ :item |
>> +                                     item
>> +                                             contents: 'Close all but this' translated ;
>> +                                             target: self;
>> +                                             selector: #closeAllWindowsBut:;
>> +                                             arguments: { window } ];
>> +                             addItem: [ :item |
>> +                                     item
>> +                                             contents: 'Expand or Contract' translated ;
>> +                                             target: window;
>> +                                             selector: #expandBoxHit ] ]!
>> - windowMenuFor: window on: menu
>> -     menu
>> -             addItem: [ :item |
>> -                     item
>> -                             contents: 'Close' translated ;
>> -                             target: window;
>> -                             selector: #delete ];
>> -             addItem: [ :item |
>> -                     item
>> -                             contents: 'Close all like this' translated ;
>> -                             target: self;
>> -                             selector: #closeAllWindowsLike:;
>> -                             arguments: { window } ];
>> -             addItem: [ :item |
>> -                     item
>> -                             contents: 'Close all but this' translated ;
>> -                             target: self;
>> -                             selector: #closeAllWindowsBut:;
>> -                             arguments: { window } ];
>> -             addItem: [ :item |
>> -                     item
>> -                             contents: 'Expand or Contract' translated ;
>> -                             target: window;
>> -                             selector: #expandBoxHit ]!
>>
>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Morphic-nice.635.mcz

Hannes Hirzel
Good to have this solution, thank you.
It will help me a lot as images grow older and larger (sometimes up to
80 MorphicProjects).

--Hannes

On 1/22/13, Nicolas Cellier <[hidden email]> wrote:

> Bert's solution is simpler, so he shall better commit it to trunk and
> I will reject this one in treated inbox.
>
> 2013/1/22 H. Hirzel <[hidden email]>:
>> Ok, this is a different approach from what Bert suggests
>>
>> http://lists.squeakfoundation.org/pipermail/squeak-dev/2013-January/168158.html
>>
>> to make it possible that closed Monticello windows are garbage
>> collected and with them MCDefinitions. Both apply to all windows.
>>
>> What are the pros and cons?
>>
>> --Hannes
>>
>> On Tue, 22 Jan 2013 21:57:54.533 0000, [hidden email]
>> <[hidden email]> wrote:
>>> A new version of Morphic was added to project The Inbox:
>>> http://source.squeak.org/inbox/Morphic-nice.635.mcz
>>>
>>> ==================== Summary ====================
>>>
>>> Name: Morphic-nice.635
>>> Author: nice
>>> Time: 22 January 2013, 10:57:07.833 pm
>>> UUID: 3a69be3a-68a2-47aa-86e5-1aa7147bcb38
>>> Ancestors: Morphic-dtl.634
>>>
>>> Let TheWorldMainDockingBar points weakly on opened windows.
>>> Otherwise they won't be garbage collected until next time the 'windows'
>>> menu
>>> is opened.
>>>
>>> =============== Diff against Morphic-dtl.634 ===============
>>>
>>> Item was changed:
>>>   ----- Method: TheWorldMainDockingBar>>listWindowsOn: (in category
>>> 'submenu
>>> - windows') -----
>>>   listWindowsOn: menu
>>>
>>>       | windows |
>>>       windows := SortedCollection sortBlock: [:winA :winB |
>>>               winA model name = winB model name
>>>                       ifTrue: [winA label < winB label]
>>>                       ifFalse: [winA model name < winB model name]].
>>>       windows addAll: self allVisibleWindows.
>>>       windows ifEmpty: [
>>>               menu addItem: [ :item |
>>>                       item
>>>                               contents: 'No Windows' translated;
>>>                               isEnabled: false ] ].
>>>       windows do: [ :each |
>>> +             | weak |
>>> +             weak := WeakArray with: each.
>>>               menu addItem: [ :item |
>>>                       item
>>>                               contents: (self windowMenuItemLabelFor:
>>> each);
>>>                               icon: (self colorIcon: each model
>>> defaultBackgroundColor);
>>> -                             target: each;
>>> -                             selector: #comeToFront;
>>>                               subMenuUpdater: self
>>> +                                     selector: #windowMenuFor:on:
>>> +                                     arguments: { weak };
>>> +                             action: [ weak first ifNotNil: [:w | w
>>> activateAndForceLabelToShow;
>>> expand ] ] ] ].!
>>> -                             selector: #windowMenuFor:on:
>>> -                             arguments: { each };
>>> -                             action: [ each activateAndForceLabelToShow;
>>> expand ] ] ].!
>>>
>>> Item was changed:
>>>   ----- Method: TheWorldMainDockingBar>>windowMenuFor:on: (in category
>>> 'submenu - windows') -----
>>> + windowMenuFor: weakArray on: menu
>>> +     weakArray first
>>> +             ifNil:
>>> +                     [menu
>>> +                             addItem: [ :item |
>>> +                                     item
>>> +                                             contents: 'already
>>> closed...' translated ;
>>> +                                             isEnabled: false ]]
>>> +             ifNotNil:
>>> +                     [:window |
>>> +                     menu
>>> +                             addItem: [ :item |
>>> +                                     item
>>> +                                             contents: 'Close'
>>> translated ;
>>> +                                             target: window;
>>> +                                             selector: #delete ];
>>> +                             addItem: [ :item |
>>> +                                     item
>>> +                                             contents: 'Close all like
>>> this' translated ;
>>> +                                             target: self;
>>> +                                             selector:
>>> #closeAllWindowsLike:;
>>> +                                             arguments: { window } ];
>>> +                             addItem: [ :item |
>>> +                                     item
>>> +                                             contents: 'Close all but
>>> this' translated ;
>>> +                                             target: self;
>>> +                                             selector:
>>> #closeAllWindowsBut:;
>>> +                                             arguments: { window } ];
>>> +                             addItem: [ :item |
>>> +                                     item
>>> +                                             contents: 'Expand or
>>> Contract' translated ;
>>> +                                             target: window;
>>> +                                             selector: #expandBoxHit ]
>>> ]!
>>> - windowMenuFor: window on: menu
>>> -     menu
>>> -             addItem: [ :item |
>>> -                     item
>>> -                             contents: 'Close' translated ;
>>> -                             target: window;
>>> -                             selector: #delete ];
>>> -             addItem: [ :item |
>>> -                     item
>>> -                             contents: 'Close all like this' translated
>>> ;
>>> -                             target: self;
>>> -                             selector: #closeAllWindowsLike:;
>>> -                             arguments: { window } ];
>>> -             addItem: [ :item |
>>> -                     item
>>> -                             contents: 'Close all but this' translated
>>> ;
>>> -                             target: self;
>>> -                             selector: #closeAllWindowsBut:;
>>> -                             arguments: { window } ];
>>> -             addItem: [ :item |
>>> -                     item
>>> -                             contents: 'Expand or Contract' translated
>>> ;
>>> -                             target: window;
>>> -                             selector: #expandBoxHit ]!
>>>
>>>
>>>
>>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Morphic-nice.635.mcz

Bert Freudenberg
On 22.01.2013, at 14:21, "H. Hirzel" <[hidden email]> wrote:

> Good to have this solution, thank you.
> It will help me a lot as images grow older and larger (sometimes up to
> 80 MorphicProjects).

Err, no. You still need to flush the MC caches manually from time to time using the MC menu item.

This docking bar change is just to get rid of unwanted dependencies, the space occupied by these windows is negligible.

- Bert -



Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Morphic-nice.635.mcz

Hannes Hirzel
Thank you for the clarification regarding MC caches. Where is the menu
item to flush MC caches manually from time to time?

It is not in the docking bar menu nor in the menu of the Monticello browser....

--Hannes

On 1/22/13, Bert Freudenberg <[hidden email]> wrote:

> On 22.01.2013, at 14:21, "H. Hirzel" <[hidden email]> wrote:
>
>> Good to have this solution, thank you.
>> It will help me a lot as images grow older and larger (sometimes up to
>> 80 MorphicProjects).
>
> Err, no. You still need to flush the MC caches manually from time to time
> using the MC menu item.
>
> This docking bar change is just to get rid of unwanted dependencies, the
> space occupied by these windows is negligible.
>
> - Bert -
>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Morphic-nice.635.mcz

Bert Freudenberg

On 22.01.2013, at 14:30, "H. Hirzel" <[hidden email]> wrote:

> Thank you for the clarification regarding MC caches. Where is the menu
> item to flush MC caches manually from time to time?
>
> It is not in the docking bar menu nor in the menu of the Monticello browser....


It is in the MC browser, in the context menu of the repository list.

- Bert -



Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Morphic-nice.635.mcz

Nicolas Cellier
In reply to this post by Hannes Hirzel
There is more...
(MCFileBasedRepository flushAllCaches) does not flush all the MCDefinition
The MCMethodDefinition ones corresponding to installed methods in the
system are remaining.

MCMethodDefinition class>>initialize
        Smalltalk addToShutDownList: self

MCMethodDefinition class>>shutDown
        definitions := nil.

So the intention was probably to release the definitions cache at
image save or quit

Unfortunately, SmalltalkImage>>processShutDownList: is sending
#shutdown: not #shutdown so the cache is not cleaned

We should implement

MCMethodDefinition class>>shutDown: quitting
        definitions := nil.

or

MCMethodDefinition class>>shutDown: quitting
        quitting ifTrue: [definitions := nil].

Nicolas

2013/1/22 H. Hirzel <[hidden email]>:

> Thank you for the clarification regarding MC caches. Where is the menu
> item to flush MC caches manually from time to time?
>
> It is not in the docking bar menu nor in the menu of the Monticello browser....
>
> --Hannes
>
> On 1/22/13, Bert Freudenberg <[hidden email]> wrote:
>> On 22.01.2013, at 14:21, "H. Hirzel" <[hidden email]> wrote:
>>
>>> Good to have this solution, thank you.
>>> It will help me a lot as images grow older and larger (sometimes up to
>>> 80 MorphicProjects).
>>
>> Err, no. You still need to flush the MC caches manually from time to time
>> using the MC menu item.
>>
>> This docking bar change is just to get rid of unwanted dependencies, the
>> space occupied by these windows is negligible.
>>
>> - Bert -
>>
>>
>>
>>
>