[gnome-photos] Cleanup widget_sensitive -> disable action for delete.



commit 4df2d494a27d0723dbc25b0ebfbccfad1e1bd516
Author: Rafael Fonseca <r4f4rfs gmail com>
Date:   Wed Jan 27 22:50:53 2016 +0100

    Cleanup widget_sensitive -> disable action for delete.

 src/photos-selection-toolbar.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/photos-selection-toolbar.c b/src/photos-selection-toolbar.c
index ce3c6ef..030d653 100644
--- a/src/photos-selection-toolbar.c
+++ b/src/photos-selection-toolbar.c
@@ -282,6 +282,10 @@ photos_selection_toolbar_set_item_visibility (PhotosSelectionToolbar *self)
   gchar *open_label;
   guint fav_count = 0;
   guint sel_length = 0;
+  GApplication *app;
+  GAction *action;
+
+  app = g_application_get_default ();
 
   self->inside_refresh = TRUE;
 
@@ -355,10 +359,12 @@ photos_selection_toolbar_set_item_visibility (PhotosSelectionToolbar *self)
   gtk_widget_set_sensitive (self->toolbar_collection, show_collection);
   gtk_widget_set_sensitive (self->toolbar_print, show_print);
   gtk_widget_set_sensitive (self->toolbar_properties, show_properties);
-  gtk_widget_set_sensitive (self->toolbar_trash, show_trash);
   gtk_widget_set_sensitive (self->toolbar_open, show_open);
   gtk_widget_set_sensitive (self->toolbar_favorite, show_favorite);
 
+  action = g_action_map_lookup_action (G_ACTION_MAP (app), "delete");
+  g_simple_action_set_enabled (G_SIMPLE_ACTION (action), show_trash);
+
   self->inside_refresh = FALSE;
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]