Index: src/gtkpounce.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/gtkpounce.c,v retrieving revision 1.59 diff -u -p -r1.59 gtkpounce.c --- src/gtkpounce.c 20 Aug 2004 05:11:30 -0000 1.59 +++ src/gtkpounce.c 29 Aug 2004 17:38:51 -0000 @@ -296,6 +296,8 @@ pounce_dnd_recv(GtkWidget *widget, GdkDr dialog = (GaimGtkPounceDialog *)data; gtk_entry_set_text(GTK_ENTRY(dialog->buddy_entry), buddy->name); + dialog->account = buddy->account; + gaim_gtk_account_option_menu_set_selected(dialog->account_menu, buddy->account); gtk_drag_finish(dc, TRUE, (dc->action == GDK_ACTION_MOVE), t); } @@ -319,6 +321,8 @@ pounce_dnd_recv(GtkWidget *widget, GdkDr dialog = (GaimGtkPounceDialog *)data; gtk_entry_set_text(GTK_ENTRY(dialog->buddy_entry), username); + dialog->account = account; + gaim_gtk_account_option_menu_set_selected(dialog->account_menu, account); } } Index: src/gtkutils.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/gtkutils.c,v retrieving revision 1.90 diff -u -p -r1.90 gtkutils.c --- src/gtkutils.c 28 Aug 2004 13:54:55 -0000 1.90 +++ src/gtkutils.c 29 Aug 2004 17:38:51 -0000 @@ -661,6 +661,33 @@ account_menu_destroyed_cb(GtkWidget *opt 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, Index: src/gtkutils.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/gtkutils.h,v retrieving revision 1.40 diff -u -p -r1.40 gtkutils.h --- src/gtkutils.h 20 Aug 2004 05:11:30 -0000 1.40 +++ src/gtkutils.h 29 Aug 2004 17:38:51 -0000 @@ -222,6 +222,15 @@ GtkWidget *gaim_gtk_account_option_menu_ GaimAccount *gaim_gtk_account_option_menu_get_selected(GtkWidget *optmenu); /** + * Sets the currently selected account for an account drop down box. + * + * @param optmenu The GtkOptionMenu created by + * gaim_gtk_account_option_menu_new. + * @param account The GaimAccount to select. + */ +void gaim_gtk_account_option_menu_set_selected(GtkWidget *optmenu, GaimAccount *account); + +/** * Check if the given path is a directory or not. If it is, then modify * the given GtkFileSelection dialog so that it displays the given path. * If the given path is not a directory, then do nothing.