The Trunk: System-kfr.726.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: System-kfr.726.mcz

commits-2
Karl Ramberg uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-kfr.726.mcz

==================== Summary ====================

Name: System-kfr.726
Author: kfr
Time: 28 April 2015, 8:53:41.096 am
UUID: a075e8a8-c4bd-d84a-8d18-5cf590262626
Ancestors: System-cmm.725

Register fileService for *.pref. Preferences can now be loaded from FileList

=============== Diff against System-cmm.725 ===============

Item was added:
+ ----- Method: Preferences class>>fileReaderServicesForFile:suffix: (in category 'file list services') -----
+ fileReaderServicesForFile: fullName suffix: suffix
+ ^(suffix = 'prefs')  | (suffix = '*')
+ ifTrue: [ self services ]
+ ifFalse: [ #() ]!

Item was changed:
  ----- Method: Preferences class>>loadPreferencesFrom: (in category 'personalization') -----
+ loadPreferencesFrom: aFile
- loadPreferencesFrom: aFileName
  | stream params dict desktopColor |
+ stream := ReferenceStream fileNamed: aFile.
- stream := ReferenceStream fileNamed: aFileName.
  params := stream next.
  self assert: (params isKindOf: IdentityDictionary).
  params removeKey: #PersonalDictionaryOfPreferences.
  dict := stream next.
  self assert: (dict isKindOf: IdentityDictionary).
  desktopColor := stream next.
  stream close.
  dict keysAndValuesDo:
  [:key :value | (self preferenceAt: key ifAbsent: [nil]) ifNotNil:
  [:pref | pref preferenceValue: value preferenceValue]].
 
  params keysAndValuesDo: [ :key :value | self setParameter: key to: value ].
 
  Smalltalk isMorphic
  ifTrue: [ World fillStyle: desktopColor ]
  ifFalse: [ self desktopColor: desktopColor. ScheduledControllers updateGray ].
  !

Item was added:
+ ----- Method: Preferences class>>serviceLoadPreferencesFromDisk (in category 'file list services') -----
+ serviceLoadPreferencesFromDisk
+ ^ SimpleServiceEntry
+ provider: self
+ label: 'load preferences from a saved file'
+ selector: #restorePreferencesFromDisk:
+ description: 'restore all saved personal preference settings'
+ buttonLabel: 'load preferences'!

Item was added:
+ ----- Method: Preferences class>>services (in category 'file list services') -----
+ services
+ ^ Array with: self serviceLoadPreferencesFromDisk!