[squeak-dev] The Trunk: Protocols-tpr.83.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Apr 19 18:51:53 UTC 2022


tim Rowledge uploaded a new version of Protocols to project The Trunk:
http://source.squeak.org/trunk/Protocols-tpr.83.mcz

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

Name: Protocols-tpr.83
Author: tpr
Time: 19 April 2022, 11:51:52.229212 am
UUID: 807db710-4c4e-478d-863d-9ce075ff9f3b
Ancestors: Protocols-mt.82

Use the new ToolBuilder ability to show a list of options - typically a small number, maybe with a cancel button etc - as opposed to an arbitrary list of values. This separates it out from the chooseFrom:... protocol.
Also update "UIManager default" with "Project uiManager"

=============== Diff against Protocols-mt.82 ===============

Item was changed:
  ----- Method: Lexicon>>okayToAccept (in category 'model glue') -----
  okayToAccept
  	"Answer whether it is okay to accept the receiver's input"
  
  	| ok reply |
  	(ok := super okayToAccept) ifTrue:
  		[((compileTargetClass := self selectedClassOrMetaClass) ~~ targetClass) ifTrue:
+ 			[reply := Project uiManager
+ 						chooseOptionFrom: 
+ 							{'okay, no problem'. 
+ 							'cancel - let me reconsider'. 
+ 							'compile into ', targetClass name, ' instead'.
+ 							'compile into a new uniclass'}
+ 						title:
- 			[reply := UIManager default chooseFrom: 
- 				{'okay, no problem'. 
- 				'cancel - let me reconsider'. 
- 				'compile into ', targetClass name, ' instead'.
- 				'compile into a new uniclass'} title:
  'Caution!!  This would be
  accepted into class ', compileTargetClass name, '.
  Is that okay?'.
  			reply caseOf:
  				{[1] -> [^ true].
  				[2] -> [^ false].
  				[3] -> [compileTargetClass := targetClass. ^ true]}
  				otherwise: [self notYetImplemented]]].
  	^ ok!



More information about the Squeak-dev mailing list