[squeak-dev] The Trunk: Morphic-cmm.533.mcz
commits at source.squeak.org
commits at source.squeak.org
Wed May 4 19:03:58 UTC 2011
Chris Muller uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-cmm.533.mcz
==================== Summary ====================
Name: Morphic-cmm.533
Author: cmm
Time: 4 May 2011, 2:01:31.796 pm
UUID: 667a2c0c-c3dd-4cae-ad8b-095965f9775b
Ancestors: Morphic-cmm.532
Factor out domain work from UI work; so that applications may save a morph on file.
=============== Diff against Morphic-cmm.532 ===============
Item was changed:
----- Method: Morph>>saveOnFile (in category 'fileIn/out') -----
saveOnFile
"Ask the user for a filename and save myself on a SmartReferenceStream file. Writes out the version and class structure. The file is fileIn-able. UniClasses will be filed out."
+ | aFileName ok |
-
- | aFileName fileStream ok |
aFileName := ('my {1}' translated format: {self class name}) asFileName. "do better?"
aFileName := UIManager default request: 'File name? (".morph" will be added to end)' translated
initialAnswer: aFileName.
aFileName isEmpty ifTrue: [^ Beeper beep].
self allMorphsDo: [:m | m prepareToBeSaved].
ok := aFileName endsWith: '.morph'. "don't double them"
ok := ok | (aFileName endsWith: '.sp').
ok ifFalse: [aFileName := aFileName,'.morph'].
+ self saveOnFileNamed: aFileName!
- fileStream := FileStream newFileNamed: aFileName asFileName.
- fileStream fileOutClass: nil andObject: self. "Puts UniClass definitions out anyway"!
More information about the Squeak-dev
mailing list
|