[squeak-dev] The Inbox: System-ct.1158.mcz

Marcel Taeumel marcel.taeumel at hpi.de
Sun May 17 12:35:24 UTC 2020


Hi Christoph.

- What about ToolSet class >> #askForDefault?
- What is the benefit of extracting #requestDefault out of #askDefault? It is not obvious that one has a side effect and the other does not.
- UIManager default -> Project uiManager

Best,
Marcel
Am 16.05.2020 20:53:34 schrieb commits at source.squeak.org <commits at source.squeak.org>:
Christoph Thiede uploaded a new version of System to project The Inbox:
http://source.squeak.org/inbox/System-ct.1158.mcz

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

Name: System-ct.1158
Author: ct
Time: 16 May 2020, 8:53:15.785708 pm
UUID: 03cddc8b-5593-504d-95c0-fc6851a15d88
Ancestors: System-nice.1157

Refactor AppRegistry class >> #askForDefault. Add multilingual support. If request is cancelled by the user, don't set a default and return a fallback value.

=============== Diff against System-nice.1157 ===============

Item was changed:
----- Method: AppRegistry class>>askForDefault (in category 'defaults') -----
askForDefault

+ self requestDefault ifNotNil: [:newDefault |
+ default := newDefault].
+ ^ default ifNil: [self registeredClasses first]!
- self registeredClasses isEmpty ifTrue:
- [self inform: 'There are no ', self appName, ' applications registered.'.
- ^ default := nil].
- self registeredClasses size = 1 ifTrue:
- [^ default := self registeredClasses anyOne].
- default := UIManager default
- chooseFrom: (self registeredClasses collect: [:ea | ea nameForViewer])
- values: self registeredClasses
- title: 'Which ', self appName, ' would you prefer?'.
- default ifNil: [default := self registeredClasses first].
- ^default.!

Item was added:
+ ----- Method: AppRegistry class>>requestDefault (in category 'defaults') -----
+ requestDefault
+
+ self registeredClasses isEmpty ifTrue: [
+ self inform: ('There are no {1} applications registered' translated format: {self appName}).
+ ^ nil].
+ self registeredClasses size = 1 ifTrue: [
+ ^ self registeredClasses anyOne].
+ ^ UIManager default
+ chooseFrom: (self registeredClasses collect: [:ea | ea nameForViewer])
+ values: self registeredClasses
+ title: ('Which {1} would you prefer?' translated format: {self appName})!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200517/11f572ae/attachment.html>


More information about the Squeak-dev mailing list