Skip to content

Commit

Permalink
Change the way the help button is setup for dialog-commodity
Browse files Browse the repository at this point in the history
  • Loading branch information
Bob-IT committed Dec 10, 2020
1 parent 2c82ad5 commit 66cdce8
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 38 deletions.
22 changes: 1 addition & 21 deletions gnucash/gnome-utils/dialog-commodity.c
Expand Up @@ -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,
Expand All @@ -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()
********************************************************************/
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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"));
Expand Down Expand Up @@ -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);
Expand Down
10 changes: 0 additions & 10 deletions gnucash/gnome-utils/dialog-commodity.h
Expand Up @@ -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 */
/** @{ */
Expand Down
7 changes: 0 additions & 7 deletions gnucash/gnome-utils/gnc-gnome-utils.c
Expand Up @@ -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
*
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 66cdce8

Please sign in to comment.