'From Squeakland 3.1.4295 of 24 August 2001 [latest update: #77] on 19 November 2001 at 6:36:49 pm'! "Change Set: miscFixes Date: 19 November 2001 Author: Michael Rueger This change set contains the following fixes: - ExternalSettings now no longer forces the creation of a preference directory unless you use assuredPreferenceDirectory - the project saving dialog now offers at least the default directory as a choice to save projects if no other places are configured - the search super swiki menu now searches all configured super swikis instead of only the testOnlySuperSwiki (aka Bob's super swiki) - fixes a problem with imported images as resources - fixes the problem of multiple flaps created on startup "! !EToyProjectQueryMorph class methodsFor: 'as yet unclassified' stamp: 'mir 11/14/2001 16:29'! onServer: aProjectServer "EToyProjectQueryMorph onServer: SuperSwikiServer testOnlySuperSwiki" | criteria clean | (self basicNew) project: nil actionBlock: [ :x | criteria _ OrderedCollection new. x keysAndValuesDo: [ :k :v | (clean _ v withBlanksTrimmed) isEmpty ifFalse: [criteria add: k,': *',clean,'*']]. aProjectServer queryProjectsAndShow: criteria]; initialize; openCenteredInWorld! ! !ExternalSettings class methodsFor: 'accessing' stamp: 'mir 11/16/2001 13:33'! assuredPreferenceDirectory | prefDir | prefDir _ self preferenceDirectory. prefDir ifNil: [ prefDir _ FileDirectory default directoryNamed: self preferenceDirectoryName. prefDir assureExistance]. ^prefDir! ! !ExternalSettings class methodsFor: 'accessing' stamp: 'mir 11/16/2001 13:34'! preferenceDirectory | prefDirName | prefDirName _ self preferenceDirectoryName. ^(FileDirectory default directoryExists: prefDirName) ifTrue: [FileDirectory default directoryNamed: prefDirName] ifFalse: [ ((FileDirectory on: Smalltalk vmPath) directoryExists: prefDirName) ifTrue: [(FileDirectory on: Smalltalk vmPath) directoryNamed: prefDirName] ifFalse: [nil]] ! ! !ExternalSettings class methodsFor: 'accessing' stamp: 'mir 11/16/2001 13:33'! preferenceDirectoryName ^'prefs'! ! !ExternalSettings class methodsFor: 'class initialization' stamp: 'mir 11/16/2001 13:29'! startUp "Look for external defs and load them." "ExternalSettings startUp" | prefDir | prefDir _ self preferenceDirectory. prefDir ifNil: [^self]. self registeredClients do: [:client | client fetchExternalSettingsIn: prefDir]! ! !FileList2 methodsFor: 'as yet unclassified' stamp: 'mir 11/15/2001 18:20'! limitedSuperSwikiDirectoryList | dir nameToShow dirList | 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) ]. (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 11/15/2001 18:17'! limitedSuperSwikiPublishDirectoryList | dirList | dirList _ self publishingServers. ServerDirectory localProjectDirectories do: [ :each | dirList add: (FileDirectoryWrapper with: each name: each localName model: self)]. dirList isEmpty ifTrue: [dirList add: (FileDirectoryWrapper with: FileDirectory default name: FileDirectory default localName model: self)]. ^dirList! ! !FileList2 methodsFor: 'as yet unclassified' stamp: 'mir 11/15/2001 18:16'! publishingServers | dir nameToShow dirList | dirList _ OrderedCollection new. ServerDirectory serverNames do: [ :n | dir _ ServerDirectory serverNamed: n. (dir isProjectSwiki and: [dir acceptsUploads]) ifTrue: [ nameToShow _ n. dirList add: ((dir directoryWrapperClass with: dir name: nameToShow model: self) balloonText: dir realUrl)]]. ^dirList! ! !Flaps class methodsFor: 'predefined flaps' stamp: 'mir 11/14/2001 15:43'! addAndEnableEToyFlaps "Initialize the standard default out-of-box set of global flaps. This method creates them and places them in my class variable #SharedFlapTabs, but does not itself get them displayed." SharedFlapTabs ifNotNil: [^self]. SharedFlapTabs _ OrderedCollection new. SharedFlapTabs add: self newSuppliesFlap. SharedFlapTabs add: self newWidgetsFlap. self enableGlobalFlapWithID: 'Supplies'. self enableGlobalFlapWithID: 'Widgets'. SharedFlapTabs do: [:aFlapTab | aFlapTab setToPopOutOnMouseOver: false]. "The above amends some historic behavior imparted by the initializers of the individual flaps" SharedFlapsAllowed _ true. Project current flapsSuppressed: false. ^ SharedFlapTabs "Flaps addAndEnableEToyFlaps"! ! !Form class methodsFor: 'instance creation' stamp: 'mir 11/19/2001 14:13'! fromFileNamed: fileName "Read a Form or ColorForm from the given file." | file form | file _ (FileStream readOnlyFileNamed: fileName) binary. form _ self fromBinaryStream: file. Smalltalk isMorphic ifTrue:[ Project current resourceManager addResource: form url: (FileDirectory urlForFileNamed: file name) asString]. file close. ^ form ! ! !ProjectNavigationMorph methodsFor: 'the buttons' stamp: 'mir 11/14/2001 17:10'! findSomethingOnSuperSwiki | projectServers server index | projectServers _ ServerDirectory projectServers. projectServers isEmpty ifTrue: [^self]. projectServers size = 1 ifTrue: [server _ projectServers first] ifFalse: [index _ (PopUpMenu labelArray: (projectServers collect: [:each | each name]) lines: #()) startUpWithCaption: 'Choose a super swiki:'. index > 0 ifTrue: [server _ projectServers at: index] ifFalse: [^self]]. EToyProjectQueryMorph onServer: server! ! !ServerDirectory methodsFor: 'testing' stamp: 'mir 11/14/2001 16:25'! isSearchable ^false! ! !ServerDirectory class methodsFor: 'available servers' stamp: 'mir 11/14/2001 16:26'! projectServers "ServerDirectory projectServers" | projectServers projectServer | projectServers _ OrderedCollection new. self serverNames do: [ :n | projectServer _ ServerDirectory serverNamed: n. (projectServer isProjectSwiki and: [projectServer isSearchable]) ifTrue: [projectServers add: projectServer]]. ^projectServers! ! !ServerDirectory class methodsFor: 'server prefs' stamp: 'mir 11/16/2001 13:30'! transferServerDefinitionsToExternal "ServerDirectory transferServerDefinitionsToExternal" | serverDir | serverDir _ ExternalSettings assuredPreferenceDirectory directoryNamed: self serverConfDirectoryName. serverDir assureExistance. ServerDirectory storeCurrentServersIn: serverDir! ! !SuperSwikiServer methodsFor: 'testing' stamp: 'mir 11/14/2001 16:25'! isSearchable ^true! !