[GRASS-SVN] r73832 - grass/trunk/gui/wxpython/modules

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Dec 25 06:38:36 PST 2018


Author: martinl
Date: 2018-12-25 06:38:35 -0800 (Tue, 25 Dec 2018)
New Revision: 73832

Modified:
   grass/trunk/gui/wxpython/modules/extensions.py
Log:
wxGUI: install extension dialog - hide repo settings (not used and misleading for user)

Modified: grass/trunk/gui/wxpython/modules/extensions.py
===================================================================
--- grass/trunk/gui/wxpython/modules/extensions.py	2018-12-25 13:31:54 UTC (rev 73831)
+++ grass/trunk/gui/wxpython/modules/extensions.py	2018-12-25 14:38:35 UTC (rev 73832)
@@ -54,14 +54,14 @@
 
         self.panel = wx.Panel(parent=self, id=wx.ID_ANY)
 
-        self.repoBox = StaticBox(
-            parent=self.panel, id=wx.ID_ANY, label=" %s " %
-            _("Repository (leave empty to use the official one)"))
+        # self.repoBox = StaticBox(
+        #     parent=self.panel, id=wx.ID_ANY, label=" %s " %
+        #     _("Repository (leave empty to use the official one)"))
         self.treeBox = StaticBox(
             parent=self.panel, id=wx.ID_ANY, label=" %s " %
             _("List of extensions - double-click to install"))
 
-        self.repo = TextCtrl(parent=self.panel, id=wx.ID_ANY)
+        # self.repo = TextCtrl(parent=self.panel, id=wx.ID_ANY)
 
         # modelBuilder loads data into tree model
         self.modelBuilder = ExtensionTreeModelBuilder()
@@ -101,19 +101,19 @@
                 continue
             self.options[name] = wx.CheckBox(parent=self.panel, id=wx.ID_ANY,
                                              label=desc)
-        defaultUrl = ''  # default/official one will be used when option empty
-        self.repo.SetValue(
-            task.get_param(
-                value='url').get(
-                'default',
-                defaultUrl))
+        # defaultUrl = ''  # default/official one will be used when option empty
+        # self.repo.SetValue(
+        #     task.get_param(
+        #         value='url').get(
+        #         'default',
+        #         defaultUrl))
 
         self.statusbar = self.CreateStatusBar(number=1)
 
-        self.btnFetch = Button(parent=self.panel, id=wx.ID_ANY,
-                               label=_("&Fetch"))
-        self.btnFetch.SetToolTip(_("Fetch list of available modules "
-                                   "from GRASS Addons SVN repository"))
+        # self.btnFetch = Button(parent=self.panel, id=wx.ID_ANY,
+        #                        label=_("&Fetch"))
+        # self.btnFetch.SetToolTip(_("Fetch list of available modules "
+        #                            "from GRASS Addons SVN repository"))
         self.btnClose = Button(parent=self.panel, id=wx.ID_CLOSE)
         self.btnInstall = Button(parent=self.panel, id=wx.ID_ANY,
                                  label=_("&Install"))
@@ -124,7 +124,7 @@
         self.btnHelp.SetToolTip(_("Show g.extension manual page"))
 
         self.btnClose.Bind(wx.EVT_BUTTON, lambda evt: self.Close())
-        self.btnFetch.Bind(wx.EVT_BUTTON, self.OnFetch)
+        # self.btnFetch.Bind(wx.EVT_BUTTON, self.OnFetch)
         self.btnInstall.Bind(wx.EVT_BUTTON, self.OnInstall)
         self.btnHelp.Bind(wx.EVT_BUTTON, self.OnHelp)
         self.tree.selectionChanged.connect(self.OnItemSelected)
@@ -138,14 +138,14 @@
     def _layout(self):
         """Do layout"""
         sizer = wx.BoxSizer(wx.VERTICAL)
-        repoSizer = wx.StaticBoxSizer(self.repoBox, wx.VERTICAL)
-        repo1Sizer = wx.BoxSizer(wx.HORIZONTAL)
-        repo1Sizer.Add(self.repo, proportion=1,
-                       flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=1)
-        repo1Sizer.Add(self.btnFetch, proportion=0,
-                       flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=1)
-        repoSizer.Add(repo1Sizer,
-                      flag=wx.EXPAND)
+        # repoSizer = wx.StaticBoxSizer(self.repoBox, wx.VERTICAL)
+        # repo1Sizer = wx.BoxSizer(wx.HORIZONTAL)
+        # repo1Sizer.Add(self.repo, proportion=1,
+        #                flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=1)
+        # repo1Sizer.Add(self.btnFetch, proportion=0,
+        #                flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=1)
+        # repoSizer.Add(repo1Sizer,
+        #               flag=wx.EXPAND)
 
         findSizer = wx.BoxSizer(wx.HORIZONTAL)
         findSizer.Add(self.search, proportion=1)
@@ -166,10 +166,10 @@
                      flag=wx.RIGHT, border=5)
         btnSizer.Add(self.btnInstall, proportion=0)
 
-        sizer.Add(repoSizer, proportion=0,
+        # sizer.Add(repoSizer, proportion=0,
+        #           flag=wx.ALL | wx.EXPAND, border=3)
+        sizer.Add(findSizer, proportion=0,
                   flag=wx.ALL | wx.EXPAND, border=3)
-        sizer.Add(findSizer, proportion=0,
-                  flag=wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.EXPAND, border=3)
         sizer.Add(treeSizer, proportion=1,
                   flag=wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.EXPAND, border=3)
         sizer.Add(optionSizer, proportion=0,
@@ -198,8 +198,8 @@
                 else:
                     flags.append('--%s' % key)
 
-        return ['g.extension'] + flags + ['extension=' + name,
-                                          'url=' + self.repo.GetValue().strip()]
+        # 'url=' + self.repo.GetValue().strip()]                    
+        return ['g.extension'] + flags + ['extension={}'.format(name) ]
 
     def OnFetch(self, event):
         """Fetch list of available extensions"""
@@ -213,7 +213,7 @@
         try:
             self.thread.Run(
                 callable=self.modelBuilder.Load,
-                url=self.repo.GetValue().strip(),
+                url='', # self.repo.GetValue().strip(),
                 ondone=lambda event: self._fetchDone())
         except GException as e:
             self._fetchDone()



More information about the grass-commit mailing list