The Inbox: Tools-ct.959.mcz

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

The Inbox: Tools-ct.959.mcz

commits-2
Christoph Thiede uploaded a new version of Tools to project The Inbox:
http://source.squeak.org/inbox/Tools-ct.959.mcz

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

Name: Tools-ct.959
Author: ct
Time: 16 March 2020, 9:03:12.729937 pm
UUID: cae0b2d6-e131-7a40-b6a9-62a90172de94
Ancestors: Tools-mt.955

Proposal: Allow simple change sorters to become become dual sorters, and dual change sorters to be split into two separate change sorters. This commit also refactors DualChangeSorter in general.

=============== Diff against Tools-mt.955 ===============

Item was added:
+ ----- Method: ChangeSorter>>addModelItemsToWindowMenu: (in category 'as yet unclassified') -----
+ addModelItemsToWindowMenu: aMenu
+ "Add model-related item to the window menu"
+
+ super addModelItemsToWindowMenu: aMenu.
+ aMenu addLine.
+ aMenu add: 'Become dual sorter' translated target: self action: #becomeDualSorter.!

Item was added:
+ ----- Method: ChangeSorter>>becomeDualSorter (in category 'as yet unclassified') -----
+ becomeDualSorter
+ "Switch the contents of the receiver's view to represent a DualChangeSorter. Kind of mitosis: We're doing the anaphase right now."
+
+ | dualSorter |
+ dualSorter := DualChangeSorter withLeft: self right: nil.
+ dualSorter initializeSides.
+ self changed: #close.
+ ToolBuilder open: dualSorter.!

Item was added:
+ ----- Method: DualChangeSorter class>>new (in category 'instance creation') -----
+ new
+
+ ^ super new
+ initializeSides;
+ yourself!

Item was added:
+ ----- Method: DualChangeSorter class>>withLeft:right: (in category 'instance creation') -----
+ withLeft: leftChangeSorter right: rightChangeSorter
+
+ ^ self basicNew
+ leftChangeSorter: leftChangeSorter;
+ rightChangeSorter: rightChangeSorter;
+ yourself!

Item was added:
+ ----- Method: DualChangeSorter>>addModelItemsToWindowMenu: (in category 'user interface') -----
+ addModelItemsToWindowMenu: aMenu
+ "Add model-related item to the window menu"
+
+ super addModelItemsToWindowMenu: aMenu.
+ aMenu addLine.
+ aMenu add: 'Split sides' translated target: self action: #splitSides.!

Item was changed:
  ----- Method: DualChangeSorter>>buildWith: (in category 'toolbuilder') -----
  buildWith: builder
- | windowSpec window |
- leftCngSorter := ChangeSorter new myChangeSet: ChangeSet current.
- leftCngSorter parent: self.
- rightCngSorter := ChangeSorter new myChangeSet:
- ChangeSet secondaryChangeSet.
- rightCngSorter parent: self.
 
+ | windowSpec window |
  windowSpec := builder pluggableWindowSpec new.
  windowSpec model: self.
  windowSpec label: 'Change Sorter'.
  windowSpec children: OrderedCollection new.
  windowSpec label: #labelString.
  leftCngSorter buildWith: builder in: windowSpec rect: (0@0 extent: 0.5@1).
  rightCngSorter buildWith: builder in: windowSpec rect: (0.5@0 extent: 0.5@1).
  window := builder build: windowSpec.
  leftCngSorter addDependent: window. "so it will get changed: #relabel"
  rightCngSorter addDependent: window. "so it will get changed: #relabel"
  ^window!

Item was added:
+ ----- Method: DualChangeSorter>>initializeSides (in category 'initialization') -----
+ initializeSides
+
+ leftCngSorter ifNil: [
+ leftCngSorter := ChangeSorter new myChangeSet: ChangeSet current].
+ leftCngSorter parent: self.
+ rightCngSorter ifNil: [
+ rightCngSorter := ChangeSorter new myChangeSet: ChangeSet secondaryChangeSet].
+ rightCngSorter parent: self.!

