[squeak-dev] The Trunk: ToolBuilder-Kernel-mt.138.mcz

Marcel Taeumel marcel.taeumel at hpi.de
Mon Apr 20 06:45:41 UTC 2020


> Did we ever document that '' implies "Cancel"?

It has been that way for FillInTheBlank for like forever. :-) All other dialogs return "nil" on cancel.

> Can't we just try to return nil and update all senders if necessary?

Maybe, because we are at the beginning of a release cycle. But a quick look at the Trunk suggested at least 1-2 days of work to make that change work. And write tests for it, of course.

Best,
Marcel
Am 18.04.2020 15:52:33 schrieb Thiede, Christoph <christoph.thiede at student.hpi.uni-potsdam.de>:
Hi Marcel,

> For text requests, fall back to the most simple case so that ui managers do not have to implement all cases. For example, our DummyUIManager did forget one already and nobody noticed.

This is probably related to The Inbox: ToolBuilder-Kernel-ct.135?

> I suspect that it is not possible to return "nil" by default because there are many cases that rely on a string being return in any case.

Hm, but this still feels wrong. Did we ever document that '' implies "Cancel"? Can't we just try to return nil and update all senders if necessary? (It would probably better to do this refactoring together with UserNotification if we ever introduce this. I cannot find the link to the full discussion at the moment.)

Best,
Christoph
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von commits at source.squeak.org <commits at source.squeak.org>
Gesendet: Mittwoch, 15. April 2020 15:55:51
An: squeak-dev at lists.squeakfoundation.org; packages at lists.squeakfoundation.org
Betreff: [squeak-dev] The Trunk: ToolBuilder-Kernel-mt.138.mcz
 
Marcel Taeumel uploaded a new version of ToolBuilder-Kernel to project The Trunk:
http://source.squeak.org/trunk/ToolBuilder-Kernel-mt.138.mcz [http://source.squeak.org/trunk/ToolBuilder-Kernel-mt.138.mcz]

==================== Summary ====================

Name: ToolBuilder-Kernel-mt.138
Author: mt
Time: 15 April 2020, 3:55:51.006534 pm
UUID: 8d0776ff-7711-a74c-ba35-ec3420f47184
Ancestors: ToolBuilder-Kernel-mt.137

For text requests, fall back to the most simple case so that ui managers do not have to implement all cases. For example, our DummyUIManager did forget one already and nobody noticed.

Adds hook to specify the cancel answer so that applications can actually work with cancellation just like in the confirmation dialogs.

I suspect that it is not possible to return "nil" by default because there are many cases that rely on a string being return in any case.

=============== Diff against ToolBuilder-Kernel-mt.137 ===============

Item was changed:
  ----- Method: UIManager>>request:initialAnswer: (in category 'ui requests - text') -----
  request: queryString initialAnswer: defaultAnswer
+        "Create an instance of me whose question is queryString with the given initial answer. Answer the  string the user accepts. Answer the empty string if the user cancels."
+       
+        ^ self subclassResponsibility!
-        "Create an instance of me whose question is queryString with the given
-        initial answer. Invoke it centered at the given point, and answer the
-        string the user accepts. Answer the empty string if the user cancels."
-        ^self subclassResponsibility!

Item was changed:
  ----- Method: UIManager>>request:initialAnswer:centerAt: (in category 'ui requests - text') -----
  request: queryString initialAnswer: defaultAnswer centerAt: aPoint
+        "Create an instance of me whose question is queryString with the given initial answer. Invoke it centered at the given point, and answer the    string the user accepts. Answer the empty string if the user cancels."
-        "Create an instance of me whose question is queryString with the given
-        initial answer. Invoke it centered at the given point, and answer the
-        string the user accepts. Answer the empty string if the user cancels."
 
+        ^ self request: queryString initialAnswer: defaultAnswer!
-        ^self subclassResponsibility!

Item was added:
+ ----- Method: UIManager>>request:initialAnswer:onCancelReturn: (in category 'ui requests - text') -----
+ request: queryString initialAnswer: defaultAnswer onCancelReturn: cancelResponse
+        "Create an instance of me whose question is queryString with the given initial answer. Answer the string the user accepts. Answer cancelResponse if the user cancels."
+
+        ^ self request: queryString initialAnswer: defaultAnswer!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200420/9ed5db1a/attachment.html>


More information about the Squeak-dev mailing list