[GRASS-SVN] r73882 - grass/branches/releasebranch_7_6/gui/wxpython/modules

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Dec 28 06:22:51 PST 2018


Author: martinl
Date: 2018-12-28 06:22:51 -0800 (Fri, 28 Dec 2018)
New Revision: 73882

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

Modified: grass/branches/releasebranch_7_6/gui/wxpython/modules/extensions.py
===================================================================
--- grass/branches/releasebranch_7_6/gui/wxpython/modules/extensions.py	2018-12-28 14:01:02 UTC (rev 73881)
+++ grass/branches/releasebranch_7_6/gui/wxpython/modules/extensions.py	2018-12-28 14:22:51 UTC (rev 73882)
@@ -53,14 +53,14 @@
 
         self.panel = wx.Panel(parent=self, id=wx.ID_ANY)
 
-        self.repoBox = wx.StaticBox(
-            parent=self.panel, id=wx.ID_ANY, label=" %s " %
-            _("Repository (leave empty to use the official one)"))
+        # self.repoBox = wx.StaticBox(
+        #     parent=self.panel, id=wx.ID_ANY, label=" %s " %
+        #     _("Repository (leave empty to use the official one)"))
         self.treeBox = wx.StaticBox(
             parent=self.panel, id=wx.ID_ANY, label=" %s " %
             _("List of extensions - double-click to install"))
 
-        self.repo = wx.TextCtrl(parent=self.panel, id=wx.ID_ANY)
+        # self.repo = wx.TextCtrl(parent=self.panel, id=wx.ID_ANY)
 
         # modelBuilder loads data into tree model
         self.modelBuilder = ExtensionTreeModelBuilder()
@@ -100,19 +100,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 = wx.Button(parent=self.panel, id=wx.ID_ANY,
-                                  label=_("&Fetch"))
-        self.btnFetch.SetToolTipString(_("Fetch list of available modules "
-                                         "from GRASS Addons SVN repository"))
+        # self.btnFetch = wx.Button(parent=self.panel, id=wx.ID_ANY,
+        #                           label=_("&Fetch"))
+        # self.btnFetch.SetToolTipString(_("Fetch list of available modules "
+        #                                  "from GRASS Addons SVN repository"))
         self.btnClose = wx.Button(parent=self.panel, id=wx.ID_CLOSE)
         self.btnInstall = wx.Button(parent=self.panel, id=wx.ID_ANY,
                                     label=_("&Install"))
@@ -123,7 +123,7 @@
         self.btnHelp.SetToolTipString(_("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)
@@ -137,14 +137,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)
@@ -165,10 +165,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,
@@ -197,8 +197,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"""
@@ -212,7 +212,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