The Trunk: Morphic-dtl.1372.mcz

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

The Trunk: Morphic-dtl.1372.mcz

commits-2
David T. Lewis uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-dtl.1372.mcz

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

Name: Morphic-dtl.1372
Author: dtl
Time: 21 November 2017, 3:40:31.873793 pm
UUID: b7c42635-028a-4baa-abca-056362808bc7
Ancestors: Morphic-dtl.1371

Restore original versions of finalEnterActions: and finalExitActions: until they can be properly sorted out.

=============== Diff against Morphic-dtl.1371 ===============

Item was removed:
- ----- Method: MorphicProject>>clearGlobalState (in category 'enter') -----
- clearGlobalState
- "Clean up global state. The global variables World, ActiveWorld, ActiveHand and ActiveEvent
- provide convenient access to the state of the active project in Morphic. Clear their prior values
- when leaving an active project. This method may be removed if the use of global state variables
- is eliminated."
-
- (Smalltalk at: #World ifAbsent: [])
- ifNotNil: [ Smalltalk at: #World put: nil ]. "If global World is defined, clear it now"
- ActiveWorld := ActiveHand := ActiveEvent := nil.
- !

Item was changed:
  ----- Method: MorphicProject>>finalEnterActions: (in category 'enter') -----
  finalEnterActions: leavingProject
  "Perform the final actions necessary as the receiver project is entered"
 
  | navigator armsLengthCmd navType thingsToUnhibernate |
+ World := world.  "Signifies Morphic"
- "If this image has a global World variable, update it now"
- (Smalltalk at: #World ifAbsent: [])
- ifNotNil: [ Smalltalk at: #World put: world ].  "Signifies Morphic"
  world install.
  world transferRemoteServerFrom: leavingProject world.
  "(revertFlag | saveForRevert | forceRevert) ifFalse: [
  (Preferences valueOfFlag: #projectsSentToDisk) ifTrue: [
  self storeSomeSegment]]."
 
  "Transfer event recorder to me."
  leavingProject isMorphic ifTrue: [
  leavingProject world pauseEventRecorder ifNotNil: [:rec |
  rec resumeIn: world]].
 
  world triggerOpeningScripts.
 
 
  self initializeMenus.
  self projectParameters
  at: #projectsToBeDeleted
  ifPresent: [ :projectsToBeDeleted |
  self removeParameter: #projectsToBeDeleted.
  projectsToBeDeleted do: [:each | each delete]].
 
  Locale switchAndInstallFontToID: self localeID.
 
  thingsToUnhibernate := world valueOfProperty: #thingsToUnhibernate ifAbsent: [#()].
  thingsToUnhibernate do: [:each | each unhibernate].
  world removeProperty: #thingsToUnhibernate.
 
  navType := ProjectNavigationMorph preferredNavigator.
  armsLengthCmd := self parameterAt: #armsLengthCmd ifAbsent: [nil].
  navigator := world findA: navType.
  (Preferences classicNavigatorEnabled and: [Preferences showProjectNavigator and: [navigator isNil]]) ifTrue:
  [(navigator := navType new)
  bottomLeft: world bottomLeft;
  openInWorld: world].
  navigator notNil & armsLengthCmd notNil ifTrue:
  [navigator color: Color lightBlue].
  armsLengthCmd notNil ifTrue:
  [Preferences showFlapsWhenPublishing
  ifFalse:
  [self flapsSuppressed: true.
  navigator ifNotNil: [navigator visible: false]].
  armsLengthCmd openInWorld: world].
  world reformulateUpdatingMenus.
  world presenter positionStandardPlayer.
  self assureMainDockingBarPresenceMatchesPreference.
 
  world repairEmbeddedWorlds.!

Item was changed:
  ----- Method: MorphicProject>>finalExitActions: (in category 'enter') -----
  finalExitActions: enteringProject
 
  world triggerClosingScripts.
 
  "Pause sound players, subject to preference settings"
  (world hasProperty: #letTheMusicPlay)
  ifTrue: [world removeProperty: #letTheMusicPlay]
  ifFalse: [SoundService stop].
 
  world sleep.
+
  (world findA: ProjectNavigationMorph)
  ifNotNil: [:navigator | navigator retractIfAppropriate].
+
+ "Clean-up global state."
+ World := nil.
+ ActiveWorld := ActiveHand := ActiveEvent := nil.
- self clearGlobalState.
  Sensor flushAllButDandDEvents. !