[GRASS-SVN] r42705 - in grass/branches/develbranch_6/gui/wxpython: gui_modules icons

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Jul 5 16:55:02 EDT 2010


Author: martinl
Date: 2010-07-05 20:55:02 +0000 (Mon, 05 Jul 2010)
New Revision: 42705

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/gmodeler.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/toolbars.py
   grass/branches/develbranch_6/gui/wxpython/icons/grass2_icons.py
   grass/branches/develbranch_6/gui/wxpython/icons/grass_icons.py
   grass/branches/develbranch_6/gui/wxpython/icons/icon.py
   grass/branches/develbranch_6/gui/wxpython/icons/silk_icons.py
Log:
wxGUI/modeler: refresh canvas func
(merge r42704 from trunk)


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/gmodeler.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/gmodeler.py	2010-07-05 20:52:29 UTC (rev 42704)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/gmodeler.py	2010-07-05 20:55:02 UTC (rev 42705)
@@ -100,6 +100,20 @@
         """!Return list of actions"""
         return self.actions
     
+    def GetAction(self, aId):
+        """!Get action of given id
+
+        @param aId action id
+        
+        @return ModelAction instance
+        @return None if no action found
+        """
+        for action in self.actions:
+            if action.GetId() == aId:
+                return action
+        
+        return None
+    
     def GetLoops(self):
         """!Return list of loops"""
         return self.loops
