'From Squeak3.3alpha of 12 January 2002 [latest update: #4784] on 4 March 2002 at 1:50 am'! "Change Set: logSaveAs-sw Date: 4 March 2002 Author: Scott Wallace Fixes a couple of long-standing problems with the save-as mechanism: ¥ If, after a save-as, you quit-without-saving, the resulting image would log a new and spurious 'save-as' every time you subsequently started it up. This is fixed. ¥ Snapshots resulting from save-as gestures did not appear in the list of checkpoints in the recently-logged-changes menu. Now every snapshot gets logged along with the image name -- this covers both the save and the save-as cases in a uniform way."! !SystemDictionary methodsFor: 'snapshot and quit' stamp: 'sw 2/27/2002 18:26'! saveAs "Put up the 'saveAs' prompt, obtain a name, and save the image under that new name." | newName | newName _ self getFileNameFromUser. newName isNil ifTrue: [^ self]. (SourceFiles at: 2) ifNotNil: [self saveChangesInFileNamed: (self fullNameForChangesNamed: newName)]. self saveImageInFileNamed: (self fullNameForImageNamed: newName)! ! !SystemDictionary methodsFor: 'snapshot and quit' stamp: 'sw 2/27/2002 18:30'! snapshot: save andQuit: quit embedded: embeddedFlag "Mark the changes file and close all files. If save is true, save the current state of this Smalltalk in the image file. If quit is true, then exit to the outer shell. The latter part of this method runs when resuming a previously saved image. The resume logic checks for a document file to process when starting up." | resuming msg sourceLink | Object flushDependents. Object flushEvents. save & (SourceFiles at: 2) notNil ifTrue: [msg _ (quit ifTrue: ['----QUIT----'] ifFalse: ['----SNAPSHOT----']) , Date dateAndTimeNow printString, ' ', (FileDirectory default localNameFor: self imageName). sourceLink _ ' priorSource: ' , LastQuitLogPosition printString. self assureStartupStampLogged. LastQuitLogPosition _ (SourceFiles at: 2) setToEnd; position. self logChange: msg , sourceLink. Transcript cr; show: msg]. self processShutDownList: quit. Cursor write show. save ifTrue: [resuming _ embeddedFlag ifTrue: [self snapshotEmbeddedPrimitive] ifFalse: [self snapshotPrimitive]. "<-- PC frozen here on image file" resuming == false "guard against failure" ifTrue: ["Time to reclaim segment files is immediately after a save" Smalltalk at: #ImageSegment ifPresent: [:theClass | theClass reclaimObsoleteSegmentFiles]]] ifFalse: [resuming _ false]. quit & (resuming == false) ifTrue: [self quitPrimitive]. Cursor normal show. self setGCParameters. resuming == true ifTrue: [self clearExternalObjects]. self processStartUpList: resuming == true. resuming == true ifTrue:[ self setPlatformPreferences. self readDocumentFile]. Smalltalk isMorphic ifTrue: [SystemWindow wakeUpTopWindowUponStartup]. "Now it's time to raise an error" resuming == nil ifTrue: [self error:'Failed to write image file (disk full?)']. ^ resuming! !