Commit 9dda8327 authored by Maurits Rijk's avatar Maurits Rijk Committed by Maurits Rijk

don't use gtk_tree_selection_get_selected with GTK_SELECTION_MULTIPLE.

2004-12-14  Maurits Rijk  <m.rijk@chello.nl>

	* plug-ins/imagemap/imap_selection.c: don't use
	gtk_tree_selection_get_selected with GTK_SELECTION_MULTIPLE. Should
	finally fix bug #149157.
parent c8d553c8
2004-12-14 Maurits Rijk <m.rijk@chello.nl>
* plug-ins/imagemap/imap_selection.c: don't use
gtk_tree_selection_get_selected with GTK_SELECTION_MULTIPLE. Should
finally fix bug #149157.
2004-12-14 Sven Neumann <sven@gimp.org>
* libgimpwidgets/gimpstock.c (gimp_stock_init): documented.
......
......@@ -40,10 +40,7 @@
static void
set_buttons(Selection_t *data)
{
GtkTreeIter iter;
GtkTreeModel *model;
if (gtk_tree_selection_get_selected (data->selection, &model, &iter)) {
if (gtk_tree_selection_count_selected_rows (data->selection)) {
#ifdef _OLD_
gtk_widget_set_sensitive(data->arrow_up,
(data->selected_row) ? TRUE : FALSE);
......@@ -70,42 +67,37 @@ changed_cb(GtkTreeSelection *selection, gpointer param)
if (data->select_lock) {
data->select_lock = FALSE;
} else {
gint count = gtk_tree_selection_count_selected_rows (selection);
Object_t *obj;
GtkTreeIter iter;
Command_t *command, *sub_command;
GtkTreeModel *model;
Command_t *command;
if (count == 0)
return;
if (count == 1) {
gtk_tree_selection_get_selected (selection, &model, &iter);
gtk_tree_model_get (GTK_TREE_MODEL(data->store), &iter, 0, &obj, -1);
if (obj->selected) {
gtk_tree_selection_unselect_iter (selection, &iter);
command = unselect_command_new (obj);
} else {
Command_t *sub_command;
gtk_tree_selection_get_selected (selection, &model, &iter);
gtk_tree_model_get (GTK_TREE_MODEL(data->store), &iter, 0, &obj, -1);
GList *list = gtk_tree_selection_get_selected_rows (selection, &model);
command = subcommand_start (NULL);
sub_command = unselect_all_command_new (data->object_list, NULL);
command_add_subcommand (command, sub_command);
for (; list; list = list->next)
{
Object_t *obj;
GtkTreeIter iter;
GtkTreePath *path = (GtkTreePath*) list->data;
gtk_tree_model_get_iter (model, &iter, path);
gtk_tree_model_get (model, &iter, 0, &obj, -1);
sub_command = select_command_new (obj);
command_add_subcommand (command, sub_command);
}
command_set_name (command, sub_command->name);
subcommand_end ();
}
} else {
command = select_command_new (obj);
}
command_execute (command);
}
g_list_foreach (list, (GFunc) gtk_tree_path_free, NULL);
g_list_free (list);
set_buttons (data);
}
}
static gboolean
......@@ -275,6 +267,7 @@ object_selected_cb(Object_t *obj, gpointer data)
Selection_t *selection = (Selection_t*) data;
gint position = object_get_position_in_list (obj);
selection_set_selected (selection, position);
set_buttons(selection);
}
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