[gnome-boxes] spice-display: Remove auto-usbredirection option



commit 42ea12d9f27e746f1892332a6a3665c1be1de2c7
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Sat Nov 8 21:17:24 2014 +0000

    spice-display: Remove auto-usbredirection option
    
    Since this option is not the most obvious one and given that we refresh
    properties view when new devices are plugged-in and users have easy way
    to redirect devices individually, lets just remove this option.
    
    I told jimmac I'm going to do this and his reply was "\o/". :)
    
    https://bugzilla.gnome.org/show_bug.cgi?id=720792

 src/spice-display.vala |   24 +++++++-----------------
 1 files changed, 7 insertions(+), 17 deletions(-)
---
diff --git a/src/spice-display.vala b/src/spice-display.vala
index ddfb681..61f639e 100644
--- a/src/spice-display.vala
+++ b/src/spice-display.vala
@@ -35,7 +35,6 @@ private class Boxes.SpiceDisplay: Boxes.Display {
     construct {
         gtk_session_sync_properties = {
             BoxConfig.SyncProperty () { name = "auto-clipboard", default_value = true },
-            BoxConfig.SyncProperty () { name = "auto-usbredir", default_value = false }
         };
 
         need_password = false;
@@ -44,13 +43,6 @@ private class Boxes.SpiceDisplay: Boxes.Display {
         gtk_session = GtkSession.get (session);
         try {
             var manager = UsbDeviceManager.get (session);
-            manager.auto_connect_failed.connect ( (dev, err) => {
-                var device_description = dev.get_description ("%1$s %2$s");
-                var box_name = get_box_name ();
-                got_error (_("Automatic redirection of USB device '%s' for '%s' failed").printf 
(device_description,
-                                                                                                 box_name));
-                debug ("Error auto-connecting %s for %s: %s", device_description, box_name, err.message);
-            });
 
             manager.device_error.connect ( (dev, err) => {
                 var device_description = dev.get_description ("%1$s %2$s");
@@ -175,7 +167,6 @@ private class Boxes.SpiceDisplay: Boxes.Display {
     public override void collect_logs (StringBuilder builder) {
         builder.append_printf ("URI: %s\n", uri);
         if (gtk_session != null) {
-            builder.append_printf ("Auto redirect USB: %s\n", gtk_session.auto_usbredir ? "yes" : "no");
             builder.append_printf ("Auto clipboard sync: %s\n", gtk_session.auto_clipboard ? "yes" : "no");
         }
         if (main_channel != null) {
@@ -290,14 +281,9 @@ private class Boxes.SpiceDisplay: Boxes.Display {
 
         case PropertiesPage.DEVICES:
             if (!(PropertyCreationFlag.NO_USB in flags) && Config.HAVE_USBREDIR) {
-                var toggle = new Gtk.Switch ();
-                gtk_session.bind_property ("auto-usbredir", toggle, "active",
-                                           BindingFlags.BIDIRECTIONAL | BindingFlags.SYNC_CREATE);
-                toggle.halign =  Gtk.Align.START;
-                Boxes.Property usb_property = add_property (ref list, _("Redirect new USB devices"), toggle);
-
                 if (connected) {
                     bool found_dev = false;
+                    Boxes.Property usb_property = null;
                     try {
                         var manager = UsbDeviceManager.get (session);
                         var devs = manager.get_devices ();
@@ -314,9 +300,9 @@ private class Boxes.SpiceDisplay: Boxes.Display {
                             dev_toggle.halign =  Gtk.Align.START;
 
                             if (!found_dev)
-                                add_property (ref list, _("USB devices"), new Gtk.Label (""));
+                                usb_property = add_property (ref list, _("USB devices"), new Gtk.Label (""));
                             found_dev = true;
-                            add_property (ref list, dev.get_description ("    %1$s %2$s"), dev_toggle);
+                            usb_property = add_property (ref list, dev.get_description ("    %1$s %2$s"), 
dev_toggle);
                             dev_toggle.active = manager.is_device_connected (dev);
 
                             dev_toggle.notify["active"].connect ( () => {
@@ -340,6 +326,10 @@ private class Boxes.SpiceDisplay: Boxes.Display {
                                 }
                             });
                         }
+
+                        if (usb_property == null)
+                            break;
+
                         manager.device_added.connect ((manager, dev) => {
                             usb_property.refresh_properties ();
                         });


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