allow multiple selections

This commit is contained in:
Brandon Lewis 2010-08-03 15:40:44 +02:00 committed by Edward Hervey
parent b05e5534df
commit f519e156e8

View file

@ -466,9 +466,13 @@ app_update_selection (App * app)
type = G_TYPE_NONE;
if (app->selected_objects) {
/* TODO: when we allow multiple selections, only set this if all values
* are the same */
type = G_TYPE_FROM_INSTANCE (app->selected_objects->data);
for (cur = app->selected_objects; cur; cur = cur->next) {
if (type != G_TYPE_FROM_INSTANCE (cur->data)) {
type = G_TYPE_NONE;
break;
}
}
}
app->selected_type = type;
}
@ -1003,6 +1007,8 @@ create_ui (App * app)
if (!(app->selection = gtk_tree_view_get_selection (timeline)))
goto fail;
gtk_tree_selection_set_mode (app->selection, GTK_SELECTION_MULTIPLE);
g_signal_connect (app->selection, "changed",
G_CALLBACK (app_selection_changed_cb), app);