From 4b5202f55dcf0f0928bb47abde65c4d90fbbd7c2 Mon Sep 17 00:00:00 2001 From: Robert Fewell <14uBobIT@gmail.com> Date: Fri, 6 Nov 2020 13:14:31 +0000 Subject: [PATCH] Bug 688917 - Edit style sheet help button not working Setup the connection between the help button and the edit style sheet section in the help. --- gnucash/gnome-utils/gnc-gnome-utils.c | 14 ++++++++++++++ gnucash/gnome-utils/gnc-gnome-utils.h | 5 +++++ gnucash/gnome-utils/gnc-ui.h | 1 + gnucash/gnome/dialog-report-style-sheet.c | 4 ++++ 4 files changed, 24 insertions(+) diff --git a/gnucash/gnome-utils/gnc-gnome-utils.c b/gnucash/gnome-utils/gnc-gnome-utils.c index c2c186b32c..b750a011fa 100644 --- a/gnucash/gnome-utils/gnc-gnome-utils.c +++ b/gnucash/gnome-utils/gnc-gnome-utils.c @@ -130,6 +130,20 @@ gnc_options_dialog_set_new_book_option_values (GNCOptionDB *odb) } } +static void +gnc_style_sheet_options_help_cb (GNCOptionWin *win, gpointer dat) +{ + gnc_gnome_help (HF_HELP, HL_STYLE_SHEET); +} + +void +gnc_options_dialog_set_style_sheet_options_help_cb (GNCOptionWin *win) +{ + gnc_options_dialog_set_help_cb (win, + (GNCOptionWinCallback)gnc_style_sheet_options_help_cb, + NULL); +} + static void gnc_commodity_help_cb (void) { diff --git a/gnucash/gnome-utils/gnc-gnome-utils.h b/gnucash/gnome-utils/gnc-gnome-utils.h index 721b3ff6b3..6c10f991d1 100644 --- a/gnucash/gnome-utils/gnc-gnome-utils.h +++ b/gnucash/gnome-utils/gnc-gnome-utils.h @@ -73,6 +73,11 @@ void gnc_options_dialog_set_book_options_help_cb (GNCOptionWin *win); */ void gnc_options_dialog_set_new_book_option_values (GNCOptionDB *odb); +/** Set the help callback to 'gnc_style_sheet_options_help_cb' to open a help browser + * and point it to the Style Sheet link in the Help file. + */ +void gnc_options_dialog_set_style_sheet_options_help_cb (GNCOptionWin *win); + /** Given a file name, find and load the requested pixmap. This * routine will display an error message if it can't find the file or * load the pixmap. diff --git a/gnucash/gnome-utils/gnc-ui.h b/gnucash/gnome-utils/gnc-ui.h index fb102c654b..c8263abacf 100644 --- a/gnucash/gnome-utils/gnc-ui.h +++ b/gnucash/gnome-utils/gnc-ui.h @@ -68,6 +68,7 @@ #define HL_RECNWIN "acct-reconcile" #define HL_SXEDITOR "trans-sched" #define HL_BOOK_OPTIONS "book-options" +#define HL_STYLE_SHEET "change-style" #define HL_CLOSE_BOOK "tool-close-book" #define HL_USAGE_CUSTOMREP "report-saving" #define HL_IMPORT_BC "busnss-imp-bills-invoices" diff --git a/gnucash/gnome/dialog-report-style-sheet.c b/gnucash/gnome/dialog-report-style-sheet.c index 52de56c767..1df072a859 100644 --- a/gnucash/gnome/dialog-report-style-sheet.c +++ b/gnucash/gnome/dialog-report-style-sheet.c @@ -33,6 +33,7 @@ #include "gnc-component-manager.h" #include "gnc-session.h" #include "gnc-gtk-utils.h" +#include "gnc-gnome-utils.h" #include "gnc-guile-utils.h" #include "gnc-report.h" #include "gnc-ui.h" @@ -180,6 +181,9 @@ gnc_style_sheet_dialog_create (StyleSheetDialog * ss, gnc_options_dialog_build_contents (ssinfo->odialog, ssinfo->odb); + + gnc_options_dialog_set_style_sheet_options_help_cb (ssinfo->odialog); + gnc_options_dialog_set_apply_cb (ssinfo->odialog, gnc_style_sheet_options_apply_cb, ssinfo);