[gnome-boxes] Add PropertyCreationFlag to IPropertiesProvider.get_properties



commit e4f8bb3fab017de5b8cd49acf00535482e252e71
Author: Alexander Larsson <alexl redhat com>
Date:   Mon Nov 5 15:51:32 2012 +0100

    Add PropertyCreationFlag to IPropertiesProvider.get_properties
    
    We will need this later for USB checks
    
    https://bugzilla.gnome.org/show_bug.cgi?id=672268

 src/display.vala               |    2 +-
 src/i-properties-provider.vala |    7 ++++++-
 src/libvirt-machine.vala       |    5 +++--
 src/machine.vala               |    2 +-
 src/properties.vala            |    2 +-
 src/remote-machine.vala        |    4 ++--
 src/spice-display.vala         |    2 +-
 src/vnc-display.vala           |    2 +-
 8 files changed, 16 insertions(+), 10 deletions(-)
---
diff --git a/src/display.vala b/src/display.vala
index 8409eb3..814b763 100644
--- a/src/display.vala
+++ b/src/display.vala
@@ -24,7 +24,7 @@ private abstract class Boxes.Display: GLib.Object, Boxes.IPropertiesProvider {
     public abstract void connect_it () throws GLib.Error;
     public abstract void disconnect_it ();
 
-    public abstract List<Boxes.Property> get_properties (Boxes.PropertiesPage page);
+    public abstract List<Boxes.Property> get_properties (Boxes.PropertiesPage page, PropertyCreationFlag flags);
 
     protected HashTable<int, Gtk.Widget?> displays;
 
diff --git a/src/i-properties-provider.vala b/src/i-properties-provider.vala
index 16a6b6f..a9a0925 100644
--- a/src/i-properties-provider.vala
+++ b/src/i-properties-provider.vala
@@ -51,8 +51,13 @@ private class Boxes.Property: GLib.Object {
 private delegate void PropertyStringChanged (Boxes.Property property, string value) throws Boxes.Error;
 private delegate void PropertySizeChanged (Boxes.Property property, uint64 value) throws Boxes.Error;
 
+[Flags]
+public enum PropertyCreationFlag {
+    NONE = 0
+}
+
 private interface Boxes.IPropertiesProvider: GLib.Object {
-    public abstract List<Boxes.Property> get_properties (Boxes.PropertiesPage page);
+    public abstract List<Boxes.Property> get_properties (Boxes.PropertiesPage page, PropertyCreationFlag flags);
 
     protected Boxes.Property add_property (ref List<Boxes.Property> list, string name, Widget widget, Widget? extra_widget = null) {
         var property = new Property (name, widget, extra_widget);
diff --git a/src/libvirt-machine.vala b/src/libvirt-machine.vala
index 34cb54f..4cd11cb 100644
--- a/src/libvirt-machine.vala
+++ b/src/libvirt-machine.vala
@@ -301,7 +301,7 @@ private class Boxes.LibvirtMachine: Boxes.Machine {
         }
     }
 
-    public override List<Boxes.Property> get_properties (Boxes.PropertiesPage page) {
+    public override List<Boxes.Property> get_properties (Boxes.PropertiesPage page, PropertyCreationFlag flags) {
         var list = new List<Boxes.Property> ();
 
         // the wizard may want to modify display properties, before connect_display()
@@ -334,7 +334,8 @@ private class Boxes.LibvirtMachine: Boxes.Machine {
         }
 
         if (display != null)
-            list.concat (display.get_properties (page));
+            list.concat (display.get_properties (page,
+                                                 flags));
 
         return list;
     }
diff --git a/src/machine.vala b/src/machine.vala
index 490fddd..4ee5d39 100644
--- a/src/machine.vala
+++ b/src/machine.vala
@@ -211,7 +211,7 @@ private abstract class Boxes.Machine: Boxes.CollectionItem, Boxes.IPropertiesPro
         return null;
     }
 
-    public abstract List<Boxes.Property> get_properties (Boxes.PropertiesPage page);
+    public abstract List<Boxes.Property> get_properties (Boxes.PropertiesPage page, PropertyCreationFlag flags);
 
     public abstract async void connect_display () throws GLib.Error;
 
diff --git a/src/properties.vala b/src/properties.vala
index 04c2306..1ed455c 100644
--- a/src/properties.vala
+++ b/src/properties.vala
@@ -89,7 +89,7 @@ private class Boxes.Properties: Boxes.UI {
             infobar.hexpand = true;
             grid.attach (infobar, 0, 0, 2, 1);
 
-            properties = machine.get_properties (page);
+            properties = machine.get_properties (page, PropertyCreationFlag.NONE);
             empty = properties.length () == 0;
             if (!empty) {
                 int current_row = 1;
diff --git a/src/remote-machine.vala b/src/remote-machine.vala
index 1b4e6b9..5a5e5f7 100644
--- a/src/remote-machine.vala
+++ b/src/remote-machine.vala
@@ -41,7 +41,7 @@ private class Boxes.RemoteMachine: Boxes.Machine, Boxes.IPropertiesProvider {
         display.connect_it ();
     }
 
-    public override List<Boxes.Property> get_properties (Boxes.PropertiesPage page) {
+    public override List<Boxes.Property> get_properties (Boxes.PropertiesPage page, PropertyCreationFlag flags) {
         var list = new List<Boxes.Property> ();
 
         switch (page) {
@@ -61,7 +61,7 @@ private class Boxes.RemoteMachine: Boxes.Machine, Boxes.IPropertiesProvider {
             if (display == null)
                 display = create_display ();
 
-            list.concat (display.get_properties (page));
+            list.concat (display.get_properties (page, flags));
         } catch (Boxes.Error error) {
             warning (error.message);
         }
diff --git a/src/spice-display.vala b/src/spice-display.vala
index 35bbdfa..bf521e6 100644
--- a/src/spice-display.vala
+++ b/src/spice-display.vala
@@ -183,7 +183,7 @@ private class Boxes.SpiceDisplay: Boxes.Display, Boxes.IPropertiesProvider {
         }
     }
 
-    public override List<Boxes.Property> get_properties (Boxes.PropertiesPage page) {
+    public override List<Boxes.Property> get_properties (Boxes.PropertiesPage page, PropertyCreationFlag flags) {
         var list = new List<Boxes.Property> ();
 
         switch (page) {
diff --git a/src/vnc-display.vala b/src/vnc-display.vala
index 052d813..75f5f8e 100644
--- a/src/vnc-display.vala
+++ b/src/vnc-display.vala
@@ -131,7 +131,7 @@ private class Boxes.VncDisplay: Boxes.Display {
             display.close ();
     }
 
-    public override List<Boxes.Property> get_properties (Boxes.PropertiesPage page) {
+    public override List<Boxes.Property> get_properties (Boxes.PropertiesPage page, PropertyCreationFlag flags) {
         var list = new List<Boxes.Property> ();
 
         switch (page) {



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