[GRASS-SVN] r44762 - grass/branches/develbranch_6/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Dec 29 09:56:07 EST 2010


Author: martinl
Date: 2010-12-29 06:56:07 -0800 (Wed, 29 Dec 2010)
New Revision: 44762

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py
Log:
wxGUI: switch page only for non-editable query mode
(merge r44758 & r44760 from trunk)


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py	2010-12-29 14:54:17 UTC (rev 44761)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py	2010-12-29 14:56:07 UTC (rev 44762)
@@ -1191,8 +1191,9 @@
 
     def _OnQuery(self):
         """!Internal method used by OnQuery*() methods"""
-        # switch GIS Manager to output console to show query results
-        self._layerManager.notebook.SetSelection(1)
+        if self.toolbars['map'].GetAction() == 'displayAttrb':
+            # switch to output console to show query results
+            self._layerManager.notebook.SetSelection(1)
         
         self.MapWindow.mouse['box'] = "point"
         self.MapWindow.zoomtype = 0
@@ -1471,7 +1472,6 @@
                     numLayers += 1
             if numLayers < 1:
                 display.Enable(False)
-            
             if action == "displayAttrb":
                 display.Check(True)
             
@@ -1481,14 +1481,17 @@
             toolsmenu.AppendItem(modify)
             self.Bind(wx.EVT_MENU, self.OnQueryModify, modify)
             modify.Enable(False)
+            if action == "modifyAttrb":
+                modify.Check(True)
             
             digitToolbar = self.toolbars['vdigit']
             if self.tree.layer_selected:
-                layer_selected = self.tree.GetPyData(self.tree.layer_selected)[0]['maplayer']
-                if layer_selected.GetType() != 'vector' or \
-                        (digitToolbar and \
-                             digitToolbar.GetLayer() == layer_selected):
-                    modify.Enable(False)
+                mapLayer = self.tree.GetPyData(self.tree.layer_selected)[0]['maplayer']
+                if mapLayer.GetType() == 'vector' and \
+                        mapLayer.GetMapset() == grass.gisenv()['MAPSET'] and \
+                        (not digitToolbar or (digitToolbar and \
+                             digitToolbar.GetLayer() != mapLayer)):
+                    modify.Enable(True)
             else:
                 if action == "modifyAttrb":
                     modify.Check(True)



More information about the grass-commit mailing list