[squeak-dev] The Trunk: System-topa.715.mcz
commits at source.squeak.org
commits at source.squeak.org
Thu Apr 2 08:57:39 UTC 2015
Tobias Pape uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-topa.715.mcz
==================== Summary ====================
Name: System-topa.715
Author: topa
Time: 2 April 2015, 10:57:12.703 am
UUID: 2a92cef0-6bb4-47b3-994e-994a626d54c8
Ancestors: System-ul.714
Make SoundService registeredClasses class-based.
Categorize in AppRegistry
=============== Diff against System-ul.714 ===============
Item was changed:
+ ----- Method: AppRegistry class>>appName (in category 'defaults') -----
- ----- Method: AppRegistry class>>appName (in category 'as yet unclassified') -----
appName
"Defaults to the class name, which is probably good enough, but you could override this in subclasses if you want to."
^ self name!
Item was changed:
+ ----- Method: AppRegistry class>>askForDefault (in category 'defaults') -----
- ----- Method: AppRegistry class>>askForDefault (in category 'as yet unclassified') -----
askForDefault
self registeredClasses isEmpty ifTrue:
[self inform: 'There are no ', self appName, ' applications registered.'.
^ default := nil].
self registeredClasses size = 1 ifTrue:
[^ default := self registeredClasses anyOne].
default := UIManager default
chooseFrom: (self registeredClasses collect: [:ea | ea nameForViewer])
values: self registeredClasses
title: 'Which ', self appName, ' would you prefer?'.
default ifNil: [default := self registeredClasses first].
^default.!
Item was changed:
+ ----- Method: AppRegistry class>>default (in category 'accessing') -----
- ----- Method: AppRegistry class>>default (in category 'as yet unclassified') -----
default
^ default ifNil: [self askForDefault]!
Item was changed:
+ ----- Method: AppRegistry class>>default: (in category 'accessing') -----
- ----- Method: AppRegistry class>>default: (in category 'as yet unclassified') -----
default: aClassOrNil
"Sets my default to aClassOrNil.
Answers the old default."
| oldDefault |
oldDefault := default.
aClassOrNil ifNotNil: [ self register: aClassOrNil ].
default := aClassOrNil.
^ oldDefault!
Item was changed:
+ ----- Method: AppRegistry class>>defaultOrNil (in category 'accessing') -----
- ----- Method: AppRegistry class>>defaultOrNil (in category 'as yet unclassified') -----
defaultOrNil
^ default!
Item was changed:
+ ----- Method: AppRegistry class>>register: (in category 'registration') -----
- ----- Method: AppRegistry class>>register: (in category 'as yet unclassified') -----
register: aProviderClass
(self registeredClasses includes: aProviderClass) ifFalse:
[default := nil. "so it'll ask for a new default, since if you're registering a new app you probably want to use it"
self registeredClasses add: aProviderClass].!
Item was changed:
+ ----- Method: AppRegistry class>>registeredClasses (in category 'registration') -----
- ----- Method: AppRegistry class>>registeredClasses (in category 'as yet unclassified') -----
registeredClasses
^ registeredClasses ifNil: [registeredClasses := OrderedCollection new]!
Item was changed:
+ ----- Method: AppRegistry class>>removeObsolete (in category 'registration') -----
- ----- Method: AppRegistry class>>removeObsolete (in category 'as yet unclassified') -----
removeObsolete
"AppRegistry removeObsoleteClasses"
self registeredClasses copy do:[:cls|
(cls class isObsolete or:[cls isBehavior and:[cls isObsolete]])
ifTrue:[self unregister: cls]].
self subclasses do:[:cls| cls removeObsolete].!
Item was changed:
+ ----- Method: AppRegistry class>>unregister: (in category 'registration') -----
- ----- Method: AppRegistry class>>unregister: (in category 'as yet unclassified') -----
unregister: aProviderClass
(default = aProviderClass) ifTrue: [default := nil].
self registeredClasses remove: aProviderClass ifAbsent: [].!
Item was changed:
----- Method: DummySoundSystem class>>initialize (in category 'class initialization') -----
initialize
+ SoundService register: self.!
- SoundService register: self new.!
Item was changed:
----- Method: DummySoundSystem class>>unload (in category 'class initialization') -----
unload
+ SoundService unregister: self.!
- SoundService registeredClasses do: [:ss |
- (ss isKindOf: self) ifTrue: [SoundService unregister: ss]].!
Item was added:
+ ----- Method: SoundService class>>default (in category 'accessing') -----
+ default
+
+ | cls |
+ cls := super default.
+ ^ cls new!
Item was added:
+ ----- Method: SoundService class>>defaultOrNil (in category 'accessing') -----
+ defaultOrNil
+
+ ^ super defaultOrNil ifNotNil: [:default |
+ default isBehavior ifTrue: [default new] ifFalse: [default]]
+ !
Item was changed:
+ (PackageInfo named: 'System') postscript: '" Convert SoundService registeredClasses to classes if necessary "
+ [ | currentSoundSystem |
+ currentSoundSystem := SoundService defaultOrNil.
+ (SoundService registeredClasses copy collect: [:ss |
+ SoundService unregister: ss.
+ ss isBehavior
+ ifTrue: [ss]
+ ifFalse: [ss class]]
+ ) do: [:ssClass |
+ SoundService register: ssClass].
+ SoundService default: (currentSoundSystem
+ ifNotNil: [:css| css isBehavior ifTrue: [css] ifFalse: [css class]]).
+ ] value'!
- (PackageInfo named: 'System') postscript: '"Preferences already removed by hand, but whose state still lingers:"
- LocaleID allInstances do:
- [ : each | each
- isoLanguage: each isoLanguage
- isoCountry: (each isoCountry ifNil: [ each isoCountry ]) ].
- LanguageEnvironment knownEnvironments rehash.
- Locale resetKnownLocales'!
More information about the Squeak-dev
mailing list
|