changeset 7060:9946001989a3

[gaim-migrate @ 7623] show_add_buddy, show_add_chat, and show_add_group are gone, replaced with the new core/UI split gaim_blist_request_add_{buddy,chat,group}. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Tue, 30 Sep 2003 05:48:42 +0000
parents e36cbed14f1e
children 80fd120e180b
files src/blist.c src/blist.h src/dialogs.c src/gtkaccount.c src/gtkconv.c src/gtkutils.c src/protocols/oscar/oscar.c src/ui.h
diffstat 8 files changed, 91 insertions(+), 626 deletions(-) [+]
line wrap: on
line diff
--- a/src/blist.c	Tue Sep 30 05:46:16 2003 +0000
+++ b/src/blist.c	Tue Sep 30 05:48:42 2003 +0000
@@ -2274,6 +2274,40 @@
 	g_free(filename);
 }
 
+void
+gaim_blist_request_add_buddy(GaimAccount *account, const char *username,
+							 const char *group, const char *alias)
+{
+	struct gaim_blist_ui_ops *ui_ops;
+
+	ui_ops = gaim_blist_get_ui_ops();
+
+	if (ui_ops != NULL && ui_ops->request_add_buddy != NULL)
+		ui_ops->request_add_buddy(account, username, group, alias);
+}
+
+void
+gaim_blist_request_add_chat(GaimAccount *account, GaimGroup *group)
+{
+	struct gaim_blist_ui_ops *ui_ops;
+
+	ui_ops = gaim_blist_get_ui_ops();
+
+	if (ui_ops != NULL && ui_ops->request_add_chat != NULL)
+		ui_ops->request_add_chat(account, group);
+}
+
+void
+gaim_blist_request_add_group(void)
+{
+	struct gaim_blist_ui_ops *ui_ops;
+
+	ui_ops = gaim_blist_get_ui_ops();
+
+	if (ui_ops != NULL && ui_ops->request_add_group != NULL)
+		ui_ops->request_add_group();
+}
+
 static void blist_print_group_settings(gpointer key, gpointer data,
 		gpointer user_data) {
 	char *key_val;
--- a/src/blist.h	Tue Sep 30 05:46:16 2003 +0000
+++ b/src/blist.h	Tue Sep 30 05:48:42 2003 +0000
@@ -170,7 +170,10 @@
 	void (*destroy)(struct gaim_buddy_list *list);  /**< When the list gets destroyed, this gets called to destroy the UI. */
 	void (*set_visible)(struct gaim_buddy_list *list,
 			    gboolean show);             /**< Hides or unhides the buddy list */
-
+	void (*request_add_buddy)(GaimAccount *account, const char *username,
+							  const char *group, const char *alias);
+	void (*request_add_chat)(GaimAccount *account, GaimGroup *group);
+	void (*request_add_group)(void);
 };
 
 #ifdef __cplusplus
@@ -669,6 +672,33 @@
 void gaim_blist_load();
 
 /**
+ * Requests from the user information needed to add a buddy to the
+ * buddy list.
+ *
+ * @param account  The account the buddy is added to.
+ * @param username The username of the buddy.
+ * @param group    The name of the group to place the buddy in.
+ * @param alias    The optional alias for the buddy.
+ */
+void gaim_blist_request_add_buddy(GaimAccount *account, const char *username,
+								  const char *group, const char *alias);
+
+/**
+ * Requests from the user information needed to add a chat to the
+ * buddy list.
+ *
+ * @param account The account the buddy is added to.
+ * @param group   The optional group to add the chat to.
+ */
+void gaim_blist_request_add_chat(GaimAccount *account, GaimGroup *group);
+
+/**
+ * Requests from the user information needed to add a group to the
+ * buddy list.
+ */
+void gaim_blist_request_add_group(void);
+
+/**
  * Associates some data with the group in the xml buddy list
  *
  * @param g      The group the data is associated with
--- a/src/dialogs.c	Tue Sep 30 05:46:16 2003 +0000
+++ b/src/dialogs.c	Tue Sep 30 05:48:42 2003 +0000
@@ -38,6 +38,10 @@
 
 #include "ui.h"
 
+#ifdef USE_GTKSPELL
+# include <gtkspell/gtkspell.h>
+#endif
+
 /* XXX */
 #include "gaim.h"
 
