diff src/gtkutils.c @ 9910:0cb20555b3ab

[gaim-migrate @ 10802] (21:34:46) nosnilmot: LSchiere: Sean made sounds like this was a good idea earlier but didn't apply it... committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Mon, 30 Aug 2004 01:40:07 +0000
parents 8651abf08dd5
children 83eb12b1f1a1
line wrap: on
line diff
--- a/src/gtkutils.c	Sun Aug 29 16:59:47 2004 +0000
+++ b/src/gtkutils.c	Mon Aug 30 01:40:07 2004 +0000
@@ -661,6 +661,33 @@
 	return FALSE;
 }
 
+void
+gaim_gtk_account_option_menu_set_selected(GtkWidget *optmenu, GaimAccount *account)
+{
+	GtkWidget *menu;
+	GtkWidget *item;
+	gboolean show_all;
+	GaimAccount *curaccount;
+	GaimFilterAccountFunc filter_func;
+
+	menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(optmenu));
+	item = gtk_menu_get_active(GTK_MENU(menu));
+	curaccount = g_object_get_data(G_OBJECT(item), "account");
+
+	if (account == curaccount)
+		return;
+
+	show_all = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(optmenu),
+												 "show_all"));
+
+	filter_func = g_object_get_data(G_OBJECT(optmenu),
+										   "filter_func");
+
+	gtk_option_menu_remove_menu(GTK_OPTION_MENU(optmenu));
+
+	create_account_menu(optmenu, account, filter_func, show_all);
+}
+
 GtkWidget *
 gaim_gtk_account_option_menu_new(GaimAccount *default_account,
 								 gboolean show_all, GCallback cb,