[gnome-boxes] Update selection when a box is removed or inserted



commit b41ac45fc00e087d47b81ed2915256a1cd217752
Author: Marc-Andrà Lureau <marcandre lureau gmail com>
Date:   Tue Sep 4 11:54:52 2012 +0200

    Update selection when a box is removed or inserted
    
    When deleting a box, the selection count in the topbar isn't updated
    correctly. This patch makes sure the selection is notified when an
    item is removed or inserted from the model.
    
    (fixme later, libgd-way isn't as nice as having a real
    GtkTreeSelection::changed)
    
    https://bugzilla.gnome.org/show_bug.cgi?id=683322

 src/collection-view.vala |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/collection-view.vala b/src/collection-view.vala
index 91efe0a..d17eb95 100644
--- a/src/collection-view.vala
+++ b/src/collection-view.vala
@@ -361,6 +361,13 @@ private class Boxes.CollectionView: Boxes.UI {
             return item_a.name.collate (item_b.name);
         });
         model.set_sort_column_id (Gtk.SortColumn.DEFAULT, Gtk.SortType.ASCENDING);
+        model.row_deleted.connect (() => {
+            App.app.notify_property ("selected-items");
+        });
+        model.row_inserted.connect (() => {
+            App.app.notify_property ("selected-items");
+        });
+
         model_filter = new Gtk.TreeModelFilter (model, null);
         model_filter.set_visible_func (model_visible);
 



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