changeset 2827:51999a36c0b1

[gaim-migrate @ 2840] heh. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sun, 02 Dec 2001 00:35:34 +0000
parents d00066b2f71a
children 06539a384d6b
files ChangeLog src/about.c src/aim.c src/browser.c src/conversation.c src/dialogs.c src/prefs.c src/prpl.c src/prpl.h src/server.c src/ui.h
diffstat 11 files changed, 156 insertions(+), 80 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Dec 01 22:53:51 2001 +0000
+++ b/ChangeLog	Sun Dec 02 00:35:34 2001 +0000
@@ -3,6 +3,7 @@
 version 0.50:
 	* Updated polish translation (Thanks Przemyslaw Sulek)
 	* Able to import GnomeICU contact lists
+	* Galeon as browser option (Thanks Rob McQueen)
 
 version 0.49 (11/29/2001):
 	* Can compile against GTK+ 2.0 (version 1.3.10/1.3.11)
--- a/src/about.c	Sat Dec 01 22:53:51 2001 +0000
+++ b/src/about.c	Sun Dec 02 00:35:34 2001 +0000
@@ -53,7 +53,7 @@
 
 static void about_click(GtkWidget *w, gpointer m)
 {
-	open_url_nw(NULL, WEBSITE);
+	open_url(NULL, WEBSITE);
 }
 
 char *name()
--- a/src/aim.c	Sat Dec 01 22:53:51 2001 +0000
+++ b/src/aim.c	Sun Dec 02 00:35:34 2001 +0000
@@ -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);
--- a/src/browser.c	Sat Dec 01 22:53:51 2001 +0000
+++ b/src/browser.c	Sun Dec 02 00:35:34 2001 +0000
@@ -567,72 +567,54 @@
 	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) {
+#ifdef USE_GNOME
+	} else if (web_browser == BROWSER_GNOME) {
+		gnome_url_show(url);
+#endif /* USE_GNOME */
+	} else {
 		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;
+			char command[1024];
+
+			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;
+			}
 
 			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) {
-		pid_t pid;
-
-		pid = fork();
-
-		if (pid == 0) {
-			char *args[4];
-
-			char command[1024];
-
-			g_snprintf(command, sizeof(command), web_command, url);
-
-			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! */
@@ -672,9 +640,6 @@
 void open_url_nw(GtkWidget *w, char *url)
 {
 }
-void open_url(GtkWidget *w, char *url)
-{
-}
 
 
 #endif /* _WIN32 */
--- a/src/conversation.c	Sat Dec 01 22:53:51 2001 +0000
+++ b/src/conversation.c	Sun Dec 02 00:35:34 2001 +0000
@@ -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);
--- a/src/dialogs.c	Sat Dec 01 22:53:51 2001 +0000
+++ b/src/dialogs.c	Sun Dec 02 00:35:34 2001 +0000
@@ -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);
 
--- a/src/prefs.c	Sat Dec 01 22:53:51 2001 +0000
+++ b/src/prefs.c	Sun Dec 02 00:35:34 2001 +0000
@@ -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();
--- a/src/prpl.c	Sat Dec 01 22:53:51 2001 +0000
+++ b/src/prpl.c	Sun Dec 02 00:35:34 2001 +0000
@@ -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);
 	}
 
@@ -575,3 +575,106 @@
 	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);
+}
--- a/src/prpl.h	Sat Dec 01 22:53:51 2001 +0000
+++ b/src/prpl.h	Sun Dec 02 00:35:34 2001 +0000
@@ -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. */
--- a/src/server.c	Sat Dec 01 22:53:51 2001 +0000
+++ b/src/server.c	Sun Dec 02 00:35:34 2001 +0000
@@ -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);
 
--- a/src/ui.h	Sat Dec 01 22:53:51 2001 +0000
+++ b/src/ui.h	Sun Dec 02 00:35:34 2001 +0000
@@ -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 */
@@ -440,6 +440,9 @@
 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);
 extern void play_file(char *);