Skip to content

Commit

Permalink
Fix display of help links in gramplet bars
Browse files Browse the repository at this point in the history
Use `display_help` rather than `display_url` to display manual
pages. The webpage and section need to be passed in separately
so that a translated url can be constructed.

Section headings in the translated manuals should include the
untranslated headings as invisible anchors.
  • Loading branch information
Nick-Hall committed Aug 29, 2023
1 parent cd6a068 commit 0977b09
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions gramps/gui/widgets/grampletbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
from gramps.gen.const import GRAMPS_LOCALE as glocale

_ = glocale.translation.gettext
from gramps.gen.const import URL_MANUAL_PAGE, URL_WIKISTRING, VERSION_DIR
from gramps.gen.const import URL_MANUAL_PAGE, VERSION_DIR
from gramps.gen.config import config
from gramps.gen.constfunc import win
from gramps.gen.utils.configmanager import clean_up
Expand All @@ -81,13 +81,8 @@
# Constants
#
# -------------------------------------------------------------------------
WIKI_HELP_PAGE = URL_WIKISTRING + URL_MANUAL_PAGE + "_-_Gramplets"
WIKI_HELP_GRAMPLETBAR = (
URL_WIKISTRING + URL_MANUAL_PAGE + "_-_Main_Window#Bottombar_and_Sidebar"
)
WIKI_HELP_ABOUT_GRAMPLETS = (
URL_WIKISTRING + URL_MANUAL_PAGE + "_-_Gramplets#What_is_a_Gramplet.3F"
)
WIKI_HELP_PAGE = URL_MANUAL_PAGE + "_-_Gramplets"
MAIN_HELP_PAGE = URL_MANUAL_PAGE + "_-_Main_Window"
NL = "\n"


Expand Down Expand Up @@ -642,11 +637,11 @@ def gramplet_panel(configdialog):

def on_help_grampletbar_clicked(self, dummy):
"""Button: Display the relevant portion of Gramps manual"""
display_url(WIKI_HELP_GRAMPLETBAR)
display_help(MAIN_HELP_PAGE, "Bottombar_and_Sidebar")

def on_help_gramplets_clicked(self, dummy):
"""Button: Display the relevant portion of Gramps manual"""
display_url(WIKI_HELP_ABOUT_GRAMPLETS)
display_help(WIKI_HELP_PAGE, "What_is_a_Gramplet?")


# -------------------------------------------------------------------------
Expand Down

0 comments on commit 0977b09

Please sign in to comment.