cd9a709
--- cheese-2.27.90/src/cheese-window.c	2009-08-10 16:03:17.000000000 -0400
cd9a709
+++ hacked/src/cheese-window.c	2009-08-22 03:32:26.482193815 -0400
cd9a709
@@ -172,6 +172,7 @@
cd9a709
   GtkActionGroup *actions_burst;
cd9a709
   GtkActionGroup *actions_fullscreen;
cd9a709
   GtkActionGroup *actions_wide_mode;
cd9a709
+  GtkActionGroup *actions_trash;
cd9a709
 
cd9a709
   GtkUIManager *ui_manager;
cd9a709
 
cd9a709
@@ -559,6 +560,7 @@
cd9a709
 {
cd9a709
   g_object_unref (cheese_window->webcam);
cd9a709
   g_object_unref (cheese_window->actions_main);
cd9a709
+  g_object_unref (cheese_window->actions_trash);
cd9a709
   g_object_unref (cheese_window->actions_account_photo);
cd9a709
   g_object_unref (cheese_window->actions_countdown);
cd9a709
   g_object_unref (cheese_window->actions_effects);
cd9a709
@@ -1182,6 +1184,39 @@
cd9a709
   }
cd9a709
 }
cd9a709
 
cd9a709
+static void
cd9a709
+cheese_window_thumbnails_changed (GtkTreeModel *model,
cd9a709
+                                  CheeseWindow *cheese_window)
cd9a709
+{
cd9a709
+  GtkTreeIter iter;
cd9a709
+
cd9a709
+  if (gtk_tree_model_get_iter_first (model, &iter))
cd9a709
+  {
cd9a709
+    gtk_action_group_set_sensitive (cheese_window->actions_trash, TRUE);
cd9a709
+  }
cd9a709
+  else
cd9a709
+  {
cd9a709
+    gtk_action_group_set_sensitive (cheese_window->actions_trash, FALSE);
cd9a709
+  }
cd9a709
+}
cd9a709
+
cd9a709
+static void
cd9a709
+cheese_window_thumbnail_inserted (GtkTreeModel *model,
cd9a709
+                                  GtkTreePath  *path,
cd9a709
+                                  GtkTreeIter  *iter,
cd9a709
+                                  CheeseWindow *cheese_window)
cd9a709
+{
cd9a709
+  cheese_window_thumbnails_changed (model, cheese_window);
cd9a709
+}
cd9a709
+
cd9a709
+static void
cd9a709
+cheese_window_thumbnail_deleted (GtkTreeModel *model,
cd9a709
+                                 GtkTreePath  *path,
cd9a709
+                                 CheeseWindow *cheese_window)
cd9a709
+{
cd9a709
+  cheese_window_thumbnails_changed (model, cheese_window);
cd9a709
+}
cd9a709
+
cd9a709
 static gboolean
cd9a709
 cheese_window_button_press_event_cb (GtkWidget *iconview, GdkEventButton *event,
cd9a709
                                      CheeseWindow *cheese_window)
cd9a709
@@ -1549,8 +1584,6 @@
cd9a709
   {"Cheese",       NULL,            N_("_Cheese")                       },
cd9a709
 
cd9a709
   {"Edit",         NULL,            N_("_Edit")                         },
cd9a709
-  {"RemoveAll",    NULL,            N_("Move All to Trash"), NULL, NULL,
cd9a709
-   G_CALLBACK (cheese_window_move_all_media_to_trash)},
cd9a709
 
cd9a709
   {"Help",         NULL,            N_("_Help")                         },
cd9a709
 
cd9a709
@@ -1560,6 +1593,11 @@
cd9a709
   {"About",        GTK_STOCK_ABOUT, NULL, NULL, NULL, G_CALLBACK (cheese_window_cmd_about)},
cd9a709
 };
cd9a709
 
cd9a709
+static const GtkActionEntry action_entries_trash[] = {
cd9a709
+  {"RemoveAll",    NULL,            N_("Move All to Trash"), NULL, NULL,
cd9a709
+   G_CALLBACK (cheese_window_move_all_media_to_trash)},
cd9a709
+};
cd9a709
+
cd9a709
 static const GtkToggleActionEntry action_entries_countdown[] = {
cd9a709
   {"Countdown", NULL, N_("Countdown"), NULL, NULL, G_CALLBACK (cheese_window_set_countdown), FALSE},
cd9a709
 };
cd9a709
@@ -1878,6 +1943,10 @@
cd9a709
                                                                 "ActionsMain",
cd9a709
                                                                 action_entries_main,
cd9a709
                                                                 G_N_ELEMENTS (action_entries_main));
cd9a709
+  cheese_window->actions_trash = cheese_window_action_group_new (cheese_window,
cd9a709
+                                                                 "ActionsTrash",
cd9a709
+                                                                 action_entries_trash,
cd9a709
+                                                                 G_N_ELEMENTS (action_entries_trash));
cd9a709
   cheese_window->actions_toggle = cheese_window_radio_action_group_new (cheese_window,
cd9a709
                                                                         "ActionsRadio",
cd9a709
                                                                         action_entries_toggle,
cd9a709
@@ -2041,6 +2110,13 @@
cd9a709
                     G_CALLBACK (cheese_window_selection_changed_cb), cheese_window);
cd9a709
   g_signal_connect (cheese_window->thumb_view, "button_press_event",
cd9a709
                     G_CALLBACK (cheese_window_button_press_event_cb), cheese_window);
cd9a709
+
cd9a709
+  g_signal_connect (gtk_icon_view_get_model (GTK_ICON_VIEW (cheese_window->thumb_view)), "row-inserted",
cd9a709
+                    G_CALLBACK (cheese_window_thumbnail_inserted), cheese_window);
cd9a709
+  g_signal_connect (gtk_icon_view_get_model (GTK_ICON_VIEW (cheese_window->thumb_view)), "row-deleted",
cd9a709
+                    G_CALLBACK (cheese_window_thumbnail_deleted), cheese_window);
cd9a709
+
cd9a709
+  cheese_window_thumbnails_changed (gtk_icon_view_get_model (GTK_ICON_VIEW (cheese_window->thumb_view)), cheese_window);
cd9a709
 }
cd9a709
 
cd9a709
 void