Commit e83937f1 authored by Morten Welinder's avatar Morten Welinder Committed by Morten Welinder
Browse files

Return a value indicating whether the current entry is valid.

2006-01-01  Morten Welinder  <terra@gnome.org>

	* dialog-solver.c (dialog_set_sec_button_sensitivity): Return a
	value indicating whether the current entry is valid.
	(cb_dialog_add_clicked): If entry is not valid, do nothing.  Fixes
	#324585.
parent 0b65910c
......@@ -17,6 +17,7 @@ Morten:
* Fix a pile of leaks in solver and scenario saving and loading.
* Fix leaks in solver dialog.
* Fix parser leak. [#301127]
* Fix solver dialog crash. [#324585]
Nick Lamb:
* Fix CONVERT crash. [#323678]
......
2006-01-01 Morten Welinder <terra@gnome.org>
* dialog-solver.c (dialog_set_sec_button_sensitivity): Return a
value indicating whether the current entry is valid.
(cb_dialog_add_clicked): If entry is not valid, do nothing. Fixes
#324585.
2005-12-13 Morten Welinder <terra@gnome.org>
* dialog-solver.c (check_int_constraints): Plug leak.
......
......@@ -177,7 +177,7 @@ is_hom_row_or_col_ref (GnmExprEntry *entry_1, GnmExprEntry *entry_2,
return res;
}
static void
static gboolean
dialog_set_sec_button_sensitivity (G_GNUC_UNUSED GtkWidget *dummy,
SolverState *state)
{
......@@ -197,6 +197,9 @@ dialog_set_sec_button_sensitivity (G_GNUC_UNUSED GtkWidget *dummy,
gtk_widget_set_sensitive (state->add_button, ready);
gtk_widget_set_sensitive (state->change_button, select_ready && ready);
gtk_widget_set_sensitive (state->delete_button, select_ready);
/* Return TRUE iff the current constraint is valid. */
return ready;
}
static void
......@@ -318,10 +321,13 @@ constraint_fill_row (SolverState *state, GtkListStore *store, GtkTreeIter *iter)
static void
cb_dialog_add_clicked (SolverState *state)
{
GtkTreeIter iter;
GtkListStore *store = GTK_LIST_STORE (gtk_tree_view_get_model (state->constraint_list));
gtk_list_store_append (store, &iter);
constraint_fill_row (state, store, &iter);
if (dialog_set_sec_button_sensitivity (NULL, state)) {
GtkTreeIter iter;
GtkListStore *store = GTK_LIST_STORE (gtk_tree_view_get_model (state->constraint_list));
gtk_list_store_append (store, &iter);
constraint_fill_row (state, store, &iter);
}
}
static void
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment