[GRASS-SVN] r36987 -
grass/branches/releasebranch_6_4/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon May 4 11:53:32 EDT 2009
Author: martinl
Date: 2009-05-04 11:53:32 -0400 (Mon, 04 May 2009)
New Revision: 36987
Modified:
grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/toolbars.py
grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/vdigit.py
grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/wxgui_utils.py
Log:
wxGUI: hide 'digitize' tool if vdigit is not available
(merge from devbr6, r36985)
Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/toolbars.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/toolbars.py 2009-05-04 15:50:45 UTC (rev 36986)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/toolbars.py 2009-05-04 15:53:32 UTC (rev 36987)
@@ -31,6 +31,7 @@
import gdialogs
import vdigit
from vdigit import VDigitSettingsDialog as VDigitSettingsDialog
+from vdigit import hasVDigit
from debug import Debug as Debug
from icon import Icons as Icons
from preferences import globalSettings as UserSettings
@@ -160,8 +161,10 @@
# optional tools
self.combo = wx.ComboBox(parent=self.toolbar, id=wx.ID_ANY, value=_('2D view'),
- choices=[_('2D view'), _('3D view'), _('Digitize')],
+ choices=[_('2D view'), _('3D view')],
style=wx.CB_READONLY, size=(90, -1))
+ if hasVDigit:
+ self.combo.Append(_('Digitize'))
self.comboid = self.toolbar.AddControl(self.combo)
self.mapdisplay.Bind(wx.EVT_COMBOBOX, self.OnSelectTool, self.comboid)
Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/vdigit.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/vdigit.py 2009-05-04 15:50:45 UTC (rev 36986)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/vdigit.py 2009-05-04 15:53:32 UTC (rev 36987)
@@ -54,8 +54,10 @@
import grass6_wxvdigit as wxvdigit
GV_LINES = wxvdigit.GV_LINES
PseudoDC = wxvdigit.PseudoDC
+ hasVDigit = True
digitErr = ''
except ImportError, err:
+ hasVDigit = False
GV_LINES = None
PseudoDC = None
digitErr = err
Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/wxgui_utils.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/wxgui_utils.py 2009-05-04 15:50:45 UTC (rev 36986)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/wxgui_utils.py 2009-05-04 15:53:32 UTC (rev 36987)
@@ -10,7 +10,7 @@
- Layer
- LayerTree
-(C) 2007-2008 by the GRASS Development Team
+(C) 2007-2009 by the GRASS Development Team
This program is free software under the GNU General Public
License (>=v2). Read the file COPYING that comes with GRASS
for details.
@@ -43,6 +43,7 @@
from debug import Debug as Debug
from icon import Icons as Icons
from preferences import globalSettings as UserSettings
+from vdigit import hasVDigit
try:
import subprocess
except:
@@ -289,6 +290,8 @@
self.Bind (wx.EVT_MENU, self.gismgr.OnShowAttributeTable, id=self.popupID4)
self.popupMenu.Append(self.popupID5, text=_("Start editing"))
+ if not hasVDigit:
+ self.popupMenu.Enable(self.popupID5, False)
self.popupMenu.Append(self.popupID6, text=_("Stop editing"))
self.popupMenu.Enable(self.popupID6, False)
self.Bind (wx.EVT_MENU, self.OnStartEditing, id=self.popupID5)
More information about the grass-commit
mailing list