[etoys-dev] Etoys: Morphic-bf.46.mcz
commits at source.squeak.org
commits at source.squeak.org
Sat Sep 11 13:16:41 EDT 2010
Bert Freudenberg uploaded a new version of Morphic to project Etoys:
http://source.squeak.org/etoys/Morphic-bf.46.mcz
==================== Summary ====================
Name: Morphic-bf.46
Author: bf
Time: 11 September 2010, 7:15:32 pm
UUID: 68c3b0cc-3aa5-4f9d-b145-a96f23e98b62
Ancestors: Morphic-bf.45
Move QuickGuideMorph>>preloadIndex to class side, fix it, remove unused methods
=============== Diff against Morphic-bf.45 ===============
Item was changed:
----- Method: QuickGuideMorph classSide>>indexPage: (in category 'initialization') -----
indexPage: anObject
+ IndexPage := anObject.
+ IndexPage ifNotNil: [
+ IndexPage setNamePropertyTo: 'index'].
- IndexPage _ anObject.
- IndexPage setNamePropertyTo: 'index'.
!
Item was removed:
- ----- Method: QuickGuideMorph classSide>>initializeIndexPageFrom: (in category 'initialization') -----
- 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'.
-
- !
Item was added:
+ ----- Method: QuickGuideMorph classSide>>preloadIndexPage (in category 'initialization') -----
+ preloadIndexPage
+ self new checkForIndexOnDisk
+ ifFalse: [self error: 'index page not found'].
+ !
Item was changed:
----- Method: QuickGuideMorph>>checkForIndexOnDisk (in category 'transition') -----
checkForIndexOnDisk
+ "For localization. Look on disk every time for a new Index. Overwrite IndexPage if found."
- "For debugging only, Look on disk every time for a new Index as a .pr file. Must be named index.pr. Overwrite IndexPage if found."
+ | dir holder |
- | dir firstPage |
dir _ FileDirectory on: QuickGuideMorph guidePath.
(dir fileExists: 'index.pr') ifFalse: [
(dir fileExists: 'index.sexp.data.gz') ifFalse: [^ false]].
+ holder _ pages first.
+ holder guideName: 'index'.
+ holder guideCategory: ''.
+ holder load. "allow index.sexp.data.gz"
+ IndexPage _ holder submorphs first.
- firstPage _ pages first.
- firstPage guideName: 'index'.
- firstPage guideCategory: ''.
- firstPage load. "allow index.sexp.data.gz"
- IndexPage _ firstPage submorphs first.
^ true
" IndexPage _ QuickGuideHolderMorph new loadPR: 'index.pr' dir: dir. "
!
Item was changed:
----- Method: QuickGuideMorph>>initializeIndexPage (in category 'initialization') -----
initializeIndexPage
| indexPage firstPage |
"debugging only -- look on disk"
self checkForIndexOnDisk ifTrue: [
self goToPage: 1.
^ self]. "Done. sets IndexPage every time if found"
- IndexPage ifNil: [
- self class initializeIndexPageFrom: IndexPageMimeString.
- ].
IndexPage ifNotNil: [
indexPage _ IndexPage veryDeepCopy.
firstPage _ pages first.
indexPage position: firstPage position.
indexPage beSticky.
firstPage extent: indexPage extent.
firstPage submorphs size > 0 ifTrue: [firstPage submorphs last delete].
firstPage submorphs size > 0 ifTrue: [firstPage submorphs last delete].
firstPage addMorph: indexPage.
self goToPage: 1.
].
!
Item was removed:
- ----- Method: QuickGuideMorph>>preloadIndex (in category 'initialization') -----
- preloadIndex
- "At system build time, load the Guide Index from file 'preload-index.sexp.data.gz'. Save in IndexPage."
-
- | dir firstPage |
- dir _ FileDirectory on: QuickGuideMorph guidePath.
- (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
- !
Item was removed:
- ----- Method: QuickGuideMorph>>setInitializePage (in category 'initialization') -----
- setInitializePage
-
- | indexPage firstPage |
- IndexPage ifNotNil: [
- indexPage _ IndexPage veryDeepCopy.
- firstPage _ pages first.
- indexPage position: firstPage position.
- indexPage beSticky.
- self goToPage: 1.
- currentPage extent: indexPage extent.
- ].
- !
More information about the etoys-dev
mailing list