Item was changed:
+ ----- Method: DualChangeSorter>>isLeftSide: (in category 'accessing') -----
- ----- Method: DualChangeSorter>>isLeftSide: (in category 'other') -----
  isLeftSide: theOne
  "Which side am I?"
  ^ theOne == leftCngSorter!

Item was changed:
+ ----- Method: DualChangeSorter>>labelString (in category 'toolbuilder') -----
- ----- Method: DualChangeSorter>>labelString (in category 'other') -----
  labelString
  "The window label"
  ^'Changes go to "', ChangeSet current name,  '"'.!

Item was added:
+ ----- Method: DualChangeSorter>>leftChangeSorter: (in category 'initialization') -----
+ leftChangeSorter: aChangeSorter
+
+ leftCngSorter := aChangeSorter!

Item was changed:
+ ----- Method: DualChangeSorter>>modelWakeUp (in category 'updating') -----
- ----- Method: DualChangeSorter>>modelWakeUp (in category 'other') -----
  modelWakeUp
  "A window with me as model is being entered.  Make sure I am up-to-date with the changeSets."
 
  "Dumb way"
  leftCngSorter canDiscardEdits
  ifTrue: [leftCngSorter update] "does both"
  ifFalse: [rightCngSorter update].
  !

Item was changed:
+ ----- Method: DualChangeSorter>>okToChange (in category 'updating') -----
- ----- Method: DualChangeSorter>>okToChange (in category 'initialization') -----
  okToChange
  ^ leftCngSorter okToChange & rightCngSorter okToChange!

Item was changed:
+ ----- Method: DualChangeSorter>>other: (in category 'accessing') -----
- ----- Method: DualChangeSorter>>other: (in category 'other') -----
  other: theOne
  "Return the other side's ChangeSorter"
  ^ theOne == leftCngSorter
  ifTrue: [rightCngSorter]
  ifFalse: [leftCngSorter]!

Item was added:
+ ----- Method: DualChangeSorter>>rightChangeSorter: (in category 'initialization') -----
+ rightChangeSorter: aChangeSorter
+
+ rightCngSorter := aChangeSorter!

Item was added:
+ ----- Method: DualChangeSorter>>splitSides (in category 'menu commands') -----
+ splitSides
+ "Split the receiver into two independent views. Kind of mitosis: We're doing cytokinesis right now."
+
+ {leftCngSorter. rightCngSorter} do: [:sorter |
+ ToolBuilder open: sorter].
+ self changed: #close.!


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Tools-ct.959.mcz

marcel.taeumel
Allow simple change sorters to become become dual sorters

What do you mean by that? Are you referring to the "inspect/explore" buttons in the Inspector and Object Explorer?

Best,
Marcel

Am 16.03.2020 21:03:29 schrieb [hidden email] <[hidden email]>:

Christoph Thiede uploaded a new version of Tools to project The Inbox:
http://source.squeak.org/inbox/Tools-ct.959.mcz

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

Name: Tools-ct.959
Author: ct
Time: 16 March 2020, 9:03:12.729937 pm
UUID: cae0b2d6-e131-7a40-b6a9-62a90172de94
Ancestors: Tools-mt.955

Proposal: Allow simple change sorters to become become dual sorters, and dual change sorters to be split into two separate change sorters. This commit also refactors DualChangeSorter in general.

=============== Diff against Tools-mt.955 ===============

Item was added:
+ ----- Method: ChangeSorter>>addModelItemsToWindowMenu: (in category 'as yet unclassified') -----
+ addModelItemsToWindowMenu: aMenu
+ "Add model-related item to the window menu"
+
+ super addModelItemsToWindowMenu: aMenu.
+ aMenu addLine.
+ aMenu add: 'Become dual sorter' translated target: self action: #becomeDualSorter.!

Item was added:
+ ----- Method: ChangeSorter>>becomeDualSorter (in category 'as yet unclassified') -----
+ becomeDualSorter
+ "Switch the contents of the receiver's view to represent a DualChangeSorter. Kind of mitosis: We're doing the anaphase right now."
+
+ | dualSorter |
+ dualSorter := DualChangeSorter withLeft: self right: nil.
+ dualSorter initializeSides.
+ self changed: #close.
+ ToolBuilder open: dualSorter.!

