[gnome-boxes] ovirt-machine: "hostname: server" as 'info'



commit a002382fdbc0d1d9e0af5e0c2338e4b80abb4a86
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Fri Jul 3 15:43:45 2015 +0100

    ovirt-machine: "hostname: server" as 'info'
    
    Set info property of ovirt machines to "host: server" where server is
    server part (hostname or IP address) of it's host URL. 'info' property is
    bound to 2nd text line in the collection view under the thumbnail.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=744004

 src/ovirt-machine.vala |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/ovirt-machine.vala b/src/ovirt-machine.vala
index 832a151..fe81951 100644
--- a/src/ovirt-machine.vala
+++ b/src/ovirt-machine.vala
@@ -19,6 +19,9 @@ private class Boxes.OvirtMachine: Boxes.Machine {
 
         load_screenshot ();
         set_screenshot_enable (true);
+        update_info ();
+
+        source.notify["uri"].connect (update_info);
     }
 
     public override async void connect_display (Machine.ConnectFlags flags) throws GLib.Error {
@@ -77,6 +80,17 @@ private class Boxes.OvirtMachine: Boxes.Machine {
 
     public override void restart () {} // See FIXME on RemoteMachine.restart
 
+    protected override void update_info () {
+        base.update_info ();
+
+        if (info != null)
+            return;
+
+        var uri = Xml.URI.parse (source.uri);
+
+        info = _("host: %s").printf (uri.server);
+    }
+
     private Display create_display_connection () throws GLib.Error {
         if (vm.display.address == null || vm.display.address == "")
             throw new Boxes.Error.INVALID ("empty display address for %s", vm.name);


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