@@ -531,6 +545,10 @@
         """
         self.GetCanvas().RemoveSelected()
         
+    def OnCanvasRefresh(self, event):
+        """!Refresh canvas"""
+        self.GetCanvas().Refresh()
+
     def OnCloseWindow(self, event):
         """!Close window"""
         if self.modelChanged and \
@@ -3688,14 +3706,15 @@
         """!Finish editing of item"""
         itemIndex = event.GetIndex()
         columnIndex = event.GetColumn()
-        nameOld = self.GetItem(itemIndex, 0).GetText()
-
-        if columnIndex == 0: # TODO
-            event.Veto()
         
         self.itemDataMap[itemIndex][columnIndex] = event.GetText()
         
-        self.parent.UpdateModelVariables()
+        aId = int(self.GetItem(itemIndex, 0).GetText())
+        action = self.parent.parent.GetModel().GetAction(aId)
+        if not action:
+            event.Veto()
+        if columnIndex == 0:
+            action.SetId(aId)
     
 def main():
     app = wx.PySimpleApp()

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/toolbars.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/toolbars.py	2010-07-05 20:52:29 UTC (rev 42704)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/toolbars.py	2010-07-05 20:55:02 UTC (rev 42705)
@@ -1406,6 +1406,7 @@
         # self.properties = wx.NewId()
         self.variables = wx.NewId()
         self.quit = wx.NewId()
+        self.redraw = wx.NewId()
         
         # tool, label, bitmap, kind, shortHelp, longHelp, handler
         return (
@@ -1435,6 +1436,9 @@
              wx.ITEM_NORMAL, Icons['modelRelation'].GetLabel(), Icons['modelRelation'].GetDesc(),
              self.parent.OnDefineRelation),
             ('', '', '', '', '', '', ''),
+            (self.redraw, 'redraw', Icons['modelRedraw'].GetBitmap(),
+             wx.ITEM_NORMAL, Icons['modelRedraw'].GetLabel(), Icons['modelRedraw'].GetDesc(),
+             self.parent.OnCanvasRefresh),
             (self.run, 'run', Icons['modelRun'].GetBitmap(),
              wx.ITEM_NORMAL, Icons['modelRun'].GetLabel(), Icons['modelRun'].GetDesc(),
              self.parent.OnRunModel),

Modified: grass/branches/develbranch_6/gui/wxpython/icons/grass2_icons.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/icons/grass2_icons.py	2010-07-05 20:52:29 UTC (rev 42704)
+++ grass/branches/develbranch_6/gui/wxpython/icons/grass2_icons.py	2010-07-05 20:55:02 UTC (rev 42705)
@@ -94,7 +94,6 @@
     'grGcpClear'   : 'gcp-remove.png',
     'grGeorect'    : 'georectify.png',
     'grGcpRms'     : 'gcp-rms.png',
-    'grGcpRefresh' : 'redraw.png',
     "grGcpSave"    : 'gcp-save.png',
     "grGcpAdd"     : 'gcp-add.png',
     "grGcpDelete"  : 'gcp-delete.png',
@@ -110,4 +109,5 @@
     "modelProperties" : 'options.png',
     # various
     "settings"       : 'settings.png',
+    'redraw'         : 'redraw.png',
     }

Modified: grass/branches/develbranch_6/gui/wxpython/icons/grass_icons.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/icons/grass_icons.py	2010-07-05 20:52:29 UTC (rev 42704)
+++ grass/branches/develbranch_6/gui/wxpython/icons/grass_icons.py	2010-07-05 20:55:02 UTC (rev 42705)
@@ -96,7 +96,6 @@
     'grGcpSet'     : 'gui-gcpset.gif',
     'grGeorect'    : 'gui-georect.gif',
     'grGcpRms'     : 'gui-rms.gif',
-    'grGcpRefresh' : 'gui-display.gif',
     "grGcpSave"    : 'file-save.gif', 
     "grGcpAdd"     : wx.ART_NEW, # FIXME
     "grGcpDelete"  : wx.ART_DELETE, # FIXME
@@ -112,4 +111,5 @@
     "modelProperties" : wx.ART_ERROR,
     # various
     "settings"       : 'edit-color.gif',
+    "redraw"         : 'gui-display.gif',
     }

Modified: grass/branches/develbranch_6/gui/wxpython/icons/icon.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/icons/icon.py	2010-07-05 20:52:29 UTC (rev 42704)
+++ grass/branches/develbranch_6/gui/wxpython/icons/icon.py	2010-07-05 20:55:02 UTC (rev 42705)
@@ -21,8 +21,7 @@
 import os
 import sys
 
-gmPath = os.path.join(os.getenv("GISBASE"), "etc", "wxpython", "gui_modules")
-sys.path.append(gmPath)
+sys.path.append(os.path.join(os.getenv("GISBASE"), "etc", "wxpython", "gui_modules"))
 
 import globalvar
 if not os.getenv("GRASS_WXBUNDLED"):
@@ -320,8 +319,6 @@
                              label=_("Georectify")),
     'grGcpRms'        : MetaIcon (img=Icons["grGcpRms"],
                                   label=_("Recalculate RMS error")),
-    'grGcpRefresh' : MetaIcon (img=Icons["grGcpRefresh"],
-                               label=_("Redraw GCP markers in map displays")),
     'grGcpSave' : MetaIcon (img=Icons["grGcpSave"],
                             label=_("Save GCPs to POINTS file")),
     'grGcpAdd' : MetaIcon (img=Icons["grGcpAdd"],
@@ -371,6 +368,8 @@
                                   label=_("Show model properties")),
     "modelVariables" : MetaIcon (img=Icons["modelProperties"],
                                  label=_("Manage model variables")),
+    "modelRedraw" : MetaIcon (img=Icons["redraw"],
+                              label=_("Redraw model canvas")),
     }
 
 # testing ...

Modified: grass/branches/develbranch_6/gui/wxpython/icons/silk_icons.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/icons/silk_icons.py	2010-07-05 20:52:29 UTC (rev 42704)
+++ grass/branches/develbranch_6/gui/wxpython/icons/silk_icons.py	2010-07-05 20:55:02 UTC (rev 42705)
@@ -98,7 +98,6 @@
     'grGcpClear'   : 'cross.png',
     'grGeorect'    : 'application_lightning.png',
     'grGcpRms'     : 'error.png',
-    'grGcpRefresh' : 'arrow_refresh.png',
     "grGcpSave"    : 'picture_save.png',
     "grGcpAdd"     : 'bullet_add.png', 
     "grGcpDelete"  : 'bullet_delete.png',
@@ -114,4 +113,5 @@
     "modelProperties" : wx.ART_ERROR,
     # various
     "settings"     : 'color_swatch.png',
+    "redraw"       : 'arrow_refresh.png',
     }


Property changes on: grass/branches/develbranch_6/gui/wxpython/icons/silk_icons.py
___________________________________________________________________
Modified: svn:mergeinfo
   - /grass/branches/releasebranch_6_4/gui/wxpython/icons/silk_icons.py:42375
/grass/trunk/gui/wxpython/icons/silk_icons.py:41584,41586-41587,41590-41592,41594,41596,41598,41600,41806,41884,41888,42350,42372,42377,42498
   + /grass/branches/releasebranch_6_4/gui/wxpython/icons/silk_icons.py:42375
/grass/trunk/gui/wxpython/icons/silk_icons.py:41584,41586-41587,41590-41592,41594,41596,41598,41600,41806,41884,41888,42350,42372,42377,42498,42704



More information about the grass-commit mailing list