'From etoys2.2 of 21 September 2007 [latest update: #1746] on 2 November 2007 at 3:01:03 pm'! "Change Set: QuickGuides5-tk Date: 2 November 2007 Author: Ted Kaehler This changeSet creates QuickGuides index at build time. Image no longer holds the index as a mime string. IndexPageMimeString is an empty string. IndexPage hangs onto the Index when it is not showing. Bert: You must have file preload-index.sexp.data.gz in QuickGuides. File index.pr should not be present, and it will be deleted by my code. Please exclude file 'preload-index.sexp.data.gz' from QuickGuides in the RPM. Once it is read into the image it is not needed."! !QuickGuideMorph methodsFor: 'initialization' stamp: 'tk 11/2/2007 14:58'! preloadIndex "At system build time, load the Guide Index from file 'preload-index.sexp.data.gz'. Save in IndexPage." | dir firstPage | dir _ (FileDirectory on: Smalltalk imagePath) directoryNamed: 'QuickGuides'. (dir fileExists: 'index.pr') ifTrue: [ self inform: 'Raw index.pr is not supposed to be in QuickGuides during a build. I will delete it now'. dir deleteFileNamed: 'index.pr']. (dir fileExists: 'preload-index.sexp.data.gz') ifFalse: [ ^ self error: 'could not find QuickGuides/preload-index.sexp.data.gz']. firstPage _ pages first. firstPage guideName: 'preload-index'. firstPage guideCategory: ''. firstPage load. "allow index.sexp.data.gz" firstPage guideName: 'index'. self class indexPage: firstPage submorphs first. "the goal, sets name" IndexPageMimeString _ ''. "remove old" self class purgeIndexProjects. ^ true ! ! !QuickGuideMorph class methodsFor: 'initialization' stamp: 'tk 11/1/2007 18:35'! initializeIndexPageFrom: mimeString | m f unzipped zipped | self error: 'not used anymore'. unzipped _ WriteStream on: ByteArray new. f _ MultiByteBinaryOrTextStream with: (Base64MimeConverter mimeDecodeToBytes: (ReadStream on: mimeString)) contents. f reset. f binary. zipped _ GZipReadStream on: f. unzipped nextPutAll: zipped contents. m _ BookMorph bookFromPagesInSISSFormat: (DataStream on: (ReadStream on: (unzipped contents))) next. IndexPage _ m. IndexPage setNamePropertyTo: 'index'. ! ! !QuickGuideMorph class methodsFor: 'initialization' stamp: 'tk 11/1/2007 18:56'! purgeIndexProjects "remove all projects that came from loading the index guide." | px nn | [px _ Project allProjects detect: [:pp | pp name beginsWith: 'index'] ifNone: [nil]. px ifNotNil: [ nn _ Project allProjects indexOf: px. Project allProjects removeAt: nn]. px == nil] whileFalse. Smalltalk garbageCollect. ! ! !ReleaseBuilderSqueakland methodsFor: 'olpc' stamp: 'tk 11/1/2007 19:03'! buildInitialScreenForOLPC "ReleaseBuilderSqueakland new buildInitialScreenForOLPC" "pre-load QuickGuideMorph class var IndexPage" QuickGuideMorph new preloadIndex. World submorphsDo: [:m | m delete]. Flaps disableGlobalFlaps: false. Flaps enableEToyFlaps. ProjectLoading loadFromImagePath: 'Tutorials'. ProjectLoading loadFromImagePath: 'Gallery'. ProjectLoading loadFromImagePath: 'Launcher'. (World submorphs select: [:e | e isMemberOf: ProjectViewMorph]) do: [:e | e delete]. Project current setThumbnail: ((Project named: 'Launcher') ifNotNil: [(Project named: 'Launcher') thumbnail] ifNil: [nil]).! !