#REFACTORING by cg draft
authorClaus Gittinger <cg@exept.de>
Sun, 26 Feb 2017 23:35:34 +0100
changeset 3425 0bf8a902d844
parent 3424 4243ce8f3411
child 3426 6d0987492205
#REFACTORING by cg class: ImageEditor added: #saveButtonInToolbarVisibleHolder changed: #doSaveImageFileAs #menuToolbar
ImageEditor.st
--- a/ImageEditor.st	Sun Feb 26 18:17:30 2017 +0100
+++ b/ImageEditor.st	Sun Feb 26 23:35:34 2017 +0100
@@ -3782,6 +3782,15 @@
             labelImage: (ResourceRetriever ToolbarIconLibrary loadImageFromFileIcon)
           )
          (MenuItem
+            activeHelpKey: fileSave
+            enabled: imageIsLoadedHolder
+            label: 'save'
+            itemValue: doSaveImageFile
+            isButton: true
+            isVisible: saveButtonInToolbarVisibleHolder
+            labelImage: (ResourceRetriever ToolbarIconLibrary saveImageIcon)
+          )
+         (MenuItem
             activeHelpKey: fileSaveAs
             enabled: imageIsLoadedHolder
             label: 'saveAsFile'
@@ -3824,6 +3833,8 @@
         nil
         nil
       )
+
+    "Modified: / 26-02-2017 / 23:03:40 / cg"
 !
 
 modeMenu
@@ -4826,6 +4837,12 @@
     ^ false
 !
 
+saveButtonInToolbarVisibleHolder
+    ^ false
+
+    "Created: / 26-02-2017 / 22:58:41 / cg"
+!
+
 selectedColors
     "returns a valueHolder for the current set of selected colors."
 
@@ -8326,7 +8343,12 @@
                 extension:nil
                 "blocking:false".
         ].
-    ] ifFalse:[    
+    ] ifFalse:[ 
+        img fileName isNil ifTrue:[
+            LastDirectory notNil ifTrue:[
+                file := LastDirectory asFilename construct:(file asFilename baseName).
+            ].    
+        ].    
         (FileSelectionBrowser isNil or:[DirectoryView isNil]) ifTrue:[
             file notNil ifTrue:[
                 file := Dialog requestFileName:'Save Image To'
@@ -8341,9 +8363,6 @@
             ].
         ] ifFalse:[
             file notNil ifTrue:[
-                LastDirectory notNil ifTrue:[
-                    file := LastDirectory asFilename construct:(file asFilename baseName).
-                ].    
                 file := FileSelectionBrowser
                             request:'Save Image To'
                             fileName:file
@@ -8363,7 +8382,7 @@
         self clearModifiedAndRememberImageSavedAsFile:file.
     ]
 
-    "Modified: / 26-02-2017 / 17:37:54 / cg"
+    "Modified: / 26-02-2017 / 22:46:59 / cg"
 !
 
 doSaveImageMaskFileAs