A new version of System was added to project Etoys Inbox:
http://source.squeak.org/etoysinbox/System-kfr.51.mcz==================== Summary ====================
Name: System-kfr.51
Author: kfr
Time: 28 January 2012, 3:34:22 pm
UUID: 25d6600f-fadb-7d47-a4b3-719dba805069
Ancestors: System-kfr.50
Add loading preferences file from disk to FileList and a file dialog when restoring preferences from disk in preference panel.
=============== Diff against System-kfr.50 ===============
Item was changed:
----- Method: Preferences class>>fileReaderServicesForFile:suffix: (in category 'services') -----
fileReaderServicesForFile: fullName suffix: suffix
^(self registeredPreferencesFileSuffixes includes: suffix )
ifTrue: [ self services ]
+ ifFalse: [ #() ] !
- ifFalse: [ #() ]!
Item was changed:
----- Method: Preferences class>>registeredPreferencesFileSuffixes (in category 'services') -----
registeredPreferencesFileSuffixes
+ ^{'prefs'}!
- ^{'prefs'} !
Item was changed:
----- Method: Preferences class>>restorePreferencesFromDisk (in category 'personalization') -----
restorePreferencesFromDisk
+ | result |
- | result |
result := (FileList2 modalFileSelectorForSuffixes: #('prefs')) .
result ifNil: [^ self].
Cursor wait showWhile: [
[ self loadPreferencesFrom: result fullName ] on: Error do: [ :ex | self inform: 'there was an error restoring the preferences' translated]
]
!
Item was changed:
----- Method: Preferences class>>restorePreferencesFromDisk: (in category 'personalization') -----
restorePreferencesFromDisk: aFile
Cursor wait showWhile: [
[ self loadPreferencesFrom: aFile ] on: Error do: [ :ex | self inform: 'there was an error restoring the preferences' translated]
+ ]
- ]
!
Item was changed:
----- Method: Preferences class>>serviceLoadPreferences (in category 'services') -----
serviceLoadPreferences
"Answer a service for loading preferences from disk"
^ SimpleServiceEntry
provider: self
label: 'load preferences' translatedNoop
selector: #restorePreferencesFromDisk:
description: 'load preferences file from disk' translatedNoop
buttonLabel: 'load preferences' translatedNoop!
Item was changed:
----- Method: Preferences class>>services (in category 'services') -----
services
"Answer the receiver's services"
+ ^ OrderedCollection with: self serviceLoadPreferences !
- ^ OrderedCollection with: self serviceLoadPreferences!
Item was added:
+ (PackageInfo named: 'System') postscript: '"below, add code to be run after the loading of this package"
+ FileList registerFileReader: Preferences'!
_______________________________________________
etoys-dev mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/etoys-dev