Added code to use gramplet.help_url which shows help for gramplet

svn: r13505
This commit is contained in:
Doug Blank 2009-11-06 04:42:56 +00:00
parent 1605254b2d
commit 9c335c802b

View File

@ -95,6 +95,7 @@ def GET_AVAILABLE_GRAMPLETS(name):
"column": -1, "column": -1,
"row": -1, "row": -1,
"data": [], "data": [],
"help_url": gplug.help_url,
} }
return None return None
@ -236,6 +237,12 @@ class GrampletWindow(ManagedWindow.ManagedWindow):
self.close() self.close()
elif response == gtk.RESPONSE_HELP: elif response == gtk.RESPONSE_HELP:
# translated name: # translated name:
if self.gramplet.help_url:
if self.gramplet.help_url.startswith("http://"):
GrampsDisplay.url(self.gramplet.help_url)
else:
GrampsDisplay.help(self.gramplet.help_url)
else:
GrampsDisplay.help(WIKI_HELP_PAGE, GrampsDisplay.help(WIKI_HELP_PAGE,
self.gramplet.tname.replace(" ", "_")) self.gramplet.tname.replace(" ", "_"))
@ -308,6 +315,7 @@ class GuiGramplet(object):
self.row = int(kwargs.get("row", -1)) self.row = int(kwargs.get("row", -1))
self.state = kwargs.get("state", "maximized") self.state = kwargs.get("state", "maximized")
self.data = kwargs.get("data", []) self.data = kwargs.get("data", [])
self.help_url = kwargs.get("help_url", None)
########## ##########
self.use_markup = False self.use_markup = False
self.pui = None # user code self.pui = None # user code