Don't wait for reconnect when user cancels auth

When starting virt-viewer with the --reconnect switch to a guest that
has a password, if the user cancels the authentication dialog (e.g.
pressing 'Esc'), the window will display "Waiting for guest domain to
restart".  Obviously, the domain will never restart because it's already
running.

After this fix, the application will simply exit when the user cancels
authentication, even if the --reconnect switch is used.
This commit is contained in:
Jonathon Jongsma 2015-06-17 16:37:54 -05:00
parent 999bd67675
commit c33f37efe3
3 changed files with 7 additions and 1 deletions

View File

@ -2566,6 +2566,11 @@ virt_viewer_app_get_option_group(void)
return group;
}
gboolean virt_viewer_app_get_session_cancelled(VirtViewerApp *self)
{
return self->priv->cancelled;
}
/*
* Local variables:
* c-indent-level: 4

View File

@ -102,6 +102,7 @@ gint virt_viewer_app_get_initial_monitor_for_display(VirtViewerApp* self, gint d
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);
G_END_DECLS

View File

@ -161,7 +161,7 @@ virt_viewer_deactivated(VirtViewerApp *app, gboolean connect_error)
priv->dom = NULL;
}
if (priv->reconnect) {
if (priv->reconnect && !virt_viewer_app_get_session_cancelled(app)) {
if (priv->domain_event < 0) {
g_debug("No domain events, falling back to polling");
virt_viewer_start_reconnect_poll(self);