[gnome-boxes] app-window: Add 'selection-mode' prop



commit e953fbb49e6ea549921f5a9c1a0570d92bf8e85f
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Wed Jul 16 10:42:06 2014 +0200

    app-window: Add 'selection-mode' prop
    
    Prepares its move from App to AppWindow because each window may been in
    selection mode independently from the others.
    
    This is needed to drop the use of AppWindow singleton and therefore to
    make multiple windows possible.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=732098

 src/app-window.vala |    9 +++++++++
 src/app.vala        |   10 ++--------
 2 files changed, 11 insertions(+), 8 deletions(-)
---
diff --git a/src/app-window.vala b/src/app-window.vala
index 213b386..eed6d98 100644
--- a/src/app-window.vala
+++ b/src/app-window.vala
@@ -27,6 +27,15 @@ private class Boxes.AppWindow: Gtk.ApplicationWindow, Boxes.UI {
     }
     private bool maximized { get { return WindowState.MAXIMIZED in get_window ().get_state (); } }
 
+    private bool _selection_mode;
+    public bool selection_mode { get { return _selection_mode; }
+        set {
+            return_if_fail (ui_state == UIState.COLLECTION);
+
+            _selection_mode = value;
+        }
+    }
+
     [GtkChild]
     public Searchbar searchbar;
     [GtkChild]
diff --git a/src/app.vala b/src/app.vala
index 510c50c..883966a 100644
--- a/src/app.vala
+++ b/src/app.vala
@@ -161,6 +161,7 @@ private class Boxes.App: Gtk.Application, Boxes.UI {
 
         window = new Boxes.AppWindow (this);
         window.setup_ui ();
+        bind_property ("selection-mode", window, "selection-mode", BindingFlags.BIDIRECTIONAL);
         set_state (UIState.COLLECTION);
 
         window.present ();
@@ -433,14 +434,7 @@ private class Boxes.App: Gtk.Application, Boxes.UI {
         debug ("Running boxes suspended");
     }
 
-    private bool _selection_mode;
-    public bool selection_mode { get { return _selection_mode; }
-        set {
-            return_if_fail (ui_state == UIState.COLLECTION);
-
-            _selection_mode = value;
-        }
-    }
+    public bool selection_mode { get; set; }
 
     public List<CollectionItem> selected_items {
         owned get { return window.view.get_selected_items (); }


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