Change the way the help button is setup for dialog-commodity

This commit is contained in:
Robert Fewell 2020-11-24 16:29:55 +00:00
parent 2c82ad5f78
commit 66cdce8d51
3 changed files with 1 additions and 38 deletions

View File

@ -106,9 +106,6 @@ struct commodity_window
typedef struct select_commodity_window SelectCommodityWindow;
typedef struct commodity_window CommodityWindow;
static gnc_commodity_help_callback help_callback = NULL;
/* The commodity selection window */
static SelectCommodityWindow *
gnc_ui_select_commodity_create(const gnc_commodity * orig_sel,
@ -129,17 +126,6 @@ gboolean gnc_ui_commodity_dialog_to_object(CommodityWindow * w);
static void gnc_ui_select_commodity_response_cb (GtkDialog * dialog, gint response, gpointer data);
#endif
/********************************************************************
* gnc_ui_commodity_set_help_callback
********************************************************************/
void
gnc_ui_commodity_set_help_callback (gnc_commodity_help_callback cb)
{
help_callback = cb;
}
/********************************************************************
* gnc_ui_select_commodity_modal_full()
********************************************************************/
@ -890,7 +876,6 @@ gnc_ui_build_commodity_dialog(const char * selected_namespace,
gboolean edit)
{
CommodityWindow * retval = g_new0(CommodityWindow, 1);
GtkWidget *help_button;
GtkWidget *box;
GtkWidget *menu;
GtkWidget *widget, *sec_label;
@ -920,10 +905,6 @@ gnc_ui_build_commodity_dialog(const char * selected_namespace,
retval->edit_commodity = NULL;
help_button = GTK_WIDGET(gtk_builder_get_object (builder, "help_button"));
if (!help_callback)
gtk_widget_hide (help_button);
/* Get widget pointers */
retval->fullname_entry = GTK_WIDGET(gtk_builder_get_object (builder, "fullname_entry"));
retval->mnemonic_entry = GTK_WIDGET(gtk_builder_get_object (builder, "mnemonic_entry"));
@ -1158,8 +1139,7 @@ gnc_ui_common_commodity_modal(gnc_commodity *commodity,
break;
case GTK_RESPONSE_HELP:
DEBUG("case HELP");
if (help_callback)
help_callback ();
gnc_gnome_help (GTK_WINDOW(win->dialog), HF_HELP, HL_COMMODITY);
break;
default: /* Cancel, Escape, Close, etc. */
DEBUG("default: %d", value);

View File

@ -57,16 +57,6 @@ typedef enum
anything. */
} dialog_commodity_mode;
typedef void (* gnc_commodity_help_callback)(void);
/** This function is used to set the action routine for the help
* button in the commodity dialog windows. If the action routine is
* unset, the help button will not be visible to the user.
*
* @param cb The function to be called when the user clicks the help
* button. */
void gnc_ui_commodity_set_help_callback (gnc_commodity_help_callback cb);
/** @name Commodity Selection */
/** @{ */

View File

@ -144,12 +144,6 @@ gnc_options_dialog_set_style_sheet_options_help_cb (GNCOptionWin *win)
NULL);
}
static void
gnc_commodity_help_cb (void)
{
gnc_gnome_help (NULL, HF_HELP, HL_COMMODITY);
}
/* gnc_configure_date_format
* sets dateFormat to the current value on the scheme side
*
@ -773,7 +767,6 @@ gnc_gui_init(void)
gnc_gui_refresh_all,
NULL);
gnc_ui_commodity_set_help_callback (gnc_commodity_help_cb);
gnc_file_set_shutdown_callback (gnc_shutdown);
gnc_options_dialog_set_global_help_cb (gnc_global_options_help_cb, NULL);