[gnome-boxes] collection-view: Add ICollectionView interface



commit 5288897baa369fd876439127c504c6de4fe6240a
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Fri Jul 10 09:14:28 2015 +0200

    collection-view: Add ICollectionView interface
    
    Extract the ICollectionView interface from CollectionView so it is
    easier to handle the current collection view and the ListView which will
    be added by a subsequent commit.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=733252

 src/Makefile.am            |    1 +
 src/collection-view.vala   |    4 ++--
 src/collection.vala        |    2 +-
 src/i-collection-view.vala |   11 +++++++++++
 4 files changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 3796b9a..015d050 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -110,6 +110,7 @@ gnome_boxes_SOURCES =                               \
        display.vala                            \
        editable-entry.vala                     \
        i-properties-provider.vala              \
+       i-collection-view.vala                  \
        installer-media.vala                    \
        installed-media.vala                    \
        keys-input-popover.vala                 \
diff --git a/src/collection-view.vala b/src/collection-view.vala
index 5f61506..a72abb7 100644
--- a/src/collection-view.vala
+++ b/src/collection-view.vala
@@ -6,7 +6,7 @@ public enum Boxes.SelectionCriteria {
     RUNNING
 }
 
-private class Boxes.CollectionView: Gd.MainView, Boxes.UI {
+private class Boxes.CollectionView: Gd.MainView, Boxes.ICollectionView, Boxes.UI {
     public UIState previous_ui_state { get; protected set; }
     public UIState ui_state { get; protected set; }
 
@@ -37,7 +37,7 @@ private class Boxes.CollectionView: Gd.MainView, Boxes.UI {
     private Boxes.ActionsPopover context_popover;
     private GLib.List<CollectionItem> hidden_items;
 
-    public CollectionFilter filter { construct; get; }
+    public CollectionFilter filter { get; protected set; }
 
     private const Gtk.CornerType[] right_corners = { Gtk.CornerType.TOP_RIGHT, Gtk.CornerType.BOTTOM_RIGHT };
     private const Gtk.CornerType[] bottom_corners = { Gtk.CornerType.BOTTOM_LEFT, 
Gtk.CornerType.BOTTOM_RIGHT };
diff --git a/src/collection.vala b/src/collection.vala
index b0351a0..6e82b5b 100644
--- a/src/collection.vala
+++ b/src/collection.vala
@@ -49,7 +49,7 @@ private class Boxes.Collection: GLib.Object {
         item_removed (item);
     }
 
-    public void populate (CollectionView view) {
+    public void populate (ICollectionView view) {
         for (uint i = 0 ; i < items.length ; i++)
             view.add_item (items[i]);
     }
diff --git a/src/i-collection-view.vala b/src/i-collection-view.vala
new file mode 100644
index 0000000..f20a730
--- /dev/null
+++ b/src/i-collection-view.vala
@@ -0,0 +1,11 @@
+// This file is part of GNOME Boxes. License: LGPLv2+
+
+private interface Boxes.ICollectionView: Gtk.Widget {
+    public abstract CollectionFilter filter { get; protected set; }
+
+    public abstract void add_item (CollectionItem item);
+    public abstract void remove_item (CollectionItem item);
+    public abstract List<CollectionItem> get_selected_items ();
+    public abstract void activate_first_item ();
+    public abstract void select_by_criteria (SelectionCriteria criteria);
+}


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