@@ -77,15 +81,6 @@
 	GaimConnection *gc;
 };
 
-struct addbuddy {
-	GtkWidget *window;
-	GtkWidget *combo;
-	GtkWidget *entry;
-	GtkWidget *entry_for_alias;
-	GtkWidget *account;
-	GaimConnection *gc;
-};
-
 struct findbyemail {
 	GtkWidget *window;
 	GtkWidget *emailentry;
@@ -827,585 +822,12 @@
 }
 
 
-/*------------------------------------------------------------------------*/
-/*  The dialog for adding buddies                                         */
-/*------------------------------------------------------------------------*/
-
-extern void add_callback(GtkWidget *, GaimConversation *);
-
-void do_add_buddy(GtkWidget *w, int resp, struct addbuddy *a)
-{
-	const char *grp, *who, *whoalias;
-	GaimConversation *c;
-	GaimBuddy *b;
-	GaimGroup *g;
-
-	if (resp == GTK_RESPONSE_OK) {
-
-		who = gtk_entry_get_text(GTK_ENTRY(a->entry));
-		grp = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(a->combo)->entry));
-		whoalias = gtk_entry_get_text(GTK_ENTRY(a->entry_for_alias));
-
-		c = gaim_find_conversation_with_account(who, a->gc->account);
-		if (!(g = gaim_find_group(grp))) {
-			g = gaim_group_new(grp);
-			gaim_blist_add_group(g, NULL);
-		}
-		b = gaim_buddy_new(a->gc->account, who, whoalias);
-		gaim_blist_add_buddy(b, NULL, g, NULL);
-		serv_add_buddy(a->gc, who, g);
-
-		if (c != NULL)
-			gaim_buddy_icon_update(gaim_im_get_icon(GAIM_IM(c)));
-
-		gaim_blist_save();
-	}
-
-	destroy_dialog(NULL, a->window);
-}
-
-static GList *groups_tree()
-{
-	GList *tmp = NULL;
-	char *tmp2;
-	GaimGroup *g;
-
-	GaimBlistNode *gnode = gaim_get_blist()->root;
-
-	if (!gnode) {
-		tmp2 = g_strdup(_("Buddies"));
-		tmp = g_list_append(tmp, tmp2);
-	} else {
-		while (gnode) {
-			if(GAIM_BLIST_NODE_IS_GROUP(gnode)) {
-				g = (GaimGroup *)gnode;
-				tmp2 = g->name;
-				tmp = g_list_append(tmp, tmp2);
-			}
-			gnode = gnode->next;
-		}
-	}
-	return tmp;
-}
-
-static void free_dialog(GtkWidget *w, struct addbuddy *a)
-{
-	g_free(a);
-}
-
-
 static void
