Skip to content

Commit

Permalink
Bug 554391 - Add Apply button to Tax Options dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
Bob-IT committed Sep 24, 2020
1 parent 95b502e commit 227bbda
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
9 changes: 7 additions & 2 deletions gnucash/gnome/dialog-tax-info.c
Expand Up @@ -109,6 +109,7 @@ typedef struct
GtkWidget * account_treeview;
GtkWidget * select_button;
GtkWidget * num_acct_label;
GtkWidget * apply_button;

GtkWidget * txf_info;
GtkWidget * tax_related_button;
Expand Down Expand Up @@ -226,6 +227,7 @@ static void
gnc_tax_info_set_changed (TaxInfoDialog *ti_dialog, gboolean changed)
{
ti_dialog->changed = changed;
gtk_widget_set_sensitive (ti_dialog->apply_button, changed);
}

static GList *
Expand Down Expand Up @@ -811,10 +813,11 @@ gnc_tax_info_dialog_response (GtkDialog *dialog, gint response, gpointer data)
{
TaxInfoDialog *ti_dialog = data;

if (response == GTK_RESPONSE_OK && ti_dialog->changed)
if (ti_dialog->changed && (response == GTK_RESPONSE_APPLY || response == GTK_RESPONSE_OK))
gui_to_accounts (ti_dialog);

gnc_close_gui_component_by_data (DIALOG_TAX_INFO_CM_CLASS, ti_dialog);
if (response != GTK_RESPONSE_APPLY)
gnc_close_gui_component_by_data (DIALOG_TAX_INFO_CM_CLASS, ti_dialog);
}

static void
Expand Down Expand Up @@ -1383,6 +1386,8 @@ gnc_tax_info_dialog_create (GtkWidget * parent, TaxInfoDialog *ti_dialog)
label = GTK_WIDGET(gtk_builder_get_object (builder, "txf_category_label"));
gtk_label_set_mnemonic_widget(GTK_LABEL(label), GTK_WIDGET(tree_view));

ti_dialog->apply_button = GTK_WIDGET(gtk_builder_get_object (builder, "apply_button"));

button = GTK_WIDGET(gtk_builder_get_object (builder, "current_account_button"));
ti_dialog->current_account_button = button;

Expand Down
18 changes: 17 additions & 1 deletion gnucash/gtkbuilder/dialog-tax-info.glade
Expand Up @@ -38,6 +38,21 @@
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="apply_button">
<property name="label" translatable="yes">_Apply</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="ok_button">
<property name="label" translatable="yes">_OK</property>
Expand All @@ -50,7 +65,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
<property name="position">2</property>
</packing>
</child>
</object>
Expand Down Expand Up @@ -712,6 +727,7 @@
</child>
<action-widgets>
<action-widget response="-6">cancel_button</action-widget>
<action-widget response="-10">apply_button</action-widget>
<action-widget response="-5">ok_button</action-widget>
</action-widgets>
<child type="titlebar">
Expand Down

0 comments on commit 227bbda

Please sign in to comment.