The Trunk: EToys-tpr.325.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-tpr.325.mcz

commits-2
tim Rowledge uploaded a new version of EToys to project The Trunk:
http://source.squeak.org/trunk/EToys-tpr.325.mcz

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

Name: EToys-tpr.325
Author: tpr
Time: 11 April 2018, 4:59:23.49563 pm
UUID: 2b399671-cf5e-4973-a599-caa3ecfb3c4d
Ancestors: EToys-tcj.324

Move FileList2 class projectOnlySelectionMethod: to Project class, where it at least makes a bit of sense and helps toward deprecating fileLsit2

=============== Diff against EToys-tcj.324 ===============

Item was changed:
  ----- Method: EToysLauncher>>projectFiles (in category 'utilities') -----
  projectFiles
  "Answer a collection of file entry. Only recent version is picked up."
  "self basicNew projectFiles"
  | entries |
  entries := self directories
  inject: OrderedCollection new
  into: [:collection :each |
  collection addAll: (FileDirectory on: each) entries.
  collection].
+ ^ Project latestProjectVersionsFromFileEntries:  entries!
- ^ FileList2 projectOnlySelectionMethod: entries!

Item was changed:
  ----- Method: FileList2 class>>buildFileListDirFilterType: (in category '*Etoys-Squeakland-blue ui') -----
  buildFileListDirFilterType: aSymbol
  | aFileList |
  aFileList := self new directory: FileDirectory default.
  aFileList
  fileSelectionBlock: (aSymbol == #limitedSuperSwikiDirectoryList
+ ifTrue: [MessageSend receiver: Project selector: #latestProjectVersionsFromFileEntries: ]
- ifTrue: [MessageSend receiver: self selector: #projectOnlySelectionMethod:]
  ifFalse: [self projectOnlySelectionBlock]).
  ^ aFileList!

Item was added:
+ ----- Method: Project>>latestProjectVersionsFromFileEntries: (in category '*Etoys-Squeakland-file in/out') -----
+ latestProjectVersionsFromFileEntries: incomingEntries
+
+ | versionsAccepted |
+
+ "this shows only the latest version of each project"
+ versionsAccepted := Dictionary new.
+ incomingEntries do: [ :entry | | basicInfoTuple basicVersion basicName |
+ entry isDirectory ifFalse: [
+ (#('*.pr' '*.pr.gz' '*.project') anySatisfy: [ :each | each match: entry name]) ifTrue: [
+ basicInfoTuple := Project parseProjectFileName: entry name.
+ basicName := basicInfoTuple first.
+ basicVersion := basicInfoTuple second.
+ ((versionsAccepted includesKey: basicName) and:
+ [(versionsAccepted at: basicName) first > basicVersion]) ifFalse: [
+ versionsAccepted at: basicName put: {basicVersion. entry}
+ ].
+ ]
+ ]
+ ].
+ ^versionsAccepted asArray collect: [ :each | each second]!

Item was changed:
  ----- Method: ProjectLoading class>>loadFromImagePath: (in category '*etoys') -----
  loadFromImagePath: projectName
  "Open the project in image path. This is used with projects in OLPC distribution.
  - The image's directory is used.
  - Squeaklets directory is ignored.
  - If there is a project named projectName, it is opened.
  "
  "self openFromImagePath: 'Welcome'"
  | directory aStream entries fileName |
  (Project named: projectName)
  ifNotNil: [:project | ^ project].
  directory := FileDirectory on: Smalltalk imagePath.
+ entries := Project latestProjectVersionsFromFileEntries: directory entries.
- entries := FileList2 projectOnlySelectionMethod: directory entries.
  fileName := (entries
  detect: [:each | (Project parseProjectFileName: each name) first = projectName]
  ifNone: [^ nil]) name.
  'Loading a Project...' displaySequentialProgress: [ProgressNotification signal: '0'.
  directory := FileDirectory on: Smalltalk imagePath.
  aStream := directory readOnlyFileNamed: fileName.
  ^ self
  loadName: fileName
  stream: aStream
  fromDirectory: directory
  withProjectView: nil]!

Item was changed:
  ----- Method: ReleaseBuilderSqueakland class>>prepareEnvironment (in category 'preparing') -----
  prepareEnvironment
  | directory entries projectNames |
  super prepareEnvironment.
  projectNames := #('Gallery' 'Tutorials' 'Home').
  directory := FileDirectory on: Smalltalk imagePath.
+ entries :=Project latestProjectVersionsFromFileEntries:  directory entries.
- entries := FileList2 projectOnlySelectionMethod: directory entries.
  projectNames
  do: [:projectName | (entries
  anySatisfy: [:each | (Project parseProjectFileName: each name) first = projectName])
  ifFalse: [self inform: projectName , ' is not found']].
  self installExtraPackages.
  DeferredTask := [ProjectLoading openFromImagePath: 'Home'].!