[squeak-dev] The Trunk: Tools-ct.1126.mcz

Chris Muller asqueaker at gmail.com
Tue Feb 8 01:25:18 UTC 2022


Christoph,

Please simply retain the dirty contents of each mode's pane rather than
introduce another use interruption.

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.

Best,
  Chris

On Sun, Feb 6, 2022 at 2:24 PM <commits at source.squeak.org> wrote:

> Christoph Thiede uploaded a new version of Tools to project The Trunk:
> http://source.squeak.org/trunk/Tools-ct.1126.mcz
>
> ==================== Summary ====================
>
> Name: Tools-ct.1126
> Author: ct
> Time: 6 February 2022, 9:24:10.500919 pm
> UUID: 95ff44c7-b6bf-0e46-b8e4-4d261c4c3806
> Ancestors: Tools-mt.1125
>
> 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.
>
> 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.
>
> =============== Diff against Tools-mt.1125 ===============
>
> Item was changed:
>   ----- Method: Inspector>>replaceInspectorWithExplorer (in category
> 'toolbuilder') -----
>   replaceInspectorWithExplorer
>         "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."
>
>         | window currentBounds |
> +       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."
> +
> +       (self okToDiscardCustomFields and: [contentsTyped notNil ==> [self
> confirm:
> + 'Changes have not been saved.
> + Is it OK to cancel those changes?' translated orCancel: [^ self]]])
> -       self okToDiscardCustomFields
>                 ifFalse: [^ self object explore].
>
>         self customFields removeAll.
> +       self changed: #contents. "Reset value pane contents before
> accepting all contents"
>         self changed: #acceptChanges. "We copy the current state anyway.
> See below."
>         currentBounds := ToolBuilder default class getBoundsForWindow:
> self containingWindow.
>
>         "Close first because MVC fiddles around with processes."
>         self changed: #close.
>
>         window := ToolSet explore: self object.
>
>         "---- In MVC, the lines after this will not be executed ---"
>
>         window model setExpression: self expression.
>         ToolBuilder default class setBoundsForWindow: window to:
> currentBounds.!
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220207/1464aa7b/attachment.html>


More information about the Squeak-dev mailing list