<div dir="ltr"><div>Christoph,</div><div><br></div><div>Please simply retain the dirty contents of each mode's pane rather than introduce another use interruption.</div><div><br></div><div>Otherwise, I would like to at least make this conditional on Reuse Windows not being set.  Reuse Windows reinforces the behavior throughout the system that new windows are opened when pane contents cannot be changed due to being dirty, so it would be good to keep that behavior consistent here.  The newly-opened window IS the "pop up" that enables the user to preserve their contents AND continue working, unfettered.<br></div><div><br></div><div>Best,</div><div>  Chris</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Feb 6, 2022 at 2:24 PM <<a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Christoph Thiede uploaded a new version of Tools to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/Tools-ct.1126.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/trunk/Tools-ct.1126.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Tools-ct.1126<br>
Author: ct<br>
Time: 6 February 2022, 9:24:10.500919 pm<br>
UUID: 95ff44c7-b6bf-0e46-b8e4-4d261c4c3806<br>
Ancestors: Tools-mt.1125<br>
<br>
Fixes a bug when switching to an explorer from an inspector that has unaccepted contents in the value pane. Rather than replacing the value of a field (or even replacing the inspected/explored object), ask the user and either withdraw these contents or open a new window for the explorer.<br>
<br>
Note that I consider this patch rather a temporary hotfix than a final solution. In the long term, we should try to communicate specific selectors (here: #expression) for requests such as #acceptChanges or #wantToChange instead.<br>
<br>
=============== Diff against Tools-mt.1125 ===============<br>
<br>
Item was changed:<br>
  ----- Method: Inspector>>replaceInspectorWithExplorer (in category 'toolbuilder') -----<br>
  replaceInspectorWithExplorer<br>
        "Switch to an explorer tool. If there are custom fields, the user can choose to not discard them, which will just spawn a new explorer tool besides this inspector."<br>
<br>
        | window currentBounds |<br>
+       self flag: #todo. "ct: In the long term, we should try to communicate specific selectors (here: #expression) along the observer pattern for requests such as #acceptChanges or #wantToChange instead of exploiting contentsTyped etc."<br>
+       <br>
+       (self okToDiscardCustomFields and: [contentsTyped notNil ==> [self confirm:<br>
+ 'Changes have not been saved.<br>
+ Is it OK to cancel those changes?' translated orCancel: [^ self]]])<br>
-       self okToDiscardCustomFields<br>
                ifFalse: [^ self object explore].<br>
<br>
        self customFields removeAll.<br>
+       self changed: #contents. "Reset value pane contents before accepting all contents"<br>
        self changed: #acceptChanges. "We copy the current state anyway. See below."<br>
        currentBounds := ToolBuilder default class getBoundsForWindow: self containingWindow.<br>
<br>
        "Close first because MVC fiddles around with processes."<br>
        self changed: #close. <br>
<br>
        window := ToolSet explore: self object.<br>
<br>
        "---- In MVC, the lines after this will not be executed ---"<br>
<br>
        window model setExpression: self expression.<br>
        ToolBuilder default class setBoundsForWindow: window to: currentBounds.!<br>
<br>
<br>
</blockquote></div>