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

commits at source.squeak.org commits at source.squeak.org
Sun Feb 6 20:24:27 UTC 2022

Christoph Thiede uploaded a new version of Tools to project The Trunk:

==================== 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') -----
  	"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.!

More information about the Squeak-dev mailing list