changeset 7080:fc9c74cfb306

[gaim-migrate @ 7645] Removed show_set_dir() and replaced show_find_email() in oscar. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Tue, 30 Sep 2003 22:41:02 +0000
parents 5a45833dd253
children 73da9c3ad9ac
files src/dialogs.c src/gaim.h src/protocols/oscar/oscar.c src/protocols/toc/toc.c
diffstat 4 files changed, 19 insertions(+), 250 deletions(-) [+]
line wrap: on
line diff
--- a/src/dialogs.c	Tue Sep 30 20:13:22 2003 +0000
+++ b/src/dialogs.c	Tue Sep 30 22:41:02 2003 +0000
@@ -831,189 +831,6 @@
 	g_free(b);
 }
 
-void do_set_dir(GtkWidget *widget, struct set_dir_dlg *b)
-{
-	const char *first = gtk_entry_get_text(GTK_ENTRY(b->first));
-	int web = GTK_TOGGLE_BUTTON(b->web)->active;
-	const char *middle = gtk_entry_get_text(GTK_ENTRY(b->middle));
-	const char *last = gtk_entry_get_text(GTK_ENTRY(b->last));
-	const char *maiden = gtk_entry_get_text(GTK_ENTRY(b->maiden));
-	const char *city = gtk_entry_get_text(GTK_ENTRY(b->city));
-	const char *state = gtk_entry_get_text(GTK_ENTRY(b->state));
-	const char *country = gtk_entry_get_text(GTK_ENTRY(b->country));
-
-	serv_set_dir(b->gc, first, middle, last, maiden, city, state, country, web);
-
-	destroy_dialog(NULL, b->window);
-	g_free(b);
-}
-
-void show_set_dir(GaimConnection *gc)
-{
-	GaimAccount *account;
-	GtkWidget *label;
-	GtkWidget *bot;
-	GtkWidget *vbox;
-	GtkWidget *hbox;
-	GtkWidget *frame;
-	GtkWidget *fbox;
-	char buf[256];
-
-	struct set_dir_dlg *b = g_new0(struct set_dir_dlg, 1);
-
-	b->gc = gc;
-
-	account = gaim_connection_get_account(gc);
-
-	GAIM_DIALOG(b->window);
-	dialogwindows = g_list_prepend(dialogwindows, b->window);
-	gtk_window_set_role(GTK_WINDOW(b->window), "set_dir");
-	gtk_window_set_resizable(GTK_WINDOW(b->window), TRUE);
-	gtk_window_set_title(GTK_WINDOW(b->window), _("Set Directory Info"));
-	g_signal_connect(G_OBJECT(b->window), "destroy", G_CALLBACK(destroy_dialog), b->window);
-	gtk_widget_realize(b->window);
-
-	fbox = gtk_vbox_new(FALSE, 5);
-	gtk_container_add(GTK_CONTAINER(b->window), fbox);
-	gtk_widget_show(fbox);
-
-	frame = gtk_frame_new(_("Directory Info"));
-	gtk_container_set_border_width(GTK_CONTAINER(fbox), 5);
-	gtk_box_pack_start(GTK_BOX(fbox), frame, FALSE, FALSE, 0);
-	gtk_widget_show(frame);
-
-	vbox = gtk_vbox_new(FALSE, 5);
-	gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
-	gtk_container_add(GTK_CONTAINER(frame), vbox);
-	gtk_widget_show(vbox);
-
-	g_snprintf(buf, sizeof(buf), _("Setting Dir Info for %s:"),
-			   gaim_account_get_username(account));
-	label = gtk_label_new(buf);
-	gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5);
-	gtk_widget_show(label);
-
-	b->first = gtk_entry_new();
-	b->middle = gtk_entry_new();
-	b->last = gtk_entry_new();
-	b->maiden = gtk_entry_new();
-	b->city = gtk_entry_new();
-	b->state = gtk_entry_new();
-	b->country = gtk_entry_new();
-	b->web = gtk_check_button_new_with_label(_("Allow Web Searches To Find Your Info"));
-
-	/* Line 1 */
-	label = gtk_label_new(_("First Name"));
-	gtk_widget_show(label);
-
-	hbox = gtk_hbox_new(FALSE, 5);
-	gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
-	gtk_box_pack_end(GTK_BOX(hbox), b->first, FALSE, FALSE, 0);
-
-	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
-	gtk_widget_show(hbox);
-
-	/* Line 2 */
-	label = gtk_label_new(_("Middle Name"));
-	gtk_widget_show(label);
-
-	hbox = gtk_hbox_new(FALSE, 5);
-	gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
-	gtk_box_pack_end(GTK_BOX(hbox), b->middle, FALSE, FALSE, 0);
-
-	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
-	gtk_widget_show(hbox);
-
-
-	/* Line 3 */
-	label = gtk_label_new(_("Last Name"));
-	gtk_widget_show(label);
-
-	hbox = gtk_hbox_new(FALSE, 5);
-	gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
-	gtk_box_pack_end(GTK_BOX(hbox), b->last, FALSE, FALSE, 0);
-
-	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
-	gtk_widget_show(hbox);
-
-	/* Line 4 */
-	label = gtk_label_new(_("Maiden Name"));
-	gtk_widget_show(label);
-
-	hbox = gtk_hbox_new(FALSE, 5);
-	gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
-	gtk_box_pack_end(GTK_BOX(hbox), b->maiden, FALSE, FALSE, 0);
-
-	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
-	gtk_widget_show(hbox);
-
-	/* Line 5 */
-	label = gtk_label_new(_("City"));
-	gtk_widget_show(label);
-
-	hbox = gtk_hbox_new(FALSE, 5);
-	gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
-	gtk_box_pack_end(GTK_BOX(hbox), b->city, FALSE, FALSE, 0);
-
-	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
-	gtk_widget_show(hbox);
-
-	/* Line 6 */
-	label = gtk_label_new(_("State"));
-	gtk_widget_show(label);
-
-	hbox = gtk_hbox_new(FALSE, 5);
-	gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
-	gtk_box_pack_end(GTK_BOX(hbox), b->state, FALSE, FALSE, 0);
-
-	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
-	gtk_widget_show(hbox);
-
-	/* Line 7 */
-	label = gtk_label_new(_("Country"));
-	gtk_widget_show(label);
-
-	hbox = gtk_hbox_new(FALSE, 5);
-	gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
-	gtk_box_pack_end(GTK_BOX(hbox), b->country, FALSE, FALSE, 0);
-
-	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
-	gtk_widget_show(hbox);
-
-	/* Line 8 */
-
-	hbox = gtk_hbox_new(FALSE, 5);
-	gtk_box_pack_start(GTK_BOX(hbox), b->web, TRUE, TRUE, 0);
-	gtk_widget_show(hbox);
-	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
-
-	gtk_widget_show(b->first);
-	gtk_widget_show(b->middle);
-	gtk_widget_show(b->last);
-	gtk_widget_show(b->maiden);
-	gtk_widget_show(b->city);
-	gtk_widget_show(b->state);
-	gtk_widget_show(b->country);
-	gtk_widget_show(b->web);
-
-	/* And add the buttons */
-
-	bot = gtk_hbox_new(FALSE, 5);
-	gtk_box_pack_start(GTK_BOX(fbox), bot, FALSE, FALSE, 0);
-
-	b->save = gaim_pixbuf_button_from_stock(_("Save"), GTK_STOCK_SAVE, GAIM_BUTTON_HORIZONTAL);
-	gtk_box_pack_end(GTK_BOX(bot), b->save, FALSE, FALSE, 0);
-	g_signal_connect(G_OBJECT(b->save), "clicked", G_CALLBACK(do_set_dir), b);
-
-	b->cancel = gaim_pixbuf_button_from_stock(_("Cancel"), GTK_STOCK_CANCEL, GAIM_BUTTON_HORIZONTAL);
-	gtk_box_pack_end(GTK_BOX(bot), b->cancel, FALSE, FALSE, 0);
-	g_signal_connect(G_OBJECT(b->cancel), "clicked", G_CALLBACK(destroy_dialog), b->window);
-
-	gtk_window_set_focus(GTK_WINDOW(b->window), b->first);
-
-	gtk_widget_show_all(b->window);
-}
-
 void show_set_info(GaimConnection *gc)
 {
 	GtkWidget *buttons;
@@ -1194,17 +1011,6 @@
 	destroy_dialog(NULL, b->window);
 }
 
