'From Squeak3.7alpha of 11 September 2003 [latest update: #5764] on 7 March 2004 at 4:20:31 pm'! "Change Set: q19-miscPrjFixes Date: 7 March 2004 Author: Michael Rueger Port of some project related fixes from the squeakland update stream."! !FileList2 methodsFor: 'as yet unclassified' stamp: 'mir 2/6/2004 17:25'! limitedSuperSwikiDirectoryList | dir nameToShow dirList localDirName localDir | dirList _ OrderedCollection new. ServerDirectory serverNames do: [ :n | dir _ ServerDirectory serverNamed: n. dir isProjectSwiki ifTrue: [ nameToShow _ n. dirList add: ((dir directoryWrapperClass with: dir name: nameToShow model: self) balloonText: dir realUrl) ]. ]. ServerDirectory localProjectDirectories do: [ :each | dirList add: (FileDirectoryWrapper with: each name: each localName model: self) ]. "Make sure the following are always shown, but not twice" localDirName := SecurityManager default untrustedUserDirectory. localDir := FileDirectory on: localDirName. ((ServerDirectory localProjectDirectories collect: [:each | each pathName]) includes: localDirName) ifFalse: [dirList add: (FileDirectoryWrapper with: localDir name: localDir localName model: self)]. FileDirectory default pathName = localDirName ifFalse: [dirList add: (FileDirectoryWrapper with: FileDirectory default name: FileDirectory default localName model: self)]. (dirList anySatisfy: [:each | each withoutListWrapper acceptsUploads]) ifFalse: [dirList add: (FileDirectoryWrapper with: FileDirectory default name: FileDirectory default localName model: self)]. ^dirList! ! !FileList2 methodsFor: 'as yet unclassified' stamp: 'mir 2/6/2004 17:25'! limitedSuperSwikiPublishDirectoryList | dirList localDirName localDir | dirList _ self publishingServers. ServerDirectory localProjectDirectories do: [ :each | dirList add: (FileDirectoryWrapper with: each name: each localName model: self)]. "Make sure the following are always shown, but not twice" localDirName := SecurityManager default untrustedUserDirectory. localDir := FileDirectory on: localDirName. ((ServerDirectory localProjectDirectories collect: [:each | each pathName]) includes: localDirName) ifFalse: [dirList add: (FileDirectoryWrapper with: localDir name: localDir localName model: self)]. FileDirectory default pathName = localDirName ifFalse: [dirList add: (FileDirectoryWrapper with: FileDirectory default name: FileDirectory default localName model: self)]. ^dirList! ! !Project class methodsFor: 'squeaklet on server' stamp: 'mir 2/6/2004 17:04'! fromUrl: urlString "Load the project, and make a thumbnail to it in the current project. Replace the old one if necessary. Project fromUrl: 'http://www.squeak.org/Squeak2.0/2.7segments/Squeak_Easy.pr.gz'. " | pair projName proj triple serverDir projectFilename serverUrl absoluteUrl | Project canWeLoadAProjectNow ifFalse: [^ self]. "serverFile _ HTTPLoader default contentStreamFor: urlString." absoluteUrl := (Url schemeNameForString: urlString) ifNil: [urlString asUrlRelativeTo: FileDirectory default url asUrl] ifNotNil: [Url absoluteFromText: urlString]. projectFilename _ absoluteUrl path last. triple _ Project parseProjectFileName: projectFilename unescapePercents. projName _ triple first. (proj _ Project named: projName) ifNotNil: ["it appeared" ^ ProjectEntryNotification signal: proj]. serverUrl _ (absoluteUrl copy path: (absoluteUrl path copyWithout: absoluteUrl path last)) toText. serverDir _ ServerDirectory serverForURL: serverUrl. serverDir ifNil: ["we just have a url, no dedicated project server" ProjectLoading installRemoteNamed: projectFilename from: absoluteUrl toText unescapePercents named: projName in: CurrentProject.]. pair _ self mostRecent: projectFilename onServer: serverDir. "Pair first is name exactly as it is on the server" pair first ifNil: [^self openBlankProjectNamed: projName]. ProjectLoading installRemoteNamed: pair first from: serverDir named: projName in: CurrentProject.! ! !ProjectLoading class methodsFor: 'as yet unclassified' stamp: 'mir 2/6/2004 14:56'! bestAccessToFileName: aFileName andDirectory: aDirectoryOrURL | localDir schema dir | ((localDir _ Project squeakletDirectory) fileExists: aFileName) ifTrue: [^{localDir readOnlyFileNamed: aFileName. localDir}]. (aDirectoryOrURL isKindOf: String) ifTrue: [ schema := Url schemeNameForString: aDirectoryOrURL. (schema isNil or: [schema = 'file']) ifTrue: [ dir := schema ifNil: [FileDirectory forFileName: (FileDirectory default fullNameFor: aDirectoryOrURL)] ifNotNil: [FileDirectory on: ((FileUrl absoluteFromText: aDirectoryOrURL) pathForDirectory)]] ifFalse: [^{(Project serverFileFromURL: aDirectoryOrURL) asStream. nil}]] ifFalse: [dir := aDirectoryOrURL]. ^{dir readOnlyFileNamed: aFileName. dir} ! ! "Postscript: " Preferences disable: #enableLocalSave. !