Browse Source

wxGUI/modeler: preferences & properties available from toolbar

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@42350 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 15 years ago
parent
commit
ed7b6cb38f

+ 1 - 1
gui/wxpython/gui_modules/gmodeler.py

@@ -1126,7 +1126,7 @@ if __name__ == "__main__":
             WriteModelFile(fd = tmpfile,
                            actions = self.model.GetActions(),
                            data = self.model.GetData(),
-                           properties = self.properties)
+                           properties = self.model.GetProperties())
         except StandardError:
             GMessage(parent = self,
                      message = _("Writing current settings to model file failed."))

+ 8 - 0
gui/wxpython/gui_modules/toolbars.py

@@ -1399,6 +1399,8 @@ class ModelToolbar(AbstractToolbar):
         self.relation = wx.NewId()
         self.run = wx.NewId()
         self.validate = wx.NewId()
+        self.settings = wx.NewId()
+        self.properties = wx.NewId()
         self.quit = wx.NewId()
         
         # tool, label, bitmap, kind, shortHelp, longHelp, handler
@@ -1428,6 +1430,9 @@ class ModelToolbar(AbstractToolbar):
             (self.relation, 'relation', Icons['modelRelation'].GetBitmap(),
              wx.ITEM_NORMAL, Icons['modelRelation'].GetLabel(), Icons['modelRelation'].GetDesc(),
              self.parent.OnDefineRelation),
+            (self.properties, "properties", Icons["modelProperties"].GetBitmap(),
+             wx.ITEM_NORMAL, Icons["modelProperties"].GetLabel(), Icons["modelProperties"].GetDesc(),
+             self.parent.OnModelProperties),
             ('', '', '', '', '', '', ''),
             (self.run, 'run', Icons['modelRun'].GetBitmap(),
              wx.ITEM_NORMAL, Icons['modelRun'].GetLabel(), Icons['modelRun'].GetDesc(),
@@ -1436,6 +1441,9 @@ class ModelToolbar(AbstractToolbar):
              wx.ITEM_NORMAL, Icons['modelValidate'].GetLabel(), Icons['modelValidate'].GetDesc(),
              self.parent.OnValidateModel),
             ('', '', '', '', '', '', ''),
+            (self.settings, "settings", Icons["modelSettings"].GetBitmap(),
+             wx.ITEM_NORMAL, Icons["modelSettings"].GetLabel(), Icons["modelSettings"].GetDesc(),
+             self.parent.OnPreferences),
             (self.quit, 'quit', Icons['quit'].GetBitmap(),
              wx.ITEM_NORMAL, Icons['quit'].GetLabel(), Icons['quit'].GetDesc(),
              self.parent.OnCloseWindow),

+ 2 - 0
gui/wxpython/icons/grass2_icons.py

@@ -112,4 +112,6 @@ IconsGrass2 = {
     "modelValidate"  : 'check.png',
     "imageSave"      : 'image-export.png',
     "pythonSave"     : 'python-export.png',
+    "modelSettings"  : 'settings.png',
+    "modelProperties" : 'options.png',
     }

+ 2 - 0
gui/wxpython/icons/grass_icons.py

@@ -114,4 +114,6 @@ IconsGrass = {
     "modelValidate"  : wx.ART_ERROR,
     "imageSave"      : wx.ART_ERROR,
     "pythonSave"     : wx.ART_ERROR,
+    "modelSettings"  : wx.ART_ERROR,
+    "modelProperties" : wx.ART_ERROR,
     }

+ 4 - 0
gui/wxpython/icons/icon.py

@@ -357,6 +357,10 @@ Icons = {
                            label=_("Run entire model")),
     "modelValidate" : MetaIcon (img=Icons["modelValidate"],
                                 label=_("Validate entire model")),
+    "modelSettings" : MetaIcon (img=Icons["modelSettings"],
+                                label=_("Show modeler settings")),
+    "modelProperties" : MetaIcon (img=Icons["modelProperties"],
+                                  label=_("Show model properties")),
     }
 
 # testing ...

+ 2 - 0
gui/wxpython/icons/silk_icons.py

@@ -115,4 +115,6 @@ IconsSilk = {
     "modelValidate"  : wx.ART_ERROR,
     "imageSave"      : wx.ART_ERROR,
     "pythonSave"     : wx.ART_ERROR,
+    "modelSettings"  : wx.ART_ERROR,
+    "modelProperties" : wx.ART_ERROR,
     }