Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv32369/src Modified Files: about.c aim.c browser.c conversation.c dialogs.c prefs.c prpl.c prpl.h server.c ui.h Log Message: heh. Index: about.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/about.c,v retrieving revision 1.56 retrieving revision 1.57 diff -u -d -r1.56 -r1.57 --- about.c 2001/11/15 22:47:03 1.56 +++ about.c 2001/12/02 00:35:33 1.57 @@ -53,7 +53,7 @@ static void about_click(GtkWidget *w, gpointer m) { - open_url_nw(NULL, WEBSITE); + open_url(NULL, WEBSITE); } char *name() Index: aim.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/aim.c,v retrieving revision 1.173 retrieving revision 1.174 diff -u -d -r1.173 -r1.174 --- aim.c 2001/12/01 01:48:26 1.173 +++ aim.c 2001/12/02 00:35:33 1.174 @@ -212,7 +212,7 @@ #endif GtkWidget *signon; GtkWidget *cancel; - GtkWidget *help; + GtkWidget *reg; GtkWidget *bbox; GtkWidget *hbox; GtkWidget *sbox; @@ -330,32 +330,32 @@ gtk_box_pack_start(GTK_BOX(sbox), hbox, TRUE, TRUE, 0); gtk_widget_show(hbox); - help = gtk_button_new_with_label(_("Help!")); + reg = 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 (misc_options & OPT_MISC_COOL_LOOK) { - gtk_button_set_relief(GTK_BUTTON(help), GTK_RELIEF_NONE); + gtk_button_set_relief(GTK_BUTTON(reg), 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(help), "clicked", GTK_SIGNAL_FUNC(gaim_help), NULL); + gtk_signal_connect(GTK_OBJECT(reg), "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), help, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(hbox), reg, 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(help); + gtk_widget_show(reg); gtk_widget_show(options); #ifdef GAIM_PLUGINS gtk_widget_show(plugs); Index: browser.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/browser.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- browser.c 2001/11/20 20:19:43 1.19 +++ browser.c 2001/12/02 00:35:33 1.20 @@ -567,68 +567,50 @@ if (web_browser == BROWSER_NETSCAPE) { char *command = g_malloc(1024); - g_snprintf(command, 1024, "OpenURL(%s)", url); + if (misc_options & OPT_MISC_BROWSER_POPUP) + g_snprintf(command, 1024, "OpenURL(%s, new-window)", url); + else + g_snprintf(command, 1024, "OpenURL(%s)", url); netscape_command(command); g_free(command); - } else if (web_browser == BROWSER_KFM) { - pid_t pid; - - pid = fork(); - - if (pid == 0) { - char *args[4]; - - args[0] = g_strdup("kfmclient"); - args[1] = g_strdup("openURL"); - args[2] = url; - args[3] = NULL; - - execvp(args[0], args); - _exit(0); - } else { - gtk_timeout_add(1000, (GtkFunction)clean_pid, NULL); - } - } else if (web_browser == BROWSER_OPERA) { - pid_t pid; - - pid = fork(); - - if (pid == 0) { - char *args[4]; - args[0] = g_strdup("opera"); - args[1] = g_strdup("-newwindow"); - args[2] = url; - args[3] = NULL; - - execvp(args[0], args); - _exit(0); - } else { - gtk_timeout_add(1000, (GtkFunction)clean_pid, NULL); - } #ifdef USE_GNOME } else if (web_browser == BROWSER_GNOME) { gnome_url_show(url); #endif /* USE_GNOME */ - } else if (web_browser == BROWSER_MANUAL) { + } else { pid_t pid; pid = fork(); if (pid == 0) { char *args[4]; - char command[1024]; - g_snprintf(command, sizeof(command), web_command, url); + if (web_browser == BROWSER_OPERA) { + args[0] = g_strdup("opera"); + args[1] = g_strdup("-newwindow"); + args[2] = url; + args[3] = NULL; + } else if (web_browser == BROWSER_KFM) { + args[0] = g_strdup("kfmclient"); + args[1] = g_strdup("openURL"); + args[2] = url; + args[3] = NULL; + } else if (web_browser == BROWSER_GALEON) { + args[0] = g_strdup("galeon"); + args[1] = url; + args[2] = NULL; + } else if (web_browser == BROWSER_MANUAL) { + g_snprintf(command, sizeof(command), web_command, url); - args[0] = "sh"; - args[1] = "-c"; - args[2] = command; - args[3] = NULL; + args[0] = "sh"; + args[1] = "-c"; + args[2] = command; + args[3] = NULL; + } execvp(args[0], args); - _exit(0); } else { gtk_timeout_add(1000, (GtkFunction)clean_pid, NULL); @@ -648,20 +630,6 @@ } } -void open_url_nw(GtkWidget *w, char *url) -{ - if (web_browser == BROWSER_NETSCAPE) { - char *command = g_malloc(1024); - - g_snprintf(command, 1024, "OpenURL(%s, new-window)", url); - - netscape_command(command); - g_free(command); - } else { - open_url(w, url); - } -} - #else /* Sooner or later, I shall support Windows clicking! */ @@ -670,9 +638,6 @@ { } void open_url_nw(GtkWidget *w, char *url) -{ -} -void open_url(GtkWidget *w, char *url) { } Index: conversation.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/conversation.c,v retrieving revision 1.307 retrieving revision 1.308 diff -u -d -r1.307 -r1.308 --- conversation.c 2001/11/27 20:50:58 1.307 +++ conversation.c 2001/12/02 00:35:33 1.308 @@ -96,7 +96,7 @@ g_return_if_fail(GTK_IS_IMHTML(imhtml)); if (!(convo_options & OPT_CONVO_SHOW_SMILEY)) gtk_imhtml_show_smileys(GTK_IMHTML(imhtml), FALSE); - gtk_signal_connect(GTK_OBJECT(imhtml), "url_clicked", GTK_SIGNAL_FUNC(open_url_nw), NULL); + gtk_signal_connect(GTK_OBJECT(imhtml), "url_clicked", GTK_SIGNAL_FUNC(open_url), NULL); gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), "C:)", luke03_xpm); gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), "C:-)", luke03_xpm); gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), "O-)", oneeye_xpm); Index: dialogs.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/dialogs.c,v retrieving revision 1.293 retrieving revision 1.294 diff -u -d -r1.293 -r1.294 --- dialogs.c 2001/11/27 01:09:33 1.293 +++ dialogs.c 2001/12/02 00:35:33 1.294 @@ -3758,7 +3758,7 @@ gtk_container_add(GTK_CONTAINER(frame), sw); gtk_box_pack_start(GTK_BOX(hbox), frame, TRUE, TRUE, 0); - gtk_signal_connect(GTK_OBJECT(layout), "url_clicked", GTK_SIGNAL_FUNC(open_url_nw), NULL); + gtk_signal_connect(GTK_OBJECT(layout), "url_clicked", GTK_SIGNAL_FUNC(open_url), NULL); gtk_container_add(GTK_CONTAINER(sw), layout); gaim_setup_imhtml(layout); Index: prefs.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/prefs.c,v retrieving revision 1.205 retrieving revision 1.206 diff -u -d -r1.205 -r1.206 --- prefs.c 2001/12/01 01:48:26 1.205 +++ prefs.c 2001/12/02 00:35:34 1.206 @@ -292,6 +292,7 @@ #ifdef USE_GNOME opt = browser_radio(_("GNOME URL Handler"), BROWSER_GNOME, vbox, opt); #endif /* USE_GNOME */ + opt = browser_radio(_("Galeon"), BROWSER_GALEON, vbox, opt); opt = browser_radio(_("Manual"), BROWSER_MANUAL, vbox, opt); browser_entry = gtk_entry_new(); Index: prpl.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/prpl.c,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- prpl.c 2001/11/15 22:47:04 1.48 +++ prpl.c 2001/12/02 00:35:34 1.49 @@ -444,7 +444,7 @@ mn->url = g_strdup(url); urlbut = picture_button(mn->email_win, _("Open Mail"), tb_forward_xpm); gtk_box_pack_end(GTK_BOX(hbox), urlbut, 0, 0, 5); - gtk_signal_connect(GTK_OBJECT(urlbut), "clicked", GTK_SIGNAL_FUNC(open_url_nw), mn->url); + gtk_signal_connect(GTK_OBJECT(urlbut), "clicked", GTK_SIGNAL_FUNC(open_url), mn->url); gtk_signal_connect(GTK_OBJECT(urlbut), "clicked", GTK_SIGNAL_FUNC(des_email_win), mn); } @@ -574,4 +574,107 @@ do_error_dialog(buf, "Added to List"); else do_ask_dialog(buf, ga, do_add, dont_add); +} + +static GtkWidget *regdlg = NULL; +static GtkWidget *reg_list = NULL; +static GtkWidget *reg_area = NULL; +static GtkWidget *reg_reg = NULL; + +static void delete_regdlg() +{ + GtkWidget *tmp = regdlg; + regdlg = NULL; + if (tmp) + gtk_widget_destroy(tmp); +} + +static void reset_reg_dlg() +{ + GSList *P = protocols; + + if (!regdlg) + return; + + while (GTK_BOX(reg_list)->children) + gtk_container_remove(GTK_CONTAINER(reg_list), + ((GtkBoxChild *)GTK_BOX(reg_list)->children->data)->widget); + + while (GTK_BOX(reg_area)->children) + gtk_container_remove(GTK_CONTAINER(reg_area), + ((GtkBoxChild *)GTK_BOX(reg_area)->children->data)->widget); + + while (P) { + struct prpl *p = P->data; + if (p->register_user) + break; + P = P->next; + } + + if (!P) { + GtkWidget *no = gtk_label_new(_("You do not currently have any plugins loaded" + " that are able to register new accounts.")); + gtk_box_pack_start(GTK_BOX(reg_area), no, FALSE, FALSE, 5); + gtk_widget_show(no); + + gtk_widget_set_sensitive(reg_reg, FALSE); + + return; + } +} + +void register_dialog() +{ + /* this is just one big hack */ + GtkWidget *vbox; + GtkWidget *frame; + GtkWidget *hbox; + GtkWidget *close; + + if (regdlg) { + gdk_window_raise(regdlg->window); + return; + } + + regdlg = gtk_window_new(GTK_WINDOW_TOPLEVEL); + gtk_window_set_title(GTK_WINDOW(regdlg), _("Gaim - Registration")); + gtk_window_set_wmclass(GTK_WINDOW(regdlg), "register", "Gaim"); + gtk_widget_realize(regdlg); + aol_icon(regdlg->window); + gtk_signal_connect(GTK_OBJECT(regdlg), "destroy", GTK_SIGNAL_FUNC(delete_regdlg), NULL); + + vbox = gtk_vbox_new(FALSE, 5); + gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); + gtk_container_add(GTK_CONTAINER(regdlg), vbox); + gtk_widget_show(vbox); + + reg_list = gtk_hbox_new(FALSE, 5); + gtk_box_pack_start(GTK_BOX(vbox), reg_list, FALSE, FALSE, 5); + gtk_widget_show(reg_list); + + frame = gtk_frame_new(_("Registration Information")); + gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 5); + gtk_widget_show(frame); + + reg_area = gtk_hbox_new(FALSE, 5); + gtk_container_add(GTK_CONTAINER(frame), reg_area); + gtk_widget_show(reg_area); + + hbox = gtk_hbox_new(FALSE, 5); + gtk_box_pack_end(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); + gtk_widget_show(hbox); + + close = picture_button(regdlg, _("Close"), cancel_xpm); + gtk_box_pack_end(GTK_BOX(hbox), close, FALSE, FALSE, 5); + gtk_signal_connect(GTK_OBJECT(close), "clicked", GTK_SIGNAL_FUNC(delete_regdlg), NULL); + gtk_widget_show(close); + + reg_reg = picture_button(regdlg, _("Register"), ok_xpm); + gtk_box_pack_end(GTK_BOX(hbox), reg_reg, FALSE, FALSE, 5); + gtk_widget_show(reg_reg); + + /* fuck me */ + reset_reg_dlg(); + + gtk_widget_show(regdlg); } Index: prpl.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/prpl.h,v retrieving revision 1.57 retrieving revision 1.58 diff -u -d -r1.57 -r1.58 --- prpl.h 2001/11/20 01:01:20 1.57 +++ prpl.h 2001/12/02 00:35:34 1.58 @@ -143,6 +143,9 @@ int (* chat_send) (struct gaim_connection *, int id, char *message); void (* keepalive) (struct gaim_connection *); + /* new user registration */ + void (* register_user) (struct gaim_connection *); + void (* buddy_free) (struct buddy *); /* this is really bad. */ Index: server.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/server.c,v retrieving revision 1.212 retrieving revision 1.213 diff -u -d -r1.212 -r1.213 --- server.c 2001/11/21 12:15:37 1.212 +++ server.c 2001/12/02 00:35:34 1.213 @@ -982,7 +982,7 @@ button = picture_button(window, _("More Info"), tb_search_xpm); gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 5); - gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(open_url_nw), url); + gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(open_url), url); gtk_widget_show_all(window); Index: ui.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/ui.h,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- ui.h 2001/11/28 21:06:45 1.22 +++ ui.h 2001/12/02 00:35:34 1.23 @@ -60,6 +60,7 @@ /*#define BROWSER_INTERNAL 3*/ #define BROWSER_GNOME 4 #define BROWSER_OPERA 5 +#define BROWSER_GALEON 6 #define FACE_ANGEL 0 #define FACE_BIGSMILE 1 @@ -296,7 +297,6 @@ /* Functions in browser.c */ extern void open_url(GtkWidget *, char *); -extern void open_url_nw(GtkWidget *, char *); extern void add_bookmark(GtkWidget *, char *); /* Functions in buddy.c */ @@ -439,6 +439,9 @@ extern GtkWidget *prefs_away_menu; extern GtkWidget *pref_fg_picture; extern GtkWidget *pref_bg_picture; + +/* Functions in prpl.c */ +extern void register_dialog(); /* Functions in sound.c */ extern void play_sound(int); |