Commit 5107cd92 authored by Andreas J. Guelzow's avatar Andreas J. Guelzow Committed by Andreas J. Guelzow
Browse files

handle delete button (cb_delete_clicked) : new (dialog_init) : connect

2002-02-06  Andreas J. Guelzow <aguelzow@taliesin.ca>

	* dialog-cell-sort.c (cb_sort_selection_changed) : handle delete
	  button
	(cb_delete_clicked) : new
	(dialog_init) : connect cb_delete_clicked to button
parent 1554ed07
2002-02-06 Andreas J. Guelzow <aguelzow@taliesin.ca>
* dialog-cell-sort.c (cb_sort_selection_changed) : handle delete
button
(cb_delete_clicked) : new
(dialog_init) : connect cb_delete_clicked to button
2002-02-05 Andreas J. Guelzow <aguelzow@taliesin.ca>
* goalseek.glade : remove hbox from active-area
* cell-sort.glade : add add and delete buttons (currently
inactive)
* dialog-cell-sort.c : add add and delete buttons (currently
inactive), set initial top-bottom vs left-right depending on
shape of initial selection, add only MAX_INITIAL_CLAUSES to the
list of available clauses (to avoid adding 65000+ if a complete
column is selected).
2002-02-05 Jon K Hellan <hellan@acm.org>
* dialog-cell-format.c (border_get_mstyle): Use style_color_new_i8.
......
......@@ -41,7 +41,9 @@ dialog_about (WorkbookControlGUI *wbcg)
* with 'Eacute' (U00C9) */
N_("Gergo Erdi, Gnumeric hacker."),
N_("John Gotts, rpm packaging."),
N_("Andreas J. Guelzow, statistics stuff."),
/* if your charset allows it, replace the 'ue' of 'Guelzow'
* with 'uumlaut' */
N_("Andreas J. Guelzow, Gnumeric hacker."),
N_("Jon K. Hellan, Gnumeric hacker."),
N_("Ross Ihaka, special functions."),
N_("Jukka-Pekka Iivonen, numerous functions and tools."),
......
......@@ -422,6 +422,7 @@ cb_sort_selection_changed (GtkTreeSelection *ignored, SortFlowState *state)
if (!gtk_tree_selection_get_selected (state->selection, NULL, &iter)) {
gtk_widget_set_sensitive (state->up_button, FALSE);
gtk_widget_set_sensitive (state->down_button, FALSE);
gtk_widget_set_sensitive (state->delete_button, FALSE);
return;
}
......@@ -432,7 +433,7 @@ cb_sort_selection_changed (GtkTreeSelection *ignored, SortFlowState *state)
gtk_widget_set_sensitive (state->down_button,
gtk_tree_model_iter_nth_child (GTK_TREE_MODEL (state->model),
&this_iter, NULL, row+1));
gtk_widget_set_sensitive (state->delete_button, FALSE);
gtk_widget_set_sensitive (state->delete_button, TRUE);
}
static void
......@@ -497,6 +498,23 @@ move_cb (SortFlowState *state, gint direction)
static void cb_up (GtkWidget *w, SortFlowState *state) { move_cb (state, -1); }
static void cb_down (GtkWidget *w, SortFlowState *state) { move_cb (state, 1); }
static void cb_delete_clicked (GtkWidget *w, SortFlowState *state)
{
GtkTreeIter iter;
gboolean in_use;
if (!gtk_tree_selection_get_selected (state->selection, NULL, &iter))
return;
gtk_tree_model_get (GTK_TREE_MODEL (state->model), &iter,
ITEM_IN_USE, &in_use,
-1);
if (in_use)
state->sort_items -= 1;
gtk_list_store_remove (state->model, &iter);
if (state->sort_items == 0 || state->sort_items == 1)
cb_update_sensitivity (NULL, state);
}
static void
cb_toggled_in_use (GtkCellRendererToggle *cell,
......@@ -628,6 +646,8 @@ dialog_init (SortFlowState *state)
"active", ITEM_SORT_BY_VALUE, NULL);
gtk_tree_view_append_column (state->treeview, column);
gtk_tree_view_set_reorderable (state->treeview,TRUE);
gtk_container_add (GTK_CONTAINER (scrolled), GTK_WIDGET (state->treeview));
gtk_widget_show (GTK_WIDGET (state->treeview));
......@@ -655,6 +675,9 @@ dialog_init (SortFlowState *state)
state->add_button = glade_xml_get_widget (state->gui, "add_button");
gtk_widget_set_sensitive (state->add_button, FALSE);
state->delete_button = glade_xml_get_widget (state->gui, "delete_button");
gtk_signal_connect (GTK_OBJECT (state->delete_button),
"clicked",
GTK_SIGNAL_FUNC (cb_delete_clicked), state);
gtk_widget_set_sensitive (state->delete_button, FALSE);
state->help_button = glade_xml_get_widget (state->gui, "help_button");
......
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