The Trunk: EToys-mt.362.mcz

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

The Trunk: EToys-mt.362.mcz

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

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

Name: EToys-mt.362
Author: mt
Time: 16 October 2019, 1:09:43.789134 pm
UUID: 7dc0a2c8-30d8-ff4e-99b2-400a969a4c8b
Ancestors: EToys-mt.361

Minor fix because #select: keeps the original kind, which is a set, which cannot be sorted in-place.

=============== Diff against EToys-mt.361 ===============

Item was changed:
  ----- Method: SearchingViewer>>doSearchFrom:interactive: (in category 'search') -----
  doSearchFrom: aSource interactive: isInteractive
  "Perform the search operation.  If interactive is true, this actually happened because a search button was pressed; if false, it was triggered some other way for which an informer would be inappropriate."
 
  | searchFor aVocab aList all anInterface useTranslations scriptNames addedMorphs |
 
  searchString := aSource isString
  ifTrue:
  [aSource]
  ifFalse:
  [(aSource isKindOf: PluggableTextMorph) "old"
  ifTrue:
  [aSource text string]
  ifFalse:
  [aSource contents asString]].
  searchFor := searchString asLowercaseAlphabetic.
 
  aVocab := self outerViewer currentVocabulary.
  (useTranslations := (scriptedPlayer isPlayerLike) and: [aVocab isEToyVocabulary])
  ifTrue:
  [all := scriptedPlayer costume selectorsForViewer.
  all addAll: (scriptNames := scriptedPlayer class namedTileScriptSelectors)]
  ifFalse:
  [all := scriptNames := scriptedPlayer class allSelectors].
  aList := all select:
  [:aSelector | (aVocab includesSelector: aSelector forInstance: scriptedPlayer ofClass: scriptedPlayer class limitClass: ProtoObject) and:
  [(useTranslations and: [(anInterface := aVocab methodInterfaceAt: aSelector ifAbsent: [nil]) notNil and: [anInterface wording asString asLowercaseAlphabetic includesSubstring: searchFor caseSensitive: true]])
  or:
  [((scriptNames includes: aSelector) or: [useTranslations not]) and:
  [aSelector includesSubstring: searchFor caseSensitive: false]]]].
+ aList := aList sorted.
- aList sort.
 
  self removeAllButFirstSubmorph. "that being the header"
  self addAllMorphs:
  ((addedMorphs := scriptedPlayer tilePhrasesForSelectorList: aList inViewer: self)).
  self enforceTileColorPolicy.
  self secreteCategorySymbol.
  self world ifNotNil: [self world startSteppingSubmorphsOf: self].
  self adjustColorsAndBordersWithin.
 
  owner ifNotNil: [owner isStandardViewer ifTrue: [owner fitFlap].
 
  (isInteractive and: [addedMorphs isEmpty]) ifTrue:
  [searchFor ifNotEmpty:
  [self inform: ('No matches found for "' translated), searchFor, '"']]]!