changeset 21459:675fbb9a402e

merge of '42565dfdfb1d0477d08281c1c37e99bba59c56fc' and '50186cf4da94766e7f15dc727898da51f906c649'
author Will Thompson <will.thompson@collabora.co.uk>
date Mon, 12 Nov 2007 18:59:14 +0000
parents d78e440584e0 (current diff) 11101e8c5793 (diff)
children f3225e454f8d
files
diffstat 1 files changed, 29 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkblist.c	Mon Nov 12 17:13:44 2007 +0000
+++ b/pidgin/gtkblist.c	Mon Nov 12 18:59:14 2007 +0000
@@ -4469,6 +4469,15 @@
 	g_hash_table_remove(gtkblist->connection_errors, account);
 }
 
+#define SSL_FAQ_URI "http://d.pidgin.im/wiki/FAQssl"
+
+static void
+ssl_faq_clicked_cb(GtkButton *button,
+                   PurpleAccount *account)
+{
+	purple_notify_uri(NULL, SSL_FAQ_URI);
+}
+
 static void
 add_generic_error_dialog(PurpleAccount *account,
                          const PurpleConnectionErrorInfo *err)
@@ -4498,6 +4507,26 @@
 	g_object_set_data(G_OBJECT(mini_dialog), OBJECT_DATA_KEY_ACCOUNT,
 		account);
 
+	if(err->type == PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT) {
+		GtkWidget *faq_button = gtk_button_new();
+		GtkWidget *faq_label = gtk_label_new(NULL);
+		gtk_label_set_markup(GTK_LABEL(faq_label),
+			"<span underline=\"single\" foreground=\"blue\""
+			" size=\"smaller\">" SSL_FAQ_URI "</span>");
+#if GTK_CHECK_VERSION(2,6,0)
+		g_object_set(G_OBJECT(faq_label), "ellipsize",
+			PANGO_ELLIPSIZE_MIDDLE, NULL);
+#endif
+		gtk_container_add(GTK_CONTAINER(faq_button), faq_label);
+		gtk_button_set_relief(GTK_BUTTON(faq_button), GTK_RELIEF_NONE);
+
+		g_signal_connect(faq_button, "clicked",
+			(GCallback)ssl_faq_clicked_cb, account);
+
+		gtk_box_pack_start(PIDGIN_MINI_DIALOG(mini_dialog)->contents,
+			faq_button, FALSE, FALSE, 0);
+	}
+
 	g_signal_connect_after(mini_dialog, "destroy",
 		(GCallback)generic_error_destroy_cb,
 		account);