Item was added:
+ ----- Method: DualChangeSorter class>>new (in category 'instance creation') -----
+ new
+
+ ^ super new
+ initializeSides;
+ yourself!

Item was added:
+ ----- Method: DualChangeSorter class>>withLeft:right: (in category 'instance creation') -----
+ withLeft: leftChangeSorter right: rightChangeSorter
+
+ ^ self basicNew
+ leftChangeSorter: leftChangeSorter;
+ rightChangeSorter: rightChangeSorter;
+ yourself!

Item was added:
+ ----- Method: DualChangeSorter>>addModelItemsToWindowMenu: (in category 'user interface') -----
+ addModelItemsToWindowMenu: aMenu
+ "Add model-related item to the window menu"
+
+ super addModelItemsToWindowMenu: aMenu.
+ aMenu addLine.
+ aMenu add: 'Split sides' translated target: self action: #splitSides.!

Item was changed:
----- Method: DualChangeSorter>>buildWith: (in category 'toolbuilder') -----
buildWith: builder
- | windowSpec window |
- leftCngSorter := ChangeSorter new myChangeSet: ChangeSet current.
- leftCngSorter parent: self.
- rightCngSorter := ChangeSorter new myChangeSet:
- ChangeSet secondaryChangeSet.
- rightCngSorter parent: self.

+ | windowSpec window |
windowSpec := builder pluggableWindowSpec new.
windowSpec model: self.
windowSpec label: 'Change Sorter'.
windowSpec children: OrderedCollection new.
windowSpec label: #labelString.
leftCngSorter buildWith: builder in: windowSpec rect: (0@0 extent: 0.5@1).
rightCngSorter buildWith: builder in: windowSpec rect: (0.5@0 extent: 0.5@1).
window := builder build: windowSpec.
leftCngSorter addDependent: window. "so it will get changed: #relabel"
rightCngSorter addDependent: window. "so it will get changed: #relabel"
^window!

Item was added:
+ ----- Method: DualChangeSorter>>initializeSides (in category 'initialization') -----
+ initializeSides
+
+ leftCngSorter ifNil: [
+ leftCngSorter := ChangeSorter new myChangeSet: ChangeSet current].
+ leftCngSorter parent: self.
+ rightCngSorter ifNil: [
+ rightCngSorter := ChangeSorter new myChangeSet: ChangeSet secondaryChangeSet].
+ rightCngSorter parent: self.!

Item was changed:
+ ----- Method: DualChangeSorter>>isLeftSide: (in category 'accessing') -----
- ----- Method: DualChangeSorter>>isLeftSide: (in category 'other') -----
isLeftSide: theOne
"Which side am I?"
^ theOne == leftCngSorter!

Item was changed:
+ ----- Method: DualChangeSorter>>labelString (in category 'toolbuilder') -----
- ----- Method: DualChangeSorter>>labelString (in category 'other') -----
labelString
"The window label"
^'Changes go to "', ChangeSet current name, '"'.!

Item was added:
+ ----- Method: DualChangeSorter>>leftChangeSorter: (in category 'initialization') -----
+ leftChangeSorter: aChangeSorter
+
+ leftCngSorter := aChangeSorter!

Item was changed:
+ ----- Method: DualChangeSorter>>modelWakeUp (in category 'updating') -----
- ----- Method: DualChangeSorter>>modelWakeUp (in category 'other') -----
modelWakeUp
"A window with me as model is being entered. Make sure I am up-to-date with the changeSets."

"Dumb way"
leftCngSorter canDiscardEdits
ifTrue: [leftCngSorter update] "does both"
ifFalse: [rightCngSorter update].
!

Item was changed:
+ ----- Method: DualChangeSorter>>okToChange (in category 'updating') -----
- ----- Method: DualChangeSorter>>okToChange (in category 'initialization') -----
okToChange
^ leftCngSorter okToChange & rightCngSorter okToChange!

