[squeak-dev] The Trunk: Tools-cmm.246.mcz
commits at source.squeak.org
commits at source.squeak.org
Sun Jun 20 21:54:09 UTC 2010
Chris Muller uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-cmm.246.mcz
==================== Summary ====================
Name: Tools-cmm.246
Author: cmm
Time: 20 June 2010, 4:53:08.374 pm
UUID: 99d3ac43-0c24-4f3f-b4e4-a4524edc02a7
Ancestors: Tools-cmm.245
Update the window title of a FileList when a new file or directory is selected. Restored the directory-contents as text display when no file is selected.
=============== Diff against Tools-cmm.245 ===============
Item was changed:
----- Method: FileList>>setFileStream: (in category 'initialization') -----
setFileStream: aStream
"Used to initialize a spawned file editor. Sets directory too."
-
self directory: aStream directory.
fileName := aStream localName.
pattern := '*'.
listIndex := 1. "pretend a file is selected"
aStream close.
brevityState := #needToGetBrief.
+ self
+ changed: #contents ;
+ changed: #labelString!
- self changed: #contents.
- !
Item was changed:
----- Method: FileList>>defaultContents (in category 'private') -----
defaultContents
contents := list == nil
ifTrue: [String new]
ifFalse: [String streamContents:
+ [:s | s nextPutAll: 'NO FILE SELECTED' translated; cr.
+ s nextPutAll: ' -- Folder Summary --' translated; cr.
+ list do: [:item | s nextPutAll: item; cr]]].
- [:s | s nextPutAll: 'NO FILE SELECTED' translated; cr]].
brevityState := #FileList.
^ contents!
Item was changed:
----- Method: FileList>>resort: (in category 'private') -----
+ resort: newMode
- resort: newMode
"Re-sort the list of files."
-
| name |
+ listIndex > 0 ifTrue: [ name := self fileNameFromFormattedItem: (list at: listIndex) ].
- listIndex > 0
- ifTrue: [name := self fileNameFromFormattedItem: (list at: listIndex)].
sortMode := newMode.
self pattern: pattern.
+ name ifNotNil:
+ [ fileName := name.
+ listIndex := list findFirst:
+ [ : item | (self fileNameFromFormattedItem: item) = name ].
+ self
+ changed: #fileListIndex ;
+ changed: #labelString ].
+ listIndex = 0 ifTrue: [ self changed: #contents ].
+ self updateButtonRow!
- name ifNotNil: [
- fileName := name.
- listIndex := list findFirst: [:item | (self fileNameFromFormattedItem: item) = name. ].
- self changed: #fileListIndex].
- listIndex = 0 ifTrue: [self changed: #contents].
- self updateButtonRow
- !
Item was changed:
----- Method: FileList>>fileListIndex: (in category 'file list') -----
fileListIndex: anInteger
"Select the file name having the given index, and display its contents."
| item name |
self okToChange ifFalse: [^ self].
listIndex := anInteger.
listIndex = 0
ifTrue: [fileName := nil]
ifFalse:
[item := self fileNameFromFormattedItem: (list at: anInteger).
(item endsWith: self folderString)
ifTrue:
["remove [...] folder string and open the folder"
name := item copyFrom: 1 to: item size - self folderString size.
listIndex := 0.
brevityState := #FileList.
self addPath: name.
name first = $^
ifTrue: [self directory: (ServerDirectory serverNamed: name allButFirst)]
ifFalse: [volListIndex = 1 ifTrue: [name := name, directory slash].
self directory: (directory directoryNamed: name)]]
ifFalse: [fileName := item]]. "open the file selected"
brevityState := self isGraphicsFileSelected
ifTrue: [#needToGetGraphic]
ifFalse: [#needToGetBrief]..
+ self
+ changed: #fileListIndex ;
+ changed: #contents ;
+ changed: #labelString.
- self changed: #fileListIndex.
- self changed: #contents.
self updateButtonRow!
Item was changed:
----- Method: FileList2 class>>modalFolderSelector: (in category 'modal dialogs') -----
modalFolderSelector: aDir
| window fileModel |
+ window := self morphicViewFolderSelector: aDir.
+ fileModel := window model.
- window _ self morphicViewFolderSelector: aDir.
- fileModel _ window model.
window openInWorld: self currentWorld extent: 300 at 400.
self modalLoopOn: window.
^fileModel getSelectedDirectory withoutListWrapper!
Item was changed:
----- Method: FileList>>labelString (in category 'initialization') -----
labelString
+ ^ directory
+ ifNil: [ 'File List' ]
+ ifNotNil:
+ [ fileName
+ ifNil: [ directory fullName ]
+ ifNotNil: [ directory fullNameFor: fileName ] ]!
- ^fileName ifNil:['File List'] ifNotNil:[directory fullNameFor: fileName].!
More information about the Squeak-dev
mailing list
|