Re: [PATCH] app: Don't leave a window opened in case of connection error

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

 



Acked-by: Jonathon Jongsma <jjongsma@xxxxxxxxxx>


On Fri, 2016-02-19 at 17:10 +0100, Fabiano Fidêncio wrote:
> Since commit ed9b3f3 the main window is not hidden when disconnecting.
> But it also is not hidden when a connection error occurs, leaving a
> black display with a not so accurate message to the users in case they
> try to connect to a non-valid address from the remote-viewer connection
> window and in this case the main window (display #1) shuldn't be shown.
> 
> The impetus for this chance is the following:
> - user runs remote-viewer without any argument
> - the remote-viewer connection window shows up
> - user attempts to connect to a non-valid address
> - a dialog pops up indicating a failure connecting to the graphic server
> - the main window shows up saying "Connecting to the graphic server"
> - user clicks 'Ok'
> - the main window stays there with the same message
> 
> As a user, I expect the program to not show the main window in
> connecting failure cases. This patch accomplishes that.
> ---
>  src/virt-viewer-app.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
> index 7f7fed3..071fb58 100644
> --- a/src/virt-viewer-app.c
> +++ b/src/virt-viewer-app.c
> @@ -614,7 +614,10 @@ static void hide_one_window(gpointer value,
>                              gpointer user_data G_GNUC_UNUSED)
>  {
>      VirtViewerApp* self = VIRT_VIEWER_APP(user_data);
> -    if (self->priv->main_window != value)
> +    VirtViewerAppPrivate *priv = self->priv;
> +    gboolean connect_error = !priv->connected && !priv->cancelled;
> +
> +    if (connect_error || self->priv->main_window != value)
>          virt_viewer_window_hide(VIRT_VIEWER_WINDOW(value));
>  }
>  

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list




[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux