The Trunk: ST80-mt.210.mcz

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

The Trunk: ST80-mt.210.mcz

commits-2
Marcel Taeumel uploaded a new version of ST80 to project The Trunk:
http://source.squeak.org/trunk/ST80-mt.210.mcz

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

Name: ST80-mt.210
Author: mt
Time: 9 May 2016, 1:46:37.619729 pm
UUID: 13ac8010-c5b9-3749-8ab7-6de20cc50a59
Ancestors: ST80-mt.209

Update according to the projects refactoring in System-mt.827

=============== Diff against ST80-mt.209 ===============

Item was changed:
  ----- Method: ControlManager class>>shutDown (in category 'snapshots') -----
  shutDown
  "Saves space in snapshots"
 
  Project current isMVC
+ ifTrue: [Project current invalidate].!
- ifTrue: [ScheduledControllers unCacheWindows].!

Item was changed:
  ----- Method: ControlManager class>>startUp (in category 'snapshots') -----
  startUp
 
  Project current isMVC
+ ifTrue: [Project current restore].!
- ifTrue: [ScheduledControllers restore].!

Item was added:
+ ----- Method: ControlManager>>displayWorld (in category 'displaying') -----
+ displayWorld
+
+ screenController view window: Display boundingBox; displayDeEmphasized.
+ self scheduledWindowControllers reverseDo:
+ [:aController | aController view displayDeEmphasized].
+ !

Item was changed:
  ----- Method: ControlManager>>restore (in category 'displaying') -----
  restore
  "Clear the screen to gray and then redisplay all the scheduled views.  Try to be a bit intelligent about the view that wants control and not display it twice if possible."
 
+ self unCacheWindows.  "assure refresh"
- scheduledControllers first view uncacheBits.  "assure refresh"
  self unschedule: screenController; scheduleOnBottom: screenController.
+ self displayWorld.!
- screenController view window: Display boundingBox; displayDeEmphasized.
- self scheduledWindowControllers reverseDo:
- [:aController | aController view displayDeEmphasized].
- !

Item was added:
+ ----- Method: MVCProject class>>releaseProjectReferences: (in category 'utilities') -----
+ releaseProjectReferences: outgoingProject
+
+ ProjectController allInstancesDo: [:pvc |
+ [pvc model == outgoingProject ifTrue: [pvc closeAndUnscheduleNoTerminate]]
+ on: Error do: [:ex |
+ "Unschedule the bad controller from all managers."
+ ControlManager allInstancesDo: [:m | m unschedule: pvc]]].!

Item was removed:
- ----- Method: MVCProject class>>removeProjectsFromSystem (in category 'shrinking') -----
- removeProjectsFromSystem
- "Remove all MVC projects from the system, reorganizing the project hierarchy as needed.
- This method was originally implemented as SmalltalkImage>>zapMVCProjects in earlier
- versions of Squeak."
-
- "MVCProject removeProjectsFromSystem"
-
- Smalltalk garbageCollect. "So allInstances is precise"
- Project
- allSubInstancesDo: [:proj | | window | proj isTopProject
- ifTrue: [(proj isKindOf: self)
- ifTrue: ["Root project is MVC -- we must become the root"
- Project current setParent: Project current.]]
- ifFalse: [(proj parent isKindOf: self)
- ifTrue: [(proj isKindOf: self)
- ifFalse: ["Remove Morphic projects from MVC views "
- "... and add them back here."
- window := (SystemWindow labelled: proj name)
- model: proj.
- window
- addMorph: (ProjectViewMorph on: proj)
- frame: (0 @ 0 corner: 1.0 @ 1.0).
- window openInWorld.
- proj setParent: Project current]].
- (proj isKindOf: self)
- ifTrue: ["Remove MVC projects from Morphic views"
- Project deletingProject: proj]]]!

Item was changed:
  ----- Method: MVCProject class>>unloadMVC (in category 'shrinking') -----
  unloadMVC
  "Completely remove MVC from the system. All MVC projects will be destroyed.
  To reinstall MVC, load all of the ST80 and MVCToolbuilder packages."
 
  "MVCProject unloadMVC"
 
+ Project current isMVC ifTrue: [
+ ^ Error signal: 'You can only unload MVC from within another kind of project.'].
+
+ MVCProject removeProjectsFromSystem.
+
+ Smalltalk globals removeKey: #ScheduledControllers.
- self removeProjectsFromSystem.
- ScheduledControllers := nil.
  { 'ToolBuilder-MVC' . 'ST80Tests' . 'ST80Tools' . 'ST80' }
  do: [ :package | (MCPackage named: package) unload ].
 
  !

Item was added:
+ ----- Method: MVCProject>>addProject: (in category 'as yet unclassified') -----
+ addProject: project
+
+ | view |
+ super addProject: project.
+
+ view := ProjectView new
+ model: project;
+ minimumSize: 50@30;
+ borderWidth: 2;
+ resizeInitially;
+ yourself.
+ view controller status: #open.!

