The Inbox: Morphic-mt.1476.mcz

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

The Inbox: Morphic-mt.1476.mcz

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

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

Name: Morphic-mt.1476
Author: mt
Time: 17 January 2019, 11:27:42.786727 am
UUID: 59287f0d-de73-49e4-b2f4-ad0d03f32f0c
Ancestors: Morphic-mt.1475

Propose a project-level script to save all code changes in (kind of) a transaction. Useful for updating UI-related code that is scattered across classes and methods.

Could find a home in the "Do" scripts in our world-main-docking-bar.

=============== Diff against Morphic-mt.1475 ===============

Item was added:
+ ----- Method: MorphicProject>>acceptAllCodeChanges (in category 'utilities') -----
+ acceptAllCodeChanges
+
+ | codeWindows acceptedChanges |
+ codeWindows := SystemWindow
+ windowsIn: self world
+ satisfying: [:window | (window visible and: [window model hasUnacceptedEdits]) and: [window model isKindOf: CodeHolder]].
+
+ acceptedChanges := codeWindows collect: [:window | MethodReference class: window model selectedClassOrMetaClass selector: window model selectedMessageName].
+
+ ((codeWindows
+ gather: [:window | window model dependents])
+ select: [:object | (object isKindOf: PluggableTextMorph) and: [object setTextSelector = #contents:notifying:]])
+ "Two steps to avoid unnecessary GUI updates."
+ do: [:morphWithCode | morphWithCode acceptTextInModel];
+ do: [:morphWithCode | morphWithCode accept].
+
+ Transcript showln: 'The following code changes were accepted:\\' withCRs, (acceptedChanges joinSeparatedBy: String cr).
+ "self inform: 'The following code changes were accepted:\\' withCRs, (acceptedChanges joinSeparatedBy: String cr). "!