[squeak-dev] The Trunk: Morphic-dtl.525.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Mar 9 02:03:42 UTC 2011


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

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

Name: Morphic-dtl.525
Author: dtl
Time: 8 March 2011, 9:02:51.59 pm
UUID: 6e8fc923-5d3c-4b06-bd3e-99cefb1ad1a3
Ancestors: Morphic-ul.524

Initialize editor menus when entering a Morphic project. Other projects (e.g. SimpleMorphic) may have set the menu actions differently, so this ensures that they are restored to the expected state when reentering a Morphic project.

If SMxMorphicProject is present in the image, make it available in the world menus. The toolbar handles this automatically without menu updates. This change provides equivalent functions in the world menu for consistency.

=============== Diff against Morphic-ul.524 ===============

Item was changed:
  ----- Method: MorphicProject>>finalEnterActions (in category 'enter') -----
  finalEnterActions
  	"Perform the final actions necessary as the receiver project is entered"
  
  	| navigator armsLengthCmd navType thingsToUnhibernate |
  
+ 	self initializeMenus.
  	self projectParameters 
  		at: #projectsToBeDeleted 
  		ifPresent: [ :projectsToBeDeleted |
  			self removeParameter: #projectsToBeDeleted.
  			projectsToBeDeleted do: [ :each | 
  				Project deletingProject: each.
  				each removeChangeSetIfPossible]].
  
  	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.
  
  	WorldState addDeferredUIMessage: [self startResourceLoading].!

Item was added:
+ ----- Method: MorphicProject>>initializeMenus (in category 'enter') -----
+ initializeMenus
+ 	"Menu setting for these classes may have have been modified by another
+ 	Morphic project, e.g. SimpleMorphic. Ensure that they are restored to the
+ 	expected menus."
+ 
+ 	TextEditor initialize.
+ 	SmalltalkEditor initialize!

Item was changed:
  ----- Method: TheWorldMenu>>openMenu (in category 'construction') -----
  openMenu
  	"Build the open window menu for the world."
  
  	| menu |
  	menu := self menu: 'open...'.
  	menu defaultTarget: ToolSet default.
  	menu addList: ToolSet menuItems.
  	menu defaultTarget: self.
  	self fillIn: menu from: {
  		nil.
  		{'file...' . { self . #openFileDirectly} . 'Lets you open a window on a single file'}.
  		{'transcript (t)' . {self . #openTranscript}. 'A window used to report messages sent to Transcript' }.
  		"{'inner world' . { WorldWindow . #test1} }."
  		nil.
  	}.
  	self fillIn: menu from: self class registeredOpenCommands.
  	menu addLine.
  
  	self mvcProjectsAllowed ifTrue:
  		[self fillIn: menu from: { {'mvc project' . {self. #openMVCProject} . 'Creates a new project of the classic "mvc" style'} }].
  
+ 	self fillIn: menu from: { 
- 	^ self fillIn: menu from: { 
  		{'morphic project' . {self. #openMorphicProject} . 'Creates a new morphic project'}.
+ 	}.
+ 	Smalltalk at: #SMxMorphicProject ifPresent: [:p |
+ 		self fillIn: menu from: { 
+ 			{ 'simple morphic project' . { self . #openSMxMorphicProject } . 'Creates a new simple morphic project' }.
+ 		}
+ 	].
+ 	^menu
+ !
- 	}.!

Item was changed:
  ----- Method: TheWorldMenu>>projectMenu (in category 'construction') -----
  projectMenu
  	"Build the project menu for the world."
  	| menu |
  
  	self flag: #bob0302.
  
  	menu := self menu: 'projects...'.
  	self fillIn: menu from: { 
  		{ 'save on server (also makes a local copy)' . { #myProject . #storeOnServer } }.
  		{ 'save to a different server' . { #myProject . #saveAs } }.
  		{ 'save project on local file only' . { #myWorld . #saveOnFile } }.
  		{ 'see if server version is more recent...' . { #myProject . #loadFromServer } }.
  		{ 'load project from file...' . { self . #loadProject } }.
  		nil.
  	}.
  
  	self mvcProjectsAllowed ifTrue: [
  		self fillIn: menu from: {
  			{ 'create new mvc project'. { self . #openMVCProject } }.
  		}
  	].
  	self fillIn: menu from: { 
  		{ 'create new morphic project' . { self . #openMorphicProject } }.
+ 	}.
+ 	Smalltalk at: #SMxMorphicProject ifPresent: [:p |
+ 		self fillIn: menu from: { 
+ 			{ 'create new simple morphic project' . { self . #openSMxMorphicProject } }.
+ 		}
+ 	].
+ 	self fillIn: menu from: { 
  		nil.
  		{ 'go to previous project' . { Project . #returnToPreviousProject } }.
  		{ 'go to next project' . { Project . #advanceToNextProject } }.
  		{ 'jump to project...' . { #myWorld . #jumpToProject } }.
  	}.
  	Preferences simpleMenus ifFalse: [
  		self fillIn: menu from: { 
  			nil.
  			{ 'save for future revert' . { #myProject . #saveForRevert } }.
  			{ 'revert to saved copy' . { #myProject . #revert } }.
  		}.
  	].
  
  	^ menu!




More information about the Squeak-dev mailing list