-add_group_cb(GaimConnection *gc, const char *group_name)
-{
-	GaimGroup *g;
-
-	g = gaim_group_new(group_name);
-	gaim_blist_add_group(g, NULL);
-	gaim_blist_save();
-}
-
-void
-show_add_group(GaimConnection *gc)
-{
-	gaim_request_input(NULL, _("Add Group"), _("Add a new group"),
-					   _("Please enter the name of the group to be added."),
-					   NULL, FALSE, FALSE,
-					   _("Add"), G_CALLBACK(add_group_cb),
-					   _("Cancel"), NULL, gc);
-}
-
-static void
-addbuddy_select_account(GObject *w, GaimAccount *account,
-						struct addbuddy *b)
-{
-	/* Save our account */
-	b->gc = gaim_account_get_connection(account);
-}
-
-void show_add_buddy(GaimConnection *gc, char *buddy, char *group, char *alias)
+free_dialog(GtkWidget *w, void *data)
 {
-	GtkWidget *table;
-	GtkWidget *label;
-	GtkWidget *hbox;
-	GtkWidget *vbox;
-	struct gaim_gtk_buddy_list *gtkblist;
-	GtkWidget *img = gtk_image_new_from_stock(GAIM_STOCK_DIALOG_QUESTION, GTK_ICON_SIZE_DIALOG);
-	struct addbuddy *a = g_new0(struct addbuddy, 1);
-	a->gc = gc ? gc : gaim_connections_get_all()->data;
-
-	gtkblist = GAIM_GTK_BLIST(gaim_get_blist());
-
-	GAIM_DIALOG(a->window);
-	a->window = gtk_dialog_new_with_buttons(_("Add Buddy"), gtkblist->window ? GTK_WINDOW(gtkblist->window) : NULL, 0,
-					GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_ADD, GTK_RESPONSE_OK, NULL);
-
-	gtk_dialog_set_default_response(GTK_DIALOG(a->window), GTK_RESPONSE_OK);
-	gtk_container_set_border_width(GTK_CONTAINER(a->window), 6);
-	gtk_window_set_resizable(GTK_WINDOW(a->window), FALSE);
-	gtk_dialog_set_has_separator(GTK_DIALOG(a->window), FALSE);
-	gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(a->window)->vbox), 12);
-	gtk_container_set_border_width(GTK_CONTAINER(GTK_DIALOG(a->window)->vbox), 6);
-	gtk_window_set_role(GTK_WINDOW(a->window), "add_buddy");
-
-	hbox = gtk_hbox_new(FALSE, 12);
-	gtk_container_add(GTK_CONTAINER(GTK_DIALOG(a->window)->vbox), hbox);
-	gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0);
-	gtk_misc_set_alignment(GTK_MISC(img), 0, 0);
-
-	vbox = gtk_vbox_new(FALSE, 0);
-	gtk_container_add(GTK_CONTAINER(hbox), vbox);
-
-	label = gtk_label_new(_("Please enter the screen name of the person you would like to add to your buddy list. You may optionally enter an alias, or nickname,  for the buddy. The alias will be displayed in place of the screen name whenever possible.\n"));
-	gtk_widget_set_size_request(GTK_WIDGET(label), 400, -1);
-	gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
-	gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
-	gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
-
-	hbox = gtk_hbox_new(FALSE, 6);
-	gtk_container_add(GTK_CONTAINER(vbox), hbox);
-
-	g_signal_connect(G_OBJECT(a->window), "destroy", G_CALLBACK(destroy_dialog), a->window);
-	g_signal_connect(G_OBJECT(a->window), "destroy", G_CALLBACK(free_dialog), a);
-	dialogwindows = g_list_prepend(dialogwindows, a->window);
-
-	table = gtk_table_new(4, 2, FALSE);
-	gtk_table_set_row_spacings(GTK_TABLE(table), 5);
-	gtk_table_set_col_spacings(GTK_TABLE(table), 5);
-	gtk_container_set_border_width(GTK_CONTAINER(table), 0);
-	gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0);
-
-	label = gtk_label_new(_("Screen Name"));
-	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
-	gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 0, 1);
-
-	a->entry = gtk_entry_new();
-	gtk_table_attach_defaults(GTK_TABLE(table), a->entry, 1, 2, 0, 1);
-	gtk_widget_grab_focus(a->entry);
-
-	if (buddy != NULL)
-		gtk_entry_set_text(GTK_ENTRY(a->entry), buddy);
-
-	gtk_entry_set_activates_default (GTK_ENTRY(a->entry), TRUE);
-
-	label = gtk_label_new(_("Alias"));
-	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
-	gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 1, 2);
-
-	a->entry_for_alias = gtk_entry_new();
-	gtk_table_attach_defaults(GTK_TABLE(table), a->entry_for_alias, 1, 2, 1, 2);
-	if (alias != NULL)
-		gtk_entry_set_text(GTK_ENTRY(a->entry_for_alias), alias);
-	gtk_entry_set_activates_default (GTK_ENTRY(a->entry_for_alias), TRUE);
-
-	label = gtk_label_new(_("Group"));
-	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
-	gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 2, 3);
-
-	a->combo = gtk_combo_new();
-	gtk_combo_set_popdown_strings(GTK_COMBO(a->combo), groups_tree());
-	gtk_table_attach_defaults(GTK_TABLE(table), a->combo, 1, 2, 2, 3);
-
-	/* Set up stuff for the account box */
-	label = gtk_label_new(_("Add To"));
-	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
-	gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 3, 4);
-
-	a->account = gaim_gtk_account_option_menu_new(
-			gc ? gaim_connection_get_account(gc) : NULL, FALSE,
-			G_CALLBACK(addbuddy_select_account), NULL, a);
-
-	gtk_table_attach_defaults(GTK_TABLE(table), a->account, 1, 2, 3, 4);
-
-	/* End of account box */
-
-	g_signal_connect(G_OBJECT(a->window), "response",
-					 G_CALLBACK(do_add_buddy), a);
-
-	gtk_widget_show_all(a->window);
-
-	if (group != NULL)
-		gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(a->combo)->entry), group);
-}
-
-struct addchat {
-    GaimAccount *account;
-    GtkWidget *window;
-	GtkWidget *account_menu;
-	GtkWidget *alias_entry;
-	GtkWidget *group_combo;
-	GtkWidget *entries_box;
-	GtkSizeGroup *sg;
-	GList *entries;
-};
-
-static void do_add_chat(GtkWidget *w, struct addchat *ac) {
-	GHashTable *components = g_hash_table_new_full(g_str_hash, g_str_equal,
-			g_free, g_free);
-	GList *tmp;
-
-	GaimBlistChat *chat;
-	GaimGroup *group;
-	const char *group_name;
-
-	for(tmp = ac->entries; tmp; tmp = tmp->next) {
-		if(g_object_get_data(tmp->data, "is_spin")) {
-			g_hash_table_replace(components,
-					g_strdup(g_object_get_data(tmp->data, "identifier")),
-					g_strdup_printf("%d",
-						gtk_spin_button_get_value_as_int(tmp->data)));
-		} else {
-			g_hash_table_replace(components,
-					g_strdup(g_object_get_data(tmp->data, "identifier")),
-					g_strdup(gtk_entry_get_text(tmp->data)));
-		}
-	}
-
-	chat = gaim_blist_chat_new(ac->account, gtk_entry_get_text(GTK_ENTRY(ac->alias_entry)), components);
-
-	group_name = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(ac->group_combo)->entry));
-	if (!(group = gaim_find_group(group_name))) {
-		group = gaim_group_new(group_name);
-		gaim_blist_add_group(group, NULL);
-	}
-
-	if(chat) {
-		gaim_blist_add_chat(chat, group, NULL);
-		gaim_blist_save();
-	}
-
-	gtk_widget_destroy(ac->window);
-	g_list_free(ac->entries);
-
-	g_free(ac);
-}
-
-static void do_add_chat_resp(GtkWidget *w, int resp, struct addchat *ac) {
-	if(resp == GTK_RESPONSE_OK) {
-		do_add_chat(NULL, ac);
-	} else {
-		gtk_widget_destroy(ac->window);
-		g_list_free(ac->entries);
-		g_free(ac);
-	}
+	g_free(data);
 }
 
