From 999bd6767576d4adacc7ecb3f89bcfeb9f39e74e Mon Sep 17 00:00:00 2001 From: Jonathon Jongsma Date: Thu, 18 Jun 2015 14:28:22 -0500 Subject: Automatically retry auth failures for VNC There's no reason that we need to ask if the user wants to retry auth failures for VNC sessions but not ask for spice sessions. If the user doesn't want to retry, she can simply click 'cancel' when the auth dialog pops up, just as they do with spice. --- src/virt-viewer-app.c | 29 ++++------------------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c index 4041a07..3f10546 100644 --- a/src/virt-viewer-app.c +++ b/src/virt-viewer-app.c @@ -1492,36 +1492,15 @@ static void virt_viewer_app_auth_refused(VirtViewerSession *session, const char *msg, VirtViewerApp *self) { - GtkWidget *dialog; - int ret; VirtViewerAppPrivate *priv = self->priv; - if (virt_viewer_session_can_retry_auth(session)) { - virt_viewer_app_simple_message_dialog(self, - _("Unable to authenticate with remote desktop server at %s: %s\n"), - priv->pretty_address, msg); - return; - } + virt_viewer_app_simple_message_dialog(self, + _("Unable to authenticate with remote desktop server at %s: %s\n"), + priv->pretty_address, msg); /* if the session implementation cannot retry auth automatically, the * VirtViewerApp needs to schedule a new connection to retry */ - dialog = gtk_message_dialog_new(virt_viewer_window_get_window(priv->main_window), - GTK_DIALOG_MODAL | - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_YES_NO, - _("Unable to authenticate with remote desktop server at %s: %s\n" - "Retry connection again?"), - priv->pretty_address, msg); - - ret = gtk_dialog_run(GTK_DIALOG(dialog)); - - gtk_widget_destroy(dialog); - - if (ret == GTK_RESPONSE_YES) - priv->authretry = TRUE; - else - priv->authretry = FALSE; + priv->authretry = !virt_viewer_session_can_retry_auth(session); } static void virt_viewer_app_auth_unsupported(VirtViewerSession *session G_GNUC_UNUSED, -- cgit v1.2.3