Alright, please see the attached changeset, everyone. It does not eliminate configuration drift completely, but at least eliminates the first cause for that.<br>
<br>
Best,<br>
Christoph<br>
<br>
<b>=============== Summary ===============</b><br>
<br>
Change Set:        resetPreferences<br>
Date:            20 May 2022<br>
Author:            Christoph Thiede<br>
<br>
Adds missing clean-ups for preferences:<br>
<br>
1. Add Preferences resetDefaultValues and send it from ReleaseBuilders after #setPreferences to bring the default values of non-pragma preferences in sync with the fresh values. See: http://lists.squeakfoundation.org/pipermail/squeak-dev/2022-January/218191.html<br>
2. Merge Preferences cleanUp and Preferences cleanUp: to ensure that both are executed. See SmalltalkImage>>#cleanUp:except:.<br>
3. Clean up project preferences during Project clean-up.<br>
<br>
Note that we have still two sources of truth for default preference values (the intrinsic #defaultValue/pragma getter and the extrinsic database ReleaseBuilder>>setPreferences). See http://lists.squeakfoundation.org/pipermail/squeak-dev/2022-January/218191.html for more information.<br>
<br>
<b>=============== Diff ===============</b><br>
<br>
<b>PragmaPreference>>resetDefaultValue {initialization} · ct 5/20/2022 18:03</b><br>
<font color="#FF0000">+ resetDefaultValue<br>
+     "No-op. Pragma preferences do not have default values."</font><br>
<br>
<b>Preference>>resetDefaultValue {initialization} · ct 5/20/2022 18:03</b><br>
<font color="#FF0000">+ resetDefaultValue<br>
+ <br>
+     self defaultValue: self preferenceValue.</font><br>
<br>
<b>Preferences class>>cleanUp {class initialization} · mt 1/24/2019 14:12 (removed)</b><br>
<s><font color="#0000FF">- cleanUp<br>
- <br>
-     "Synchronize the cache for pragma preferences. Note that the actual preferences values are stored in class variables. So, no such value gets lost if we remove all such preferences from that cache."<br>
-     self removeAllPreferencesSuchThat: [:preference |<br>
-         preference isPragmaPreference].<br>
-     SystemNavigation default allSelectorsAndMethodsDo: [:behavior :selector :method |<br>
-         method pragmas do: [:pragma |<br>
-             self addPragmaPreference: pragma]].<br>
-     <br>
-     "Remove obsolete (non-pragma) preferences."<br>
-     self removeObsolete.<br>
</font></s><br>
<br>
<b>Preferences class>>cleanUp: {initialization} · ct 5/20/2022 18:01 (changed)</b><br>
cleanUp: aggressive<br>
<br>
<font color="#FF0000">+     self cleanUpPragmaPreferences.<br>
+     <br>
+     "Remove obsolete (non-pragma) preferences."<br>
+     self removeObsolete.<br>
+     <br>
</font>    aggressive ifTrue: [<br>
        self class organization categories<br>
            select: [:ea | ea beginsWith: '*autogenerated']<br>
            thenDo: [:ea | self class removeCategory: ea]].<br>
<br>
<b>Preferences class>>cleanUpPragmaPreferences {initialization} · ct 5/20/2022 17:15</b><br>
<font color="#FF0000">+ cleanUpPragmaPreferences<br>
+     "Synchronize the cache for pragma preferences. Note that the actual preferences values are stored in class variables. So, no such value gets lost if we remove all such preferences from that cache."<br>
+ <br>
+     self removeAllPreferencesSuchThat: [:preference |<br>
+         preference isPragmaPreference].<br>
+     SystemNavigation default allSelectorsAndMethodsDo: [:behavior :selector :method |<br>
+         method pragmas do: [:pragma |<br>
+             self addPragmaPreference: pragma]].</font><br>
<br>
<b>Preferences class>>resetDefaultValues {initialization} · ct 5/20/2022 18:02</b><br>
<font color="#FF0000">+ resetDefaultValues<br>
+ <br>
+     self allPreferences do: [:preference |<br>
+         preference resetDefaultValue].</font><br>
<br>
<b>Project class>>cleanUp: {class initialization} · ct 5/20/2022 18:13 (changed)</b><br>
cleanUp: agressive<br>
    "Remove all projects but only when cleaning aggressively"<br>
<br>
    agressive ifTrue:[<br>
        self removeAllButCurrent.<br>
<s><font color="#0000FF">-         self current resourceManager reset].<br>
</font></s><font color="#FF0000">+         self current resourceManager reset].<br>
+     <br>
+     self allSubInstancesDo: [:project |<br>
+         project projectPreferenceFlagDictionary removeAll].<br>
+     self allSubInstancesDo: [:project |<br>
+         project initializeProjectPreferences].</font><br>
<br>
<b>ReleaseBuilder class>>clearPreferenceCaches {scripts} · ct 5/20/2022 18:06</b><br>
<font color="#FF0000">+ clearPreferenceCaches<br>
+ <br>
+     Preferences resetDefaultValues.</font><br>
<br>
<b>ReleaseBuilder class>>prepareEnvironment {preparing} · ct 5/20/2022 18:05 (changed)</b><br>
prepareEnvironment<br>
    "Prepare everything that should be done for a new image build. Clear caches, passwords, etc."<br>
    <br>
    | balloon |<br>
    <br>
    self<br>
        clearCaches;<br>
        configureProjects;<br>
        configureTools;<br>
        setPreferences;<br>
