Группа :: Сети/IRC
Пакет: xchat
Главная Изменения Спек Патчи Загрузить Bugs and FR
Патч: xchat-2.4.3-alt-browser.patch
--- xchat-2.4.2.orig/src/fe-gtk/fe-gtk.c 2005-03-11 09:14:15 +0300
+++ xchat-2.4.2/src/fe-gtk/fe-gtk.c 2005-03-28 22:14:43 +0400
@@ -822,11 +822,16 @@
static void
fe_open_url_locale (const char *url)
{
-#ifdef WIN32
- ShellExecute (0, "open", url, NULL, NULL, SW_SHOWNORMAL);
-#else
char tbuf[512], *moz;
+ moz = getenv ("XCHAT_BROWSER");
+ if (moz)
+ {
+ snprintf(tbuf, sizeof (tbuf), "%s %s", moz, url);
+ xchat_exec(tbuf);
+ return;
+ }
+
/* gnome 2.4+ has this */
moz = g_find_program_in_path ("gnome-open");
if (moz)
@@ -837,17 +842,23 @@
return;
}
- moz = g_find_program_in_path ("gnome-moz-remote");
+ moz = g_find_program_in_path ("mozilla");
if (moz)
{
- snprintf (tbuf, sizeof (tbuf), "%s %s", moz, url);
- g_free (moz);
- } else
+ snprintf (tbuf, sizeof (tbuf), "mozilla -remote "
+ "'openURL(%s),new-tab'", url);
+ g_free(moz);
+ xchat_exec (tbuf);
+ return;
+ }
+
+ moz = getenv ("BROWSER");
+ if (moz)
{
- snprintf (tbuf, sizeof (tbuf), "mozilla -remote 'openURL(%s)'", url);
+ snprintf (tbuf, sizeof (tbuf), "%s %s", moz, url);
+ xchat_exec(tbuf);
}
- xchat_exec (tbuf);
-#endif
+ /* FIXME: tell the user we failed. */
}
void