[squeak-dev] SmalltalkImage >> #setPlatformPreferences

Bob Arning arning315 at comcast.net
Sun Sep 29 11:31:11 UTC 2013


FWIW, here's what it used to do

setPlatformPreferences
     "Set some platform specific preferences on system startup"
     | platform specs |
     Preferences automaticPlatformSettings ifFalse:[^self].
     platform _ self platformName.
     specs _     #(
                     (soundStopWhenDone false)
                     (soundQuickStart false)
             ).
     platform = 'Win32' ifTrue:[
         specs _ #(
                     (soundStopWhenDone true)
                     (soundQuickStart false)
                 )].
     platform = 'Mac OS' ifTrue:[
         specs _ #(
                     (soundStopWhenDone false)
                     (soundQuickStart true)
                 )].
     specs do:[:tuple|
         Preferences setPreference: tuple first toValue: (tuple last == 
#true).
     ].


Cheers,
Bob

On 9/29/13 7:15 AM, Frank Shearar wrote:
> 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
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20130929/b37dff74/attachment.htm


More information about the Squeak-dev mailing list