The Trunk: ToolBuilder-Morphic-mt.217.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: ToolBuilder-Morphic-mt.217.mcz

commits-2
Marcel Taeumel uploaded a new version of ToolBuilder-Morphic to project The Trunk:
http://source.squeak.org/trunk/ToolBuilder-Morphic-mt.217.mcz

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

Name: ToolBuilder-Morphic-mt.217
Author: mt
Time: 4 May 2018, 8:00:07.49707 am
UUID: cd568389-663e-a647-9920-ff9ec82e9544
Ancestors: ToolBuilder-Morphic-pre.216

When adding a new item to the list via the ListChooser, allow for cancelling the (optional) confirmation step.

=============== Diff against ToolBuilder-Morphic-pre.216 ===============

Item was changed:
  ----- Method: ListChooser>>accept (in category 'actions') -----
  accept
  "if the user submits with no valid entry, make them start over"
 
  | choice |
  self canAccept ifFalse: [
  self canAdd ifTrue: [^ self add].
  ^ self changed: #textSelection].
 
  choice := self selectedItem.
 
  self canAdd ifTrue: [
  "Ask the user whether to add the new item or choose the list selection."
+ (UserDialogBoxMorph
+ confirm: 'You can either choose an existing item or add a new one.\What do you want?' translated withCRs
+ title: 'Choose or Add' translated
+ trueChoice: choice asString
+ falseChoice: self searchText asString at: ActiveHand position)
+ ifNil: ["Cancelled" self result: nil. ^ self]
+ ifNotNil: [:answer |
+ answer ifTrue: [self result: choice] ifFalse: [self result: self searchText asString]]
- (UserDialogBoxMorph confirm: 'You can either choose an existing item or add a new one.\What do you want?' translated withCRs title: 'Choose or Add' translated trueChoice: choice asString falseChoice: self searchText asString at: ActiveHand position)
- ifTrue: [self result: choice] ifFalse: [self result: self searchText asString]
  ] ifFalse: [self result: choice].
 
 
  self changed: #close.!