[squeak-dev] The Inbox: PreferenceBrowser-tpr.98.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Dec 24 19:56:25 UTC 2019


tim Rowledge uploaded a new version of PreferenceBrowser to project The Inbox:
http://source.squeak.org/inbox/PreferenceBrowser-tpr.98.mcz

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

Name: PreferenceBrowser-tpr.98
Author: tpr
Time: 24 December 2019, 11:56:24.390074 am
UUID: 686fff60-db2c-4f95-a3f4-486b0e3c68db
Ancestors: PreferenceBrowser-mt.97

Possible change to allow users to save preferences to other than the default directory and with names other than 'my.prefs'.

=============== Diff against PreferenceBrowser-mt.97 ===============

Item was changed:
  ----- Method: PreferenceBrowser>>loadFromDiskSelected (in category 'preferences search') -----
+ loadFromDiskSelected
+ "Ask the user to select a saved preference file to load. If none is chosen then do nothing. If there is an error during the loading inform the user; this may leave the preferences in a messy state as we aren't tracking where the erro ocurred"
+ 	(Project uiManager chooseFileMatching: '*.prefs' label: 'Select a preferences file to load')
+ 		ifNotNil: [:fname | Cursor wait
+ 				showWhile: [[preferences loadPreferencesFrom: fname]
+ 						on: Error
+ 						do: [:ex | self inform: 'there was an error restoring the preferences from ' , fname]]] !
- loadFromDiskSelected 
- 
- 	(Project uiManager
- 		confirm: 'Do you really want to restore your\personal preferences from disk?\\The file ''my.prefs'' will be loaded.' translated withCRs
- 		title: 'Restore Preferences from Disk') ifFalse: [^ self].
- 
- 	preferences restorePreferencesFromDisk!

Item was changed:
  ----- Method: PreferenceBrowser>>saveToDiskSelected (in category 'preferences search') -----
+ saveToDiskSelected
+ 	"save the current preferences settings to file; the default is 'my.prefs' in the current default directory. Allow the user to choose where they should go"
+ 	(Project uiManager saveFilenameRequest: 'Save prefernces to file' initialAnswer: 'my.prefs')
+ 		ifNotNil: [:fname | Cursor wait
+ 				showWhile: [[preferences storePreferencesIn: fname]
+ 						on: Error
+ 						do: [:ex | self inform: 'there was an error storing your preferences to disk']]]!
- saveToDiskSelected 
- 
- 	(Project uiManager
- 		confirm: 'Do you really want to overwrite your\personal preferences on disk?\\The file ''my.prefs'' will be updated.' translated withCRs
- 		title: 'Save Preferences to Disk') ifFalse: [^ self].
- 		
- 	preferences storePreferencesToDisk!



More information about the Squeak-dev mailing list