[GRASS-SVN] r49295 - grass/branches/develbranch_6/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Nov 19 07:21:22 EST 2011


Author: martinl
Date: 2011-11-19 04:21:22 -0800 (Sat, 19 Nov 2011)
New Revision: 49295

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/ghelp.py
Log:
wxGUI: define OnDone for extensions


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/ghelp.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/ghelp.py	2011-11-19 12:15:40 UTC (rev 49294)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/ghelp.py	2011-11-19 12:21:22 UTC (rev 49295)
@@ -966,10 +966,18 @@
     def OnInstall(self, event):
         """!Install selected extension"""
         log = self.parent.GetLogWindow()
-        log.RunCmd(self._getCmd())
+        log.RunCmd(self._getCmd(), onDone = self.OnDone)
         
-        ### self.OnCloseWindow(None)
-                
+    def OnDone(self, cmd, returncode):
+        item = self.tree.GetSelected()
+        if not item or not item.IsOk() or \
+                returncode != 0 or \
+                not os.getenv('GRASS_ADDON_PATH'):
+            return
+        
+        name = self.tree.GetItemText(item)
+        globalvar.grassCmd['all'].append(name)
+        
     def OnItemSelected(self, event):
         """!Item selected"""
         item = event.GetItem()



More information about the grass-commit mailing list