-
-static void rebuild_addchat_entries(struct addchat *ac) {
-	GList *list, *tmp;
-	struct proto_chat_entry *pce;
-	gboolean focus = TRUE;
-
-	while(GTK_BOX(ac->entries_box)->children)
-		gtk_container_remove(GTK_CONTAINER(ac->entries_box),
-				((GtkBoxChild *)GTK_BOX(ac->entries_box)->children->data)->widget);
-
-	if(ac->entries)
-		g_list_free(ac->entries);
-
-	ac->entries = NULL;
-
-	list = GAIM_PLUGIN_PROTOCOL_INFO(ac->account->gc->prpl)->chat_info(ac->account->gc);
-
-	for(tmp = list; tmp; tmp = tmp->next) {
-		GtkWidget *label;
-		GtkWidget *rowbox;
-		pce = tmp->data;
-
-		rowbox = gtk_hbox_new(FALSE, 5);
-		gtk_box_pack_start(GTK_BOX(ac->entries_box), rowbox, FALSE, FALSE, 0);
-
-		label = gtk_label_new(pce->label);
-		gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
-		gtk_size_group_add_widget(ac->sg, label);
-		gtk_box_pack_start(GTK_BOX(rowbox), label, FALSE, FALSE, 0);
-
-		if(pce->is_int) {
-			GtkObject *adjust;
-			GtkWidget *spin;
-			adjust = gtk_adjustment_new(pce->min, pce->min, pce->max,
-					1, 10, 10);
-			spin = gtk_spin_button_new(GTK_ADJUSTMENT(adjust), 1, 0);
-			g_object_set_data(G_OBJECT(spin), "is_spin", GINT_TO_POINTER(TRUE));
-			g_object_set_data(G_OBJECT(spin), "identifier", pce->identifier);
-			ac->entries = g_list_append(ac->entries, spin);
-			gtk_widget_set_size_request(spin, 50, -1);
-			gtk_box_pack_end(GTK_BOX(rowbox), spin, FALSE, FALSE, 0);
-		} else {
-			GtkWidget *entry = gtk_entry_new();
-			g_object_set_data(G_OBJECT(entry), "identifier", pce->identifier);
-			ac->entries = g_list_append(ac->entries, entry);
-
-			if(pce->def)
-				gtk_entry_set_text(GTK_ENTRY(entry), pce->def);
-
-			if(focus) {
-				gtk_widget_grab_focus(entry);
-				focus = FALSE;
-			}
-
-			if(pce->secret)
-				gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE);
-
-			gtk_box_pack_end(GTK_BOX(rowbox), entry, TRUE, TRUE, 0);
-
-			g_signal_connect(G_OBJECT(entry), "activate",
-					G_CALLBACK(do_add_chat), ac);
-		}
-		g_free(pce);
-	}
-
-	gtk_widget_show_all(ac->entries_box);
-}
-
-static void addchat_select_account(GObject *w, GaimConnection *gc)
-{
-	struct addchat *ac = g_object_get_data(w, "addchat");
-	GaimAccount *account;
-
-	account = gaim_connection_get_account(gc);
-
-	if (gaim_account_get_protocol(ac->account) ==
-		gaim_account_get_protocol(account)) {
-
-		ac->account = account;
-	} else {
-		ac->account = account;
-		rebuild_addchat_entries(ac);
-	}
-}
-
-static void create_online_account_menu_for_add_chat(struct addchat *ac)
-{
-	char buf[2048]; /* Never hurts to be safe ;-) */
-	GList *g;
-	GaimConnection *c;
-	GaimAccount *account;
-	GtkWidget *menu, *opt;
-	GtkWidget *hbox;
-	GtkWidget *label;
-	GtkWidget *image;
-	GdkPixbuf *pixbuf;
-	GdkPixbuf *scale;
-	GtkSizeGroup *sg;
-	char *filename;
-	const char *proto_name;
-	int count = 0;
-	int place = 0;
-
-	menu = gtk_menu_new();
-
-	sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
-
-	for (g = gaim_connections_get_all(); g != NULL; g = g->next) {
-		GaimPluginProtocolInfo *prpl_info = NULL;
-		GaimPlugin *plugin;
-
-		c = (GaimConnection *)g->data;
-		account = gaim_connection_get_account(c);
-
-		plugin = c->prpl;
-
-		if (plugin == NULL)
-			continue;
-
-		prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(plugin);
-
-		if (prpl_info == NULL || prpl_info->join_chat == NULL)
-			continue;
-
-		opt = gtk_menu_item_new();
-
-		/* Create the hbox. */
-		hbox = gtk_hbox_new(FALSE, 4);
-		gtk_container_add(GTK_CONTAINER(opt), hbox);
-		gtk_widget_show(hbox);
-
-		/* Load the image. */
-		if (prpl_info != NULL) {
-			proto_name = prpl_info->list_icon(NULL, NULL);
-			g_snprintf(buf, sizeof(buf), "%s.png", proto_name);
-
-			filename = g_build_filename(DATADIR, "pixmaps", "gaim", "status",
-										"default", buf, NULL);
-			pixbuf = gdk_pixbuf_new_from_file(filename, NULL);
-			g_free(filename);
-
-			if (pixbuf != NULL) {
-				/* Scale and insert the image */
-				scale = gdk_pixbuf_scale_simple(pixbuf, 16, 16,
-												GDK_INTERP_BILINEAR);
-				image = gtk_image_new_from_pixbuf(scale);
-
-				g_object_unref(G_OBJECT(pixbuf));
-				g_object_unref(G_OBJECT(scale));
-			}
-			else
-				image = gtk_image_new();
-		}
-		else
-			image = gtk_image_new();
-
-		gtk_size_group_add_widget(sg, image);
-
-		gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 0);
-		gtk_widget_show(image);
-
-		g_snprintf(buf, sizeof(buf), "%s (%s)",
-				   gaim_account_get_username(account),
-				   c->prpl->info->name);
-
-		/* Create the label. */
-		label = gtk_label_new(buf);
-		gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
-		gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
-		gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 0);
-		gtk_widget_show(label);
-
-
-		g_object_set_data(G_OBJECT(opt), "addchat", ac);
-		g_signal_connect(G_OBJECT(opt), "activate",
-						 G_CALLBACK(addchat_select_account), c);
-		gtk_widget_show(opt);
-		gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt);
-
-		/* Now check to see if it's our current menu */
-		if (c->account == ac->account) {
-			place = count;
-			gtk_menu_item_activate(GTK_MENU_ITEM(opt));
-			gtk_option_menu_set_history(GTK_OPTION_MENU(ac->account_menu),
-										count);
-
-			/* Do the cha cha cha */
-		}
-
-		count++;
-	}
-
-	g_object_unref(sg);
-
-	gtk_option_menu_remove_menu(GTK_OPTION_MENU(ac->account_menu));
-	gtk_option_menu_set_menu(GTK_OPTION_MENU(ac->account_menu), menu);
-	gtk_option_menu_set_history(GTK_OPTION_MENU(ac->account_menu), place);
-}
-
-void show_add_chat(GaimAccount *account, GaimGroup *group) {
-    struct addchat *ac = g_new0(struct addchat, 1);
-    struct gaim_gtk_buddy_list *gtkblist;
-    GList *c;
-    GaimConnection *gc;
-
-	GtkWidget *label;
-	GtkWidget *rowbox;
-	GtkWidget *hbox;
-	GtkWidget *vbox;
-	GtkWidget *img = gtk_image_new_from_stock(GAIM_STOCK_DIALOG_QUESTION,
-			GTK_ICON_SIZE_DIALOG);
-
-    gtkblist = GAIM_GTK_BLIST(gaim_get_blist());
-
-    if (account) {
-		ac->account = account;
-	} else {
-		/* Select an account with chat capabilities */
-		for (c = gaim_connections_get_all(); c != NULL; c = c->next) {
-			gc = c->data;
-
-			if (GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl)->join_chat) {
-				ac->account = gc->account;
-				break;
-			}
-		}
-	}
-
-    if (!ac->account) {
-		gaim_notify_error(NULL, NULL,
-						  _("You are not currently signed on with any "
-							"protocols that have the ability to chat."), NULL);
-		return;
-    }
-
-	ac->sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
-
-    ac->window = gtk_dialog_new_with_buttons(_("Add Chat"),
-            GTK_WINDOW(gtkblist->window), 0,
-            GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
-            GTK_STOCK_ADD, GTK_RESPONSE_OK,
-            NULL);
-
-    gtk_dialog_set_default_response(GTK_DIALOG(ac->window), GTK_RESPONSE_OK);
-    gtk_container_set_border_width(GTK_CONTAINER(ac->window), 6);
-    gtk_window_set_resizable(GTK_WINDOW(ac->window), FALSE);
-    gtk_dialog_set_has_separator(GTK_DIALOG(ac->window), FALSE);
-    gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(ac->window)->vbox), 12);
-    gtk_container_set_border_width(GTK_CONTAINER(GTK_DIALOG(ac->window)->vbox),
-            6);
-	gtk_window_set_role(GTK_WINDOW(ac->window), "add_chat");
-
-	hbox = gtk_hbox_new(FALSE, 12);
-	gtk_container_add(GTK_CONTAINER(GTK_DIALOG(ac->window)->vbox), hbox);
-	gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0);
-	gtk_misc_set_alignment(GTK_MISC(img), 0, 0);
-
-	vbox = gtk_vbox_new(FALSE, 5);
-	gtk_container_add(GTK_CONTAINER(hbox), vbox);
-
-	label = gtk_label_new(_("Please enter an alias, and the appropriate information about the chat you would like to add to your buddy list.\n"));
-	gtk_widget_set_size_request(label, 400, -1);
-	gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
-	gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
-	gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
-
-	rowbox = gtk_hbox_new(FALSE, 5);
-	gtk_box_pack_start(GTK_BOX(vbox), rowbox, FALSE, FALSE, 0);
-
-	label = gtk_label_new(_("Account:"));
-	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
-	gtk_size_group_add_widget(ac->sg, label);
-	gtk_box_pack_start(GTK_BOX(rowbox), label, FALSE, FALSE, 0);
-
-	ac->account_menu = gtk_option_menu_new();
-	gtk_box_pack_end(GTK_BOX(rowbox), ac->account_menu, TRUE, TRUE, 0);
-
-	create_online_account_menu_for_add_chat(ac);
-
-	ac->entries_box = gtk_vbox_new(FALSE, 5);
-    gtk_container_set_border_width(GTK_CONTAINER(ac->entries_box), 0);
-	gtk_box_pack_start(GTK_BOX(vbox), ac->entries_box, TRUE, TRUE, 0);
-
-	rebuild_addchat_entries(ac);
-
-	rowbox = gtk_hbox_new(FALSE, 5);
-	gtk_box_pack_start(GTK_BOX(vbox), rowbox, FALSE, FALSE, 0);
-
-	label = gtk_label_new(_("Alias:"));
-	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
-	gtk_size_group_add_widget(ac->sg, label);
-	gtk_box_pack_start(GTK_BOX(rowbox), label, FALSE, FALSE, 0);
-
-	ac->alias_entry = gtk_entry_new();
-	gtk_box_pack_end(GTK_BOX(rowbox), ac->alias_entry, TRUE, TRUE, 0);
-
-	rowbox = gtk_hbox_new(FALSE, 5);
-	gtk_box_pack_start(GTK_BOX(vbox), rowbox, FALSE, FALSE, 0);
-
-    label = gtk_label_new(_("Group:"));
-	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
-	gtk_size_group_add_widget(ac->sg, label);
-	gtk_box_pack_start(GTK_BOX(rowbox), label, FALSE, FALSE, 0);
-
-    ac->group_combo = gtk_combo_new();
-    gtk_combo_set_popdown_strings(GTK_COMBO(ac->group_combo), groups_tree());
-	gtk_box_pack_end(GTK_BOX(rowbox), ac->group_combo, TRUE, TRUE, 0);
-
-	if (group)
-		gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(ac->group_combo)->entry), group->name);
-
-	g_signal_connect(G_OBJECT(ac->window), "response", G_CALLBACK(do_add_chat_resp), ac);
-
-	gtk_widget_show_all(ac->window);
-}
-
-
 /*------------------------------------------------------------------------*/
 /*  The dialog for SET INFO / SET DIR INFO                                */
 /*------------------------------------------------------------------------*/
