[gnome-boxes] app-window: Add 'collection_view' property



commit 9fa66f3b54ca20753c089b944ca1b54a67cb99cc
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Fri Jul 10 09:36:23 2015 +0200

    app-window: Add 'collection_view' property
    
    Rename the 'view' attribute to 'collection_view', making it private in
    the process, and add a new generic 'view' property that always points to
    the current collection view of the window.
    
    For now this isn't very useful since we only have a single view but a
    list view will be added in a following patch.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=733252

 data/ui/app-window.ui |    2 +-
 src/app-window.vala   |   10 +++++++---
 src/empty-boxes.vala  |    2 +-
 3 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/data/ui/app-window.ui b/data/ui/app-window.ui
index 31ebc7e..d95ca7c 100644
--- a/data/ui/app-window.ui
+++ b/data/ui/app-window.ui
@@ -82,7 +82,7 @@
                 </child>
 
                 <child>
-                  <object class="BoxesCollectionView" id="view">
+                  <object class="BoxesCollectionView" id="collection_view">
                     <property name="visible">True</property>
                   </object>
                   <packing>
diff --git a/src/app-window.vala b/src/app-window.vala
index 1140266..3560f43 100644
--- a/src/app-window.vala
+++ b/src/app-window.vala
@@ -89,7 +89,11 @@ private class Boxes.AppWindow: Gtk.ApplicationWindow, Boxes.UI {
     [GtkChild]
     public Gtk.Stack below_bin;
     [GtkChild]
-    public CollectionView view;
+    private CollectionView collection_view;
+
+    public ICollectionView view {
+        get { return collection_view; }
+    }
 
     public GLib.Settings settings;
 
@@ -138,7 +142,7 @@ private class Boxes.AppWindow: Gtk.ApplicationWindow, Boxes.UI {
     public void setup_ui () {
         topbar.setup_ui (this);
         display_page.setup_ui (this);
-        view.setup_ui (this);
+        collection_view.setup_ui (this);
         selectionbar.setup_ui (this);
         searchbar.setup_ui (this);
         empty_boxes.setup_ui (this);
@@ -167,7 +171,7 @@ private class Boxes.AppWindow: Gtk.ApplicationWindow, Boxes.UI {
     private void ui_state_changed () {
         // The order is important for some widgets here (e.g properties must change its state before wizard 
so it can
         // flush any deferred changes for wizard to pick-up when going back from properties to wizard 
(review).
-        foreach (var ui in new Boxes.UI[] { topbar, view, props_window, wizard_window, empty_boxes }) {
+        foreach (var ui in new Boxes.UI[] { topbar, collection_view, props_window, wizard_window, 
empty_boxes }) {
             ui.set_state (ui_state);
         }
 
diff --git a/src/empty-boxes.vala b/src/empty-boxes.vala
index ab7a3d5..5c75a0c 100644
--- a/src/empty-boxes.vala
+++ b/src/empty-boxes.vala
@@ -36,6 +36,6 @@ private class Boxes.EmptyBoxes : Gtk.Stack, Boxes.UI {
         if (visible)
             window.below_bin.set_visible_child_name ("empty-boxes");
         else
-            window.below_bin.set_visible_child_name ("collection-view");
+            window.below_bin.set_visible_child (window.view);
     }
 }


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