# HG changeset patch # User Luke Schierer # Date 1093830007 0 # Node ID 0cb20555b3ab62da8d2e4bcbc5346dd9f1b14d52 # Parent ebca3bbc6719a4a3ffec74ed9cd7cc61b36ede05 [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 diff -r ebca3bbc6719 -r 0cb20555b3ab ChangeLog --- a/ChangeLog Sun Aug 29 16:59:47 2004 +0000 +++ b/ChangeLog Mon Aug 30 01:40:07 2004 +0000 @@ -2,6 +2,7 @@ version 0.83: New Features: * Drag-and-drop buddy support for the Invite dialog (Stu Tomlinson) + * Drag-and-drop buddy support for the Pounce dialog (Stu Tomlinson) Bug Fixes: * Compile with gtk 2.5.x (Gary Kramlich) diff -r ebca3bbc6719 -r 0cb20555b3ab src/gtkpounce.c --- a/src/gtkpounce.c Sun Aug 29 16:59:47 2004 +0000 +++ b/src/gtkpounce.c Mon Aug 30 01:40:07 2004 +0000 @@ -296,6 +296,8 @@ 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 @@ 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); } } diff -r ebca3bbc6719 -r 0cb20555b3ab src/gtkutils.c --- 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, diff -r ebca3bbc6719 -r 0cb20555b3ab src/gtkutils.h --- a/src/gtkutils.h Sun Aug 29 16:59:47 2004 +0000 +++ b/src/gtkutils.h Mon Aug 30 01:40:07 2004 +0000 @@ -222,6 +222,15 @@ 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.