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

svn_grass at osgeo.org svn_grass at osgeo.org
Sat May 8 15:31:38 EDT 2010


Author: martinl
Date: 2010-05-08 15:31:37 -0400 (Sat, 08 May 2010)
New Revision: 42168

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/help.py
Log:
wxGUI/ext: repo widget
(merge r42166 from trunk)


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/help.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/help.py	2010-05-08 19:28:01 UTC (rev 42167)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/help.py	2010-05-08 19:31:37 UTC (rev 42168)
@@ -671,11 +671,16 @@
         
         self.panel = wx.Panel(parent = self, id = wx.ID_ANY)
 
+        self.repoBox = wx.StaticBox(parent = self.panel, id = wx.ID_ANY,
+                                    label=" %s " % _("Repository"))
         self.findBox = wx.StaticBox(parent = self.panel, id = wx.ID_ANY,
                                     label=" %s " % _("Find extension by"))
         self.treeBox = wx.StaticBox(parent = self.panel, id = wx.ID_ANY,
                                     label=" %s " % _("List of extensions"))
         
+        self.repo = wx.TextCtrl(parent = self.panel, id = wx.ID_ANY,
+                                value = 'https://svn.osgeo.org/grass/grass-addons')
+        
         self.search = SearchModuleWindow(parent = self.panel, showLabel = False)
         
         self.tree   = ExtensionTree(parent = self.panel, log = parent.GetLogWindow())
@@ -704,12 +709,15 @@
     def _layout(self):
         """!Do layout"""
         sizer = wx.BoxSizer(wx.VERTICAL)
-        findSizer = wx.StaticBoxSizer(self.findBox, wx.HORIZONTAL)
-        findSizer.Add(item = self.search, proportion = 1,
-                      flag = wx.ALL, border = 1)
-        findSizer.Add(item = self.btnFetch, proportion = 0,
+        repoSizer = wx.StaticBoxSizer(self.repoBox, wx.HORIZONTAL)
+        repoSizer.Add(item = self.repo, proportion = 1,
                       flag = wx.ALL | wx.ALIGN_CENTER_VERTICAL, border = 1)
+        repoSizer.Add(item = self.btnFetch, proportion = 0,
+                      flag = wx.ALL | wx.ALIGN_CENTER_VERTICAL, border = 1)
         
+        findSizer = wx.StaticBoxSizer(self.findBox, wx.HORIZONTAL)
+        findSizer.Add(item = self.search, proportion = 1)
+        
         treeSizer = wx.StaticBoxSizer(self.treeBox, wx.HORIZONTAL)
         treeSizer.Add(item = self.tree, proportion = 1,
                       flag = wx.ALL | wx.EXPAND, border = 1)
@@ -720,8 +728,10 @@
         btnSizer.Add(item = self.btnInstall, proportion = 0,
                      flag = wx.LEFT | wx.RIGHT, border = 5)
         
+        sizer.Add(item = repoSizer, proportion = 0,
+                  flag = wx.ALL | wx.EXPAND, border = 3)
         sizer.Add(item = findSizer, proportion = 0,
-                  flag = wx.ALL | wx.EXPAND, border = 3)
+                  flag = wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.EXPAND, border = 3)
         sizer.Add(item = treeSizer, proportion = 1,
                   flag = wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.EXPAND, border = 3)
         sizer.Add(item = btnSizer, proportion=0,
@@ -736,7 +746,8 @@
         if not name:
             return
         log = self.parent.GetLogWindow()
-        log.RunCmd(['g.extension', 'extension=' + name])
+        log.RunCmd(['g.extension', 'extension=' + name,
+                    'svnurl=' + self.repo.GetValue().strip()])
         self.OnCloseWindow(None)
         
     def OnUpdateStatusBar(self, event):
@@ -760,7 +771,7 @@
     def OnFetch(self, event):
         """!Fetch list of available extensions"""
         self.SetStatusText(_("Fetching list of modules from GRASS-Addons SVN (be patient)..."), 0)
-        self.tree.Load()
+        self.tree.Load(url = self.repo.GetValue().strip())
         self.SetStatusText("", 0)
 
     def OnItemActivated(self, event):
@@ -846,14 +857,15 @@
         
         return None
     
-    def Load(self):
+    def Load(self, url):
         """!Load list of extensions"""
         self.DeleteAllItems()
         self.root = self.AddRoot(_("Menu tree"))
         self._initTree()
         
         ret = gcmd.RunCommand('g.extension', read = True,
-                                 flags = 'g', quiet = True)
+                              svnurl = url,
+                              flags = 'g', quiet = True)
         if not ret:
             return
         



More information about the grass-commit mailing list