Alexander Lazarević uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-laza.203.mcz==================== Summary ====================
Name: Tools-laza.203
Author: laza
Time: 8 March 2010, 12:04:53.301 pm
UUID: 02f8d9ec-57da-497c-9d95-aa0e16f04c69
Ancestors: Tools-laza.202
adapt FileList2/FileChooser to the last change
=============== Diff against Tools-laza.202 ===============
Item was changed:
----- Method: FileList2>>listForPatterns: (in category 'volume list and pattern') -----
listForPatterns: anArray
"Make the list be those file names which match the patterns."
| sizePad newList |
directory ifNil: [^#()].
(fileSelectionBlock isKindOf: MessageSend) ifTrue: [
fileSelectionBlock arguments: {directory entries}.
newList := fileSelectionBlock value.
fileSelectionBlock arguments: #().
] ifFalse: [
newList := Set new.
anArray do: [ :pat |
newList addAll: (directory entries select: [:entry | fileSelectionBlock value: entry value: pat]) ].
].
newList := newList asSortedCollection: self sortBlock.
sizePad := (newList inject: 0 into: [:mx :entry | mx max: entry fileSize])
+ asStringWithCommas size.
- asStringWithCommas size - 1.
newList := newList collect: [ :e | self fileNameFormattedFrom: e sizePad: sizePad ].
^ newList asArray!
Item was changed:
----- Method: FileChooser>>fileNameFormattedFrom:sizePad: (in category 'updating') -----
fileNameFormattedFrom: entry sizePad: sizePad
- "entry is a 5-element array of the form:
- (name creationTime modificationTime dirFlag fileSize)"
-
"If the short file list flag is false, we send this on to the superclass."
| nameStr |
showShortFileNames
ifFalse: [^super fileNameFormattedFrom: entry sizePad: sizePad].
"Otherwise, just show the name of the file in the file list."
+ nameStr := (entry isDirectory)
+ ifTrue: [entry name, self folderString]
+ ifFalse: [entry name].
- nameStr := (entry at: 4)
- ifTrue: [entry first , self folderString]
- ifFalse: [entry first].
^nameStr!