<font color="#FF0000">+         clearPreferenceCaches;<br>
</font>        configureDesktop.<br>
    <br>
    balloon := self getBalloonForm. "Get now because later the file might be missing."<br>
    DeferredTask := [<br>
        self openWelcomeWorkspacesWith: balloon.<br>
        PreferenceWizardMorph open].<br>
    <br>
    "If you save-and-quit the image after calling #prepareEnvironment, ensure that the next image startup will be fast."<br>
    Project current world doOneCycle.<br>
    Display platformScaleFactor: 1.0.<br>
<br>
<b>ReleaseBuilderSqueakland class>>intermediatePrepareForUsers {scripts} · ct 5/20/2022 18:06 (changed)</b><br>
intermediatePrepareForUsers<br>
    "self intermediatePrepareForUsers"<br>
    Project cleanUpEtoysGarbage.<br>
    Smalltalk zapAllOtherProjects.<br>
    Project cleanUpEtoysGarbage.<br>
    ReleaseBuilder clearCaches.<br>
    ObjectScanner new. "clear ObjectScanner's class pool"<br>
    ExternalSettings registerClient: ServerDirectory.<br>
    Project cleanUpEtoysGarbage.<br>
    ReleaseBuilderSqueakland configureDesktop.<br>
    ReleaseBuilderSqueakland setPreferences.<br>
<font color="#FF0000">+     ReleaseBuilderSqueakland clearPreferenceCaches.<br>
</font>    Model useColorfulWindows: true.<br>
<br>
<b>ReleaseBuilderSqueakland class>>setPreferences {scripts} · ct 5/20/2022 18:05 (changed)</b><br>
setPreferences<br>
<br>
    super setPreferences.<br>
    <br>
    [ "Reset all preferences to their default value but ensure that all control and alt keys stay duplicated."<br>
        Preferences cambridge.<br>
<font color="#FF0000">+         self flag: #suspicious. "ct: This does not set the preferences to their default values, but reconfigures the default values based on their current values... If this is intended, update the comment and use Preferences resetDefaultValues."<br>
</font>        Preferences allPreferences do: [:each |<br>
            each defaultValue: each preferenceValue].<br>
        Preferences<br>
            enable: #duplicateAllControlAndAltKeys.<br>
    ] valueSupplyingAnswer: true.<br>
<br>
    Preferences<br>
        disable: #alternativeWindowBoxesLook;<br>
        enable: #magicHalos;<br>
        enable: #mouseOverHalos;<br>
        enable: #showAdvancedNavigatorButtons;<br>
        disable: #honorDesktopCmdKeys;<br>
        enable: #unlimitedPaintArea;<br>
        enable: #fastDragWindowForMorphic;<br>
        enable: #noviceMode;<br>
        disable: #generalizedYellowButtonMenu;<br>
        disable: #signProjectFiles;<br>
        enable: #alwaysHideHScrollbar;<br>
        enable: #alwaysShowVScrollbar. "For the menu button."<br>
    ScrollBar scrollBarsWithoutMenuButton: false.<br>
    ScrollBar scrollBarsWithoutArrowButtons: false.    <br>
<br>
    "Rounded corners."<br>
    Morph preferredCornerRadius: 8.<br>
    PluggableButtonMorph roundedButtonCorners: true.<br>
    DialogWindow roundedDialogCorners: true.<br>
    SystemWindow roundedWindowCorners: true.<br>
    ScrollBar roundedScrollBarLook: true.<br>
<br>
    Cursor useBiggerCursors: true.<br>
    TrashCanMorph<br>
        slideDismissalsToTrash: true;<br>
        preserveTrash: true.<br>
    SugarNavigatorBar<br>
        showHideButton: false;<br>
        showSugarNavigator: true.<br>
    Preferences disable: #showAdvancedNavigatorButtons.<br>
    TileMorph usePopUpArrows: true.<br>
    Morph indicateKeyboardFocus: false.<br>
        <br>
    "Ignore warnings."<br>
    Deprecation showDeprecationWarnings: false.<br>
    Preferences<br>
        disable: #warnIfChangesFileReadOnly;<br>
        disable: #warnIfNoChangesFile;<br>
        disable: #warnIfNoSourcesFile.<br>
