changeset 1340:1526caa87138

[gaim-migrate @ 1350] Grey's out the info button on conversation windows if the protocol doesnt support it. Probably should add support for the other buttons to. For example: Warn, Block, add/remove, send :-) committer: Tailor Script <tailor@pidgin.im>
author Rob Flynn <gaim@robflynn.com>
date Thu, 21 Dec 2000 02:01:20 +0000
parents 6b31e7948b05
children 6ec45c45157c
files src/buddy.c src/conversation.c src/server.c
diffstat 3 files changed, 23 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/buddy.c	Thu Dec 21 01:07:18 2000 +0000
+++ b/src/buddy.c	Thu Dec 21 02:01:20 2000 +0000
@@ -359,8 +359,11 @@
 		c = new_conversation(b->name);
 
 		c->gc = b->connlist->data;
+		
 		gtk_option_menu_set_history(GTK_OPTION_MENU(c->menu),
 				g_slist_index(connections, b->connlist->data));
+
+		update_buttons_by_protocol(c);
 	}
 }
 
@@ -398,6 +401,8 @@
 			c->gc = b->connlist->data;
 			gtk_option_menu_set_history(GTK_OPTION_MENU(c->menu),
 					g_slist_index(connections, b->connlist->data));
+		
+			update_buttons_by_protocol(c);
                 }
 	} else if (event->type == GDK_BUTTON_PRESS && event->button == 3) {
 		GtkWidget *menu;
--- a/src/conversation.c	Thu Dec 21 01:07:18 2000 +0000
+++ b/src/conversation.c	Thu Dec 21 02:01:20 2000 +0000
@@ -1643,6 +1643,11 @@
 {
 	struct conversation *cnv = gtk_object_get_user_data(m);
 	cnv->gc = c;
+
+	if (cnv->gc->prpl->set_info == NULL)
+		gtk_widget_set_sensitive(cnv->info, FALSE);
+	else
+		gtk_widget_set_sensitive(cnv->info, TRUE);
 }
 
 void update_convo_add_button(struct conversation *c)
@@ -1715,6 +1720,15 @@
 	}
 }
 
+void update_buttons_by_protocol(struct conversation *c)
+{
+	if (c->gc->prpl->set_info == NULL)
+		gtk_widget_set_sensitive(c->info, FALSE);
+	else
+		gtk_widget_set_sensitive(c->info, TRUE);
+}
+
+
 void show_conv(struct conversation *c)
 {
 	GtkWidget *win;
@@ -1867,6 +1881,7 @@
 
 	info = picture_button2(win, _("Info"), tb_search_xpm, dispstyle);
 	c->info = info;
+
 	gtk_signal_connect(GTK_OBJECT(info), "clicked", GTK_SIGNAL_FUNC(info_callback), c);
 	gtk_box_pack_end(GTK_BOX(bbox), info, dispstyle, dispstyle, 0);
 	gtk_widget_show(info);
@@ -1881,6 +1896,8 @@
 	gtk_box_pack_end(GTK_BOX(bbox), send, dispstyle, dispstyle, 0);
 	gtk_widget_show(send);
 
+	update_buttons_by_protocol(c);
+
 	gtk_widget_show(win);
 }
 
--- a/src/server.c	Thu Dec 21 01:07:18 2000 +0000
+++ b/src/server.c	Thu Dec 21 02:01:20 2000 +0000
@@ -371,6 +371,7 @@
 
 	cnv->gc = gc;
 	gtk_option_menu_set_history(GTK_OPTION_MENU(cnv->menu), g_slist_index(connections, gc));
+	update_buttons_by_protocol(cnv);
 
 
 	if (awaymessage != NULL) {