[squeak-dev] The Trunk: Tools-tpr.1146.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Apr 19 18:59:52 UTC 2022


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

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

Name: Tools-tpr.1146
Author: tpr
Time: 19 April 2022, 11:59:48.012063 am
UUID: e8bfe083-26d2-4e61-aa9e-81f42b5543de
Ancestors: Tools-ul.1145

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 Tools-ul.1145 ===============

Item was changed:
  ----- Method: CodeHolder>>okayToAccept (in category 'misc') -----
  okayToAccept
  	"Answer whether it is okay to accept the receiver's input"
  
  	self showingDocumentation ifTrue:
  		[self inform: 
  'Sorry, for the moment you can
  only submit changes here when
  you are showing source.  Later, you
  will be able to edit the isolated comment
  here and save it back, but only if YOU
  implement it!!.'.
  		^ false].
  
  	self showingEditContentsOption ifTrue:
  		[self inform: 'Cannot accept ', self contentsSymbol, ' input'.
  		^ false].
  
  	self showingAnyKindOfDiffs ifFalse:
  		[^ true]. 
+ 	^ (Project uiManager
+ 		chooseOptionFrom:
+ 		{'accept anyway -- I''ll take my chances'.
+ 		'um, let me reconsider'.}
+ 		title:
- 	^ (UIManager default chooseFrom: {
- 		'accept anyway -- I''ll take my chances'.
- 		'um, let me reconsider'.
- 	} title:
  'Caution!!  You are "showing diffs" here, so 
  there is a danger that some of the text in the
  code pane is contaminated by the "diff" display') = 1!

Item was changed:
  ----- Method: PluggableFileList class>>okToOpen:without: (in category 'validateBlocks') -----
  okToOpen: aFileNameString without: aSuffixString
  
  	"Answer whether user confirms that it is ok to overwrite the file named in aString"
+ 	^ 1 = (Project uiManager 
+ 				chooseOptionFrom: #('overwrite that file' 'select another file')
- 	^ 1 = (UIManager default 
- 				chooseFrom: #('overwrite that file' 'select another file')
  				title:  aFileNameString, ' already exists.').
  !

Item was changed:
  ----- Method: PluggableFileList class>>okToOverwrite: (in category 'validateBlocks') -----
  okToOverwrite: aString
  
  	"Answer whether user confirms that it is ok to overwrite the file named in aString"
+ 	^ 1 = (Project uiManager
+ 				chooseOptionFrom: #('overwrite that file' 'select another file')
+ 				title:  aString, ' already exists.')
- 	^ 1 = (UIManager default chooseFrom: #('overwrite that file' 'select another file')
- 			title:  aString, ' already exists.')
  !

Item was changed:
  ----- Method: Text>>askIfAddStyle:req: (in category '*Tools-attributes') -----
  askIfAddStyle: priorMethod req: requestor
  	"Ask the user if we have a complex style (i.e. bold) for the first time"
  	| tell answ old |
+ 	(SystemBrowser browseWithPrettyPrint) ifTrue:
+ 		[self couldDeriveFromPrettyPrinting ifTrue: [^ self asString]].
- 	(SystemBrowser browseWithPrettyPrint)
- 		ifTrue: [self couldDeriveFromPrettyPrinting ifTrue: [^ self asString]].
  	self runs coalesce.
  	self unembellished ifTrue: [^ self asString].
+ 	priorMethod ifNotNil:
+ 		[old := priorMethod getSourceFromFile].
+ 	(old == nil or: [old unembellished]) ifTrue:
+ 		[tell := 'This method contains style for the first time (e.g. bold or colored text).
- 	priorMethod ifNotNil: [old := priorMethod getSourceFromFile].
- 	(old == nil or: [old unembellished])
- 		ifTrue:
- 			[tell := 'This method contains style for the first time (e.g. bold or colored text).
  Do you really want to save the style info?'.
+ 		answ := (Project uiManager
+ 					chooseOptionFrom: #('Save method with style' 'Save method simply')
+ 					title: tell).
+ 		answ = 2 ifTrue: [^ self asString]]!
- 			answ := (UIManager default 
- 						chooseFrom: #('Save method with style' 'Save method simply')
- 						title: tell).
- 			answ = 2 ifTrue: [^ self asString]]!



More information about the Squeak-dev mailing list