<br>
<font color="#808080">---<br>
</font><font color="#808080"><i>Sent from </i></font><font color="#808080"><i><a href="https://github.com/hpi-swa-lab/squeak-inbox-talk"><u><font color="#808080">Squeak Inbox Talk</font></u></a></i></font><br>
<br>
On 2022-05-20T14:36:00+00:00, mail@jaromir.net wrote:<br>
<br>
> Hi Christoph, all,<br>
> <br>
> > my proposal would be that we set all Preferences' defaultValues to their value during the release building<br>
> <br>
> Yes, that feels intuitive and I like the defaults the image comes with; I personally only need to make like 4 changes in the wizard and would appreciate to be able to get back to that default set.<br>
> <br>
> Thanks,<br>
> <br>
> <br>
> --<br>
> <br>
> Jaromír Matas<br>
> <br>
> +420 777 492 777<br>
> mail at jaromir.net<br>
> <br>
> From: Thiede, Christoph<mailto:Christoph.Thiede at student.hpi.uni-potsdam.de><br>
> Sent: Friday, May 20, 2022 15:16<br>
> To: Squeak Dev<mailto:squeak-dev at lists.squeakfoundation.org><br>
> Subject: Re: [squeak-dev] Default preferences<br>
> <br>
> <br>
> Hi Jaromir, hi all,<br>
> <br>
> <br>
> <br>
> thanks for finding this! This is insane. I suppose that no one in the last years has ever pressed this "default" button and thus this inconsistency was never found.<br>
> <br>
> <br>
> <br>
> We seem to have two sources of truth here:<br>
> <br>
> 1. The default value of each preference:<br>
> <br>
>   1a. For pragma preferences, this is encoded in the getter of the preference (i.e., Model class>>#useColorfulWindows falls back to true).<br>
> <br>
>   1b. For old-style preferences, this is the defaultValue variable of the preference instance (this is not encoded anywhere, just historic instances that have been handed down since years or decades via the release images like the Olympic torch). See Preferences preferenceAt: #fastDragWindowForMorphic for example.<br>
> <br>
> 2. The default values encoded in the ReleaseBuilder (or actually, the ReleaseBuilders, since this thing is even subclassed), see #setPreferences. For instance, here #useColorfulWindows is set to false.<br>
> <br>
> <br>
> <br>
> This is really crazy. I feel like traveling ten years back in time after clicking that button. I don't know how we should solve the two sources of truth problem, but my proposal would be that we set all Preferences' defaultValues to their value during the release building - how do you think about that? Would some others agree with that? If yes, I can implement & upload that.<br>
> <br>
> <br>
> <br>
> > A theme is not a 'preference', despite the Preference Wizard sets it, right? (slightly confusing but ok)<br>
> <br>
> <br>
> <br>
> Yes. The Preference Wizard does not display all preferences, but it also provides access to some other options. For instance, the preference browser also does not have logic for installing recommended packages. :-)<br>
> <br>
> <br>
> <br>
> Best,<br>
> <br>
> Christoph<br>
> <br>
> Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von Jaromir Matas <mail at jaromir.net><br>
> Gesendet: Freitag, 20. Mai 2022 10:03:23<br>
> An: Squeak Dev<br>
> Betreff: [squeak-dev] Default preferences<br>
> <br>
> Hi All,<br>
> A quick question: What are the 'default preferences'?<br>
> <br>
> I thought they were the ones the fresh image comes with but when you open a Preference Browser and hit the 'default' button you get another set of preferences (round buttons, colorful windows etc.) ? is this a bug? Is there a way to get back to the preferences the image comes with?<br>
> <br>
> A theme is not a 'preference', despite the Preference Wizard sets it, right? (slightly confusing but ok) (BTW the Community Dark theme is awesome! Even italic comments :) Using it all the time)<br>
> <br>
> Also, if I check the 'English' tick-box in Extras -> Language, the flaps show (that must be a bug).<br>
> <br>
> Best,<br>
> <br>
> --<br>
> <br>
> Jaromír Matas<br>
> <br>
> mail at jaromir.net<br>
> <br>
> <br>
> -------------- next part --------------<br>
> An HTML attachment was scrubbed...<br>
> URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220520/1d98428b/attachment.html><br>
> -------------- next part --------------<br>
> A non-text attachment was scrubbed...<br>
> Name: 41142808068542D2863E07CB95D21DCC.png<br>
> Type: image/png<br>
> Size: 144 bytes<br>
> Desc: 41142808068542D2863E07CB95D21DCC.png<br>
> URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220520/1d98428b/attachment.png><br>
> <br>
> <br>
["resetPreferences.1.cs"]