[BUG][FIX] noviceMode preference fix
Jesse Welton
jwelton at pacific.mps.ohio-state.edu
Wed Feb 7 21:54:33 UTC 2001
The noviceMode preference causes passive SystemWindows to deactivate
their close and collapse buttons. Bug: This has no immediate effect
on existing passive windows, violating the naive user's expectations.
(That is, to the extent that a naive user could possibly have any
expectations about the preference.) Fix: Trap this preference in
Preferences>>noteThatFlag:justChangedTo: and tell all passive windows
to react accordingly.
-Jesse
-------------- next part --------------
'From Squeak3.0 of 4 February 2001 [latest update: #3446] on 7 February 2001 at 4:53:06 pm'!
"Change Set: NoviceModeFix
Date: 7 February 2001
Author: Jesse Welton
Makes the effects of noviceMode preference on SystemWindow buttons felt immediately."!
!Preferences class methodsFor: 'preferences dictionary' stamp: 'JW 2/7/2001 16:50'!
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 == #noviceMode) ifTrue: [
aBoolean
ifTrue: [
SystemWindow allSubInstances do: [:w | w isActive ifFalse: [w passivate]]
]
ifFalse: [
SystemWindow allSubInstances do: [:w | w isActive ifFalse: [w activateButtons]]
].
].! !
!SystemWindow methodsFor: 'top window' stamp: 'JW 2/7/2001 16:49'!
activateButtons
"For turning off noviceMode preference"
closeBox ifNotNil: [ closeBox unlock ].
collapseBox ifNotNil: [ collapseBox unlock ].
! !
More information about the Squeak-dev
mailing list
|