[GRASS-SVN] r37040 - grass/branches/releasebranch_6_4/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Thu May 7 11:19:50 EDT 2009


Author: martinl
Date: 2009-05-07 11:19:50 -0400 (Thu, 07 May 2009)
New Revision: 37040

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/nviz.py
   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: remove '3D view' from toolbar if Nviz extension is not available 


Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/nviz.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/nviz.py	2009-05-07 12:41:12 UTC (rev 37039)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/nviz.py	2009-05-07 15:19:50 UTC (rev 37040)
@@ -38,6 +38,7 @@
 except ImportError, e:
     haveNviz = False
     errorMsg = e
+    print >> sys.stderr, "\nWARNING: Nviz extension (3D view) is not available (%s). " % e
 
 if haveNviz:
     GLWindow = nviz_mapdisp.GLWindow

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-07 12:41:12 UTC (rev 37039)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/toolbars.py	2009-05-07 15:19:50 UTC (rev 37040)
@@ -31,7 +31,8 @@
 import gdialogs
 import vdigit
 from vdigit import VDigitSettingsDialog as VDigitSettingsDialog
-from vdigit import hasVDigit
+from vdigit import haveVDigit
+from nviz import haveNviz
 from debug import Debug as Debug
 from icon import Icons as Icons
 from preferences import globalSettings as UserSettings
@@ -161,9 +162,11 @@
         
         # optional tools
         self.combo = wx.ComboBox(parent=self.toolbar, id=wx.ID_ANY, value=_('2D view'),
-                                 choices=[_('2D view'), _('3D view')], 
+                                 choices=[_('2D view'), ], 
                                  style=wx.CB_READONLY, size=(90, -1))
-        if hasVDigit:
+        if haveNviz:
+            self.combo.Append(_('3D view'))
+        if haveVDigit:
             self.combo.Append(_('Digitize'))
         
         self.comboid = self.toolbar.AddControl(self.combo)

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-07 12:41:12 UTC (rev 37039)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/vdigit.py	2009-05-07 15:19:50 UTC (rev 37040)
@@ -54,16 +54,14 @@
     import grass6_wxvdigit as wxvdigit
     GV_LINES = wxvdigit.GV_LINES
     PseudoDC = wxvdigit.PseudoDC
-    hasVDigit = True
+    haveVDigit = True
     digitErr = ''
 except ImportError, err:
-    hasVDigit = False
+    haveVDigit = False
     GV_LINES = None
     PseudoDC = None
     digitErr = err
-    print >> sys.stderr, "%sWARNING: Digitization tool is disabled (%s). " \
-          "Detailed information in README file." % \
-          (os.linesep, err)
+    print >> sys.stderr, "\nWARNING: Vector digitizer is not available (%s). " % err
 
 class AbstractDigit:
     """

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-07 12:41:12 UTC (rev 37039)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/wxgui_utils.py	2009-05-07 15:19:50 UTC (rev 37040)
@@ -33,6 +33,7 @@
 import gdialogs
 import globalvar
 import menuform
+import toolbars
 import mapdisp
 import render
 import gcmd
@@ -43,7 +44,7 @@
 from debug import Debug as Debug
 from icon import Icons as Icons
 from preferences import globalSettings as UserSettings
-from vdigit import hasVDigit
+from vdigit import haveVDigit
 try:
     import subprocess
 except:
@@ -290,7 +291,7 @@
             self.Bind (wx.EVT_MENU, self.gismgr.OnShowAttributeTable, id=self.popupID4)
 
             self.popupMenu.Append(self.popupID5, text=_("Start editing"))
-            if not hasVDigit:
+            if not haveVDigit:
                 self.popupMenu.Enable(self.popupID5, False)
             self.popupMenu.Append(self.popupID6, text=_("Stop editing"))
             self.popupMenu.Enable(self.popupID6, False)



More information about the grass-commit mailing list