Item was changed:
+ ----- Method: DualChangeSorter>>other: (in category 'accessing') -----
- ----- Method: DualChangeSorter>>other: (in category 'other') -----
other: theOne
"Return the other side's ChangeSorter"
^ theOne == leftCngSorter
ifTrue: [rightCngSorter]
ifFalse: [leftCngSorter]!

Item was added:
+ ----- Method: DualChangeSorter>>rightChangeSorter: (in category 'initialization') -----
+ rightChangeSorter: aChangeSorter
+
+ rightCngSorter := aChangeSorter!

Item was added:
+ ----- Method: DualChangeSorter>>splitSides (in category 'menu commands') -----
+ splitSides
+ "Split the receiver into two independent views. Kind of mitosis: We're doing cytokinesis right now."
+
+ {leftCngSorter. rightCngSorter} do: [:sorter |
+ ToolBuilder open: sorter].
+ self changed: #close.!




Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Tools-ct.959.mcz

Christoph Thiede
Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Tools-ct.959.mcz

K K Subbu
Chris,

This is a good improvement but it needs better visibility. Instead of
tucking the single/dual switch within a tiny menu button in the title
bar, you could
  * place it in a separate button, or
  * add a menu bar along the top with some of the frequently used menu
items in the right click menu and then place it there.

Then it will be just a single click away.

Regards .. Subbu

On 23/03/20 7:13 PM, Christoph Thiede wrote:

Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Tools-ct.959.mcz

Christoph Thiede

This would be one possibility:



Con: Development is more extensive as we need to find icons. But it might be generally interesting to add some interface to SystemWindow & ToolBuilder that allow making the list of window buttons more customizable.

Another problem here: The model would be responsible for delivering an icon matching the UI theme and preferences - unless we write some automatic icon transformation stuff (such as Android uses for its notification area).


Here is another option:


But I think this positioning of the button would be way too prominent.


Are you imagining a third option? :-)

Best,
Christoph

(PS: the "toph" in my name is actually helpful in order to differentiate me from Chris Muller (cmm) :-))

Von: Squeak-dev <[hidden email]> im Auftrag von K K Subbu <[hidden email]>
Gesendet: Dienstag, 24. März 2020 19:05:51
An: [hidden email]
Betreff: Re: [squeak-dev] The Inbox: Tools-ct.959.mcz
 
Chris,

This is a good improvement but it needs better visibility. Instead of
tucking the single/dual switch within a tiny menu button in the title
bar, you could
  * place it in a separate button, or
  * add a menu bar along the top with some of the frequently used menu
items in the right click menu and then place it there.

Then it will be just a single click away.

Regards .. Subbu

On 23/03/20 7:13 PM, Christoph Thiede wrote:
> Hi Marcel,
>
> this is exactly what it does. Here is a screencast (unless Nabble destroys
> it again):
>
> <http://forum.world.st/file/t372205/changesorter%2520mitosis.gif>
>
> Backup link:
> https://n4o5pq.db.files.1drv.com/y4mfY-Bg7xT8-cCyziptdK3VBbDePFF1Sai4940_cwCT3dNau5a0wWABM-sc8w9iIjvRAztE2dHT2eJAQlBNXtbPqOBmCrpLxJw0h0o6J9s8XG6OF0QeBspBQ1ETBWYp61niV_x_n3iGwJaERBTsX4hQSV1oEI7agfTNREddlRwjY875klShBNvV-KfyPEDYPDAzp6QY8LvvSPLPOAcqZIOmA/changesorter%20mitosis.gif?psid=1
>
> Best,
> Christoph
>
>
>
> --
> Sent from: http://forum.world.st/Squeak-Dev-f45488.html
>




Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Tools-ct.959.mcz

K K Subbu
On 24/03/20 11:56 PM, Thiede, Christoph wrote:
> Are you imagining a third option? :-)
Yes. A list of buttons along the top (New Find Dual/Single ...) just
below the Window title.

Regards .. Subbu