# HG changeset patch # User Rob Flynn # Date 977364080 0 # Node ID 1526caa8713854d087c257d416d1129044d2d485 # Parent 6b31e7948b0536249c56de6dd631c34bf9f75069 [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 diff -r 6b31e7948b05 -r 1526caa87138 src/buddy.c --- 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; diff -r 6b31e7948b05 -r 1526caa87138 src/conversation.c --- 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); } diff -r 6b31e7948b05 -r 1526caa87138 src/server.c --- 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) {