[virt-tools-list] [PATCH virt-viewer] spice: add proxy configuration to connection file

Hans de Goede hdegoede at redhat.com
Tue Jan 29 11:33:32 UTC 2013


Looks good, ack.

On 01/28/2013 09:21 PM, Marc-André Lureau wrote:
> ---
>   configure.ac                    |  2 +-
>   src/virt-viewer-file.c          | 26 +++++++++++++++++++++++++-
>   src/virt-viewer-session-spice.c |  6 ++++++
>   3 files changed, 32 insertions(+), 2 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index 251b134..55f6ea0 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -19,7 +19,7 @@ GTK2_REQUIRED="2.18.0"
>   GTK3_REQUIRED="3.0"
>   GTK_VNC1_REQUIRED="0.3.8"
>   GTK_VNC2_REQUIRED="0.4.0"
> -SPICE_GTK_REQUIRED="0.12.101"
> +SPICE_GTK_REQUIRED="0.16.24"
>   SPICE_PROTOCOL_REQUIRED="0.10.1"
>
>   AC_MSG_CHECKING([for native Win32])
> diff --git a/src/virt-viewer-file.c b/src/virt-viewer-file.c
> index caac50f..7271156 100644
> --- a/src/virt-viewer-file.c
> +++ b/src/virt-viewer-file.c
> @@ -92,7 +92,8 @@ enum  {
>       PROP_COLOR_DEPTH,
>       PROP_DISABLE_EFFECTS,
>       PROP_ENABLE_USB_AUTOSHARE,
> -    PROP_USB_FILTER
> +    PROP_USB_FILTER,
> +    PROP_PROXY,
>   };
>
>   VirtViewerFile*
> @@ -509,6 +510,19 @@ virt_viewer_file_set_usb_filter(VirtViewerFile* self, const gchar* value)
>       g_object_notify(G_OBJECT(self), "usb-filter");
>   }
>
> +gchar*
> +virt_viewer_file_get_proxy(VirtViewerFile* self)
> +{
> +    return virt_viewer_file_get_string(self, "proxy");
> +}
> +
> +void
> +virt_viewer_file_set_proxy(VirtViewerFile* self, const gchar* value)
> +{
> +    virt_viewer_file_set_string(self, "proxy", value);
> +    g_object_notify(G_OBJECT(self), "proxy");
> +}
> +
>   static void
>   spice_hotkey_set_accel(VirtViewerApp *app, const gchar *accel_path, const gchar *key)
>   {
> @@ -633,6 +647,9 @@ virt_viewer_file_set_property(GObject* object, guint property_id,
>       case PROP_USB_FILTER:
>           virt_viewer_file_set_usb_filter(self, g_value_get_string(value));
>           break;
> +    case PROP_PROXY:
> +        virt_viewer_file_set_proxy(self, g_value_get_string(value));
> +        break;
>       default:
>           G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
>           break;
> @@ -706,6 +723,9 @@ virt_viewer_file_get_property(GObject* object, guint property_id,
>       case PROP_USB_FILTER:
>           g_value_take_string(value, virt_viewer_file_get_usb_filter(self));
>           break;
> +    case PROP_PROXY:
> +        g_value_take_string(value, virt_viewer_file_get_proxy(self));
> +        break;
>       default:
>           G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
>           break;
> @@ -820,4 +840,8 @@ virt_viewer_file_class_init(VirtViewerFileClass* klass)
>       g_object_class_install_property(G_OBJECT_CLASS(klass), PROP_DISABLE_EFFECTS,
>           g_param_spec_boxed("disable-effects", "disable-effects", "disable-effects", G_TYPE_STRV,
>                              G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE));
> +
> +    g_object_class_install_property(G_OBJECT_CLASS(klass), PROP_PROXY,
> +        g_param_spec_string("proxy", "proxy", "proxy", NULL,
> +                            G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE));
>   }
> diff --git a/src/virt-viewer-session-spice.c b/src/virt-viewer-session-spice.c
> index 468b8a7..80a3f34 100644
> --- a/src/virt-viewer-session-spice.c
> +++ b/src/virt-viewer-session-spice.c
> @@ -302,6 +302,12 @@ fill_session(VirtViewerFile *file, SpiceSession *session)
>           g_free(val);
>       }
>
> +    if (virt_viewer_file_is_set(file, "proxy")) {
> +        gchar *val = virt_viewer_file_get_proxy(file);
> +        g_object_set(G_OBJECT(session), "proxy", val, NULL);
> +        g_free(val);
> +    }
> +
>       if (virt_viewer_file_is_set(file, "enable-smartcard")) {
>           g_object_set(G_OBJECT(session),
>                        "enable-smartcard", virt_viewer_file_get_enable_smartcard(file), NULL);
>




More information about the virt-tools-list mailing list