[etoys-dev] Etoys: Morphic-tk.37.mcz

commits at source.squeak.org commits at source.squeak.org
Sun Aug 15 17:49:28 EDT 2010


Bert Freudenberg uploaded a new version of Morphic to project Etoys:
http://source.squeak.org/etoys/Morphic-tk.37.mcz

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

Name: Morphic-tk.37
Author: tk
Time: 15 August 2010, 2:40:02 pm
UUID: 334889d8-ebb1-4132-b1de-1dbf3d1b5cf7
Ancestors: Morphic-bf.36

Code to read both index.txt and files on the disk was not comparing them correctly.  If two entries have the same file name but two different pretty names, they need to be only one entry.  Fixed.

=============== Diff against Morphic-bf.36 ===============

Item was changed:
  BookMorph subclass: #QuickGuideMorph
  	instanceVariableNames: 'control order'
  	classVariableNames: 'Categories HTMLJumpTo IndexPage IndexPageMimeString PagesForCategory'
  	poolDictionaries: ''
  	category: 'Morphic-Books'!
  
+ !QuickGuideMorph commentStamp: 'tk 8/15/2010 14:18' prior: 0!
- !QuickGuideMorph commentStamp: '<historical>' prior: 0!
  A BookMorph that holds QuickGuides.
  
  World
  an AlignmentMorph (the flap)
  an AlignmentMorph
  a QuickGuideMorph  (one page per guide, 54 pages.  
  		Page may be a stub if guide not in)
  a QuickGuideHolderMorph
  a BookMorph (4 pages)
  a PasteUpMorph (a page)
  
  QuickGuides are stored in Contents/Resources/QuickGuides/
  or by language in Contents/Resources/locale/<id>/QuickGuides/
+ (see guidePath)
+ 
+ Categories = OrderedCollection of {catKey. catTitle}
+ 	where catKey appears at the start of a file name 'Menu'
+ 	catTitle may be UTF-8 full name.
+ PagesForCategory dictionary of (catKey -> list).  list has elements {guideName. guideTitle}.  guideName is last part of a file name and guideTitle may be in UTF-8.!
- (see guidePath)!

Item was changed:
  ----- Method: QuickGuideMorph classSide>>loadIndexAndPeekOnDisk (in category 'initialization') -----
  loadIndexAndPeekOnDisk
  	"If index.txt is present, load it and then scan the actual folder for extra guides.  Add them to the list."
  
+ 	| indCat indPages extras list indList |
- 	| indCat indPages extras |
  	(FileStream concreteStream isAFileNamed: 
  		QuickGuideMorph guidePath, (FileDirectory slash), 'index.txt')
  			ifTrue: [self loadIndex]
  			ifFalse: [^ self buildDefaultIndex].	"no index file"
  
  	"Add in the guides on disk that are not in index.txt"
  	indCat := Categories. 	"from index.txt"
  	indPages := PagesForCategory.
  	self buildDefaultIndex.	"from the file directory"
  	Categories "from disk" do: [:categoryRec |
  		(indCat includes: categoryRec) ifFalse: [
  			indCat addLast: categoryRec]].
+ 	PagesForCategory "from disk" associationsDo: [:pair |
- 	PagesForCategory associationsDo: [:pair |
  		 (indPages includesKey: pair key) 
  			ifFalse: [indPages at: pair key put: pair value]
+ 			ifTrue: [list := pair value.
+ 				indList := indPages at: pair key.
+ 				extras := OrderedCollection new.
+ 				list do: [:diskPair |
+ 					indList detect: [:indPair | indPair first = diskPair first]
+ 						ifNone: [extras addLast: diskPair]].
+ 				indPages at: pair key put: indList, extras]].
- 			ifTrue: [extras := pair value.
- 				extras removeAllFoundIn: (indPages at: pair key).
- 				indPages at: pair key put: 
- 					(indPages at: pair key), extras]].
  	Categories := indCat.
  	PagesForCategory := indPages.!



More information about the etoys-dev mailing list