Pedigree View - Add Help context menu (#938)

* Add [About Pedigree View]

Fixes #10919
This commit is contained in:
Sam Manzi 2020-01-10 05:15:10 +11:00 committed by Paul Culley
parent 0264dbbe43
commit 539a443639

View File

@ -51,6 +51,7 @@ import cairo
from gramps.gen.lib import ChildRef, ChildRefType, Family
from gramps.gui.views.navigationview import NavigationView
from gramps.gui.editors import FilterEditor
from gramps.gui.display import display_url
from gramps.gen.display.name import displayer as name_displayer
from gramps.gen.utils.alive import probably_alive
from gramps.gen.utils.file import media_path_full
@ -62,7 +63,7 @@ from gramps.gui.editors import EditPerson, EditFamily
from gramps.gui.ddtargets import DdTargets
from gramps.gen.config import config
from gramps.gui.views.bookmarks import PersonBookmarks
from gramps.gen.const import CUSTOM_FILTERS
from gramps.gen.const import CUSTOM_FILTERS, URL_MANUAL_PAGE, URL_WIKISTRING
from gramps.gui.dialog import RunDatabaseRepair, ErrorDialog
from gramps.gui.utils import color_graph_box, hex_to_rgb_float, is_right_click
from gramps.gen.constfunc import lin
@ -75,7 +76,7 @@ from gramps.gen.utils.symbols import Symbols
# Constants
#
#-------------------------------------------------------------------------
WIKI_PAGE = URL_WIKISTRING + URL_MANUAL_PAGE + '_-_Categories#Pedigree_View'
_PERSON = "p"
_BORN = _('short for born|b.')
_DIED = _('short for died|d.')
@ -824,6 +825,10 @@ class PedigreeView(NavigationView):
self._config.save()
NavigationView.on_delete(self)
def on_help_clicked(self, dummy):
""" Button: Display the relevant portion of Gramps manual"""
display_url(WIKI_PAGE)
def goto_handle(self, handle=None):
"""
Rebuild the tree with the given person handle as the root.
@ -1695,6 +1700,18 @@ class PedigreeView(NavigationView):
item.show()
menu.append(item)
# Separator.
item = Gtk.SeparatorMenuItem()
item.show()
menu.append(item)
# Help menu entry
menu.append(item)
item = Gtk.MenuItem(label=_("About Pedigree View"))
item.connect("activate", self.on_help_clicked)
item.show()
menu.append(item)
def cb_build_missing_parent_nav_menu(self, obj, event,
person_handle, family_handle):
"""Builds the menu for a missing parent."""