[squeak-dev] SmalltalkImage >> #setPlatformPreferences
Frank Shearar
frank.shearar at gmail.com
Sun Sep 29 11:15:12 UTC 2013
Am I missing anything, or can most of this be driven into #startUp methods?:
SmalltalkImage >> setPlatformPreferences
"Set some platform specific preferences on system startup"
| platform specs |
Preferences automaticPlatformSettings ifFalse:[^self].
SoundPlayer soundQuickStart: SoundPlayer defaultQuickStartForPlatform.
SoundPlayer stopSoundWhenDone: SoundPlayer defaultStopSoundForPlatform.
platform := self platformName.
specs := #().
platform = 'Win32' ifTrue:[
specs := #()].
platform = 'Mac OS' ifTrue:[
specs := #()].
specs do:[:tuple|
Preferences setPreference: tuple first toValue: (tuple last == true).
].
In particular, it looks like SoundPlayer >> #startUp would be a good
place to put
Preferences automaticPlatformSettings ifTrue: [
SoundPlayer soundQuickStart: SoundPlayer defaultQuickStartForPlatform.
SoundPlayer stopSoundWhenDone: SoundPlayer defaultStopSoundForPlatform].
The rest of #setPlatformPreferences is a giant no-op, but it's a giant
no-op that shows the structure one would need to follow if we needed
per-platform specs, at least. (Although my strong preference would
still be to drive this kind've stuff into packages' #startUp methods.)
frank
More information about the Squeak-dev
mailing list
|