[GRASS-SVN] r45567 -
grass/branches/develbranch_6/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Mar 5 10:28:12 EST 2011
Author: martinl
Date: 2011-03-05 07:28:12 -0800 (Sat, 05 Mar 2011)
New Revision: 45567
Modified:
grass/branches/develbranch_6/gui/wxpython/gui_modules/layertree.py
grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py
Log:
#1299 (Provide user-friendly error message when trying to edit vectors in Windows)
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/layertree.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/layertree.py 2011-03-05 15:18:06 UTC (rev 45566)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/layertree.py 2011-03-05 15:28:12 UTC (rev 45567)
@@ -543,30 +543,12 @@
event.Skip()
return
- if not haveVDigit:
- from vdigit import errorMsg
- msg = _("Unable to start wxGUI vector digitizer.\nDo you want to start "
- "TCL/TK digitizer (v.digit) instead?\n\n"
- "Details: %s" % errorMsg)
-
- self.mapdisplay.toolbars['map'].combo.SetValue (_("2D view"))
- dlg = wx.MessageDialog(parent = self.mapdisplay,
- message = msg,
- caption=_("Vector digitizer failed"),
- style = wx.YES_NO | wx.CENTRE)
- if dlg.ShowModal() == wx.ID_YES:
- self.lmgr.goutput.RunCmd(['v.digit', 'map=%s' % maplayer.GetName()],
- switchPage = False)
-
- dlg.Destroy()
- return
-
if not self.mapdisplay.toolbars['vdigit']: # enable tool
self.mapdisplay.AddToolbar('vdigit')
- else: # tool already enabled
- pass
- # mark layer as 'edited'
+ if not self.mapdisplay.toolbars['vdigit']:
+ return
+
self.mapdisplay.toolbars['vdigit'].StartEditing(maplayer)
self._setGradient('vdigit')
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py 2011-03-05 15:18:06 UTC (rev 45566)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py 2011-03-05 15:28:12 UTC (rev 45567)
@@ -334,11 +334,12 @@
caption=_("Vector digitizer failed"),
style = wx.YES_NO | wx.CENTRE)
if dlg.ShowModal() == wx.ID_YES:
- self.lmgr.goutput.RunCmd(['v.digit', 'map=%s' % maplayer.GetName()],
- switchPage=False)
+ mapName = self.tree.GetPyData(self.tree.layer_selected)[0]['maplayer'].GetName()
+ self._layerManager.goutput.RunCmd(['v.digit', 'map=%s' % mapName],
+ switchPage=False)
dlg.Destroy()
- self.toolbars['map'].combo.SetValue (_("2D view"))
+ self.toolbars['map'].combo.SetValue(_("2D view"))
return
if self._layerManager:
More information about the grass-commit
mailing list