changeset 1352:2e8213567278

[gaim-migrate @ 1362] Blah Blah Blah :) The cute grey/non grey stuff works better and is less crashy committer: Tailor Script <tailor@pidgin.im>
author Rob Flynn <gaim@robflynn.com>
date Fri, 22 Dec 2000 02:25:28 +0000
parents 3c7ccd2fd4b0
children f6a8bca11766
files src/buddy.c src/conversation.c src/dialogs.c
diffstat 3 files changed, 34 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/buddy.c	Fri Dec 22 02:09:39 2000 +0000
+++ b/src/buddy.c	Fri Dec 22 02:25:28 2000 +0000
@@ -535,7 +535,7 @@
 	mem = delg->members;
 
 	if (c)
-		update_convo_add_button(c);
+		update_buttons_by_protocol(c);
 
 	// flush buddy list to cache
 
--- a/src/conversation.c	Fri Dec 22 02:09:39 2000 +0000
+++ b/src/conversation.c	Fri Dec 22 02:25:28 2000 +0000
@@ -1653,19 +1653,30 @@
 	GtkWidget *parent = c->add->parent;
 	gtk_widget_destroy(c->add);
 
-	if (c->gc && find_buddy(c->gc, c->name)) {
+	if (find_buddy(c->gc, c->name)) {
 		c->add = picture_button2(c->window, _("Remove"), gnome_remove_xpm, dispstyle);
-		if (c->gc->prpl->remove_buddy == NULL)
-			gtk_widget_set_sensitive(c->add, FALSE);
-		else
-			gtk_widget_set_sensitive(c->add, TRUE);
+
+		if (c->gc) 
+		{
+			if (c->gc->prpl->remove_buddy == NULL)
+				gtk_widget_set_sensitive(c->add, FALSE);
+			else
+				gtk_widget_set_sensitive(c->add, TRUE);
+		}
 	} else {
 		c->add = picture_button2(c->window, _("Add"), gnome_add_xpm, dispstyle);
-		if (c->gc->prpl->add_buddy == NULL)
-			gtk_widget_set_sensitive(c->add, FALSE);
-		else
-			gtk_widget_set_sensitive(c->add, TRUE);
+		if (c->gc) 
+		{
+			if (c->gc->prpl->add_buddy == NULL)
+				gtk_widget_set_sensitive(c->add, FALSE);
+			else
+				gtk_widget_set_sensitive(c->add, TRUE);
+		}
 	}
+
+	if (!c->gc)
+		gtk_widget_set_sensitive(c->add, FALSE);
+
 	gtk_signal_connect(GTK_OBJECT(c->add), "clicked", GTK_SIGNAL_FUNC(add_callback), c);
 	gtk_box_pack_end(GTK_BOX(parent), c->add, dispstyle, dispstyle, 0);
 	gtk_box_reorder_child(GTK_BOX(parent), c->add, 2);
@@ -1719,7 +1730,7 @@
 		else
 			C->gc = NULL;
 
-		update_convo_add_button(C);
+		update_buttons_by_protocol(C);
 
 		c = c->next;
 	}
@@ -1727,6 +1738,17 @@
 
 void update_buttons_by_protocol(struct conversation *c)
 {
+	if (!c->gc)
+	{
+		gtk_widget_set_sensitive(c->info, FALSE);
+		gtk_widget_set_sensitive(c->send, FALSE);
+		gtk_widget_set_sensitive(c->warn, FALSE);
+		gtk_widget_set_sensitive(c->block, FALSE);
+		gtk_widget_set_sensitive(c->add, FALSE);
+
+		return;
+	}
+	
 	if (c->gc->prpl->set_info == NULL && c->info)
 		gtk_widget_set_sensitive(c->info, FALSE);
 	else
--- a/src/dialogs.c	Fri Dec 22 02:09:39 2000 +0000
+++ b/src/dialogs.c	Fri Dec 22 02:25:28 2000 +0000
@@ -774,7 +774,7 @@
 	}
 
         if (c != NULL) {
-		update_convo_add_button(c);
+		update_buttons_by_protocol(c);
 	}
         
         build_edit_tree();