@@ -1765,7 +1187,7 @@
 	b->text = gtk_text_view_new();
 	gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(b->text), GTK_WRAP_WORD_CHAR);
 #ifdef USE_GTKSPELL
- 	if (gaim_prefs_get_bool("/gaim/gtk/conversations/spellcheck"))
+	if (gaim_prefs_get_bool("/gaim/gtk/conversations/spellcheck"))
 		gtkspell_new_attach(GTK_TEXT_VIEW(b->text), NULL, NULL);
 #endif
 	gtk_widget_set_size_request(b->text, 300, 200);
--- a/src/gtkaccount.c	Tue Sep 30 05:46:16 2003 +0000
+++ b/src/gtkaccount.c	Tue Sep 30 05:48:42 2003 +0000
@@ -1933,7 +1933,10 @@
 	GaimConnection *gc = gaim_account_get_connection(data->account);
 
 	if (g_list_find(gaim_connections_get_all(), gc))
-		show_add_buddy(gc, data->username, NULL, data->alias);
+	{
+		gaim_blist_request_add_buddy(data->account, data->username,
+									 NULL, data->alias);
+	}
 
 	free_add_user_data(data);
 }
--- a/src/gtkconv.c	Tue Sep 30 05:46:16 2003 +0000
+++ b/src/gtkconv.c	Tue Sep 30 05:48:42 2003 +0000
@@ -479,18 +479,18 @@
 static void
 add_cb(GtkWidget *widget, GaimConversation *conv)
 {
-	GaimConnection *gc;
+	GaimAccount *account;
 	GaimBuddy *b;
 	const char *name;
 
-	gc   = gaim_conversation_get_gc(conv);
-	name = gaim_conversation_get_name(conv);
-	b    = gaim_find_buddy(gc->account, name);
+	account = gaim_conversation_get_account(conv);
+	name    = gaim_conversation_get_name(conv);
+	b       = gaim_find_buddy(account, name);
 
 	if (b != NULL)
 		show_confirm_del(b);
-	else if (gc != NULL)
-		show_add_buddy(gc, (char *)name, NULL, NULL);
+	else if (account != NULL && gaim_account_is_connected(account))
+		gaim_blist_request_add_buddy(account, (char *)name, NULL, NULL);
 
 	gtk_widget_grab_focus(GAIM_GTK_CONVERSATION(conv)->entry);
 }
