tim Rowledge uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-tpr.993.mcz==================== Summary ====================
Name: System-tpr.993
Author: tpr
Time: 28 December 2017, 12:14:53.711212 pm
UUID: b0b7616c-47d9-4b95-a35e-ab2d79268f5f
Ancestors: System-eem.992
Connect the image saving process to the new FileSaverDialog.
Likewise for FilePackage fileout.
=============== Diff against System-eem.992 ===============
Item was changed:
----- Method: FilePackage>>fileOut (in category 'fileIn/fileOut') -----
fileOut
+ "Ask the user for a file path where I should save my contents; if the file already exists ask for a replacement name"
+ | fileName |
+ fileName := UIManager default saveFilenameRequest: 'Enter the file name' initialAnswer: self fullPackageName.
+ fileName ifNil:[^self].
+ [FileStream
+ newFileNamed: fileName
+ do: [:stream |
+ sourceSystem isEmpty
+ ifFalse: [stream nextChunkPut: sourceSystem printString;
+ cr].
+ self fileOutOn: stream.
+ stream cr; cr.
+ self classes do: [:cls | cls needsInitialize
+ ifTrue: [stream cr; nextChunkPut: cls name , ' initialize']].
+ stream cr]
+ ] on: FileExistsException
+ do: [:ex | fileName := UIManager default saveFilenameRequest: 'Last entered filename already exists; try again' initialAnswer: self fullPackageName.
+ ex retry]!
- | fileName stream |
- fileName := UIManager default request: 'Enter the file name' initialAnswer:''.
- stream := FileStream newFileNamed: fileName.
- sourceSystem isEmpty ifFalse:[
- stream nextChunkPut: sourceSystem printString;cr ].
- self fileOutOn: stream.
- stream cr; cr.
- self classes do:[:cls|
- cls needsInitialize ifTrue:[
- stream cr; nextChunkPut: cls name,' initialize']].
- stream cr.
- stream close.
-
- "DeepCopier new checkVariables."
- !
Item was changed:
----- Method: SmalltalkImage>>getFileNameFromUserSuggesting: (in category 'snapshot and quit') -----
getFileNameFromUserSuggesting: aName
"Ask the user for a new image name"
| newName |
newName := UIManager default
+ saveFilenameRequest: 'Save Image as new name...' translated
- request: 'New File Name?' translated
initialAnswer: aName.
+ newName ifNil: [^nil].
- newName isEmpty ifTrue: [^nil].
((FileDirectory default fileOrDirectoryExists: (self fullNameForImageNamed: newName)) or:
[FileDirectory default fileOrDirectoryExists: (self fullNameForChangesNamed: newName)]) ifTrue: [
(self confirm: ('{1} already exists. Overwrite?' translated format: {newName})) ifFalse: [^nil]].
^newName
!