<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body>
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>Well, you could use it in methods such as <span>Flaps class >> makeNavigatorFlapResembleGoldenBar or PreferenceWizardMorph >> <span>toggleToolAndMenuIcons as well, but there are few of these senders outside of test methods.</span></span></p>
<p><span><span><br>
</span></span></p>
<p>However, I just discovered a possible duplicate, Preferences >> #setPreferencesFrom:. Do you think that's a problem? I think the old nested array style is less convenient compared to the use of associations, and there is no "during" version ...</p>
<p><br>
</p>
<p>Best,</p>
<p>Christoph</p>
<div id="Signature">
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div><font size="2" color="#808080"></font></div>
</div>
</div>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von Taeumel, Marcel<br>
<b>Gesendet:</b> Dienstag, 29. Oktober 2019 10:59:30<br>
<b>An:</b> John Pfersich via Squeak-dev<br>
<b>Betreff:</b> Re: [squeak-dev] The Inbox: System-ct.1119.mcz</font>
<div> </div>
</div>
<div>
<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000">
Hmm.... this sounds like it is meant to be used in tests only. Or are there other scenarios? Putting this in regular application code might yield confusing effects or hacky code.
<div><br>
</div>
<div>So, what about putting this into an *SUnit extension category?</div>
<div><br>
</div>
<div>Best,</div>
<div>Marcel</div>
<div class="mb_sig"></div>
<blockquote class="history_container" type="cite" style="border-left-style:solid;border-width:1px; margin-top:20px; margin-left:0px;padding-left:10px;">
<p style="color: #AAAAAA; margin-top: 10px;">Am 26.10.2019 22:01:13 schrieb commits@source.squeak.org <commits@source.squeak.org>:</p>
<div style="font-family:Arial,Helvetica,sans-serif">A new version of System was added to project The Inbox:<br>
http://source.squeak.org/inbox/System-ct.1119.mcz<br>
<br>
==================== Summary ====================<br>
<br>
Name: System-ct.1119<br>
Author: ct<br>
Time: 26 October 2019, 10:00:59.779469 pm<br>
UUID: dc499ab1-dfe1-064c-a997-271a591d4b18<br>
Ancestors: System-mt.1116<br>
<br>
Adds convenience methods to change multiple preferences<br>
<br>
Usage example:<br>
<br>
Preferences<br>
setPreferences: {<br>
#(UIManager >> #openToolsAttachedToMouseCursor) join asSymbol -> false.<br>
#(Model >> #useColorfulWindows) join asSymbol -> false }<br>
during: [self notify: 'Carpe Squeak!']<br>
<br>
=============== Diff against System-mt.1116 ===============<br>
<br>
Item was added:<br>
+ ----- Method: Preferences class>>setPreferences: (in category 'get/set') -----<br>
+ setPreferences: associations<br>
+ <br>
+ associations associationsDo: [:association |<br>
+ self setPreference: association key toValue: association value].!<br>
<br>
Item was added:<br>
+ ----- Method: Preferences class>>setPreferences:during: (in category 'get/set') -----<br>
+ setPreferences: associations during: aBlock<br>
+ "Changes the given values for the duration of aBlock"<br>
+ <br>
+ | values previousValues |<br>
+ values := associations as: Dictionary.<br>
+ previousValues := values associations collect: [:association |<br>
+ association key -> (self valueOfFlag: association key)].<br>
+ self setPreferences: values.<br>
+ ^ aBlock ensure: [<br>
+ self setPreferences: previousValues]!<br>
<br>
<br>
</div>
</blockquote>
</div>
</div>
</body>
</html>