Skip to content

Commit

Permalink
Add help button to plugin selection dialogs
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick-Hall committed Feb 1, 2025
1 parent fce30f2 commit d8949f4
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
21 changes: 19 additions & 2 deletions gramps/gui/glade/plugins.glade
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,21 @@
<property name="can-focus">False</property>
<property name="spacing">6</property>
<property name="layout-style">end</property>
<child>
<object class="GtkButton" id="help">
<property name="label" translatable="yes">_Help</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="use-underline">True</property>
<signal name="clicked" handler="on_report_help_clicked" object="report" swapped="yes"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button108">
<property name="label" translatable="yes">_Close</property>
Expand All @@ -30,7 +45,8 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
<property name="pack-type">end</property>
<property name="position">1</property>
</packing>
</child>
<child>
Expand All @@ -51,7 +67,8 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
<property name="pack-type">end</property>
<property name="position">2</property>
</packing>
</child>
</object>
Expand Down
9 changes: 9 additions & 0 deletions gramps/gui/plug/_dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
from .report import report
from ..pluginmanager import GuiPluginManager
from ..managedwindow import ManagedWindow
from ..display import display_help

# -------------------------------------------------------------------------
#
Expand Down Expand Up @@ -105,6 +106,7 @@ def __init__(
self.dialog.connect_signals(
{
"on_report_apply_clicked": self.on_apply_clicked,
"on_report_help_clicked": self.on_help_clicked,
"destroy_passed_object": self.close,
"on_delete_event": self.close,
}
Expand Down Expand Up @@ -170,6 +172,13 @@ def on_apply_clicked(self, obj):
return
self.run_plugin(self.item)

def on_help_clicked(self, obj):
"""Display help page for the selected report"""
if not self.item:
return
if self.item.help_url:
display_help(self.item.help_url)

def on_node_selected(self, obj):
"""Updates the informational display on the right hand side of
the dialog box with the description of the selected report"""
Expand Down

0 comments on commit d8949f4

Please sign in to comment.