[GRASS-SVN] r57214 - in grass/trunk/gui/wxpython: lmgr modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Jul 18 06:40:52 PDT 2013
Author: annakrat
Date: 2013-07-18 06:40:51 -0700 (Thu, 18 Jul 2013)
New Revision: 57214
Modified:
grass/trunk/gui/wxpython/lmgr/frame.py
grass/trunk/gui/wxpython/modules/extensions.py
Log:
wxGUI: add help button to install extension dialog
Modified: grass/trunk/gui/wxpython/lmgr/frame.py
===================================================================
--- grass/trunk/gui/wxpython/lmgr/frame.py 2013-07-18 13:29:11 UTC (rev 57213)
+++ grass/trunk/gui/wxpython/lmgr/frame.py 2013-07-18 13:40:51 UTC (rev 57214)
@@ -1380,7 +1380,7 @@
def OnInstallExtension(self, event):
"""!Install extension from GRASS Addons SVN repository"""
- win = InstallExtensionWindow(self, size = (650, 550))
+ win = InstallExtensionWindow(self, giface=self._giface, size = (650, 550))
win.CentreOnScreen()
win.Show()
Modified: grass/trunk/gui/wxpython/modules/extensions.py
===================================================================
--- grass/trunk/gui/wxpython/modules/extensions.py 2013-07-18 13:29:11 UTC (rev 57213)
+++ grass/trunk/gui/wxpython/modules/extensions.py 2013-07-18 13:40:51 UTC (rev 57214)
@@ -35,9 +35,10 @@
class InstallExtensionWindow(wx.Frame):
- def __init__(self, parent, id = wx.ID_ANY,
+ def __init__(self, parent, giface, id = wx.ID_ANY,
title = _("Fetch & install extension from GRASS Addons"), **kwargs):
self.parent = parent
+ self._giface = giface
self.options = dict() # list of options
wx.Frame.__init__(self, parent = parent, id = id, title = title, **kwargs)
@@ -99,10 +100,13 @@
label = _("&Install"))
self.btnInstall.SetToolTipString(_("Install selected add-ons GRASS module"))
self.btnInstall.Enable(False)
+ self.btnHelp = wx.Button(parent = self.panel, id = wx.ID_HELP)
+ 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.btnInstall.Bind(wx.EVT_BUTTON, self.OnInstall)
+ self.btnHelp.Bind(wx.EVT_BUTTON, self.OnHelp)
self.tree.selectionChanged.connect(self.OnItemSelected)
self.tree.itemActivated.connect(self.OnItemActivated)
@@ -135,6 +139,8 @@
optionSizer.Add(item = self.options[key], proportion = 0)
btnSizer = wx.BoxSizer(wx.HORIZONTAL)
+ btnSizer.Add(item = self.btnHelp, proportion = 0)
+ btnSizer.AddStretchSpacer()
btnSizer.Add(item = self.btnClose, proportion = 0,
flag = wx.RIGHT, border = 5)
btnSizer.Add(item = self.btnInstall, proportion = 0)
@@ -148,7 +154,7 @@
sizer.Add(item = optionSizer, proportion = 0,
flag = wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.EXPAND, border = 3)
sizer.Add(item = btnSizer, proportion = 0,
- flag = wx.ALIGN_RIGHT | wx.ALL, border = 5)
+ flag = wx.ALIGN_RIGHT | wx.ALL | wx.EXPAND, border = 5)
self.panel.SetSizer(sizer)
sizer.Fit(self.panel)
@@ -210,8 +216,10 @@
globalvar.UpdateGRASSAddOnCommands()
toolboxesOutdated()
-
+ def OnHelp(self, event):
+ self._giface.Help(entry='g.extension')
+
def OnItemSelected(self, node):
"""!Item selected"""
data = node.data
More information about the grass-commit
mailing list