diff src/dialogs.c @ 2564:552a56d334ec

[gaim-migrate @ 2577] Once upon a midnight dreary, robbie coded weak and weary... committer: Tailor Script <tailor@pidgin.im>
author Rob Flynn <gaim@robflynn.com>
date Sun, 21 Oct 2001 00:15:55 +0000
parents f9bdfca15404
children 075011d08d1d
line wrap: on
line diff
--- a/src/dialogs.c	Sun Oct 21 00:14:41 2001 +0000
+++ b/src/dialogs.c	Sun Oct 21 00:15:55 2001 +0000
@@ -1026,13 +1026,15 @@
 	b->user = u;
 }
 
-static GtkWidget *pounce_user_menu(struct addbp *b)
+static GtkWidget *pounce_user_menu(struct addbp *b, struct gaim_connection *gc)
 {
 	GtkWidget *optmenu;
 	GtkWidget *menu;
 	GtkWidget *opt;
 	GSList *u = aim_users;
 	struct aim_user *a;
+	int count = 0;
+	int place = 0;
 
 	optmenu = gtk_option_menu_new();
 
@@ -1051,13 +1053,19 @@
 		gtk_signal_connect(GTK_OBJECT(opt), "activate", GTK_SIGNAL_FUNC(pounce_choose), b);
 		gtk_menu_append(GTK_MENU(menu), opt);
 		gtk_widget_show(opt);
+
+		if (a->gc == gc) {
+			gtk_menu_item_activate(GTK_MENU_ITEM(opt));
+			place = count;
+		}
+
+		count++;
+			
 		u = u->next;
 	}
 
 	gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu), menu);
-	gtk_option_menu_set_history(GTK_OPTION_MENU(optmenu),
-				    g_slist_index(aim_users,
-						 ((struct gaim_connection *)connections->data)->user));
+	gtk_option_menu_set_history(GTK_OPTION_MENU(optmenu), place);
 	b->user = ((struct gaim_connection *)connections->data)->user;
 
 	b->menu = optmenu;
@@ -1066,7 +1074,7 @@
 }
 
 
-void show_new_bp(char *name)
+void show_new_bp(char *name, struct gaim_connection *gc, int idle, int away)
 {
 	GtkWidget *label;
 	GtkWidget *bbox;
@@ -1109,7 +1117,7 @@
 	gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0);
 	gtk_widget_show(label);
 
-	optmenu = pounce_user_menu(b);
+	optmenu = pounce_user_menu(b, gc);
 	gtk_table_attach(GTK_TABLE(table), optmenu, 1, 2, 0, 1, GTK_FILL | GTK_EXPAND, 0, 0, 0);
 	gtk_widget_show(optmenu);
 
@@ -1144,10 +1152,14 @@
 	gtk_widget_show(b->p_signon);
 
 	b->p_unaway = gtk_check_button_new_with_label(_("Pounce on return from away"));
+	if (away)
+		gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(b->p_unaway), TRUE);
 	gtk_table_attach(GTK_TABLE(table), b->p_unaway, 1, 2, 0, 1, GTK_FILL | GTK_EXPAND, 0, 0, 0);
 	gtk_widget_show(b->p_unaway);
 
 	b->p_unidle = gtk_check_button_new_with_label(_("Pounce on return from idle"));
+	if (idle)
+		gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(b->p_unidle), TRUE);
 	gtk_table_attach(GTK_TABLE(table), b->p_unidle, 0, 1, 1, 2, GTK_FILL, 0, 0, 0);
 	gtk_widget_show(b->p_unidle);