changeset 10500:6ec5da82ef41

[gaim-migrate @ 11792] Disable/enabled the userlist buttons in chat windows when you sign offline committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Mon, 10 Jan 2005 05:54:07 +0000
parents d0c336ad0b27
children 4806967e093e
files src/gtkconv.c src/gtkconv.h src/status.c
diffstat 3 files changed, 23 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkconv.c	Mon Jan 10 05:29:48 2005 +0000
+++ b/src/gtkconv.c	Mon Jan 10 05:54:07 2005 +0000
@@ -2763,6 +2763,14 @@
 			gtk_widget_set_sensitive(gtkwin->menu.alias,
 					(gaim_blist_find_chat(account, gaim_conversation_get_name(conv)) != NULL));
 		}
+
+		/* Deal with chat userlist buttons */
+		if (gaim_conversation_get_type(conv) == GAIM_CONV_CHAT)
+		{
+			gtk_widget_set_sensitive(gtkconv->u.chat->userlist_im, TRUE);
+			gtk_widget_set_sensitive(gtkconv->u.chat->userlist_ignore, TRUE);
+			gtk_widget_set_sensitive(gtkconv->u.chat->userlist_info, (prpl_info->get_info != NULL));
+		}
 	} else {
 		/* Account is offline */
 		/* Or it's a chat that we've left. */
@@ -2780,6 +2788,14 @@
 		gtk_widget_set_sensitive(gtkwin->menu.remove, FALSE);
 		gtk_widget_set_sensitive(gtkwin->menu.insert_link, TRUE);
 		gtk_widget_set_sensitive(gtkwin->menu.insert_image, FALSE);
+
+		/* Deal with chat userlist buttons */
+		if (gaim_conversation_get_type(conv) == GAIM_CONV_CHAT)
+		{
+			gtk_widget_set_sensitive(gtkconv->u.chat->userlist_im, FALSE);
+			gtk_widget_set_sensitive(gtkconv->u.chat->userlist_ignore, FALSE);
+			gtk_widget_set_sensitive(gtkconv->u.chat->userlist_info, FALSE);
+		}
 	}
 
 	/*
@@ -3876,6 +3892,7 @@
 	/* IM */
 	button = gaim_pixbuf_button_from_stock(NULL, GAIM_STOCK_IM,
 										   GAIM_BUTTON_VERTICAL);
+	gtkchat->userlist_im = button;
 	gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
 	gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 0);
 	gtk_tooltips_set_tip(gtkconv->tooltips, button, _("IM the user"), NULL);
@@ -3887,6 +3904,7 @@
 	/* Ignore */
 	button = gaim_pixbuf_button_from_stock(NULL, GAIM_STOCK_IGNORE,
 										   GAIM_BUTTON_VERTICAL);
+	gtkchat->userlist_ignore = button;
 	gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
 	gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 0);
 	gtk_tooltips_set_tip(gtkconv->tooltips, button,
@@ -3898,6 +3916,7 @@
 	/* Info */
 	button = gaim_pixbuf_button_from_stock(NULL, GAIM_STOCK_INFO,
 										   GAIM_BUTTON_VERTICAL);
+	gtkchat->userlist_info = button;
 	gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
 	gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 0);
 	gtk_tooltips_set_tip(gtkconv->tooltips, button,
--- a/src/gtkconv.h	Mon Jan 10 05:29:48 2005 +0000
+++ b/src/gtkconv.h	Mon Jan 10 05:54:07 2005 +0000
@@ -144,6 +144,9 @@
 	GtkWidget *count;
 	GtkWidget *list;
 	GtkWidget *topic_text;
+	GtkWidget *userlist_im;
+	GtkWidget *userlist_ignore;
+	GtkWidget *userlist_info;
 };
 
 /**
--- a/src/status.c	Mon Jan 10 05:29:48 2005 +0000
+++ b/src/status.c	Mon Jan 10 05:54:07 2005 +0000
@@ -430,6 +430,7 @@
 
 	primitive = gaim_status_type_get_primitive(status_type);
 
+	/* Why does "hidden" mean the person is available? */
 	return (primitive == GAIM_STATUS_AVAILABLE ||
 			primitive == GAIM_STATUS_HIDDEN);
 }