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

Marcel Taeumel marcel.taeumel at hpi.de
Thu Dec 26 15:07:47 UTC 2019


Hi Tim,

looks good. Would you fix the typo and add #translated calls?

'Select a preferences file to load' translated

'There was an error restoring the preferences from file {1}.' translated format: {fname}

Best,
Marcel
Am 24.12.2019 20:56:32 schrieb commits at source.squeak.org <commits at source.squeak.org>:
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!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20191226/7ab7bc6f/attachment.html>


More information about the Squeak-dev mailing list