changeset 2598:b2800bca74fe

[gaim-migrate @ 2611] yeah. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Wed, 24 Oct 2001 11:07:35 +0000
parents 2ced57c58653
children b5236052876d
files src/buddy.c src/dialogs.c src/perl.c src/ui.h
diffstat 4 files changed, 19 insertions(+), 74 deletions(-) [+]
line wrap: on
line diff
--- a/src/buddy.c	Wed Oct 24 10:23:49 2001 +0000
+++ b/src/buddy.c	Wed Oct 24 11:07:35 2001 +0000
@@ -2413,49 +2413,16 @@
 
 	gaim_separator(menu);
 
-#ifdef NO_MULTI
-	findmenu = gtk_menu_new();
-	gtk_widget_show(findmenu);
-	menuitem = gaim_new_item_with_pixmap(menu, _("Search for Buddy"), search_small_xpm,
-					     NULL, 0, 0, 0);
-	gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), findmenu);
-	gtk_widget_show(menuitem);
-	menuitem = gtk_menu_item_new_with_label(_("by Email"));
-	gtk_menu_append(GTK_MENU(findmenu), menuitem);
-	gtk_signal_connect(GTK_OBJECT(menuitem), "activate", GTK_SIGNAL_FUNC(show_find_email), NULL);
-	gtk_widget_show(menuitem);
-	menuitem = gtk_menu_item_new_with_label(_("by Dir Info"));
-	gtk_menu_append(GTK_MENU(findmenu), menuitem);
-	gtk_signal_connect(GTK_OBJECT(menuitem), "activate", GTK_SIGNAL_FUNC(show_find_info),
-			   connections->data);
-	gtk_widget_show(menuitem);
-
-	setmenu = gtk_menu_new();
-	gtk_widget_show(setmenu);
-	menuitem = gaim_new_item_with_pixmap(menu, _("Settings"), prefs_small_xpm, NULL, 0, 0, 0);
-	gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), setmenu);
-	menuitem = gtk_menu_item_new_with_label(_("User Info"));
-	gtk_menu_append(GTK_MENU(setmenu), menuitem);
-	gtk_signal_connect(GTK_OBJECT(menuitem), "activate", GTK_SIGNAL_FUNC(show_set_info), NULL);
-	gtk_widget_show(menuitem);
-	menuitem = gtk_menu_item_new_with_label(_("Directory Info"));
-	gtk_menu_append(GTK_MENU(setmenu), menuitem);
-	gtk_signal_connect(GTK_OBJECT(menuitem), "activate", GTK_SIGNAL_FUNC(show_set_dir), NULL);
-	gtk_widget_show(menuitem);
-	menuitem = gtk_menu_item_new_with_label(_("Change Password"));
-	gtk_menu_append(GTK_MENU(setmenu), menuitem);
-	gtk_signal_connect(GTK_OBJECT(menuitem), "activate", GTK_SIGNAL_FUNC(show_change_passwd), NULL);
-	gtk_widget_show(menuitem);
-#else
+#ifndef NO_MULTI
 	gaim_new_item_with_pixmap(menu, _("Accounts"), add_small_xpm,
 				  GTK_SIGNAL_FUNC(account_editor), 'a', GDK_CONTROL_MASK, "Ctl+A");
+#endif
 
 	protomenu = gtk_menu_new();
 	menuitem =
 	    gaim_new_item_with_pixmap(menu, _("Protocol Actions"), prefs_small_xpm, NULL, 0, 0, 0);
 	gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), protomenu);
 	do_proto_menu();
-#endif
 
 	gaim_new_item_with_pixmap(menu, _("Preferences"), prefs_small_xpm,
 				  GTK_SIGNAL_FUNC(show_prefs), 'p', GDK_CONTROL_MASK, "Ctl+P");
--- a/src/dialogs.c	Wed Oct 24 10:23:49 2001 +0000
+++ b/src/dialogs.c	Wed Oct 24 11:07:35 2001 +0000
@@ -678,14 +678,8 @@
 
 	c = find_conversation(who);
 
-	if (a->gc) {
-		add_buddy(a->gc, grp, who, whoalias);
-		serv_add_buddy(a->gc, who);
-	} else if (connections) {
-		add_buddy(connections->data, grp, who, whoalias);
-		serv_add_buddy(connections->data, who);
-		a->gc = connections->data;
-	}
+	add_buddy(a->gc, grp, who, whoalias);
+	serv_add_buddy(a->gc, who);
 
 	if (c != NULL) {
 		update_buttons_by_protocol(c);
@@ -702,13 +696,10 @@
 
 	grp = gtk_entry_get_text(GTK_ENTRY(a->entry));
 
-	if (a->gc)
-		add_group(a->gc, grp);
-	else if (connections) {
-		add_group(connections->data, grp);
+	if (!a->gc)
 		a->gc = connections->data;
-	}
-
+
+	add_group(a->gc, grp);
 	do_export(a->gc);
 
 	destroy_dialog(NULL, a->window);
@@ -820,7 +811,7 @@
 	b->gc = gc;
 
 	/* We also want to update our group list */	
-	gtk_combo_set_popdown_strings(GTK_COMBO(b->combo), groups_tree(gc ? gc : connections->data));
+	gtk_combo_set_popdown_strings(GTK_COMBO(b->combo), groups_tree(gc));
 }
 
 static void create_online_user_names(struct addbuddy *b)
