[GRASS-SVN] r57000 - grass/trunk/gui/wxpython/core
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Jul 3 08:23:22 PDT 2013
Author: annakrat
Date: 2013-07-03 08:23:20 -0700 (Wed, 03 Jul 2013)
New Revision: 57000
Modified:
grass/trunk/gui/wxpython/core/toolboxes.py
Log:
wxGUI/toolboxes: remove Toolboxes menu item when there are no custom toolboxes in toolboxes file
Modified: grass/trunk/gui/wxpython/core/toolboxes.py
===================================================================
--- grass/trunk/gui/wxpython/core/toolboxes.py 2013-07-03 15:01:13 UTC (rev 56999)
+++ grass/trunk/gui/wxpython/core/toolboxes.py 2013-07-03 15:23:20 UTC (rev 57000)
@@ -168,13 +168,17 @@
else:
mainMenu = etree.parse(mainMenuFile)
root = mainMenu.getroot()
-
+
+ userHasToolboxes = False
if userDefined and userToolboxesFile:
- userToolboxes = etree.parse(userToolboxesFile)
- _expandUserToolboxesItem(root, userToolboxes)
- _expandToolboxes(root, userToolboxes)
+ userToolboxes = etree.parse(userToolboxesFile)
+ # in case user has empty toolboxes file (to avoid genereation)
+ if userToolboxes.findall('.//toolbox'):
+ _expandUserToolboxesItem(root, userToolboxes)
+ _expandToolboxes(root, userToolboxes)
+ userHasToolboxes = True
- if not userToolboxesFile:
+ if not userHasToolboxes:
_removeUserToolboxesItem(root)
toolboxes = etree.parse(toolboxesFile)
More information about the grass-commit
mailing list