[GRASS-SVN] r36984 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Mon May 4 11:27:45 EDT 2009


Author: martinl
Date: 2009-05-04 11:27:45 -0400 (Mon, 04 May 2009)
New Revision: 36984

Modified:
   grass/trunk/gui/wxpython/gui_modules/toolbars.py
   grass/trunk/gui/wxpython/gui_modules/vdigit.py
   grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py
Log:
wxGUI: hide 'digitize' tool if vdigit is not available


Modified: grass/trunk/gui/wxpython/gui_modules/toolbars.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/toolbars.py	2009-05-04 15:13:50 UTC (rev 36983)
+++ grass/trunk/gui/wxpython/gui_modules/toolbars.py	2009-05-04 15:27:45 UTC (rev 36984)
@@ -32,6 +32,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
@@ -161,8 +162,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/trunk/gui/wxpython/gui_modules/vdigit.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/vdigit.py	2009-05-04 15:13:50 UTC (rev 36983)
+++ grass/trunk/gui/wxpython/gui_modules/vdigit.py	2009-05-04 15:27:45 UTC (rev 36984)
@@ -54,8 +54,10 @@
     import grass7_wxvdigit as wxvdigit
     GV_LINES = wxvdigit.GV_LINES
     PseudoDC = wxvdigit.PseudoDC
+    hasVDigit = True
     digitErr = ''
 except ImportError, err:
+    hasVDigit = False
     GV_LINES = None
     PseudoDC = wx.PseudoDC
     digitErr = err

Modified: grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py	2009-05-04 15:13:50 UTC (rev 36983)
+++ grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py	2009-05-04 15:27:45 UTC (rev 36984)
@@ -289,6 +289,7 @@
             self.Bind (wx.EVT_MENU, self.lmgr.OnShowAttributeTable, id=self.popupID4)
 
             self.popupMenu.Append(self.popupID5, text=_("Start editing"))
+            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