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

David T. Lewis lewis at mail.msen.com
Fri Dec 27 15:44:16 UTC 2019


On Thu, Dec 26, 2019 at 05:58:28PM -0600, Chris Muller wrote:
> Hi Tim,
> 
> Why?  Preferences are specific to users.  An individual user concerned
> enough to want their own preferences is going to want their own directory
> to work out of.

An individual user may work with more than one directory. For example, I
have a ./squeak/squeak5.2 directory that holds stuff I have been doing
since since the 5.2 release, and a ./squeak/squeak3.8 folder for things
I was doing back in that era, plus a folder for VM work, and so forth.

> 
> As with the new Image "Save as...", on machines with magnetic HD's and lots
> of directories, having to scan the directory just to present this unwanted
> UI immensely slows down and complicates the normal use-case for that.  Even
> more frustrating is that it encourages a bad habits, manual configuration.
> 
> Please add a new button to render and "Select..." your desired preference
> file instead.  That way, the existing buttons can maintain the quick-access
> we've enjoyed all these years.

Saving preferences to disk is (for me) a rare operation, I find Tim's
enhancement to be helpful and easy to understand. It also saves time for
me, because I don't have to stop and think about out where the file is
being saved.

Dave

> 
> Best,
>   Chris
> 
> On Tue, Dec 24, 2019 at 1:56 PM <commits at source.squeak.org> wrote:
> 
> > 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