changeset 10060:7570908c558f

[gaim-migrate @ 11030] <seanegan> It removes the Web Browser dropdown if you're running GNOME and uses the GNOME browser instead of what's set in prefs. committer: Tailor Script <tailor@pidgin.im>
author Tim Ringenbach <marv@pidgin.im>
date Thu, 23 Sep 2004 03:09:46 +0000
parents 79fafe47d919
children 83eb12b1f1a1
files COPYRIGHT src/gtknotify.c src/gtkprefs.c
diffstat 3 files changed, 22 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/COPYRIGHT	Wed Sep 22 11:54:29 2004 +0000
+++ b/COPYRIGHT	Thu Sep 23 03:09:46 2004 +0000
@@ -39,6 +39,7 @@
 Mark Doliner
 Nuno Donato
 Jim Duchek
+Alex Duggan
 Tom Dyas
 Marc E.
 Marc Etcheverry
--- a/src/gtknotify.c	Wed Sep 22 11:54:29 2004 +0000
+++ b/src/gtknotify.c	Thu Sep 23 03:09:46 2004 +0000
@@ -466,6 +466,17 @@
 }
 #endif /* _WIN32 */
 
+gboolean 
+running_gnome(void)
+{
+	if (g_getenv("GNOME_DESKTOP_SESSION_ID") && g_find_program_in_path("gnome-open") != NULL)
+	{
+		return TRUE;
+	}
+
+	return FALSE;
+}
+
 static void *
 gaim_gtk_notify_uri(const char *uri)
 {
@@ -478,7 +489,12 @@
 	web_browser = gaim_prefs_get_string("/gaim/gtk/browsers/browser");
 	place = gaim_prefs_get_int("/gaim/gtk/browsers/place");
 
-	if (!strcmp(web_browser, "epiphany") ||
+	/* if they are running gnome, use the gnome web browser */
+	if (running_gnome() == TRUE)
+	{
+		command = g_strdup_printf("gnome-open \"%s\"", uri);
+	} 
+	else if (!strcmp(web_browser, "epiphany") ||
 		!strcmp(web_browser, "galeon"))
 	{
 		if (place == GAIM_BROWSER_NEW_WINDOW)
--- a/src/gtkprefs.c	Wed Sep 22 11:54:29 2004 +0000
+++ b/src/gtkprefs.c	Thu Sep 23 03:09:46 2004 +0000
@@ -2455,7 +2455,10 @@
 	prefs_notebook_add_page(_("Network"), NULL, network_page(), &p, NULL, notebook_page++);
 #ifndef _WIN32
 	/* We use the registered default browser in windows */
-	prefs_notebook_add_page(_("Browser"), NULL, browser_page(), &p, NULL, notebook_page++);
+	/* if the user is running gnome 2.x, hide the browsers tab */
+	if (running_gnome() == FALSE) {
+		prefs_notebook_add_page(_("Browser"), NULL, browser_page(), &p, NULL, notebook_page++);
+	}
 #endif
 	prefs_notebook_add_page(_("Logging"), NULL, logging_page(), &p, NULL, notebook_page++);
 	prefs_notebook_add_page(_("Away / Idle"), NULL, away_page(), &p, NULL, notebook_page++);