@@ -880,7 +871,7 @@
 	GtkWidget *label;
 
 	struct addbuddy *a = g_new0(struct addbuddy, 1);
-	a->gc = gc;
+	a->gc = gc ? gc : connections->data;
 
 	a->window = gtk_window_new(GTK_WINDOW_DIALOG);
 	gtk_window_set_wmclass(GTK_WINDOW(a->window), "add_buddy", "Gaim");
@@ -929,7 +920,7 @@
 	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(gc ? gc : connections->data));
+	gtk_combo_set_popdown_strings(GTK_COMBO(a->combo), groups_tree(a->gc));
 	if (group != NULL)
 		gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(a->combo)->entry), group);
 	gtk_table_attach_defaults(GTK_TABLE(table), a->combo, 1, 2, 2, 3);
@@ -1042,12 +1033,6 @@
 
 	menu = gtk_menu_new();
 
-	/* We should go ahead and set this in order to prevent problems */
-	if (u) {
-		a = (struct aim_user *)u->data;
-		b->user = a;
-	}
-
 	while (u) {
 		a = (struct aim_user *)u->data;
 		opt = gtk_menu_item_new_with_label(a->username);
@@ -1056,7 +1041,7 @@
 		gtk_menu_append(GTK_MENU(menu), opt);
 		gtk_widget_show(opt);
 
-		if (a->gc == gc) {
+		if (b->user == a) {
 			gtk_menu_item_activate(GTK_MENU_ITEM(opt));
 			place = count;
 		}
@@ -1068,7 +1053,6 @@
 
 	gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu), menu);
 	gtk_option_menu_set_history(GTK_OPTION_MENU(optmenu), place);
-	b->user = ((struct gaim_connection *)connections->data)->user;
 
 	b->menu = optmenu;
 
@@ -1087,6 +1071,7 @@
 	GtkWidget *optmenu;
 
 	struct addbp *b = g_new0(struct addbp, 1);
+	b->user = gc ? gc->user : aim_users->data;
 
 	b->window = gtk_window_new(GTK_WINDOW_DIALOG);
 	dialogwindows = g_list_prepend(dialogwindows, b->window);
@@ -1309,8 +1294,6 @@
 	char buf[256];
 
 	struct set_dir_dlg *b = g_new0(struct set_dir_dlg, 1);
-	if (!g_slist_find(connections, gc))
-		gc = connections->data;
 	b->gc = gc;
 
 	b->window = gtk_window_new(GTK_WINDOW_DIALOG);
@@ -1497,8 +1480,6 @@
 	char buf[256];
 
 	struct passwddlg *b = g_new0(struct passwddlg, 1);
-	if (!g_slist_find(connections, gc))
-		gc = connections->data;
 	b->gc = gc;
 
 	b->window = gtk_window_new(GTK_WINDOW_DIALOG);
@@ -1597,8 +1578,6 @@
 	struct aim_user *tmp;
 
 	struct set_info_dlg *b = g_new0(struct set_info_dlg, 1);
-	if (!g_slist_find(connections, gc))
-		gc = connections->data;
 	tmp = gc->user;
 	b->user = tmp;
 
@@ -1984,10 +1963,7 @@
 
 	email = gtk_entry_get_text(GTK_ENTRY(b->emailentry));
 
-	if (b->gc)
-		serv_dir_search(b->gc, "", "", "", "", "", "", "", email);
-	else
-		serv_dir_search(connections->data, "", "", "", "", "", "", "", email);
+	serv_dir_search(b->gc, "", "", "", "", "", "", "", email);
 
 	destroy_dialog(NULL, b->window);
 }
@@ -2701,8 +2677,10 @@
 	if (file_is_dir(file, importdialog)) {
 		return;
 	}
-	do_import(importgc, file);
-	do_export(importgc);
+	if (g_slist_find(connections, importgc)) {
+		do_import(importgc, file);
+		do_export(importgc);
+	}
 	destroy_dialog(NULL, importdialog);
 }
 
--- a/src/perl.c	Wed Oct 24 10:23:49 2001 +0000
+++ b/src/perl.c	Wed Oct 24 11:07:35 2001 +0000
@@ -586,7 +586,7 @@
 		XSRETURN(0);
 		return;
 	}
-	serv_send_im(connections->data, nick, what, isauto);
+	serv_send_im(gc, nick, what, isauto);
 	XSRETURN(0);
 }
 
--- a/src/ui.h	Wed Oct 24 10:23:49 2001 +0000
+++ b/src/ui.h	Wed Oct 24 11:07:35 2001 +0000
@@ -370,7 +370,7 @@
 extern void destroy_all_dialogs();
 extern void show_import_dialog();
 extern void show_export_dialog();
-extern void show_new_bp();
+extern void show_new_bp(char *, struct gaim_connection *, int, int);
 extern void show_log(char *);
 extern void show_log_dialog(struct conversation *);
 extern void show_fgcolor_dialog(struct conversation *c, GtkWidget *color);