'From Squeak3.1alpha of 5 February 2001 [latest update: #3564] on 12 February 2001 at 11:50:57 am'! "Change Set: navPref-sw Date: 12 February 2001 Author: Scott Wallace Make the project navigator immediately appear or disappear whenever the preference governing its presence is changed."! !Preferences class methodsFor: 'preferences dictionary' stamp: 'sw 2/12/2001 11:46'! noteThatFlag: prefSymbol justChangedTo: aBoolean "Provides a hook so that a user's toggling of a preference might precipitate some immediate action" | keep | prefSymbol == #useGlobalFlaps ifTrue: [aBoolean ifFalse: "Turning off use of flaps" [keep _ self confirm: 'Do you want to preserve the existing global flaps for future use?'. Utilities globalFlapTabsIfAny do: [:aFlapTab | Utilities removeFlapTab: aFlapTab keepInList: keep. aFlapTab isInWorld ifTrue: [self error: 'Flap problem']]. keep ifFalse: [Utilities clobberFlapTabList]] ifTrue: "Turning on use of flaps" [Smalltalk isMorphic ifTrue: [self currentWorld addGlobalFlaps]]]. prefSymbol == #roundedWindowCorners ifTrue: [Display repaintMorphicDisplay]. prefSymbol == #optionalButtons ifTrue: [Utilities replacePartSatisfying: [:el | (el isKindOf: MorphThumbnail) and: [(el morphRepresented isKindOf: SystemWindow) and: [el morphRepresented model isKindOf: FileList]]] inGlobalFlapSatisfying: [:f1 | f1 wording = 'Tools'] with: FileList openAsMorph applyModelExtent]. (prefSymbol == #optionalButtons or: [prefSymbol == #annotationPanes]) ifTrue: [Utilities replaceBrowserInToolsFlap]. (prefSymbol == #smartUpdating) ifTrue: [SystemWindow allSubInstancesDo: [:aWindow | aWindow amendSteppingStatus]]. (prefSymbol == #eToyFriendly) ifTrue: [ScriptingSystem customizeForEToyUsers: aBoolean]. ((prefSymbol == #infiniteUndo) and: [aBoolean not]) ifTrue: [CommandHistory resetAllHistory]. (prefSymbol == #showProjectNavigator) ifTrue: [Project current assureNavigatorPresenceMatchesPreference] ! ! !Project methodsFor: 'menu messages' stamp: 'sw 2/12/2001 11:46'! assureNavigatorPresenceMatchesPreference "Make sure that the current project conforms to the presence/absence of the navigator" | navigator navType wantIt | Smalltalk isMorphic ifFalse: [^ self]. wantIt _ Preferences showProjectNavigator. navType _ ProjectNavigationMorph preferredNavigator. navigator _ world findA: navType. wantIt ifFalse: [navigator ifNotNil: [navigator delete]] ifTrue: [navigator isNil ifTrue: [(navigator _ navType new) bottomLeft: world bottomLeft; openInWorld: world]]! !