changeset 4090:286d487a4fd7

[gaim-migrate @ 4305] Fixed the problems with the add/remove button being moved and keeping its original state. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Tue, 17 Dec 2002 06:53:50 +0000
parents 7f4f3aa61069
children 0c131a8ea3d1
files src/buddy_chat.c src/conversation.c
diffstat 2 files changed, 20 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/buddy_chat.c	Tue Dec 17 04:44:00 2002 +0000
+++ b/src/buddy_chat.c	Tue Dec 17 06:53:50 2002 +0000
@@ -1571,19 +1571,27 @@
 		c->send = change_text(c->window, _("Send"), c->send, "gtk-convert", opt);
 		gtk_box_pack_end(GTK_BOX(parent), c->send, FALSE, FALSE, 0);
 
-		c->warn = change_text(c->window, _("Warn"), c->warn, "gtk-dialog-warning", opt);
-		gtk_box_pack_start(GTK_BOX(parent), c->warn, FALSE, FALSE, 0);
-		c->block = change_text(c->window, _("Block"), c->block, "gtk-stop", opt);
-		gtk_box_pack_start(GTK_BOX(parent), c->block, FALSE, FALSE, 0);
+		gtk_widget_destroy(c->sep2);
+		c->sep2 = gtk_vseparator_new();
+		gtk_box_pack_end(GTK_BOX(parent), c->sep2, FALSE, TRUE, 0);
+		gtk_widget_show(c->sep2);
 
 		if (find_buddy(c->gc, c->name) == NULL)
-			 c->add = change_text(c->window, _("Add"), c->add, "gtk-add", opt);
+			c->add = change_text(c->window, _("Add"), c->add, "gtk-add", opt);
 		else
 			c->add = change_text(c->window, _("Remove"), c->add, "gtk-remove", opt);
+
 		gtk_box_pack_start(GTK_BOX(parent), c->add, FALSE, FALSE, 0);
+
+		c->warn = change_text(c->window, _("Warn"), c->warn, "gtk-dialog-warning", opt);
+		gtk_box_pack_start(GTK_BOX(parent), c->warn, FALSE, FALSE, 0);
+
 		c->info = change_text(c->window, _("Info"), c->info, "gtk-find", opt);
 		gtk_box_pack_start(GTK_BOX(parent), c->info, FALSE, FALSE, 0);
 
+		c->block = change_text(c->window, _("Block"), c->block, "gtk-stop", opt);
+		gtk_box_pack_start(GTK_BOX(parent), c->block, FALSE, FALSE, 0);
+
 		gtk_button_set_relief(GTK_BUTTON(c->info), GTK_RELIEF_NONE);
 		gtk_button_set_relief(GTK_BUTTON(c->add), GTK_RELIEF_NONE);
 		gtk_button_set_relief(GTK_BUTTON(c->warn), GTK_RELIEF_NONE);
@@ -1598,16 +1606,12 @@
 
 		gtk_box_reorder_child(GTK_BOX(parent), c->warn, 1);
 		gtk_box_reorder_child(GTK_BOX(parent), c->block, 2);
-		gtk_box_reorder_child(GTK_BOX(parent), c->add, 3);
 		gtk_box_reorder_child(GTK_BOX(parent), c->info, 4);
-		gtk_box_reorder_child(GTK_BOX(parent), c->sep2, 5);
 
 
 		update_buttons_by_protocol(c);
 
-		/* XXX gtk_signal_connect(GTK_OBJECT(c->close), "clicked", GTK_SIGNAL_FUNC(close_callback), c); */
 		gtk_signal_connect(GTK_OBJECT(c->send), "clicked", GTK_SIGNAL_FUNC(send_callback), c);
-		gtk_signal_connect(GTK_OBJECT(c->add), "clicked", GTK_SIGNAL_FUNC(add_callback), c);
 		gtk_signal_connect(GTK_OBJECT(c->info), "clicked", GTK_SIGNAL_FUNC(info_callback), c);
 		gtk_signal_connect(GTK_OBJECT(c->warn), "clicked", GTK_SIGNAL_FUNC(warn_callback), c);
 		gtk_signal_connect(GTK_OBJECT(c->block), "clicked", GTK_SIGNAL_FUNC(block_callback), c);
--- a/src/conversation.c	Tue Dec 17 04:44:00 2002 +0000
+++ b/src/conversation.c	Tue Dec 17 06:53:50 2002 +0000
@@ -2417,14 +2417,16 @@
 
 void update_convo_add_button(struct conversation *c)
 {
-	/*int dispstyle = set_dispstyle(0);*/
+	int dispstyle = set_dispstyle(0);
 	GtkWidget *parent = c->add->parent;
 	gboolean rebuild = FALSE;
 
 	if (find_buddy(c->gc, c->name)) {
 		if (!gtk_object_get_user_data(GTK_OBJECT(c->add))) {
 			gtk_widget_destroy(c->add);
-			c->add = gaim_pixbuf_button_from_stock(_("Remove"), "gtk-remove", GAIM_BUTTON_VERTICAL);
+			c->add = gaim_pixbuf_button_from_stock(dispstyle == 0 ? NULL : _("Remove"),
+												   dispstyle == 1 ? NULL : "gtk-remove",
+												   GAIM_BUTTON_VERTICAL);
 			rebuild = TRUE;
 		}
 		if (c->gc) {
@@ -2438,7 +2440,9 @@
 	} else {
 		if (gtk_object_get_user_data(GTK_OBJECT(c->add))) {
 			gtk_widget_destroy(c->add);
-			c->add = gaim_pixbuf_button_from_stock(_("Add"), "gtk-add", GAIM_BUTTON_VERTICAL);
+			c->add = gaim_pixbuf_button_from_stock(dispstyle == 0 ? NULL : _("Add"),
+												   dispstyle == 1 ? NULL : "gtk-add",
+												   GAIM_BUTTON_VERTICAL);
 			rebuild = TRUE;
 		}
 		if (c->gc) {