mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Change the sensitivity of Add price button
Enable the Add price button based on the number of rows selected as it does not make sense for it to be enabled with more than one row.
This commit is contained in:
@@ -80,6 +80,7 @@ typedef struct
|
||||
|
||||
GtkWidget * edit_button;
|
||||
GtkWidget * remove_button;
|
||||
GtkWidget * add_button;
|
||||
|
||||
GtkWidget *remove_dialog;
|
||||
GtkTreeView *remove_view;
|
||||
@@ -580,6 +581,8 @@ gnc_prices_dialog_selection_changed (GtkTreeSelection *treeselection,
|
||||
length == 1);
|
||||
gtk_widget_set_sensitive (pdb_dialog->remove_button,
|
||||
length >= 1);
|
||||
gtk_widget_set_sensitive (pdb_dialog->add_button,
|
||||
length <= 1);
|
||||
LEAVE("%d prices selected", length);
|
||||
}
|
||||
|
||||
@@ -708,6 +711,9 @@ gnc_prices_dialog_create (GtkWidget * parent, PricesDialog *pdb_dialog)
|
||||
button = GTK_WIDGET(gtk_builder_get_object (builder, "remove_button"));
|
||||
pdb_dialog->remove_button = button;
|
||||
|
||||
button = GTK_WIDGET(gtk_builder_get_object (builder, "add_button"));
|
||||
pdb_dialog->add_button = button;
|
||||
|
||||
if (!gnc_quote_source_fq_installed())
|
||||
{
|
||||
button = GTK_WIDGET(gtk_builder_get_object (builder, "get_quotes_button"));
|
||||
|
||||
Reference in New Issue
Block a user