[gnome-boxes/wip/automated-tests: 3/7] machine: Ensure 'status' property is always set



commit 471a0238c6efc88aa9a5f2913b2842ea23041caf
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Thu Jan 29 14:15:29 2015 +0000

    machine: Ensure 'status' property is always set
    
    We were not initializing the 'status' property and not resetting it
    later either so it'll remain to be 'Connecting to MACHINE_NAME' even
    after connection.
    
    This isn't exactly an issue on its own but later we'll indirectly
    connect this property to the a11y-name of the containing window and that
    property is not nullable.

 src/libvirt-machine.vala |    2 ++
 src/machine.vala         |    3 ++-
 src/ovirt-machine.vala   |    2 ++
 src/remote-machine.vala  |    2 ++
 4 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/libvirt-machine.vala b/src/libvirt-machine.vala
index 49caa69..f78e158 100644
--- a/src/libvirt-machine.vala
+++ b/src/libvirt-machine.vala
@@ -66,6 +66,8 @@ private class Boxes.LibvirtMachine: Boxes.Machine {
             show_display ();
             display.set_enable_audio (true);
         }
+
+        status = name;
     }
 
     struct MachineStat {
diff --git a/src/machine.vala b/src/machine.vala
index 9a7050c..9dae31d 100644
--- a/src/machine.vala
+++ b/src/machine.vala
@@ -10,7 +10,7 @@ private abstract class Boxes.Machine: Boxes.CollectionItem, Boxes.IPropertiesPro
     public Gdk.Pixbuf? pixbuf { get; set; }
     public bool stay_on_display;
     public string? info { get; set; }
-    public string? status { get; set; }
+    public string status { get; set; }
     public bool suspend_at_exit;
 
     public virtual bool can_save { get { return false; } }
@@ -209,6 +209,7 @@ private abstract class Boxes.Machine: Boxes.CollectionItem, Boxes.IPropertiesPro
                 set_screenshot_enable (true);
         });
 
+        status = this.name;
         notify["name"].connect (() => {
             status = this.name;
         });
diff --git a/src/ovirt-machine.vala b/src/ovirt-machine.vala
index 029c1c1..730b990 100644
--- a/src/ovirt-machine.vala
+++ b/src/ovirt-machine.vala
@@ -54,6 +54,8 @@ private class Boxes.OvirtMachine: Boxes.Machine {
         } catch (GLib.Error e) {
             throw new Boxes.Error.INVALID ("Error opening display: %s", e.message);
         }
+
+        status = name;
     }
 
     public override List<Boxes.Property> get_properties (Boxes.PropertiesPage page, ref PropertyCreationFlag 
flags) {
diff --git a/src/remote-machine.vala b/src/remote-machine.vala
index 1007cba..d2030d7 100644
--- a/src/remote-machine.vala
+++ b/src/remote-machine.vala
@@ -43,6 +43,8 @@ private class Boxes.RemoteMachine: Boxes.Machine, Boxes.IPropertiesProvider {
             show_display ();
             display.set_enable_audio (true);
         }
+
+        status = name;
     }
 
     public override List<Boxes.Property> get_properties (Boxes.PropertiesPage page, ref PropertyCreationFlag 
flags) {


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