#FEATURE by cg draft
authorClaus Gittinger <cg@exept.de>
Sat, 21 Jan 2017 00:08:18 +0100
changeset 3379 407c5d5ec14d
parent 3378 7225434f9d46
child 3380 0eb344c2fe3a
#FEATURE by cg class: ImageEditor class definition added: #clearModifiedAndRememberImageSaved #clearModifiedAndRememberImageSavedAsFile: #savedFile removed: #clearModifiedAndRememberSavedImage changed: #doSaveImageFile (send #clearModifiedAndRememberImageSaved instead of #clearModifiedAndRememberSavedImage) #doSaveImageFileAs #doSaveMethod (send #clearModifiedAndRememberImageSaved instead of #clearModifiedAndRememberSavedImage) #doSaveMethodAs (send #clearModifiedAndRememberImageSaved instead of #clearModifiedAndRememberSavedImage)
ImageEditor.st
--- a/ImageEditor.st	Fri Jan 20 23:07:21 2017 +0100
+++ b/ImageEditor.st	Sat Jan 21 00:08:18 2017 +0100
@@ -17,7 +17,7 @@
 	instanceVariableNames:'imageEditView colorMapMode editMode mouseKeyColorMode
 		selectedColorIndex postOpenAction imageSeqNr drawingColormap
 		lastShiftUsedWrap lastGrabbedScreenArea
-		allowedToChangeImageDimensionAndDepth savedImage'
+		allowedToChangeImageDimensionAndDepth savedImage savedFile'
 	classVariableNames:'LastDirectory LastSizeString MaskClipboard LastColormapMode
 		DefaultRelativeSizes LastURL'
 	poolDictionaries:''
@@ -3933,6 +3933,13 @@
     imageEditView resourceClass:aClass
 !
 
+savedFile
+    "if user did a save to file, return the filename.
+     Otherwise, this returns nil"
+
+    ^ savedFile
+!
+
 savedImage
     "if user did a save, return what was saved last.
      Otherwise, this returns nil"
@@ -4991,13 +4998,20 @@
     "Modified: / 29.7.1998 / 18:55:24 / cg"
 !
 
-clearModifiedAndRememberSavedImage
-    "called after a save-to-file/or whereever operation"
+clearModifiedAndRememberImageSaved
+    "called after a save-to-xxx operation"
     
     self clearModified.
     savedImage := self image.
 !
 
+clearModifiedAndRememberImageSavedAsFile:file
+    "called after a save-to-file operation"
+    
+    self clearModifiedAndRememberImageSaved.
+    savedFile := file.
+!
+
 pointFromString:aString
     |p s x y|
 
@@ -7529,7 +7543,7 @@
     "saves current image to current file"
 
     imageEditView save.
-    self clearModifiedAndRememberSavedImage.
+    self clearModifiedAndRememberImageSaved.
 !
 
 doSaveImageFileAs
@@ -7547,6 +7561,7 @@
     (UserPreferences current useNativeFileDialog
      and:[Screen current isWindowsPlatform]) ifTrue:[
         self withWaitCursorDo:[
+            "/ windows only
             file := Screen current
                 nativeFileDialogFor:(self window topView id)
                 save:true
@@ -7593,7 +7608,7 @@
         imageEditView saveImageFileAs:file.
         LastDirectory := file asFilename directoryName.
         self updateLabelsAndHistory.
-        self clearModifiedAndRememberSavedImage.
+        self clearModifiedAndRememberImageSavedAsFile:file.
     ]
 
     "Modified: / 14-12-2010 / 13:51:47 / cg"
@@ -7610,7 +7625,7 @@
 
     imageEditView saveMethod ifTrue:[
         self updateLabelsAndHistory.
-        self clearModifiedAndRememberSavedImage.
+        self clearModifiedAndRememberImageSaved.
     ]
 !
 
@@ -7619,7 +7634,7 @@
 
     imageEditView saveMethodAs ifTrue:[
         self updateLabelsAndHistory.
-        self clearModifiedAndRememberSavedImage.
+        self clearModifiedAndRememberImageSaved.
     ]
 !