Marcel Taeumel uploaded a new version of ToolBuilder-Kernel to project The Trunk:
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! |
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 <[hidden email]> im Auftrag von [hidden email] <[hidden email]>
Gesendet: Mittwoch, 15. April 2020 15:55:51 An: [hidden email]; [hidden email] 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 ==================== 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!
Carpe Squeak!
|
> 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
|
Free forum by Nabble | Edit this page |