# HG changeset patch # User Eric Warmenhoven # Date 999853104 0 # Node ID 14e8978f86bbb3b9d3dae6e929c51e1547f62d6b # Parent 8c4ff1a368bdaa2db9fffb35b1c4f07cb6b479f1 [gaim-migrate @ 2242] heh. committer: Tailor Script diff -r 8c4ff1a368bd -r 14e8978f86bb ChangeLog --- a/ChangeLog Fri Sep 07 08:09:22 2001 +0000 +++ b/ChangeLog Fri Sep 07 08:58:24 2001 +0000 @@ -6,6 +6,9 @@ * Have you ever had it happen where you cancel a login and Gaim starts using all the available processing power? I think I fixed that. + * Temporarily removed Jabber user registration, which wasn't + working anyway. + * Added a spiffy Help button version 0.43: * Updated German Translation (thanks Daniel Seifert) diff -r 8c4ff1a368bd -r 14e8978f86bb pixmaps/Makefile.am --- a/pixmaps/Makefile.am Fri Sep 07 08:09:22 2001 +0000 +++ b/pixmaps/Makefile.am Fri Sep 07 08:58:24 2001 +0000 @@ -61,6 +61,7 @@ normal.xpm \ ok.xpm \ oneeye.xpm \ + panic.xpm \ plugins_small.xpm \ pounce_small.xpm \ prefs_small.xpm \ diff -r 8c4ff1a368bd -r 14e8978f86bb pixmaps/panic.xpm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pixmaps/panic.xpm Fri Sep 07 08:58:24 2001 +0000 @@ -0,0 +1,155 @@ +/* XPM */ +static char * panic_xpm[] = { +"190 150 2 1", +" c None", +". c #000000", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ..... ", +" ................. ...... ..... ", +" .................... ...... ...... ", +" ...................... ...... ...... ", +" ....................... ..... ...... ", +" ...................... ..... ...... ", +" ...... .......... .... ... ..... ..... ", +" ...... ........ ............ ....... ........ ..... ...... ", +" ....... ....... .............. ........ .......... .... ...... ", +" ...... ........ .................. ...................... .... .................... ", +" ...... ....... ................... ...................... .... ..................... ", +" ...... ....... ......... ......... ............ ........ .... ...................... ", +" ...... ....... ........ ........ ........ ....... .... ..................... ", +" ....... ....... ....... ....... ....... ....... ................... ", +" ...... ...... ....... ....... ...... ....... ...... ", +" ...... ....... ....... ...... ....... ...... ...... ", +" ...... ....... ...... ...... ...... ...... ...... ", +" ...... ....... ....... ...... ...... ...... ...... ", +" ....... ....... ....... ...... ...... ...... ...... ", +" ...... ....... ....... ....... ...... ....... ...... ", +" ...... ....... ....... ....... ...... ...... ...... ", +" ...... ....... ....... ...... ...... ...... ...... ", +" ...... ........ ....... ....... ...... ...... ...... . ", +" ....... ......... ........ ....... ...... ...... ...... ..... ", +" ........................ ........ ........ ......... ........ ....... ....... ", +" ........................ ..................... ........... ........... ................... ", +" ...................... ................... ............ ............ .................. ", +" ..................... ................. ............ ............ ................ ", +" ................... .............. ........... ........... ............. ", +" ............. .......... ......... ........ ......... ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" .... ", +" ...... ", +" ...... ", +" ....... ", +" ...... ", +" .................. ...... ", +" ..................... ...... ", +" ...................... ... ", +" ....................... ", +" ...................... ", +" ....... ........ ...... ... ... . ", +" ....... ........ .............. ....... ........ ........... ............ .... ", +" ...... ....... ................. ........ .......... ............ .................... ", +" ...... ....... ................... ...................... ............ ..................... ", +" ...... ....... ................... ...................... ............ ..................... ", +" ....... ...... ....... ........ ............ ........ ........... .......... ......... ", +" ...... ....... ..... ....... ........ ....... ...... ........ ....... ", +" ...... .......... ....... ....... ....... ...... ........ ...... ", +" ..................... ...... ...... ....... ...... ....... ...... ", +" .................... ...... ...... ....... ...... ...... ....... ..... ", +" .................... .................. ...... ...... ...... ...... .... ", +" ................... .................... ...... ...... ...... ...... ", +" ................ ..................... ...... ...... ...... ...... ", +" ...... ......... ...... ...... ....... ...... ....... ", +" ...... ....... ...... ...... ...... ...... ....... ", +" ....... ...... ...... ...... ...... ...... ....... ", +" ...... ...... ...... ...... ...... ...... ....... ... ", +" ...... ...... ....... ...... ...... ...... ....... ..... ", +" ........... ....... .......... ......... ........ .................. ........ ........ ", +" ............. ........................ ........... ........... ..................... ....................... ", +" .............. ........................ ............ ............ ...................... ..................... ", +" .............. ....................... ............ ............ ...................... ................... ", +" ............. ............ ....... ........... ........... .................... ................ ", +" ........... ........ .... ......... ........ .................. .......... ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" "}; diff -r 8c4ff1a368bd -r 14e8978f86bb src/about.c --- a/src/about.c Fri Sep 07 08:09:22 2001 +0000 +++ b/src/about.c Fri Sep 07 08:58:24 2001 +0000 @@ -32,8 +32,10 @@ #include "pixmaps/logo.xpm" #include "pixmaps/cancel.xpm" #include "pixmaps/about_small.xpm" +#include "pixmaps/panic.xpm" static GtkWidget *about = NULL; +static GtkWidget *help = NULL; static void destroy_about() { @@ -169,3 +171,71 @@ gtk_widget_show_all(about); } + +static void destroy_help() +{ + if (help) + gtk_widget_destroy(help); + help = NULL; +} + +void gaim_help(GtkWidget *w, void *x) +{ + GtkWidget *vbox; + GdkPixmap *pm; + GdkBitmap *bm; + GtkWidget *pix; + GtkWidget *label; + GtkWidget *hbox; + GtkWidget *close; + + if (!help) { + + help = gtk_window_new(GTK_WINDOW_TOPLEVEL); + gtk_window_set_title(GTK_WINDOW(help), "Gaim Help"); + gtk_window_set_wmclass(GTK_WINDOW(help), "help", "Gaim"); + gtk_window_set_policy(GTK_WINDOW(help), FALSE, TRUE, TRUE); + gtk_widget_realize(help); + aol_icon(help->window); + gtk_signal_connect(GTK_OBJECT(help), "destroy", + GTK_SIGNAL_FUNC(destroy_help), GTK_OBJECT(help)); + gtk_widget_set_usize(help, 240, -1); + + vbox = gtk_vbox_new(FALSE, 10); + gtk_container_add(GTK_CONTAINER(help), vbox); + + hbox = gtk_hbox_new(FALSE, 10); + gtk_box_pack_end(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); + + close = picture_button(help, _("Close"), cancel_xpm); + gtk_box_pack_end(GTK_BOX(hbox), close, FALSE, FALSE, 5); + gtk_signal_connect(GTK_OBJECT(close), "clicked", + GTK_SIGNAL_FUNC(destroy_help), NULL); + + pm = gdk_pixmap_create_from_xpm_d(help->window, &bm, NULL, panic_xpm); + pix = gtk_pixmap_new(pm, bm); + gdk_pixmap_unref(pm); + gdk_bitmap_unref(bm); + gtk_box_pack_start(GTK_BOX(vbox), pix, FALSE, FALSE, 5); + + label = gtk_label_new(_("Relax, help is just around the corner. " + "The first thing you'll need to do is get an AIM " + "account; you can get one from http://aim.aol.com/. " + "Just click the button that says \"New Users\" and " + "you can create an account that way. Once you have " + "your account, enter the username and password into " + "the login window that comes up when you start Gaim, " + "and click the Signon button. Once you're online, " + "you can talk to one of the Gaim developers for more " + "assistance; their contact information is in the " + "AUTHORS file in the Gaim source, or at " + WEBSITE "contact.shtml. If you can't get online and " + "still need more assistance, feel free to email us " + "at gaim@marko.net. Thanks for using Gaim!")); + gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); + gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); + gtk_box_pack_end(GTK_BOX(vbox), label, FALSE, FALSE, 5); + } + + gtk_widget_show_all(help); +} diff -r 8c4ff1a368bd -r 14e8978f86bb src/aim.c --- a/src/aim.c Fri Sep 07 08:09:22 2001 +0000 +++ b/src/aim.c Fri Sep 07 08:58:24 2001 +0000 @@ -209,7 +209,7 @@ #endif GtkWidget *signon; GtkWidget *cancel; - GtkWidget *reg; + GtkWidget *help; GtkWidget *bbox; GtkWidget *hbox; GtkWidget *sbox; @@ -323,32 +323,32 @@ gtk_box_pack_start(GTK_BOX(sbox), hbox, TRUE, TRUE, 0); gtk_widget_show(hbox); - reg = gtk_button_new_with_label(_("Register")); + help = gtk_button_new_with_label(_("Help!")); options = gtk_button_new_with_label(_("Options")); #ifdef GAIM_PLUGINS plugs = gtk_button_new_with_label(_("Plugins")); #endif if (display_options & OPT_DISP_COOL_LOOK) { - gtk_button_set_relief(GTK_BUTTON(reg), GTK_RELIEF_NONE); + gtk_button_set_relief(GTK_BUTTON(help), GTK_RELIEF_NONE); gtk_button_set_relief(GTK_BUTTON(options), GTK_RELIEF_NONE); #ifdef GAIM_PLUGINS gtk_button_set_relief(GTK_BUTTON(plugs), GTK_RELIEF_NONE); #endif } - gtk_signal_connect(GTK_OBJECT(reg), "clicked", GTK_SIGNAL_FUNC(register_user), NULL); + gtk_signal_connect(GTK_OBJECT(help), "clicked", GTK_SIGNAL_FUNC(gaim_help), NULL); gtk_signal_connect(GTK_OBJECT(options), "clicked", GTK_SIGNAL_FUNC(show_prefs), NULL); #ifdef GAIM_PLUGINS gtk_signal_connect(GTK_OBJECT(plugs), "clicked", GTK_SIGNAL_FUNC(show_plugins), NULL); #endif - gtk_box_pack_start(GTK_BOX(hbox), reg, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(hbox), help, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(hbox), options, TRUE, TRUE, 0); #ifdef GAIM_PLUGINS gtk_box_pack_start(GTK_BOX(hbox), plugs, TRUE, TRUE, 0); #endif - gtk_widget_show(reg); + gtk_widget_show(help); gtk_widget_show(options); #ifdef GAIM_PLUGINS gtk_widget_show(plugs); diff -r 8c4ff1a368bd -r 14e8978f86bb src/gaim.h --- a/src/gaim.h Fri Sep 07 08:09:22 2001 +0000 +++ b/src/gaim.h Fri Sep 07 08:58:24 2001 +0000 @@ -590,6 +590,7 @@ /* Functions in about.c */ extern void show_about(GtkWidget *, void *); +extern void gaim_help(GtkWidget *, void *); /* Functions in buddy_chat.c */ diff -r 8c4ff1a368bd -r 14e8978f86bb src/protocols/jabber/jabber.c --- a/src/protocols/jabber/jabber.c Fri Sep 07 08:09:22 2001 +0000 +++ b/src/protocols/jabber/jabber.c Fri Sep 07 08:58:24 2001 +0000 @@ -26,13 +26,6 @@ #endif -#include -#ifdef MAX -#undef MAX -#endif -#ifdef MIN -#undef MIN -#endif #include #include #include @@ -48,6 +41,12 @@ #include "multi.h" #include "prpl.h" #include "gaim.h" +#ifdef MAX +#undef MAX +#endif +#ifdef MIN +#undef MIN +#endif #include "jabber.h" #include "proxy.h" @@ -1622,241 +1621,6 @@ xmlnode_free(x); } -static GtkWidget *newname = NULL; -static GtkWidget *newpass1 = NULL; -static GtkWidget *newpass2 = NULL; -static GtkWidget *newserv = NULL; -static jconn regjconn = NULL; -static int reginpa = 0; - -static void newdes() -{ - newname = newpass1 = newpass2 = newserv = NULL; -} - -static void jabber_draw_new_user(GtkWidget *box) -{ - GtkWidget *hbox; - GtkWidget *label; - - if (newname) - return; - - label = gtk_label_new("Enter your name, password, and server to register on. If you " - "already have a Jabber account and do not need to register one, " - "use the Account Editor to add it to your list of accounts."); - gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); - gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5); - gtk_widget_show(label); - - hbox = gtk_hbox_new(FALSE, 5); - gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5); - gtk_widget_show(hbox); - - label = gtk_label_new("Username:"); - gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); - gtk_widget_show(label); - - newname = gtk_entry_new(); - gtk_box_pack_end(GTK_BOX(hbox), newname, FALSE, FALSE, 5); - gtk_signal_connect(GTK_OBJECT(newname), "destroy", GTK_SIGNAL_FUNC(newdes), NULL); - gtk_widget_show(newname); - - hbox = gtk_hbox_new(FALSE, 5); - gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5); - gtk_widget_show(hbox); - - label = gtk_label_new("Password:"); - gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); - gtk_widget_show(label); - - newpass1 = gtk_entry_new(); - gtk_box_pack_end(GTK_BOX(hbox), newpass1, FALSE, FALSE, 5); - gtk_entry_set_visibility(GTK_ENTRY(newpass1), FALSE); - gtk_widget_show(newpass1); - - hbox = gtk_hbox_new(FALSE, 5); - gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5); - gtk_widget_show(hbox); - - label = gtk_label_new("Confirm:"); - gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); - gtk_widget_show(label); - - newpass2 = gtk_entry_new(); - gtk_box_pack_end(GTK_BOX(hbox), newpass2, FALSE, FALSE, 5); - gtk_entry_set_visibility(GTK_ENTRY(newpass2), FALSE); - gtk_widget_show(newpass2); - - hbox = gtk_hbox_new(FALSE, 5); - gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5); - gtk_widget_show(hbox); - - label = gtk_label_new("Server:"); - gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); - gtk_widget_show(label); - - newserv = gtk_entry_new(); - gtk_entry_set_text(GTK_ENTRY(newserv), "jabber.org"); - gtk_box_pack_end(GTK_BOX(hbox), newserv, FALSE, FALSE, 5); - gtk_widget_show(newserv); -} - -static void regstate(jconn j, int state) -{ - static int catch = 0; - switch (state) { - case JCONN_STATE_OFF: - gaim_input_remove(reginpa); - reginpa = 0; - jab_delete(j); - break; - case JCONN_STATE_CONNECTED: - break; - case JCONN_STATE_ON: - if (catch) - break; - catch = 1; - jab_reg(regjconn); - catch = 0; - break; - case JCONN_STATE_AUTH: - break; - default: - break; - } -} - -static void regpacket(jconn j, jpacket p) -{ - static int here = 0; - switch (p->type) { - case JPACKET_MESSAGE: - break; - case JPACKET_PRESENCE: - break; - case JPACKET_IQ: - if (jpacket_subtype(p) == JPACKET__RESULT) { - xmlnode x, y, z; - char *user, *id; - - if (here == 2) { - struct aim_user *u; - user = g_strdup(jid_full(j->user)); - regjconn = NULL; - here = 0; - u = new_user(user, PROTO_JABBER, OPT_USR_REM_PASS); - g_free(user); - g_snprintf(u->password, sizeof(u->password), "%s", j->pass); - save_prefs(); - xmlnode_free(p->x); - do_error_dialog("Registration successful! Your account has been" - " added to the Account Editor.", "Jabber " - "Registration"); - gtk_entry_set_text(GTK_ENTRY(newname), ""); - gtk_entry_set_text(GTK_ENTRY(newpass1), ""); - gtk_entry_set_text(GTK_ENTRY(newpass2), ""); - return; - } else if (here == 1) { - x = jutil_iqnew(JPACKET__SET, NS_AUTH); - here = 2; - } else { /* here == 0 */ - here = 1; - x = jutil_iqnew(JPACKET__GET, NS_AUTH); - } - - id = jab_getid(j); - xmlnode_put_attrib(x, "id", id); - y = xmlnode_get_tag(x, "query"); - - user = j->user->user; - if (user) - { - z = xmlnode_insert_tag(y, "username"); - xmlnode_insert_cdata(z, user, -1); - } - - if (here == 2) { - z = xmlnode_insert_tag(y, "resource"); - xmlnode_insert_cdata(z, j->user->resource, -1); - z = xmlnode_insert_tag(y, "password"); - xmlnode_insert_cdata(z, j->pass, -1); - } - - jab_send(j, x); - xmlnode_free(x); - } else if (jpacket_subtype(p) == JPACKET__ERROR) { - xmlnode x = xmlnode_get_tag(p->x, "error"); - if (x) { - char buf[8192]; - g_snprintf(buf, sizeof(buf), "Registration failed: %d %s", - atoi(xmlnode_get_attrib(x, "code")), - xmlnode_get_data(xmlnode_get_firstchild(x))); - do_error_dialog(buf, "Jabber Registration"); - } else { - do_error_dialog("Registration failed", "Jabber Registration"); - } - regjconn = NULL; - xmlnode_free(p->x); - here = 0; - return; - } - break; - case JPACKET_S10N: - break; - default: - break; - } - - xmlnode_free(p->x); -} - -static void regjcall(gpointer data, gint source, GaimInputCondition cond) -{ - gjab_recv((gjconn)regjconn); -} - -static void jabber_do_new_user() -{ - const char *name, *pass1, *pass2, *serv; - char *tmp; - char *user; - - if (!newname || regjconn) - return; - - pass1 = gtk_entry_get_text(GTK_ENTRY(newpass1)); - pass2 = gtk_entry_get_text(GTK_ENTRY(newpass2)); - if (pass1[0] == 0 || pass2[0] == 0) { - do_error_dialog("Please enter the same valid password in both password entry boxes", - "Registration error"); - return; - } - if (strcmp(pass1, pass2)) { - do_error_dialog("Mismatched passwords, please verify that both passwords are the same", - "Registration error"); - return; - } - name = gtk_entry_get_text(GTK_ENTRY(newname)); - serv = gtk_entry_get_text(GTK_ENTRY(newserv)); - if (name[0] == 0 || serv[0] == 0) { - do_error_dialog("Please enter a valid username and server", "Registration error"); - return; - } - - user = g_strdup_printf("%s@%s/GAIM", name, serv); - tmp = g_strdup(pass1); - regjconn = jab_new(user, tmp); - g_free(tmp); - g_free(user); - - jab_state_handler(regjconn, regstate); - jab_packet_handler(regjconn, regpacket); - - jab_start(regjconn); - reginpa = gaim_input_add(jab_getfd(regjconn), GAIM_INPUT_READ, regjcall, NULL); -} - static char *jabber_normalize(const char *s) { static char buf[BUF_LEN]; @@ -2014,8 +1778,6 @@ ret->away_states = jabber_away_states; ret->buddy_menu = jabber_buddy_menu; ret->user_opts = jabber_user_opts; - ret->draw_new_user = jabber_draw_new_user; - ret->do_new_user = jabber_do_new_user; ret->login = jabber_login; ret->close = jabber_close; ret->send_im = jabber_send_im; diff -r 8c4ff1a368bd -r 14e8978f86bb src/protocols/oscar/oscar.c --- a/src/protocols/oscar/oscar.c Fri Sep 07 08:09:22 2001 +0000 +++ b/src/protocols/oscar/oscar.c Fri Sep 07 08:58:24 2001 +0000 @@ -2622,23 +2622,6 @@ oscar_set_permit_deny(gc); } -static void oscar_draw_new_user(GtkWidget *box) -{ - GtkWidget *label; - - label = gtk_label_new(_("Unfortunately, currently Oscar only allows new user registration by " - "going to http://aim.aol.com/aimnew/Aim/register.adp?promo=106723&pageset=Aim&client=no" - ". Clicking the Register button will open the URL for you.")); - gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); - gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5); - gtk_widget_show(label); -} - -static void oscar_do_new_user() -{ - open_url(NULL, "http://aim.aol.com/aimnew/Aim/register.adp?promo=106723&pageset=Aim&client=no"); -} - static GList *oscar_away_states() { return g_list_append(NULL, GAIM_AWAY_CUSTOM); @@ -2715,8 +2698,6 @@ ret->do_action = oscar_do_action; ret->buddy_menu = oscar_buddy_menu; ret->user_opts = oscar_user_opts; - ret->draw_new_user = oscar_draw_new_user; - ret->do_new_user = oscar_do_new_user; ret->login = oscar_login; ret->close = oscar_close; ret->send_im = oscar_send_im; diff -r 8c4ff1a368bd -r 14e8978f86bb src/protocols/toc/toc.c --- a/src/protocols/toc/toc.c Fri Sep 07 08:09:22 2001 +0000 +++ b/src/protocols/toc/toc.c Fri Sep 07 08:58:24 2001 +0000 @@ -1129,23 +1129,6 @@ toc_set_permit_deny(gc); } -static void toc_draw_new_user(GtkWidget *box) -{ - GtkWidget *label; - - label = gtk_label_new(_("Unfortunately, currently TOC only allows new user registration by " - "going to http://aim.aol.com/aimnew/Aim/register.adp?promo=106723&pageset=Aim&client=no" - ". Clicking the Register button will open the URL for you.")); - gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); - gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5); - gtk_widget_show(label); -} - -static void toc_do_new_user() -{ - open_url(NULL, "http://aim.aol.com/aimnew/Aim/register.adp?promo=106723&pageset=Aim&client=no"); -} - static GList *toc_away_states() { return g_list_append(NULL, GAIM_AWAY_CUSTOM); @@ -1186,8 +1169,6 @@ ret->do_action = toc_do_action; ret->buddy_menu = toc_buddy_menu; ret->user_opts = toc_user_opts; - ret->draw_new_user = toc_draw_new_user; - ret->do_new_user = toc_do_new_user; ret->login = toc_login; ret->close = toc_close; ret->send_im = toc_send_im; diff -r 8c4ff1a368bd -r 14e8978f86bb src/prpl.c --- a/src/prpl.c Fri Sep 07 08:09:22 2001 +0000 +++ b/src/prpl.c Fri Sep 07 08:58:24 2001 +0000 @@ -30,10 +30,6 @@ GSList *protocols = NULL; -static GtkWidget *regdialog = NULL; -static GtkWidget *regbox = NULL; -static struct prpl *regprpl = NULL; - GtkWidget *protomenu = NULL; struct _prompt { @@ -82,8 +78,6 @@ if ((old = find_prpl(p->protocol)) == NULL) unload_protocol(old); protocols = g_slist_insert_sorted(protocols, p, (GCompareFunc)proto_compare); - if (regdialog) - gtk_widget_destroy(regdialog); regenerate_user_list(); } @@ -235,134 +229,6 @@ gtk_widget_show_all(window); } -static void delete_reg(gpointer a, gpointer b) -{ - GtkWidget *tmp = regdialog; - if (regdialog) { - regdialog = NULL; - gtk_widget_destroy(tmp); - } -} - -void prepare_regbox_for_next() -{ - while (GTK_BOX(regbox)->children) - gtk_container_remove(GTK_CONTAINER(regbox), - ((GtkBoxChild *)GTK_BOX(regbox)->children->data)->widget); -} - -static void reg_prpl(gpointer a, struct prpl *p) -{ - prepare_regbox_for_next(); - regprpl = p; - (*regprpl->draw_new_user)(regbox); -} - -static void do_reg(gpointer a, gpointer b) -{ - if (regprpl->do_new_user) - (*regprpl->do_new_user)(); -} - -void register_user(gpointer a, gpointer b) -{ - GSList *pr = protocols; - struct prpl *p = NULL, *q; - GtkWidget *box; - GtkWidget *frame; - GtkWidget *vbox; - GtkWidget *hbox; - GtkWidget *label; - GtkWidget *optmenu; - GtkWidget *menu; - GtkWidget *opt; - GtkWidget *button; - - if (regdialog) - return; - - while (pr) { - p = pr->data; - if (p->draw_new_user) - break; - pr = pr->next; - p = NULL; - } - if (p == NULL) - /* this should never happen because I said so. Hi mom. */ - return; - pr = protocols; - - regdialog = gtk_window_new(GTK_WINDOW_TOPLEVEL); - gtk_window_set_wmclass(GTK_WINDOW(regdialog), "registration", "Gaim"); - gtk_container_set_border_width(GTK_CONTAINER(regdialog), 5); - gtk_window_set_title(GTK_WINDOW(regdialog), _("Gaim - New User Registration")); - gtk_signal_connect(GTK_OBJECT(regdialog), "destroy", GTK_SIGNAL_FUNC(delete_reg), NULL); - gtk_widget_realize(regdialog); - aol_icon(regdialog->window); - - box = gtk_vbox_new(FALSE, 5); - gtk_container_add(GTK_CONTAINER(regdialog), box); - gtk_widget_show(box); - - frame = gtk_frame_new(_("New User Registration")); - gtk_box_pack_start(GTK_BOX(box), frame, FALSE, FALSE, 5); - gtk_widget_show(frame); - - vbox = gtk_vbox_new(FALSE, 5); - gtk_container_add(GTK_CONTAINER(frame), vbox); - gtk_widget_show(vbox); - - hbox = gtk_hbox_new(FALSE, 5); - gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); - gtk_widget_show(hbox); - - label = gtk_label_new(_("Register new user for")); - gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); - gtk_widget_show(label); - - optmenu = gtk_option_menu_new(); - gtk_box_pack_start(GTK_BOX(hbox), optmenu, FALSE, FALSE, 5); - gtk_widget_show(optmenu); - - menu = gtk_menu_new(); - - while (pr) { - q = pr->data; - if (q->draw_new_user) { - opt = gtk_menu_item_new_with_label((*q->name)()); - gtk_signal_connect(GTK_OBJECT(opt), "activate", GTK_SIGNAL_FUNC(reg_prpl), q); - gtk_menu_append(GTK_MENU(menu), opt); - gtk_widget_show(opt); - } - pr = pr->next; - } - - gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu), menu); - gtk_option_menu_set_history(GTK_OPTION_MENU(optmenu), 0); - regprpl = p; - - regbox = gtk_vbox_new(FALSE, 5); - gtk_box_pack_start(GTK_BOX(vbox), regbox, FALSE, FALSE, 5); - gtk_widget_show(regbox); - - (*regprpl->draw_new_user)(regbox); - - hbox = gtk_hbox_new(FALSE, 5); - gtk_box_pack_end(GTK_BOX(box), hbox, FALSE, FALSE, 5); - gtk_widget_show(hbox); - - button = picture_button(regdialog, _("Close"), cancel_xpm); - gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 5); - gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(delete_reg), NULL); - - button = picture_button(regdialog, _("Register"), register_xpm); - gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 5); - gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(do_reg), NULL); - - gtk_widget_show(regdialog); -} - static void proto_act(GtkObject *obj, struct gaim_connection *gc) { char *act = gtk_object_get_user_data(obj); diff -r 8c4ff1a368bd -r 14e8978f86bb src/prpl.h --- a/src/prpl.h Fri Sep 07 08:09:22 2001 +0000 +++ b/src/prpl.h Fri Sep 07 08:58:24 2001 +0000 @@ -86,15 +86,6 @@ GList *(* buddy_menu)(struct gaim_connection *, char *); GList *(* chat_info)(struct gaim_connection *); - /* when UI plugins come, these will have to be reconciled by returning - * structs indicating what kinds of information they want displayed. */ - /* new thought though. instead of UI plugins, just do like X-Chat does; - * have different src- dirs in src: src-common, src-gtk, src-cli, etc. - * then have a prpl-base and prpl-UI stuff. people don't need to change - * their UIs all that often anyway. */ - void (* draw_new_user)(GtkWidget *); - void (* do_new_user)(); - /* all the server-related functions */ void (* login) (struct aim_user *); void (* close) (struct gaim_connection *);