changeset 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 ebca3bbc6719
children 4f1fcf5efaf9
files ChangeLog src/gtkpounce.c src/gtkutils.c src/gtkutils.h
diffstat 4 files changed, 41 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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)
--- 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);
 			}
 		}
 
--- 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,
--- 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.