[GRASS-SVN] r57400 - in grass/trunk/gui/wxpython: lmgr mapdisp nviz vdigit

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Aug 4 10:51:16 PDT 2013


Author: wenzeslaus
Date: 2013-08-04 10:51:16 -0700 (Sun, 04 Aug 2013)
New Revision: 57400

Modified:
   grass/trunk/gui/wxpython/lmgr/layertree.py
   grass/trunk/gui/wxpython/mapdisp/statusbar.py
   grass/trunk/gui/wxpython/nviz/mapwindow.py
   grass/trunk/gui/wxpython/vdigit/toolbars.py
Log:
wxGUI: removing dead code related to vdigit button in lmgr (not needed, might be useful but this was not working for multiple map displays), fixing query in nviz (frame required), fixing statusbar error displaying

Modified: grass/trunk/gui/wxpython/lmgr/layertree.py
===================================================================
--- grass/trunk/gui/wxpython/lmgr/layertree.py	2013-08-04 17:02:58 UTC (rev 57399)
+++ grass/trunk/gui/wxpython/lmgr/layertree.py	2013-08-04 17:51:16 UTC (rev 57400)
@@ -719,9 +719,8 @@
         maplayer = self.GetLayerInfo(self.layer_selected, key = 'maplayer')
         
         self.mapdisplay.toolbars['vdigit'].OnExit()
-        if self.lmgr:
-            self.lmgr.toolbars['tools'].Enable('vdigit', enable = True)
-        
+        # here was dead code to enable vdigit button in toolbar
+
         self._setGradient()
         self.RefreshLine(self.layer_selected)
         

Modified: grass/trunk/gui/wxpython/mapdisp/statusbar.py
===================================================================
--- grass/trunk/gui/wxpython/mapdisp/statusbar.py	2013-08-04 17:02:58 UTC (rev 57399)
+++ grass/trunk/gui/wxpython/mapdisp/statusbar.py	2013-08-04 17:51:16 UTC (rev 57400)
@@ -886,7 +886,7 @@
                 value = self._basicValue
             self.SetValue(value)
         except SbException, e:
-            self.SetValue(e)
+            self.SetValue(e.message)
         # TODO: remove these excepts, they just hide errors, solve problems differently
         except TypeError, e:
             self.SetValue("")
@@ -955,7 +955,7 @@
             regionReprojected = self.ReprojectRegionFromMap(region, projection, precision, format)
             self.SetValue(regionReprojected)
         except SbException, e:
-            self.SetValue(e)
+            self.SetValue(e.message)
         SbTextItem.Show(self)
     
     def _getRegion(self):

Modified: grass/trunk/gui/wxpython/nviz/mapwindow.py
===================================================================
--- grass/trunk/gui/wxpython/nviz/mapwindow.py	2013-08-04 17:02:58 UTC (rev 57399)
+++ grass/trunk/gui/wxpython/nviz/mapwindow.py	2013-08-04 17:51:16 UTC (rev 57400)
@@ -71,12 +71,14 @@
 
 class GLWindow(MapWindow, glcanvas.GLCanvas):
     """!OpenGL canvas for Map Display Window"""
-    def __init__(self, parent, giface, id = wx.ID_ANY, frame = None,
-                 Map = None, tree = None, lmgr = None):
-        self.parent = parent # MapFrame
+    def __init__(self, parent, giface, frame, Map, tree, lmgr, id=wx.ID_ANY):
+        """All parameters except for id are mandatory. The todo is to remove
+        them completely."""
+        self.parent = parent
         self.tree = tree
         self.lmgr = lmgr
-        
+        self.frame = frame
+
         # for wxGTK we need to set WX_GL_DEPTH_SIZE to draw vectors correctly
         # but we don't know the right value
         # in wxpython 2.9, there is IsDisplaySupported

Modified: grass/trunk/gui/wxpython/vdigit/toolbars.py
===================================================================
--- grass/trunk/gui/wxpython/vdigit/toolbars.py	2013-08-04 17:02:58 UTC (rev 57399)
+++ grass/trunk/gui/wxpython/vdigit/toolbars.py	2013-08-04 17:51:16 UTC (rev 57400)
@@ -798,10 +798,9 @@
         if 'map' in self.parent.toolbars:
             self.parent.toolbars['map'].combo.SetValue (_('Digitize'))
         
-        if self.digitClass != IClassVDigit:
-            lmgr = self.parent.GetLayerManager()
-            if lmgr:
-                lmgr.toolbars['tools'].Enable('vdigit', enable = False)
+        # here was dead code to enable vdigit button in toolbar
+        # with if to ignore iclass
+        # some signal (DigitizerStarted) can be emitted here
         
         Debug.msg (4, "VDigitToolbar.StartEditing(): layer=%s" % mapLayer.GetName())
         
@@ -854,7 +853,8 @@
             # TODO: replace by giface
             lmgr = self.parent.GetLayerManager()
             if lmgr:
-                lmgr.toolbars['tools'].Enable('vdigit', enable = True)
+                # here was dead code to enable vdigit button in toolbar
+                # some signal (DigitizerEnded) can be emitted here
                 lmgr._giface.GetProgress().SetValue(0)
                 lmgr.GetLogWindow().WriteCmdLog(_("Editing of vector map <%s> successfully finished") % \
                                                     self.mapLayer.GetName())



More information about the grass-commit mailing list