@@ -1014,18 +1014,18 @@
 static void
 menu_chat_add_cb(GtkWidget *w, GaimConversation *conv)
 {
-	GaimConnection *gc;
+	GaimAccount *account;
 	GaimBuddy *b;
 	char *name;
 
-	gc   = gaim_conversation_get_gc(conv);
-	name = g_object_get_data(G_OBJECT(w), "user_data");
-	b    = gaim_find_buddy(gc->account, name);
+	account = gaim_conversation_get_account(conv);
+	name    = g_object_get_data(G_OBJECT(w), "user_data");
+	b       = gaim_find_buddy(account, name);
 
 	if (b != NULL)
 		show_confirm_del(b);
-	else if (gc != NULL)
-		show_add_buddy(gc, name, NULL, NULL);
+	else if (account != NULL && gaim_account_is_connected(account))
+		gaim_blist_request_add_buddy(account, name, NULL, NULL);
 
 	gtk_widget_grab_focus(GAIM_GTK_CONVERSATION(conv)->entry);
 }
--- a/src/gtkutils.c	Tue Sep 30 05:46:16 2003 +0000
+++ b/src/gtkutils.c	Tue Sep 30 05:48:42 2003 +0000
@@ -5,7 +5,7 @@
  * gaim
  *
  * Copyright (C) 2003 Christian Hammond <chipx86@gnupdate.org>
