[squeak-dev] The Trunk: Tools-xw.1147.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue May 3 11:42:29 UTC 2022
Marcel Taeumel uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-xw.1147.mcz
==================== Summary ====================
Name: Tools-xw.1147
Author: xw
Time: 3 May 2022, 4:52:28.265125 pm
UUID: 2c748e92-f991-c745-96d5-c5f8b1d2ec71
Ancestors: Tools-tpr.1146
Set text converter while writing files in FileList, to be consistent with reading
=============== Diff against Tools-tpr.1146 ===============
Item was changed:
----- Method: FileList>>put: (in category 'private') -----
put: aText
"Private - put the supplied text onto the file"
| ff newName contentTypeLabel |
brevityState == #fullFile ifTrue:
[ff := directory newFileNamed: self fullName.
+ self setDefaultEncoderFor: ff.
Cursor write showWhile: [ff nextPutAll: aText asString; close].
(directory = ff directory and: [fileName = ff localName])
ifTrue: [contents := aText asString]
ifFalse: "user changed the directory and/or renamed the file"
[self clearUserEditFlag.
directory ~= ff directory ifTrue:
[self directory: ff directory.
self changed: #rootDirectoryList; changed: #selectedPath].
self updateFileList.
contents := aText asString.
newName := ff localName.
listIndex := list findFirst: [:item | (self fileNameFromFormattedItem: item) = newName].
listIndex > 0 ifTrue: [fileName := newName].
brevityState := #needToGetBrief.
self changed: #fileListIndex].
self changed: #relabel.
^ true "accepted"].
listIndex = 0 ifTrue:
[self inform: 'No fileName is selected' translated.
^ false "failed"].
contentTypeLabel := 'These contents' translated.
brevityState = #briefFile ifTrue: [contentTypeLabel := 'Abbreviated contents' translated].
brevityState = #briefHex ifTrue: [contentTypeLabel := 'Abbreviated contents' translated].
brevityState = #fullHex ifTrue: [contentTypeLabel := 'Hexadecimal contents' translated].
brevityState = #FileList ifTrue: [contentTypeLabel := 'Directory contents' translated].
self inform: ('{1} cannot
meaningfully be saved at present.' translated format: {'Abbreviated contents' translated}).
^ false "failed"
!
More information about the Squeak-dev
mailing list
|