`ChangeSetBrowser2`: do not show "Save" toolbar button when browser is embedded jv
authorJan Vrany <jan.vrany@fit.cvut.cz>
Mon, 05 Mar 2018 10:19:20 +0000
branchjv
changeset 18222 7b2b8ae7a123
parent 18221 adda804955e2
child 18223 920de32128c2
`ChangeSetBrowser2`: do not show "Save" toolbar button when browser is embedded ...in another application, such as in inspector.
Tools__ChangeSetBrowser2.st
--- a/Tools__ChangeSetBrowser2.st	Sun Nov 19 11:36:08 2017 -0300
+++ b/Tools__ChangeSetBrowser2.st	Mon Mar 05 10:19:20 2018 +0000
@@ -1882,6 +1882,7 @@
             label: 'Load'
             itemValue: doOpen
             isButton: true
+            isVisible: isStandalone
             labelImage: (ResourceRetriever XPToolbarIconLibrary loadFromFileIcon)
           )
          (MenuItem
@@ -1890,10 +1891,12 @@
             label: 'Save'
             itemValue: doSave
             isButton: true
+            isVisible: true
             labelImage: (ResourceRetriever XPToolbarIconLibrary saveToFileIcon)
           )
          (MenuItem
             label: '-'
+            isVisible: true
           )
          (MenuItem
             activeHelpKey: applyLine
@@ -1901,6 +1904,7 @@
             label: 'Apply'
             itemValue: doApply
             isButton: true
+            isVisible: true
             labelImage: (ResourceRetriever nil applyIcon)
           )
          (MenuItem
@@ -1909,6 +1913,7 @@
             label: 'Apply To End'
             itemValue: doApplyToEnd
             isButton: true
+            isVisible: true
             labelImage: (ResourceRetriever nil applyToEndIcon)
           )
          (MenuItem
@@ -1917,10 +1922,12 @@
             label: 'Apply From Last Snapshot'
             itemValue: doApplyFromLastSnapshot
             isButton: true
+            isVisible: true
             labelImage: (ResourceRetriever nil applyFromLastSnapshotIcon)
           )
          (MenuItem
             label: '-'
+            isVisible: true
           )
          (MenuItem
             activeHelpKey: deleteLine
@@ -3124,14 +3131,11 @@
 doSaveAs
     | file |
     Dialog aboutToOpenBoxNotificationSignal handle:[:ex|
-"/        OOPS, not supported!!!!!!!!
-
-"/        | box |
-"/        box := ex box.
-"/        box verticalPanel
-"/                add:(CheckBox label:'x'
+"/        | dialog |
+"/        dialog := ex box application.
+"/        dialog addComponent:(CheckBox label:'x'
 "/                              model:true asValue).
-        ex pass.
+"/        ex pass.
     ] do:[
         file := Dialog requestFileName:'Select File for Save' default: (changesetFile ? 'somechanges.chg') pattern:('*.chg').
     ].
@@ -3139,7 +3143,7 @@
     self doSaveAs: file.
 
     "Modified: / 27-12-2011 / 10:39:52 / cg"
-    "Modified: / 20-03-2012 / 13:52:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 05-03-2018 / 10:09:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 doSaveAs: newFile
@@ -3170,6 +3174,12 @@
     "Created: / 30-03-2012 / 16:56:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
+isStandalone
+    ^ self window isApplicationSubView not
+
+    "Modified: / 05-03-2018 / 09:38:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 loadChangeSet: aChangeSet
     self changesetHolder value: aChangeSet.
     self infoPanel hide.