Преглед изворни кода

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

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@57400 15284696-431f-4ddb-bdfa-cd5b030d7da7
Vaclav Petras пре 11 година
родитељ
комит
b6ace1c969

+ 2 - 3
gui/wxpython/lmgr/layertree.py

@@ -719,9 +719,8 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
         maplayer = self.GetLayerInfo(self.layer_selected, key = 'maplayer')
         maplayer = self.GetLayerInfo(self.layer_selected, key = 'maplayer')
         
         
         self.mapdisplay.toolbars['vdigit'].OnExit()
         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._setGradient()
         self.RefreshLine(self.layer_selected)
         self.RefreshLine(self.layer_selected)
         
         

+ 2 - 2
gui/wxpython/mapdisp/statusbar.py

@@ -886,7 +886,7 @@ class SbCoordinates(SbTextItem):
                 value = self._basicValue
                 value = self._basicValue
             self.SetValue(value)
             self.SetValue(value)
         except SbException, e:
         except SbException, e:
-            self.SetValue(e)
+            self.SetValue(e.message)
         # TODO: remove these excepts, they just hide errors, solve problems differently
         # TODO: remove these excepts, they just hide errors, solve problems differently
         except TypeError, e:
         except TypeError, e:
             self.SetValue("")
             self.SetValue("")
@@ -955,7 +955,7 @@ class SbRegionExtent(SbTextItem):
             regionReprojected = self.ReprojectRegionFromMap(region, projection, precision, format)
             regionReprojected = self.ReprojectRegionFromMap(region, projection, precision, format)
             self.SetValue(regionReprojected)
             self.SetValue(regionReprojected)
         except SbException, e:
         except SbException, e:
-            self.SetValue(e)
+            self.SetValue(e.message)
         SbTextItem.Show(self)
         SbTextItem.Show(self)
     
     
     def _getRegion(self):
     def _getRegion(self):

+ 6 - 4
gui/wxpython/nviz/mapwindow.py

@@ -71,12 +71,14 @@ class NvizThread(Thread):
 
 
 class GLWindow(MapWindow, glcanvas.GLCanvas):
 class GLWindow(MapWindow, glcanvas.GLCanvas):
     """!OpenGL canvas for Map Display Window"""
     """!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.tree = tree
         self.lmgr = lmgr
         self.lmgr = lmgr
-        
+        self.frame = frame
+
         # for wxGTK we need to set WX_GL_DEPTH_SIZE to draw vectors correctly
         # for wxGTK we need to set WX_GL_DEPTH_SIZE to draw vectors correctly
         # but we don't know the right value
         # but we don't know the right value
         # in wxpython 2.9, there is IsDisplaySupported
         # in wxpython 2.9, there is IsDisplaySupported

+ 5 - 5
gui/wxpython/vdigit/toolbars.py

@@ -798,10 +798,9 @@ class VDigitToolbar(BaseToolbar):
         if 'map' in self.parent.toolbars:
         if 'map' in self.parent.toolbars:
             self.parent.toolbars['map'].combo.SetValue (_('Digitize'))
             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())
         Debug.msg (4, "VDigitToolbar.StartEditing(): layer=%s" % mapLayer.GetName())
         
         
@@ -854,7 +853,8 @@ class VDigitToolbar(BaseToolbar):
             # TODO: replace by giface
             # TODO: replace by giface
             lmgr = self.parent.GetLayerManager()
             lmgr = self.parent.GetLayerManager()
             if lmgr:
             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._giface.GetProgress().SetValue(0)
                 lmgr.GetLogWindow().WriteCmdLog(_("Editing of vector map <%s> successfully finished") % \
                 lmgr.GetLogWindow().WriteCmdLog(_("Editing of vector map <%s> successfully finished") % \
                                                     self.mapLayer.GetName())
                                                     self.mapLayer.GetName())