[gnome-boxes] spice-display: Inform user if SPICE agent not installed



commit 53d65f1db5a7a049a15e0b3d6d02c0bfc2de4d31
Author: Visarion Alexandru <viorel visarion gmail com>
Date:   Sun Jun 26 11:00:59 2016 +0300

    spice-display: Inform user if SPICE agent not installed
    
    Currently a user has no feedback regarding the existence of SPICE
    agent in the guest machine, which can result in a loss of performace
    and missing features.
    
    Inform the user about missing guest agent and where to download and
    install it from, on the 'general' page of properties view.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=704012

 data/gtk-style.css     |    5 +++++
 src/spice-display.vala |   14 ++++++++++++++
 2 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/data/gtk-style.css b/data/gtk-style.css
index 9f9efc2..95e53bc 100644
--- a/data/gtk-style.css
+++ b/data/gtk-style.css
@@ -58,6 +58,11 @@
     font-style: italic;
 }
 
+.boxes-spice-tools-notice-label {
+    font-size: smaller;
+    font-style: italic;
+}
+
 .boxes-product-key-entry {
     font-family: monospace;
 }
diff --git a/src/spice-display.vala b/src/spice-display.vala
index 66c2691..96da823 100644
--- a/src/spice-display.vala
+++ b/src/spice-display.vala
@@ -323,6 +323,20 @@ private class Boxes.SpiceDisplay: Boxes.Display {
                                        BindingFlags.BIDIRECTIONAL | BindingFlags.SYNC_CREATE);
             toggle.halign = Gtk.Align.START;
             add_property (ref list, _("Share Clipboard"), toggle);
+
+            if (!connected || !main_channel.agent_connected)
+                break;
+
+            var message = _("SPICE guest tools are not installed. These tools improve user experience and 
enable host and box interactions, such as copy&amp;paste. Please visit <a 
href=\"http://www.spice-space.org/download.html\";>http://www.spice-space.org/download.html</a> to download 
and install these tools from within the box.");
+            var label = new Gtk.Label (message);
+            label.vexpand = true;
+            label.valign = Gtk.Align.END;
+            label.wrap = true;
+            label.max_width_chars = 80;
+            label.use_markup = true;
+            label.get_style_context ().add_class ("boxes-spice-tools-notice-label");
+
+            add_property (ref list, null, label);
             break;
 
         case PropertiesPage.DEVICES:


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