-void do_find_email(GtkWidget *w, struct findbyemail *b)
-{
-	const char *email;
-
-	email = gtk_entry_get_text(GTK_ENTRY(b->emailentry));
-
-	serv_dir_search(b->gc, "", "", "", "", "", "", "", email);
-
-	destroy_dialog(NULL, b->window);
-}
-
 void show_find_info(GaimConnection *gc)
 {
 	GtkWidget *cancel;
@@ -1333,59 +1139,6 @@
 	gtk_widget_show_all(b->window);
 }
 
-void show_find_email(GaimConnection *gc)
-{
-	GtkWidget *label;
-	GtkWidget *bbox;
-	GtkWidget *vbox;
-	GtkWidget *frame;
-	GtkWidget *topbox;
-	GtkWidget *button;
-
-	struct findbyemail *b = g_new0(struct findbyemail, 1);
-	if (g_list_find(gaim_connections_get_all(), gc))
-		b->gc = gc;
-	GAIM_DIALOG(b->window);
-	gtk_window_set_resizable(GTK_WINDOW(b->window), TRUE);
-	gtk_window_set_role(GTK_WINDOW(b->window), "find_email");
-	gtk_widget_realize(b->window);
-	dialogwindows = g_list_prepend(dialogwindows, b->window);
-	g_signal_connect(G_OBJECT(b->window), "destroy", G_CALLBACK(destroy_dialog), b->window);
-	gtk_window_set_title(GTK_WINDOW(b->window), _("Find Buddy By Email"));
-
-	vbox = gtk_vbox_new(FALSE, 5);
-	gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
-	gtk_container_add(GTK_CONTAINER(b->window), vbox);
-
-	frame = gtk_frame_new(_("Search for Buddy"));
-	gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0);
-
-	topbox = gtk_hbox_new(FALSE, 5);
-	gtk_container_add(GTK_CONTAINER(frame), topbox);
-	gtk_container_set_border_width(GTK_CONTAINER(topbox), 5);
-
-	label = gtk_label_new(_("Email"));
-	gtk_box_pack_start(GTK_BOX(topbox), label, FALSE, FALSE, 0);
-
-	b->emailentry = gtk_entry_new();
-	gtk_box_pack_start(GTK_BOX(topbox), b->emailentry, TRUE, TRUE, 0);
-	g_signal_connect(G_OBJECT(b->emailentry), "activate", G_CALLBACK(do_find_email), b);
-	gtk_window_set_focus(GTK_WINDOW(b->window), b->emailentry);
-
-	bbox = gtk_hbox_new(FALSE, 5);
-	gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0);
-
-	button = gaim_pixbuf_button_from_stock(_("OK"), GTK_STOCK_OK, GAIM_BUTTON_HORIZONTAL);
-	g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(do_find_email), b);
-	gtk_box_pack_end(GTK_BOX(bbox), button, FALSE, FALSE, 0);
-
-	button = gaim_pixbuf_button_from_stock(_("Cancel"), GTK_STOCK_CANCEL, GAIM_BUTTON_HORIZONTAL);
-	g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(destroy_dialog), b->window);
-	gtk_box_pack_end(GTK_BOX(bbox), button, FALSE, FALSE, 0);
-
-	gtk_widget_show_all(b->window);
-}
-
 /*------------------------------------------------------*/
 /* Link Dialog                                          */
 /*------------------------------------------------------*/
