'From Squeak2.8alpha of 22 February 2000 [latest update: #1852] on 29 February 2000 at 10:32:23 am'! "Change Set: CleanSaveWarning Date: 28 February 2000 Author: Doug Way Adds a warning when someone attempts to save over a 'clean' image. (In other words an image whose name is the same as the current Squeak version.) Overwriting the clean image is usually discouraged, so this warning can be helpful, especially for beginners. Modified by Jesse Welton on 29 February 2000 to present an option to set a preference that will suppress the warning on future saves."! !SystemDictionary methodsFor: 'snapshot and quit' stamp: 'JW 2/29/2000 10:15'! snapshot: save andQuit: quit "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 | save ifTrue: [((FileDirectory localNameFor: self imageName) = (EToySystem version, '.image') and: [(EToySystem version includesSubString: 'alpha') not and: [Preferences suppressCleanSaveWarning not]]) ifTrue: [(self confirm: 'You are about to save over a clean ', EToySystem version, ' image. Normally it is recommended to use ''save as...'' first instead to save your working image, so that a copy of the original (clean) image is preserved. Do you still want to proceed with saving?' ) ifFalse: [^self]. (self confirm: 'Would you like this warning to be suppressed for future saves? Selecting ''yes'' will set a preference to suppress the clean save warning.' ) ifTrue: [Preferences enable: #suppressCleanSaveWarning]]]. save & (SourceFiles at: 2) notNil ifTrue: [msg _ (quit ifTrue: ['----QUIT----'] ifFalse: ['----SNAPSHOT----']) , Date dateAndTimeNow printString. 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 _ self snapshotPrimitive. "<-- PC frozen here on image file" resuming ifFalse: ["Time to reclaim segment files is immediately after a save" Smalltalk at: #ImageSegment ifPresent: [:theClass | theClass reclaimObsoleteSegmentFiles]]] ifFalse: [resuming _ false]. quit & resuming not ifTrue: [self quitPrimitive]. Cursor normal show. self setGCParameters. resuming ifTrue: [self clearExternalObjects]. self processStartUpList: resuming. resuming ifTrue: [self readDocumentFile]. Smalltalk isMorphic ifTrue: [SystemWindow wakeUpTopWindowUponStartup]. ^ resuming! !