Bläddra i källkod

update toolboxes after change in addons

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@57148 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 11 år sedan
förälder
incheckning
031410f706
2 ändrade filer med 12 tillägg och 0 borttagningar
  1. 8 0
      gui/wxpython/core/toolboxes.py
  2. 4 0
      gui/wxpython/modules/extensions.py

+ 8 - 0
gui/wxpython/core/toolboxes.py

@@ -59,6 +59,14 @@ if not os.path.exists(userMainMenuFile):
     userMainMenuFile = None
 
 
+def toolboxesOutdated():
+    """!Removes auto-generated menudata.xml
+    to let gui regenerate it next time it starts."""
+    path = os.path.join(GetSettingsPath(), 'toolboxes', 'menudata.xml')
+    if os.path.exists(path):
+        gcore.try_remove(path)
+
+
 def getMenuFile():
     """!Returns path to XML file for building menu.
 

+ 4 - 0
gui/wxpython/modules/extensions.py

@@ -31,6 +31,7 @@ from core.utils       import SetAddOnPath
 from core.menutree    import TreeModel, ModuleNode
 from gui_core.widgets import GListCtrl, SearchModuleWidget
 from gui_core.treeview import CTreeView
+from core.toolboxes   import toolboxesOutdated
 
 
 class InstallExtensionWindow(wx.Frame):
@@ -205,6 +206,8 @@ class InstallExtensionWindow(wx.Frame):
                 SetAddOnPath(key = 'BASE')
             
             globalvar.UpdateGRASSAddOnCommands()
+            toolboxesOutdated()
+            
 
     def OnItemSelected(self, node):
         """!Item selected"""
@@ -386,6 +389,7 @@ class UninstallExtensionWindow(wx.Frame):
         
         # update prompt
         globalvar.UpdateGRASSAddOnCommands(eList)
+        toolboxesOutdated()
 
         
 class CheckListExtension(GListCtrl):