'From etoys4.0 of 9 October 2008 [latest update: #2280] on 9 September 2009 at 2:27:07 pm'! "Change Set: SaveLoadAutoSelect-yo Date: 9 September 2009 Author: Yoshiki Ohshima Automatically selects the local document dir by default."! !FileList2 class methodsFor: 'blue ui' stamp: 'yo 9/9/2009 14:18'! buildPane: aWorld fileList: aFileList window: window dirFilterType: aSymbol | treeExtent filesExtent treePane fileListPane pane2a pane2b aRow | aWorld width < 800 ifTrue: [treeExtent := 150 @ 300. filesExtent := 350 @ 300] ifFalse: [treeExtent := 250 @ 300. filesExtent := 350 @ 300]. (treePane := aFileList morphicDirectoryTreePaneFiltered: aSymbol) extent: treeExtent; retractable: false; borderWidth: 0. fileListPane := aFileList morphicFileListPane extent: filesExtent; retractable: false; borderWidth: 0. aRow := window addARow: {(window inAColumn: {(pane2a := window inARow: {window inAColumn: {treePane}}) useRoundedCornersInEtoys; layoutInset: 3}) layoutInset: 3. (window inAColumn: {(pane2b := window inARow: {window inAColumn: {fileListPane}}) useRoundedCornersInEtoys; layoutInset: 3}) layoutInset: 3}. aRow color: ScriptingSystem paneColor. window fullBounds. {pane2a. pane2b} do: [:each | each borderWidth: 1. each borderColor: ScriptingSystem borderColor]. ^ treePane.! ! !FileList2 class methodsFor: 'blue ui' stamp: 'yo 9/9/2009 14:18'! morphicViewProjectLoader2InWorld: aWorld title: title reallyLoad: aBoolean dirFilterType: aSymbol isGeneral: isGeneral "Put up a blue file-list for loading etoy projects." " FileList2 morphicViewProjectLoader2InWorld: self currentWorld reallyLoad: true dirFilterType: #limitedSuperSwikiDirectoryList " | window aFileList actionRow treePane item | aFileList _ self buildFileListDirFilterType: aSymbol. window := self buildMorphicWindow: aFileList title: title. actionRow _ self buildLoadButtons: window fileList: aFileList reallyLoad: aBoolean. isGeneral ifTrue: [self buildFileTypeButtons: window actionRow: actionRow fileList: aFileList]. treePane := self buildPane: aWorld fileList: aFileList window: window dirFilterType: aSymbol. window addMorphBack: actionRow. window fullBounds. window position: aWorld topLeft + (aWorld extent - window extent // 2). window beSticky. aFileList sortByName. "This crazy stuff I really cannot figure out how to get the directory selected by default other than this." (item := treePane scroller submorphs detect: [:e | e complexContents withoutListWrapper pathName = SecurityManager default untrustedUserDirectory] ifNone: [nil]) notNil ifTrue: [ WorldState addDeferredUIMessage: [aFileList setSelectedDirectoryTo: item complexContents]]. aFileList postOpen. ^ window! ! !FileList2 class methodsFor: 'blue ui' stamp: 'yo 9/9/2009 14:15'! morphicViewProjectSaverFor: aProject " (FileList2 morphicViewProjectSaverFor: Project current) openInWorld " | window aFileList treePane pane2 option treeExtent row item | aFileList _ self new directory: ServerDirectory projectDefaultDirectory. aFileList dirSelectionBlock: self hideSqueakletDirectoryBlock. window := self buildMorphicWindow: aFileList title: 'Publish This Project' translated. window setProperty: #morphicLayerNumber toValue: 11. option _ aProject world valueOfProperty: #SuperSwikiPublishOptions ifAbsent: [#initialDirectoryListForProjects]. aProject world removeProperty: #SuperSwikiPublishOptions. World height < 500 ifTrue: [ treeExtent _ 350@150. ] ifFalse: [ treeExtent _ 350@300. ]. (treePane _ aFileList morphicDirectoryTreePaneFiltered: option) extent: treeExtent; retractable: false; borderWidth: 0. treePane color: Color transparent. row := window addARow: { window inAColumn: {(ProjectViewMorph on: aProject) lock}. ( window inAColumn: { (pane2 _ window inARow: {window inAColumn: {treePane}}) useRoundedCornersInEtoys; layoutInset: 3 } ) layoutInset: 3 }. row color: ScriptingSystem paneColor. pane2 borderColor: ScriptingSystem borderColor. pane2 borderWidth: 1. window addMorphBack: (self buildSaveButtons: window fileList: aFileList). window fullBounds. window beSticky. "This crazy stuff I really cannot figure out how to get the directory selected by default other than this." (item := treePane scroller submorphs detect: [:e | e complexContents withoutListWrapper pathName = SecurityManager default untrustedUserDirectory] ifNone: [nil]) notNil ifTrue: [ WorldState addDeferredUIMessage: [aFileList setSelectedDirectoryTo: item complexContents]]. aFileList postOpen. ^ window ! ! "Postscript: Leave the line above, and replace the rest of this comment by a useful one. Executable statements should follow this comment, and should be separated by periods, with no exclamation points (!!). Be sure to put any further comments in double-quotes, like this one." !