[squeak-dev] Please try out | Inspector Refactoring =)

Marcel Taeumel marcel.taeumel at hpi.de
Tue Apr 21 16:37:51 UTC 2020


Hi all!

Please find attached a slightly updated version of this Inspector Refactoring:

- Stef's bug fixed
- InspectorBrowser cleaned up a little bit
- some MVC-related bugs fixed
- BasicInspector more robust; no #expectedFailures anymore in the BasicInspectorTests

Happy try out! If you don't have further concerns with this, I will merge it into Trunk tomorrow or the day after.

Best,
Marcel
Am 20.04.2020 16:19:12 schrieb Marcel Taeumel <marcel.taeumel at hpi.de>:
Hi Stef,

thank you for testing and finding this bug. I think we can just factor out #okToDiscardCustomFields from #okToClose and then trigger that confirmation manually in #replaceInspectorWithExplorer. So we can re-use the confirmation dialog and properly react to the user's decision.

Best,
Marcel
Am 18.04.2020 01:18:26 schrieb Thiede, Christoph <christoph.thiede at student.hpi.uni-potsdam.de>:
Hi Stef, many thanks for trying out the changeset and finding the bug! :-)

I'm not sure if there is already a better pattern to fix this, but the following patch resolved the issue for me:

Inspector > replaceInspectorWithExplorer
"Switch to an explorer tool."
| window currentBounds |
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 myDependents ifNil: [self myDependents: #()].
self changed: #close.
+  self myDependents ifNotNil: [
+  "View resisted to release, aborting"
+  ^ self].
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.

Hm, maybe we should extract this into Model >> #close ... see also the flag in Debugger >> #close for reference.
(And thinking more generally, I would like to move the whole logic somewhere into the UIManager/ToolBuilder. But that's stuff for another refactoring :-))

Best,
Christoph


Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von Stéphane Rollandin <lecteur at zogotounga.net>
Gesendet: Samstag, 18. April 2020 00:58 Uhr
An: squeak-dev at lists.squeakfoundation.org
Betreff: Re: [squeak-dev] Please try out | Inspector Refactoring =)
 
> *2. Custom Fields*
>
> You can now add custom fields during your inspector session. Invoke the
> field-list menu and choose "add field..." at the bottom.

If, after having added a field, one swaps to the explorer via the
bottom-right button, a dialog appears warning that the field will be
discarded. This dialog has a 'yes' and a 'no' button, but both lead to
the same behavior: the explorer is installed.

Stef

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200421/db17f985/attachment-0001.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: inspector-refactoring.9.cs
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200421/db17f985/attachment-0001.ksh>


More information about the Squeak-dev mailing list