[gnome-boxes] ui: Go out of selection mode after removing all boxes



commit 53124fb9a7dca6f1fa02a703cf06e864b3286193
Author: Christophe Fergeau <cfergeau redhat com>
Date:   Wed Sep 5 11:42:32 2012 +0200

    ui: Go out of selection mode after removing all boxes
    
    If you delete all your boxes, we currently stay in selection mode,
    and the user has to click on 'Cancel' to go out of it. After this
    commit, we go out of selection mode when the collection view gets
    empty after some changes in selection mode.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=681985

 src/app.vala |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/app.vala b/src/app.vala
index 082f0fa..ddfbd8c 100644
--- a/src/app.vala
+++ b/src/app.vala
@@ -628,6 +628,11 @@ private class Boxes.App: Boxes.UI {
         };
 
         notificationbar.display_for_action (message, Gtk.Stock.UNDO, (owned) undo, (owned) really_remove);
+
+        // go out of selection mode if there are no more boxes
+        if (App.app.collection.items.length == 0) {
+            App.app.selection_mode = false;
+        }
     }
 
     private bool on_key_pressed (Widget widget, Gdk.EventKey event) {



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