The Trunk: Morphic-dtl.219.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.219.mcz

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

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

Name: Morphic-dtl.219
Author: dtl
Time: 31 October 2009, 3:28:41 am
UUID: 2a3f5c6f-3317-469a-a1ed-3f5014f5024f
Ancestors: Morphic-dtl.218

Move flaps support from Project to MorphicProject.
Remove 3 #isMorphic: sends, fix spelling error and comment example.


=============== Diff against Morphic-dtl.218 ===============

Item was added:
+ ----- Method: MorphicProject>>globalFlapEnabledString: (in category 'flaps support') -----
+ globalFlapEnabledString: aFlapTab
+ "Answer the string to be shown in a menu to represent the status of the given flap regarding whether it it should be shown in this project."
+
+ ^ (self isFlapEnabled: aFlapTab)
+ ifTrue:
+ ['<on>', aFlapTab wording]
+ ifFalse:
+ ['<off>', aFlapTab wording]!

Item was added:
+ ----- Method: MorphicProject>>suppressFlapsString (in category 'flaps support') -----
+ suppressFlapsString
+ ^ (self flapsSuppressed
+ ifTrue: ['<no>']
+ ifFalse: ['<yes>']), 'show shared tabs (F)' translated!

Item was added:
+ ----- Method: MorphicProject>>toggleFlapsSuppressed (in category 'flaps support') -----
+ toggleFlapsSuppressed
+ "Project current toggleFlapsSuppressed"
+
+ ^self flapsSuppressed: self flapsSuppressed not.!

Item was added:
+ ----- Method: MorphicProject>>flapsSuppressed: (in category 'flaps support') -----
+ flapsSuppressed: aBoolean
+ "Make the setting of the flag that governs whether global flaps are suppressed in the project be as indicated and add or remove the actual flaps"
+
+ self projectPreferenceFlagDictionary at: #showSharedFlaps put: aBoolean not.
+ self == Project current  "Typical case"
+ ifTrue:
+ [Preferences setPreference: #showSharedFlaps toValue: aBoolean not]
+ ifFalse:   "Anomalous case where this project is not the current one."
+ [aBoolean
+ ifTrue:
+ [Flaps globalFlapTabsIfAny do:
+ [:aFlapTab | Flaps removeFlapTab: aFlapTab keepInList: true]]
+
+ ifFalse:
+ [self currentWorld addGlobalFlaps]].
+ Project current assureNavigatorPresenceMatchesPreference!

Item was added:
+ ----- Method: MorphicProject>>cleanseDisabledGlobalFlapIDsList (in category 'flaps support') -----
+ cleanseDisabledGlobalFlapIDsList
+ "Make certain that the items on the disabled-global-flap list are actually global flaps, and if not, get rid of them"
+
+ | disabledFlapIDs currentGlobalIDs oldList |
+ disabledFlapIDs := self parameterAt: #disabledGlobalFlapIDs ifAbsent: [Set new].
+ currentGlobalIDs := Flaps globalFlapTabsIfAny collect: [:f | f flapID].
+ oldList := Project current projectParameterAt: #disabledGlobalFlaps ifAbsent: [nil].
+ oldList ifNotNil:
+ [disabledFlapIDs := oldList select: [:aFlap | aFlap flapID]].
+ disabledFlapIDs := disabledFlapIDs select: [:anID | currentGlobalIDs includes: anID].
+ self projectParameterAt: #disabledGlobalFlapIDs put: disabledFlapIDs.
+
+ projectParameters ifNotNil:
+ [projectParameters removeKey: #disabledGlobalFlaps ifAbsent: []].
+ !

Item was added:
+ ----- Method: MorphicProject>>isFlapEnabled: (in category 'flaps support') -----
+ isFlapEnabled:  aFlapTab
+ "Answer whether the given flap tab is enabled in this project"
+
+ ^ self isFlapIDEnabled: aFlapTab flapID!

Item was added:
+ ----- Method: MorphicProject>>showSharedFlaps (in category 'flaps support') -----
+ showSharedFlaps
+ "Answer whether shared flaps are shown or suppressed in this project"
+
+ | result |
+ result := Preferences showSharedFlaps.
+ ^ self == Project current
+ ifTrue:
+ [result]
+ ifFalse:
+ [self projectPreferenceAt: #showSharedFlaps ifAbsent: [result]]!

Item was added:
+ ----- Method: MorphicProject>>isFlapIDEnabled: (in category 'flaps support') -----
+ isFlapIDEnabled:  aFlapID
+ "Answer whether a flap of the given ID is enabled in this project"
+
+ | disabledFlapIDs  |
+ disabledFlapIDs := self parameterAt: #disabledGlobalFlapIDs ifAbsent: [^ true].
+ ^ (disabledFlapIDs includes: aFlapID) not!

Item was added:
+ ----- Method: MorphicProject>>globalFlapWithIDEnabledString: (in category 'flaps support') -----
+ globalFlapWithIDEnabledString: aFlapID
+ "Answer the string to be shown in a menu to represent the status of the given flap regarding whether it it should be shown in this project."
+
+ | aFlapTab |
+ aFlapTab := Flaps globalFlapTabWithID: aFlapID.
+ ^ (self isFlapEnabled: aFlapTab)
+ ifTrue:
+ ['<on>', aFlapTab wording]
+ ifFalse:
+ ['<off>', aFlapTab wording]!

Item was added:
+ ----- Method: MorphicProject>>flapsSuppressed (in category 'flaps support') -----
+ flapsSuppressed
+ "Answer whether flaps are suppressed in this project"
+
+ ^ self showSharedFlaps not!

Item was added:
+ ----- Method: MorphicProject>>assureFlapIntegrity (in category 'flaps support') -----
+ assureFlapIntegrity
+ "Make certain that the items on the disabled-global-flap list are actually global flaps, and if not, get rid of them.  Also, old (and damaging) parameters that held references to actual disabled flaps are cleansed"
+
+ | disabledFlapIDs currentGlobalIDs oldList |
+ disabledFlapIDs := self parameterAt: #disabledGlobalFlapIDs ifAbsent: [Set new].
+ currentGlobalIDs := Flaps globalFlapTabsIfAny collect: [:f | f flapID].
+ oldList := Project current projectParameterAt: #disabledGlobalFlaps ifAbsent: [nil].
+ oldList ifNotNil:
+ [disabledFlapIDs := oldList collect: [:aFlap | aFlap flapID].
+ disabledFlapIDs addAll: {'Scripting' translated. 'Stack Tools' translated. 'Painting' translated}].
+ disabledFlapIDs := disabledFlapIDs select: [:anID | currentGlobalIDs includes: anID].
+ self projectParameterAt: #disabledGlobalFlapIDs put: disabledFlapIDs asSet.
+ self assureNavigatorPresenceMatchesPreference.
+
+ projectParameters ifNotNil:
+ [projectParameters removeKey: #disabledGlobalFlaps ifAbsent: []]!

Item was added:
+ ----- Method: MorphicProject>>enableDisableGlobalFlap: (in category 'flaps support') -----
+ enableDisableGlobalFlap: aFlapTab
+ "For the benefit of pre-existing which-global-flap buttons from a design now left behind."
+
+ self flag: #toRemove.
+ ^ self inform:
+ 'Sorry, this is an obsolete menu; please
+ dismiss it and get a fresh menu.  Thanks.'.!