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

svn_grass at osgeo.org svn_grass at osgeo.org
Thu May 7 11:27:25 EDT 2009


Author: martinl
Date: 2009-05-07 11:27:25 -0400 (Thu, 07 May 2009)
New Revision: 37042

Modified:
   grass/trunk/gui/wxpython/gui_modules/nviz.py
   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: remove '3D view' from toolbar if Nviz extension is not available
      (merge from relbr64, r37040)


Modified: grass/trunk/gui/wxpython/gui_modules/nviz.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/nviz.py	2009-05-07 15:24:55 UTC (rev 37041)
+++ grass/trunk/gui/wxpython/gui_modules/nviz.py	2009-05-07 15:27:25 UTC (rev 37042)
@@ -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/trunk/gui/wxpython/gui_modules/toolbars.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/toolbars.py	2009-05-07 15:24:55 UTC (rev 37041)
+++ grass/trunk/gui/wxpython/gui_modules/toolbars.py	2009-05-07 15:27:25 UTC (rev 37042)
@@ -32,7 +32,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
@@ -162,9 +163,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/trunk/gui/wxpython/gui_modules/vdigit.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/vdigit.py	2009-05-07 15:24:55 UTC (rev 37041)
+++ grass/trunk/gui/wxpython/gui_modules/vdigit.py	2009-05-07 15:27:25 UTC (rev 37042)
@@ -54,16 +54,14 @@
     import grass7_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 = wx.PseudoDC
     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/trunk/gui/wxpython/gui_modules/wxgui_utils.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py	2009-05-07 15:24:55 UTC (rev 37041)
+++ grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py	2009-05-07 15:27:25 UTC (rev 37042)
@@ -35,6 +35,7 @@
 import gdialogs
 import globalvar
 import menuform
+import toolbars
 import mapdisp
 import render
 import histogram
@@ -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.lmgr.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