im.pidgin.pidgin: 50186cf4da94766e7f15dc727898da51f906c649

resiak at soc.pidgin.im resiak at soc.pidgin.im
Mon Nov 12 14:05:50 EST 2007


-----------------------------------------------------------------
Revision: 50186cf4da94766e7f15dc727898da51f906c649
Ancestor: 31dc734ac8134adea5117486aeb595ac34c3e746
Author: resiak at soc.pidgin.im
Date: 2007-11-12T18:47:40
Branch: im.pidgin.pidgin

Modified files:
        pidgin/gtkblist.c

ChangeLog: 

Add a clickable link to the SSL FAQ to errors about accounts which need SSL
support.

-------------- next part --------------
============================================================
--- pidgin/gtkblist.c	6f1ac0834fbfc30a54c2dc25f1bb51c4ff4b9952
+++ pidgin/gtkblist.c	22dd3953c0b4087dbe33466e0a1bf9b4f88772e3
@@ -4469,7 +4469,16 @@ generic_error_destroy_cb(GtkObject *dial
 	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 @@ add_generic_error_dialog(PurpleAccount *
 	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);


More information about the Commits mailing list