From fccf1d4520ee7a389c29a4e718f46c2aae0b8628 Mon Sep 17 00:00:00 2001 From: Brandon Lewis Date: Thu, 22 Jul 2010 12:51:07 +0200 Subject: [PATCH] disable delete during playback --- tests/examples/ges-ui.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/examples/ges-ui.c b/tests/examples/ges-ui.c index 5c3822663f..34fc58ccdc 100644 --- a/tests/examples/ges-ui.c +++ b/tests/examples/ges-ui.c @@ -90,6 +90,14 @@ update_properties_sensitivity (App * app) (app->n_selected == 1) && (app->state != GST_STATE_PLAYING)); } +static void +update_delete_sensitivity (App * app) +{ + /* delete will work for multiple items */ + gtk_action_set_sensitive (app->delete, + (app->n_selected > 0) && (app->state != GST_STATE_PLAYING)); +} + /* UI callbacks ************************************************************/ void @@ -136,9 +144,7 @@ app_selection_changed_cb (GtkTreeSelection * selection, App * app) /* doesn't make sense to set properties on more than one item */ update_properties_sensitivity (app); - - /* delete will work for multiple items */ - gtk_action_set_sensitive (app->delete, app->n_selected > 0); + update_delete_sensitivity (app); } gboolean @@ -450,6 +456,7 @@ pipeline_state_changed_cb (App * app) gtk_action_set_stock_id (app->play, GTK_STOCK_MEDIA_PLAY); update_properties_sensitivity (app); + update_delete_sensitivity (app); } static void