On 23/06/17 12:30, marcandre.lureau@xxxxxxxxxx wrote: > From: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx> > > If the dbus-ctrl property is set, we should call open_uri() without > guri set. > My general feeling is that this patch could be merged with the option parsing on the follow up patch, while that one should split in two, the first one adding the dbus handlers and the only after that option parsing/property setting/open_uri() call. > Signed-off-by: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx> > --- > src/virt-viewer-app.c | 12 ++++++++++++ > src/virt-viewer-app.h | 1 + > 2 files changed, 13 insertions(+) > > diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c > index 2a88882..c770cc0 100644 > --- a/src/virt-viewer-app.c > +++ b/src/virt-viewer-app.c > @@ -130,6 +130,7 @@ struct _VirtViewerAppPrivate { > gboolean active; > gboolean connected; > gboolean cancelled; > + gboolean dbus_ctrl; > char *unixsock; > char *guri; /* prefered over ghost:gport */ > char *ghost; > @@ -1225,6 +1226,9 @@ virt_viewer_app_default_activate(VirtViewerApp *self, GError **error) > > if (fd >= 0) { > return virt_viewer_session_open_fd(VIRT_VIEWER_SESSION(priv->session), fd); > + } else if (priv->dbus_ctrl) { > + /* open_uri handles session set with vv file */ > + return virt_viewer_session_open_uri(VIRT_VIEWER_SESSION(priv->session), NULL, error); > } else if (priv->guri) { > virt_viewer_app_trace(self, "Opening connection to display at %s", priv->guri); > return virt_viewer_session_open_uri(VIRT_VIEWER_SESSION(priv->session), priv->guri, error); > @@ -2036,6 +2040,14 @@ virt_viewer_app_class_init (VirtViewerAppClass *klass) > G_PARAM_STATIC_STRINGS)); > } > > +void > +virt_viewer_app_set_dbus_ctrl(VirtViewerApp *self, gboolean dbus_ctrl) > +{ > + g_return_if_fail(VIRT_VIEWER_IS_APP(self)); > + > + self->priv->dbus_ctrl = dbus_ctrl; > +} > + > void > virt_viewer_app_set_direct(VirtViewerApp *self, gboolean direct) > { > diff --git a/src/virt-viewer-app.h b/src/virt-viewer-app.h > index 16b1c8c..6f6d9c8 100644 > --- a/src/virt-viewer-app.h > +++ b/src/virt-viewer-app.h > @@ -98,6 +98,7 @@ void virt_viewer_app_set_enable_accel(VirtViewerApp *app, gboolean enable); > void virt_viewer_app_show_preferences(VirtViewerApp *app, GtkWidget *parent); > void virt_viewer_app_set_menus_sensitive(VirtViewerApp *self, gboolean sensitive); > gboolean virt_viewer_app_get_session_cancelled(VirtViewerApp *self); > +void virt_viewer_app_set_dbus_ctrl(VirtViewerApp *self, gboolean dbus_ctrl); > > G_END_DECLS > > -- Eduardo de Barros Lima (Etrunko) Software Engineer - RedHat etrunko@xxxxxxxxxx _______________________________________________ virt-tools-list mailing list virt-tools-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/virt-tools-list