changeset 24321:068557dd121a

Don't add the Send button to a gtkconv->lower_hbox when the data specifying it already exists. This means you shouldn't get multiple Send buttons for conversations with contacts with multiple contained buddies with whom you've started a conversation. Also, remove that same data when the Send button plugin is removed so that it will come back properly next time you load the plugin.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Thu, 13 Nov 2008 04:32:54 +0000
parents 00d189f90539
children f0d5d78e8e47
files pidgin/plugins/sendbutton.c
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/plugins/sendbutton.c	Tue Nov 11 22:55:02 2008 +0000
+++ b/pidgin/plugins/sendbutton.c	Thu Nov 13 04:32:54 2008 +0000
@@ -41,6 +41,12 @@
 {
 	GtkWidget *send_button;
 
+	send_button = g_object_get_data(G_OBJECT(gtkconv->lower_hbox),
+	                                "send_button");
+
+	if (send_button != NULL)
+		return;
+
 	send_button = gtk_button_new_with_mnemonic(_("_Send"));
 	g_signal_connect(G_OBJECT(send_button), "clicked",
 	                 G_CALLBACK(send_button_cb), gtkconv);
@@ -61,6 +67,8 @@
 	                                "send_button");
 	if (send_button != NULL) {
 		gtk_widget_destroy(send_button);
+		g_object_set_data(G_OBJECT(gtkconv->lower_hbox),
+		                  "send_button", NULL);
 	}
 }