Item was removed:
- ----- Method: MVCProject>>defaultBackgroundColor (in category 'initialize') -----
- defaultBackgroundColor
- ^ Color white!

Item was added:
+ ----- Method: MVCProject>>deletingProject: (in category 'release') -----
+ deletingProject: outgoingProject
+
+ "Clean-up my project views."
+ (self world controllersSatisfying: [:m | m model = outgoingProject])
+ do: [:projectController |
+ self world unschedule: projectController.
+ projectController view
+ model: nil;
+ release].
+
+ super deletingProject: outgoingProject.!

Item was removed:
- ----- Method: MVCProject>>displaySizeChanged (in category 'display') -----
- displaySizeChanged
- "Inform the current project that its display size has changed"
- world "ScheduledControllers" restore; searchForActiveController!

Item was added:
+ ----- Method: MVCProject>>finalEnterActions: (in category 'enter') -----
+ finalEnterActions: leavingProject
+
+ ScheduledControllers := world.!

Item was removed:
- ----- Method: MVCProject>>finalExitActions (in category 'enter') -----
- finalExitActions
-
- self world unCacheWindows.
- Sensor flushAllButDandDEvents. "Will be reinstalled by World>>install"
-
- ScheduledControllers := nil.!

Item was added:
+ ----- Method: MVCProject>>finalExitActions: (in category 'enter') -----
+ finalExitActions: enteringProject
+
+ super finalExitActions: enteringProject.
+
+ self world unCacheWindows.
+ Sensor flushAllButDandDEvents.
+
+ ScheduledControllers := nil.!

Item was changed:
  ----- Method: MVCProject>>invalidate (in category 'display') -----
  invalidate
  "Invalidate the entire project so that a redraw will be forced later."
+
+ world
+ unCacheWindows;
+ unschedule: world screenController;
+ scheduleOnBottom: world screenController.!
- world "ScheduledControllers" unCacheWindows!

Item was added:
+ ----- Method: MVCProject>>okToChange (in category 'release') -----
+ okToChange
+ "If there is no open window, we are fine to close."
+
+ ^ (self parent ~~ Project current
+ or: [self world scheduledControllers size <= 1])
+ or: [super okToChange]!

Item was removed:
- ----- Method: MVCProject>>pauseSoundPlayers (in category 'enter') -----
- pauseSoundPlayers
- "Pause sound players, subject to preference settings"
-
- Smalltalk at: #ScorePlayer ifPresent:[:playerClass|
- playerClass allSubInstancesDo: [:player | player pause]]!

Item was removed:
- ----- Method: MVCProject>>resetDisplay (in category 'display') -----
- resetDisplay
- "Bring the display to a usable state after handling primitiveError."
-
- world searchForActiveController!

Item was changed:
  ----- Method: MVCProject>>restore (in category 'display') -----
  restore
+ "Redraw the entire Project. Ignore errors to keep system responsive."
+
+ [world displayWorld] on: Error do: [:ex | "Ignore."].!
- "Redraw the entire Project"
- world "ScheduledControllers" restore.!

Item was removed:
- ----- Method: MVCProject>>restoreDisplay (in category 'display') -----
- restoreDisplay
- "Clear the screen to gray and then redisplay all the scheduled views."
-
- Display extent = DisplayScreen actualScreenSize
- ifFalse:
- [DisplayScreen startUp.
- world unCacheWindows].
- world restore!

Item was added:
+ ----- Method: MVCProject>>scheduleProcessForEnter (in category 'enter') -----
+ scheduleProcessForEnter
+ "Complete the enter: by launching a new process. Note that we have to use a helper process because MVC will terminate the current process immediately when searching for an active controller. There might, however, be other code to be executed when returning from this call."
+
+ [world searchForActiveController] newProcess
+ priority: Processor userSchedulingPriority;
+ resume.!

Item was removed:
- ----- Method: MVCProject>>scheduleProcessForEnter: (in category 'enter') -----
- scheduleProcessForEnter: showZoom
- "Complete the enter: by launching a new process"
-
- | newProcess |
- SystemWindow clearTopWindow. "break external ref to this project"
- newProcess := [
- world resetActiveController. "in case of walkback in #restore"
- showZoom ifFalse: [world restore].
- world searchForActiveController
- ] newProcess priority: Processor userSchedulingPriority.
- newProcess resume. "lose the current process and its referenced morphs"
- !

Item was changed:
  ----- Method: MVCProject>>setAsBackground: (in category 'utilities') -----
  setAsBackground: aForm
+ "Set aForm as a background image."
- "Set  aForm as a background image."
 
  world screenController model form: aForm.
+ Display restore.!
- Display restoreAfter: []!

Item was removed:
- ----- Method: MVCProject>>setWorldForEmergencyRecovery (in category 'enter') -----
- setWorldForEmergencyRecovery
- "Prepare world for enter with an absolute minimum of mechanism.
- An unrecoverable error has been detected in an isolated project."
-
- World := nil.
- Smalltalk at: #ScheduledControllers put: world.
- ScheduledControllers restore
- !

