[GRASS-SVN] r46758 - in grass/trunk/gui/wxpython: gui_modules xml
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Jun 23 08:01:08 EDT 2011
Author: martinl
Date: 2011-06-23 05:01:08 -0700 (Thu, 23 Jun 2011)
New Revision: 46758
Modified:
grass/trunk/gui/wxpython/gui_modules/ghelp.py
grass/trunk/gui/wxpython/xml/menudata.xml
Log:
wxGUI: various minor changes in install add-ons dialog
minor changes in the menu
Modified: grass/trunk/gui/wxpython/gui_modules/ghelp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/ghelp.py 2011-06-23 11:20:53 UTC (rev 46757)
+++ grass/trunk/gui/wxpython/gui_modules/ghelp.py 2011-06-23 12:01:08 UTC (rev 46758)
@@ -800,8 +800,7 @@
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.repo = wx.TextCtrl(parent = self.panel, id = wx.ID_ANY)
self.fullDesc = wx.CheckBox(parent = self.panel, id = wx.ID_ANY,
label = _("Fetch full info including description and keywords (takes time)"))
self.fullDesc.SetValue(False)
@@ -825,6 +824,8 @@
continue
self.options[name] = wx.CheckBox(parent = self.panel, id = wx.ID_ANY,
label = desc)
+ self.repo.SetValue(task.get_param(value = 'svnurl').get('default',
+ 'https://svn.osgeo.org/grass/grass-addons'))
self.statusbar = self.CreateStatusBar(0)
@@ -836,10 +837,14 @@
label = _("&Install"))
self.btnInstall.SetToolTipString(_("Install selected add-ons GRASS module"))
self.btnInstall.Enable(False)
-
+ self.btnCmd = wx.Button(parent = self.panel, id = wx.ID_ANY,
+ label = _("Command dialog"))
+ self.btnCmd.SetToolTipString(_('Open %s dialog') % 'g.extension')
+
self.btnClose.Bind(wx.EVT_BUTTON, self.OnCloseWindow)
self.btnFetch.Bind(wx.EVT_BUTTON, self.OnFetch)
self.btnInstall.Bind(wx.EVT_BUTTON, self.OnInstall)
+ self.btnCmd.Bind(wx.EVT_BUTTON, self.OnCmdDialog)
self.tree.Bind(wx.EVT_TREE_ITEM_ACTIVATED, self.OnItemActivated)
self.tree.Bind(wx.EVT_TREE_SEL_CHANGED, self.OnItemSelected)
self.search.Bind(wx.EVT_TEXT_ENTER, self.OnShowItem)
@@ -873,6 +878,9 @@
optionSizer.Add(item = self.options[key], proportion = 0)
btnSizer = wx.BoxSizer(wx.HORIZONTAL)
+ btnSizer.Add(item = self.btnCmd, proportion = 0,
+ flag = wx.RIGHT, border = 5)
+ btnSizer.AddSpacer(10)
btnSizer.Add(item = self.btnClose, proportion = 0,
flag = wx.RIGHT, border = 5)
btnSizer.Add(item = self.btnInstall, proportion = 0)
@@ -893,21 +901,24 @@
self.Layout()
- def _install(self, name):
+ def _getCmd(self):
+ item = self.tree.GetSelected()
+ if not item or not item.IsOk():
+ return ['g.extension']
+
+ name = self.tree.GetItemText(item)
if not name:
+ gcmd.GError(_("Extension not defined"), parent = self)
return
- log = self.parent.GetLogWindow()
flags = list()
for key in self.options.keys():
if self.options[key].IsChecked():
flags.append('-%s' % key)
- log.RunCmd(['g.extension'] + flags + ['extension=' + name,
- 'svnurl=' + self.repo.GetValue().strip()])
-
- self.OnCloseWindow(None)
-
+ return ['g.extension'] + flags + ['extension=' + name,
+ 'svnurl=' + self.repo.GetValue().strip()]
+
def OnUpdateStatusBar(self, event):
"""!Update statusbar text"""
element = self.search.GetSelection()
@@ -940,15 +951,15 @@
item = event.GetItem()
data = self.tree.GetPyData(item)
if data and 'command' in data:
- self._install(data['command'])
-
+ self.OnInstall(event = None)
+
def OnInstall(self, event):
"""!Install selected extension"""
- item = self.tree.GetSelected()
- if not item.IsOk():
- return
- self._install(self.tree.GetItemText(item))
+ log = self.parent.GetLogWindow()
+ log.RunCmd(self._getCmd())
+ self.OnCloseWindow(None)
+
def OnItemSelected(self, event):
"""!Item selected"""
item = event.GetItem()
@@ -968,6 +979,10 @@
self.btnInstall.Enable()
else:
self.btnInstall.Enable(False)
+
+ def OnCmdDialog(self, event):
+ """!Shows command dialog"""
+ menuform.GUI(parent = self).ParseCommand(cmd = self._getCmd())
class ExtensionTree(ItemTree):
"""!List of available extensions"""
Modified: grass/trunk/gui/wxpython/xml/menudata.xml
===================================================================
--- grass/trunk/gui/wxpython/xml/menudata.xml 2011-06-23 11:20:53 UTC (rev 46757)
+++ grass/trunk/gui/wxpython/xml/menudata.xml 2011-06-23 12:01:08 UTC (rev 46758)
@@ -865,13 +865,8 @@
<menuitem>
<label>Install extension from add-ons</label>
<help>Install new extension from GRASS AddOns SVN repository.</help>
- <handler>OnInstallExtension</handler>
- </menuitem>
- <menuitem>
- <label>Manage add-ons extensions</label>
- <help>Tool to maintain the extensions in local GRASS installation.</help>
<keywords>general,installation,extensions</keywords>
- <handler>OnMenuCmd</handler>
+ <handler>OnInstallExtension</handler>
<command>g.extension</command>
</menuitem>
<separator />
@@ -1005,7 +1000,7 @@
<menuitem>
<label>Color tables</label>
<help>Creates/modifies the color table associated with a raster map.</help>
- <keywords>raster,color table</keywords>
+ <keywords>raster3d,raster,color table</keywords>
<handler>OnMenuCmd</handler>
<command>r.colors</command>
</menuitem>
@@ -1019,14 +1014,14 @@
<menuitem>
<label>Color rules</label>
<help>Interactive management of raster color tables.</help>
- <keywords>raster,color table</keywords>
+ <keywords>raster3d,raster,color table</keywords>
<handler>RulesCmd</handler>
<command>r.colors</command>
</menuitem>
<menuitem>
<label>Export color table</label>
<help>Exports the color table associated with a raster map layer.</help>
- <keywords>raster,export,color table</keywords>
+ <keywords>raster,color table,export</keywords>
<handler>OnMenuCmd</handler>
<command>r.colors.out</command>
</menuitem>
@@ -2172,7 +2167,7 @@
<separator />
<menuitem>
<label>Allocate subnets</label>
- <help>Allocate subnets for nearest centres (direction from centre).</help>
+ <help>Allocate subnets for nearest centers (direction from center).</help>
<keywords>vector,network,allocation</keywords>
<handler>OnMenuCmd</handler>
<command>v.net.alloc</command>
More information about the grass-commit
mailing list