--- a/src/gaim.h	Tue Sep 30 20:13:22 2003 +0000
+++ b/src/gaim.h	Tue Sep 30 22:41:02 2003 +0000
@@ -37,8 +37,6 @@
 extern GSList *away_time_queue;
 
 /* Functions in dialogs.c */
-extern void show_set_dir(GaimConnection *);
-extern void show_find_email(GaimConnection *);
 extern void show_find_info(GaimConnection *);
 extern void show_confirm_del(GaimBuddy *);
 extern void show_confirm_del_group(GaimGroup *);
--- a/src/protocols/oscar/oscar.c	Tue Sep 30 20:13:22 2003 +0000
+++ b/src/protocols/oscar/oscar.c	Tue Sep 30 22:41:02 2003 +0000
@@ -6250,6 +6250,22 @@
 	g_free(text);
 }
 
+static void search_by_email_cb(GaimConnection *gc, const char *email)
+{
+	serv_dir_search(gc, "", "", "", "", "", "", "", email);
+}
+
+static void oscar_show_find_email(GaimConnection *gc)
+{
+	gaim_request_input(gc, _("Find Buddy by E-mail"),
+					   _("Search for a buddy by e-mail address"),
+					   _("Type the e-mail address of the buddy you are "
+						 "searching for."),
+					   NULL, FALSE, FALSE,
+					   _("Search"), G_CALLBACK(search_by_email_cb),
+					   _("Cancel"), NULL, gc);
+}
+
 #if 0
 static void oscar_setavailmsg(GaimConnection *gc, char *text) {
 	struct oscar_data *od = (struct oscar_data *)gc->proto_data;
@@ -6406,7 +6422,7 @@
 
 	pam = g_new0(struct proto_actions_menu, 1);
 	pam->label = _("Search for Buddy by Email");
-	pam->callback = show_find_email;
+	pam->callback = oscar_show_find_email;
 	pam->gc = gc;
 	m = g_list_append(m, pam);
 
--- a/src/protocols/toc/toc.c	Tue Sep 30 20:13:22 2003 +0000
+++ b/src/protocols/toc/toc.c	Tue Sep 30 22:41:02 2003 +0000
@@ -1537,11 +1537,13 @@
 	pam->gc = gc;
 	m = g_list_append(m, pam);
 
+#if 0
 	pam = g_new0(struct proto_actions_menu, 1);
 	pam->label = _("Set Dir Info");
 	pam->callback = show_set_dir;
 	pam->gc = gc;
 	m = g_list_append(m, pam);
+#endif
 
 	pam = g_new0(struct proto_actions_menu, 1);
 	pam->label = _("Change Password");