[virt-tools-list] [virt-viewer v3 1/4] Fix window title after failed connection

Jonathon Jongsma jjongsma at redhat.com
Thu Nov 14 17:56:11 UTC 2013



----- Original Message -----
> From: "Christophe Fergeau" <cfergeau at redhat.com>
> To: "Daniel P. Berrange" <berrange at redhat.com>
> Cc: virt-tools-list at redhat.com
> Sent: Wednesday, November 13, 2013 6:43:07 AM
> Subject: Re: [virt-tools-list] [virt-viewer v3 1/4] Fix window title after failed connection
> 
> On Wed, Nov 13, 2013 at 10:36:07AM +0000, Daniel P. Berrange wrote:
> > > On Wed, Oct 30, 2013 at 02:30:11PM +0100, Christophe Fergeau wrote:
> > > > When using the connection dialog, if the user picks an invalid
> > > > URI first causing a failed connection, and then picks/enters a valid
> > > > URI, remote-viewer window title will be set to the first invalid URI,
> > > > not to the second one which was entered.
> > > > 
> > > > As the user may have specified a window title to use on the command
> > > > line (-t option), we need to be careful not to override that when
> > > > setting the window title on the second attempt.
> > > > 
> > > > Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1024309
> > > > ---
> > > >  src/remote-viewer.c | 8 +++++++-
> > > >  1 file changed, 7 insertions(+), 1 deletion(-)
> > > > 
> > > > diff --git a/src/remote-viewer.c b/src/remote-viewer.c
> > > > index fa53690..5d111a9 100644
> > > > --- a/src/remote-viewer.c
> > > > +++ b/src/remote-viewer.c
> > > > @@ -57,6 +57,10 @@ struct _RemoteViewerPrivate {
> > > >      GtkWidget *controller_menu;
> > > >      GtkWidget *foreign_menu;
> > > >      gboolean open_recent_dialog;
> > > > +
> > > > +    gboolean default_title; /* Whether the window title was set by the
> > > > user, or
> > > > +                               is the default one (URI we are
> > > > connecting to) */
> > > > +
> > > >  };
> > > >  
> > > >  G_DEFINE_TYPE (RemoteViewer, remote_viewer, VIRT_VIEWER_TYPE_APP)
> > > > @@ -983,8 +987,10 @@ remote_viewer_start(VirtViewerApp *app)
> > > >          g_return_val_if_fail(guri != NULL, FALSE);
> > > >  
> > > >          DEBUG_LOG("Opening display to %s", guri);
> > > > -        if (virt_viewer_app_get_title(app) == NULL)
> > > > +        if ((virt_viewer_app_get_title(app) == NULL) ||
> > > > priv->default_title) {
> > > > +            priv->default_title = TRUE;
> > > >              virt_viewer_app_set_title(app, guri);
> > > > +        }
> > > >  
> > > >          file = g_file_new_for_commandline_arg(guri);
> > > >          if (g_file_query_exists(file, NULL)) {
> > 
> > ACK
> > 
> 
> The other 3 patches in this series need review as well (4/4 incorporates
> some changes after Marc-André reviewed the previous version). I forgot the
> cover letter in that v3 so could not ping that :-/
> 
> 


The remaining patches in the series look fine to me.

Jonathon




More information about the virt-tools-list mailing list