- * 
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -30,10 +30,6 @@
 # endif
 #endif /*_WIN32*/
 
-#ifdef USE_GTKSPELL
-# include <gtkspell/gtkspell.h>
-#endif
-
 #include <gdk/gdkkeysyms.h>
 
 #include "debug.h"
--- a/src/protocols/oscar/oscar.c	Tue Sep 30 05:46:16 2003 +0000
+++ b/src/protocols/oscar/oscar.c	Tue Sep 30 05:48:42 2003 +0000
@@ -2539,7 +2539,7 @@
 	GaimConnection *gc = data->gc;
 
 	if (g_list_find(gaim_connections_get_all(), gc)) {
-		show_add_buddy(gc, data->name, NULL, data->nick);
+		gaim_blist_request_add_buddy(gaim_connection_get_account(gc), data->name, NULL, data->nick);
 	}
 
 	oscar_free_name_data(data);
--- a/src/ui.h	Tue Sep 30 05:46:16 2003 +0000
+++ b/src/ui.h	Tue Sep 30 05:48:42 2003 +0000
@@ -5,7 +5,7 @@
  * gaim
  *
  * Copyright (C) 1998-1999, Mark Spencer <markster@marko.net>
- * 
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -24,23 +24,6 @@
 #ifndef _UI_H_
 #define _UI_H_
 
-#if 0
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <gtk/gtk.h>
-#include <gdk-pixbuf/gdk-pixbuf.h>
-
-#include "core.h"
-#include "gtkconv.h"
-#include "pounce.h"
-#include "gtkft.h"
-#include "gtkprefs.h"
-#include "gtkutils.h"
-#include "stock.h"
-#endif
-
 #include "account.h"
 #include "conversation.h"
 
@@ -144,9 +127,6 @@
 extern void show_warn_dialog(GaimConnection *, char *);
 extern void show_im_dialog();
 extern void show_info_dialog();
-extern void show_add_buddy(GaimConnection *, char *, char *, char *);
-extern void show_add_chat(GaimAccount *, GaimGroup *);
-extern void show_add_group(GaimConnection *);
 extern void destroy_all_dialogs();
 extern void show_import_dialog();
 extern void show_export_dialog();