# HG changeset patch # User Mark Doliner # Date 1084660749 0 # Node ID 88ec59dec95aedba188ace86ab143053c34af0cc # Parent fd1a4ff1f7eda0a27d6db46ffc57c31021404318 [gaim-migrate @ 9708] Make the Tools->Privacy menu item be insensitive if there are no accounts online that support privacy. committer: Tailor Script diff -r fd1a4ff1f7ed -r 88ec59dec95a src/gtkblist.c --- a/src/gtkblist.c Sat May 15 21:56:17 2004 +0000 +++ b/src/gtkblist.c Sat May 15 22:39:09 2004 +0000 @@ -2892,6 +2892,9 @@ widget = gtk_item_factory_get_widget(gtkblist->ift, N_("/Tools/Room List")); gtk_widget_set_sensitive(widget, gaim_roomlist_is_showable()); + + widget = gtk_item_factory_get_widget(gtkblist->ift, N_("/Tools/Privacy")); + gtk_widget_set_sensitive(widget, gaim_gtk_privacy_is_showable()); } /* this is called on all sorts of signals, and we have no reason to pass diff -r fd1a4ff1f7ed -r 88ec59dec95a src/gtkprivacy.c --- a/src/gtkprivacy.c Sat May 15 21:56:17 2004 +0000 +++ b/src/gtkprivacy.c Sat May 15 22:39:09 2004 +0000 @@ -347,6 +347,22 @@ return (prpl_info->set_permit_deny != NULL); } +gboolean +gaim_gtk_privacy_is_showable() +{ + GList *c; + GaimConnection *gc; + + for (c = gaim_connections_get_all(); c != NULL; c = c->next) { + gc = c->data; + + if (check_account_func(gaim_connection_get_account(gc))) + return TRUE; + } + + return FALSE; +} + static GaimGtkPrivacyDialog * privacy_dialog_new(void) { diff -r fd1a4ff1f7ed -r 88ec59dec95a src/gtkprivacy.h --- a/src/gtkprivacy.h Sat May 15 21:56:17 2004 +0000 +++ b/src/gtkprivacy.h Sat May 15 22:39:09 2004 +0000 @@ -33,6 +33,14 @@ void gaim_gtk_privacy_init(void); /** + * Determine if showing the privacy dialog is a valid action. + * + * @return TRUE if there are accounts online that support privacy. + * Otherwise return FALSE. + */ +gboolean gaim_gtk_privacy_is_showable(void); + +/** * Shows the privacy dialog. */ void gaim_gtk_privacy_dialog_show(void);