<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: arial,helvetica,sans-serif; font-size: 12pt; color: #000000'><div>Hi Gerald,</div><div><br></div><div>Answers below<br></div><div><br></div><div><br></div><hr id="zwchr"><blockquote style="border-left:2px solid rgb(16, 16, 255);margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div>Yes and no, in this case the problem is the <font style="font-family:monospace">beep</font> method</div><div>checks the aforementioned property. Someone even changed</div><div>this method to use <font style="font-family:monospace">PreferenceNG</font>, but did not bother to add</div><div>the property. If there is no <font style="font-family:monospace">SampleSound</font> class, it just sends</div><div><font style="font-family:monospace">primitiveBeep</font> to itself. I presume the later should just beep,</div><div id="DWT523">AFAIR it never worked on my Linux installation.</div></blockquote><div><br></div><div>We can add the preference then. <br></div><div></div><div><br></div><blockquote style="border-left:2px solid rgb(16, 16, 255);margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div></div><br><div>I see four unsolved issues with PreferenceNG (I have to</div><div>apologize, I did to review your code, I was busy getting out  a</div><div>Haver release before Haver's demo).</div><br><ol><li><div>It's difficult to install preferences for a package, at least without a special <font style="font-family:monospace">CodePackage</font> subclass.</div><div>We need something like <font style="font-family:monospace" id="DWT524">PreferenceNG at: #somePreferenceSymbol ifAbsentInstall: [ ... ]</font></div></li></ol></blockquote><div><br></div><div>You just need to declare a new preference with one of the two class methods:</div><div>PreferenceNG name:....</div><div><br></div><div>If the preference exist, it is updated, if not it is created.</div><div>A package can put this in a class initialize method.<br></div><div><br></div><div><br></div><blockquote style="border-left:2px solid rgb(16, 16, 255);margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><ol><li><div><font style="font-family:monospace"></font></div></li><li><div>We should map the old Preferences code to PreferenceNG, this should provide the old default behavior.</div><div id="DWT525">This feature is important for packages the Cuis team can not change.</div></li></ol></blockquote><div><br></div><div>Hum, we wanted to simplify, so.... Neverthless you can access PreferenceNG myPreference, there is DNU for that compatibility level<br></div><div>Packages should be adapted because indeed there is some breakage. It can be done now has the two preferences system co-exist now.<br></div><div><br></div><div><br></div><blockquote style="border-left:2px solid rgb(16, 16, 255);margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><ol><li><div></div></li><li><div>We have lot of unconverted packages in the Cuis repo.</div><div id="DWT526">Just try: <font style="font-family:monospace">find -iname '*.st' | xargs grep -l ' Preferences '</font>.</div></li></ol></blockquote><div>One can only holds his own baggage <br></div><div><br></div><div><br></div><blockquote style="border-left:2px solid rgb(16, 16, 255);margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><ol><li><div></div></li><li><div>Implementing some sort of “world state object”, that should hold some sort of local preferences, is at least difficult,</div><div>because the whole logic is still at the class side. A <font style="font-family:monospace">PreferencesNGContainer</font> class, that has a singleton instance</div><div>bound to <font style="font-family:monospace">PreferencesNG</font> will solve that problem. Of course we need to move the class side methods of <font style="font-family:monospace">PreferenceNG</font></div><div id="DWT527">to the instance side of <font style="font-family:monospace">PreferencesNGContainer</font>.</div></li></ol></blockquote><div>I think we wanted to move away from this, and do not put too much responsibility on the Preference system<br></div><div>You can hold a state in the preference with a dedicated type object. To be explored<br></div><div><br></div><div>Hope this helps</div><div><br></div><div>Hliaire<br></div><div><br></div><blockquote style="border-left:2px solid rgb(16, 16, 255);margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><ol><li><div></div></li></ol><br><div>As I said, I am sorry that I mention this issues when it's almost to late.</div><br><br><div>Just my CHF 0.05,</div><br><div>Gerald</div><br><div class="gmail_quote_attribution">On May 29 2022, at 11:24 pm, Hilaire Fernandes via Cuis-dev <cuis-dev@lists.cuis.st> wrote:</div><blockquote><div> </div><div><div><font size="4">Hi Gerald,</font></div></div><br><div><font size="4">I do not know how to handle the soundsEnanbled preference because, if you have this option in the base image, without the sound package, one can set the preference to true but sound will not work. Am I right?</font></div><br><div><div><font size="4">If I am wrong, we can add it to the prefSystem method in PreferenceNG.</font></div></div><br><div><div><font size="4">Hilaire</font></div></div><br><div><br></div><br><div class="moz-cite-prefix"><div>Le 29/05/2022 à 10:35, Gerald Klix a écrit :</div></div><blockquote><br><div>I hate to point out that <font style="font-family:monospace">SystemDictionary>>#beep</font> is currently broken,</div><div>because <font style="font-family:monospace">PreferenceNG</font> lacks a <font style="font-family:monospace">#soundsEnabled</font> preference.</div><br><div><font style="font-family:monospace">@Juan and @Hilaire:</font></div><div><font style="font-family:monospace">How should one fix this properly?</font></div><ul><li><div>Provide a script that just adds this property</div></li><li><div>Add it to the <font style="font-family:monospace">PreferenceNG class>>#initialize</font> method.</div></li><li><div>Both of the above.</div></li></ul></blockquote><code><pre style="background-color:;padding:0.2em 1em">-- <br>GNU Dr. Geo<br><a href="http://drgeo.eu" title="http://drgeo.eu" target="_blank">http://drgeo.eu</a><a href="http://blog.drgeo.eu" title="http://blog.drgeo.eu" target="_blank">http://blog.drgeo.eu</a></pre></code><div>--</div><div>Cuis-dev mailing list</div><div>Cuis-dev@lists.cuis.st</div><div>https://lists.cuis.st/mailman/listinfo/cuis-dev</div></blockquote><br>-- <br>Cuis-dev mailing list<br>Cuis-dev@lists.cuis.st<br>https://lists.cuis.st/mailman/listinfo/cuis-dev<br></blockquote><br></div></body></html>