[Commits] [SCM] claws branch, master, updated. 3.12.0-93-ge6aa883

mones at claws-mail.org mones at claws-mail.org
Thu Oct 1 22:06:39 CEST 2015


The branch, master has been updated
       via  e6aa8837949636cb1c8540074b87e26907022c05 (commit)
      from  98b12b276ff17b22d83295998a0898de44e916f2 (commit)

Summary of changes:
 src/gtk/gtkutils.c |   16 +++++++++++++++-
 src/gtk/gtkutils.h |    1 +
 2 files changed, 16 insertions(+), 1 deletion(-)


- Log -----------------------------------------------------------------
commit e6aa8837949636cb1c8540074b87e26907022c05
Author: Ricardo Mones <ricardo at mones.org>
Date:   Wed Sep 30 23:17:41 2015 +0200

    Fix bug #3526 ‘autoconfiguration: get more detailed error message’
    
    Based on original patch by Christian Hesse (thanks!).

diff --git a/src/gtk/gtkutils.c b/src/gtk/gtkutils.c
index 695ca62..3500a83 100644
--- a/src/gtk/gtkutils.c
+++ b/src/gtk/gtkutils.c
@@ -1915,7 +1915,19 @@ static void auto_configure_done(const gchar *hostname, gint port, gboolean ssl,
 
 		gtk_label_set_text(data->info_label, _("Done."));
 	} else {
-	gtk_label_set_text(data->info_label, _("Failed."));
+		const gchar *msg;
+		switch (data->resolver_error) {
+		case G_RESOLVER_ERROR_NOT_FOUND:
+			msg = g_strdup(_("Failed: no service record found."));
+			break;
+		case G_RESOLVER_ERROR_TEMPORARY_FAILURE:
+			msg = g_strdup(_("Failed: network error."));
+			break;
+		default:
+			msg = g_strdup_printf(_("Failed: unknown error (%d)."), data->resolver_error);
+		}
+		gtk_label_set_text(data->info_label, msg);
+		g_free(msg);
 	}
 	gtk_widget_show(GTK_WIDGET(data->configure_button));
 	gtk_widget_hide(GTK_WIDGET(data->cancel_button));
@@ -1951,6 +1963,8 @@ static void resolve_done(GObject *source, GAsyncResult *result, gpointer user_da
 	} else if (error) {
 		if (error->code == G_IO_ERROR_CANCELLED)
 			abort = TRUE;
+		else
+			data->resolver_error = error->code;
 		debug_print("error %s\n", error->message);
 		g_error_free(error);
 	}
diff --git a/src/gtk/gtkutils.h b/src/gtk/gtkutils.h
index 39fdbdb..7510387 100644
--- a/src/gtk/gtkutils.h
+++ b/src/gtk/gtkutils.h
@@ -214,6 +214,7 @@ typedef struct _AutoConfigureData {
 	const gchar *ssl_service;
 	const gchar *tls_service;
 	gchar *address;
+	gint resolver_error;
 
 	GtkEntry *hostname_entry;
 	GtkToggleButton *set_port;

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list