[GRASS-SVN] r33160 - grass/trunk/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Aug 29 16:57:26 EDT 2008
Author: martinl
Date: 2008-08-29 16:57:26 -0400 (Fri, 29 Aug 2008)
New Revision: 33160
Modified:
grass/trunk/gui/wxpython/gui_modules/goutput.py
grass/trunk/gui/wxpython/gui_modules/mapdisp.py
Log:
wxGUI: disable query vector editable mode when selected layer is currently edited, see trac #264
(merge from devrb6, r33159)
Modified: grass/trunk/gui/wxpython/gui_modules/goutput.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/goutput.py 2008-08-29 20:54:31 UTC (rev 33159)
+++ grass/trunk/gui/wxpython/gui_modules/goutput.py 2008-08-29 20:57:26 UTC (rev 33160)
@@ -234,8 +234,12 @@
"""Write out line in selected style"""
if pid:
line = '(' + str(pid) + ') ' + line
- self.WriteLog(line, self.cmd_output.StyleCommand)
+ self.WriteLog(line, style=self.cmd_output.StyleCommand)
+ def WriteWarning(self, line):
+ """Write out line in warning style"""
+ self.WriteLog(line, style=self.cmd_output.StyleWarning)
+
def RunCmd(self, command):
"""
Run in GUI GRASS (or other) commands typed into
Modified: grass/trunk/gui/wxpython/gui_modules/mapdisp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/mapdisp.py 2008-08-29 20:54:31 UTC (rev 33159)
+++ grass/trunk/gui/wxpython/gui_modules/mapdisp.py 2008-08-29 20:57:26 UTC (rev 33160)
@@ -1348,7 +1348,7 @@
elif self.mouse["use"] == "queryVector":
# editable mode for vector map layers
self.parent.QueryVector(self.mouse['begin'][0],self.mouse['begin'][1])
-
+
elif self.mouse["use"] in ["measure", "profile"]:
# measure or profile
if self.mouse["use"] == "measure":
@@ -3253,7 +3253,7 @@
# change the cursor
self.MapWindow.SetCursor(self.cursors["cross"])
-
+
def QueryMap(self, x, y):
"""
Query map layer features
@@ -3297,6 +3297,23 @@
'east_north=%f,%f' % (float(east), float(north))]
if vectstr != '':
+ # check for vector maps open to be edited
+ digitToolbar = self.toolbars['vdigit']
+ if digitToolbar:
+ map = digitToolbar.GetLayer().GetName()
+ vect = []
+ for vector in vectstr.split(','):
+ if map == vector:
+ self.gismanager.goutput.WriteWarning("Vector map <%s> "
+ "opened for editing - skipped." % map)
+ continue
+ vect.append(vector)
+ vectstr = ','.join(vect)
+
+ if len(vectstr) <= 1:
+ self.gismanager.goutput.WriteCmdLog("Nothing to query.")
+ return
+
vcmd = ['v.what', '--q',
'-a',
'map=%s' % vectstr.rstrip(','),
@@ -3396,8 +3413,14 @@
kind=wx.ITEM_CHECK)
toolsmenu.AppendItem(modify)
self.Bind(wx.EVT_MENU, self.OnQueryModify, modify)
- if action == "modifyAttrb":
- modify.Check(True)
+ digitToolbar = self.toolbars['vdigit']
+ layer_selected = self.tree.GetPyData(self.tree.layer_selected)[0]['maplayer']
+ if digitToolbar and \
+ digitToolbar.GetLayer() == layer_selected:
+ modify.Enable(False)
+ else:
+ if action == "modifyAttrb":
+ modify.Check(True)
self.PopupMenu(toolsmenu)
toolsmenu.Destroy()
More information about the grass-commit
mailing list