Item was removed:
- ----- Method: MVCProject>>setWorldForEnterFrom:recorder: (in category 'enter') -----
- setWorldForEnterFrom: old recorder: recorderOrNil
- "Prepare world for enter."
-
- Smalltalk at: #ScheduledControllers put: world.!

Item was changed:
  ----- Method: MVCProject>>subProjects (in category 'utilities') -----
  subProjects
  "Answer a list of all the subprojects  of the receiver. "
+
+ ^ (self world controllersSatisfying: [:m | m model isKindOf: Project])
+ collect: [:controller | controller model]!
- ^(world controllersSatisfying: [:m | m model isKindOf: Project])
- collect: [:c | c model]!

Item was changed:
  ----- Method: MVCProject>>viewLocFor: (in category 'display') -----
  viewLocFor: exitedProject
  "Look for a view of the exitedProject, and return its center"
 
+ ^ (world controllerWhoseModelSatisfies: [:p | p == exitedProject])
+ ifNil: [super viewLocFor: exitedProject]
+ ifNotNil: [:ctlr | ^ctlr view windowBox center]!
- (world controllerWhoseModelSatisfies: [:p | p == exitedProject])
- ifNotNil: [:ctlr | ^ctlr view windowBox center].
- ^Sensor cursorPoint "default result"!

Item was changed:
  ----- Method: ModalController>>closeAndUnscheduleNoTerminate (in category 'as yet unclassified') -----
  closeAndUnscheduleNoTerminate
  "Erase the receiver's view and remove it from the collection of scheduled views, but do not terminate the current process."
 
+ ScheduledControllers unschedule: self.
  view erase.
+ view release.!
- view release.
- ScheduledControllers unschedule: self.!

Item was added:
+ ----- Method: Project class>>allMVCProjects (in category '*ST80-Support') -----
+ allMVCProjects
+
+ ^ self allProjects select: [:p | p isMVC]!

Item was changed:
+ ----- Method: Project>>isMVC (in category '*ST80-Testing') -----
- ----- Method: Project>>isMVC (in category '*ST80-testing') -----
  isMVC
 
  ^ false!

Item was changed:
  ----- Method: ScreenController>>closeUnchangedWindows (in category 'menu messages') -----
  closeUnchangedWindows
  "Close any window that doesn't have unaccepted input."
 
  | clean |
  (SelectionMenu confirm:
  'Do you really want to close all windows
  except those with unaccepted edits?')
  ifFalse: [^ self].
 
  clean := ScheduledControllers scheduledControllers select:
  [:c | c model canDiscardEdits and: [(c isKindOf: ScreenController) not]].
  clean do: [:c | c closeAndUnscheduleNoTerminate].
+
+ Project current restoreDisplay.
- self restoreDisplay.
  !

Item was changed:
  ----- Method: ScreenController>>restoreDisplay (in category 'menu messages') -----
  restoreDisplay
  "Clear the screen to gray and then redisplay all the scheduled views."
 
+ Project current restoreDisplay.!
- Project current restoreDisplay
- !

Item was changed:
  ----- Method: StandardSystemController>>closeAndUnschedule (in category 'scheduling') -----
  closeAndUnschedule
  "Erase the receiver's view and remove it from the collection of scheduled
  views."
 
  status := #closed.
+ ScheduledControllers unschedule: self.
  view erase.
  view release.
+ ScheduledControllers searchForActiveController.!
- ScheduledControllers unschedule: self; searchForActiveController
- !

Item was changed:
  ----- Method: StandardSystemController>>closeAndUnscheduleNoErase (in category 'scheduling') -----
  closeAndUnscheduleNoErase
  "Remove the scheduled view from the collection of scheduled views. Set
  its status to closed but do not erase."
 
  status := #closed.
+ ScheduledControllers unschedule: self.
+ view release.!
- view release.
- ScheduledControllers unschedule: self!

Item was changed:
  ----- Method: StandardSystemController>>closeAndUnscheduleNoTerminate (in category 'scheduling') -----
  closeAndUnscheduleNoTerminate
  "Erase the receiver's view and remove it from the collection of scheduled views, but do not terminate the current process."
 
  status := #closed.
+ ScheduledControllers unschedule: self.
  view erase.
  view release.
- ScheduledControllers unschedule: self.
  !

Item was changed:
  ----- Method: StandardSystemController>>controlTerminate (in category 'basic control sequence') -----
  controlTerminate
  status == #closed
+ ifTrue: [
- ifTrue:
- [view ~~ nil ifTrue: [view release].
  ScheduledControllers unschedule: self.
+ view ~~ nil ifTrue: [view release].
  ^self].
  view deEmphasize; cacheBits.
  view isCollapsed ifFalse: [model modelSleep].!

Item was changed:
  ----- Method: StandardSystemView>>release (in category 'initialize-release') -----
  release
 
+ model windowIsClosing; release.
- model windowIsClosing.
  self isCollapsed ifTrue: [savedSubViews do: [:v | v release]].
  super release.
  !