[Xfce4-commits] <xfce4-clipman-plugin:master> Update code responsible to open website URL and manual
Mike Massonnet
noreply at xfce.org
Thu Oct 20 11:42:02 CEST 2011
Updating branch refs/heads/master
to 62c39364f83f10d42c874054662cfc8f3f2f6a3f (commit)
from fca96054a1eafb0c5dc9db5e4d40c17b4f7ba255 (commit)
commit 62c39364f83f10d42c874054662cfc8f3f2f6a3f
Author: Mike Massonnet <mmassonnet at xfce.org>
Date: Mon Oct 17 21:28:46 2011 +0200
Update code responsible to open website URL and manual
panel-plugin/actions.c | 1 -
panel-plugin/plugin.c | 15 +++++++++------
panel-plugin/xfce4-clipman-settings.c | 15 ++++++++-------
3 files changed, 17 insertions(+), 14 deletions(-)
diff --git a/panel-plugin/actions.c b/panel-plugin/actions.c
index f67cd01..ccebe81 100644
--- a/panel-plugin/actions.c
+++ b/panel-plugin/actions.c
@@ -35,7 +35,6 @@
#endif
#include <gio/gio.h>
-#include <exo/exo.h>
#include <gtk/gtk.h>
#include <libxfce4util/libxfce4util.h>
#include <libxfce4ui/libxfce4ui.h>
diff --git a/panel-plugin/plugin.c b/panel-plugin/plugin.c
index 47cb088..2dccfea 100644
--- a/panel-plugin/plugin.c
+++ b/panel-plugin/plugin.c
@@ -291,16 +291,19 @@ cb_about_dialog_url_hook (GtkAboutDialog *dialog,
const gchar *uri,
gpointer user_data)
{
- gchar *command;
+ gchar *command = NULL;
- command = g_strdup_printf ("exo-open %s", uri);
- if (!g_spawn_command_line_async (command, NULL))
+ if (!gtk_show_uri (NULL, uri, GDK_CURRENT_TIME, NULL))
{
+ command = g_strdup_printf ("exo-open --launch %s", uri);
+ if (!g_spawn_command_line_async (command, NULL))
+ {
+ g_free (command);
+ command = g_strdup_printf ("firefox %s", uri);
+ g_spawn_command_line_async (command, NULL);
+ }
g_free (command);
- command = g_strdup_printf ("firefox %s", uri);
- g_spawn_command_line_async (command, NULL);
}
- g_free (command);
}
void
diff --git a/panel-plugin/xfce4-clipman-settings.c b/panel-plugin/xfce4-clipman-settings.c
index c1921fb..b201a46 100644
--- a/panel-plugin/xfce4-clipman-settings.c
+++ b/panel-plugin/xfce4-clipman-settings.c
@@ -187,40 +187,41 @@ cb_show_help (GtkButton *button)
locale = g_strdup ("C");
#endif
- filename = g_strdup_printf (DATAROOTDIR"/xfce4/doc/%s/"PACKAGE".html", locale);
+ filename = g_strdup_printf ("file://"DATAROOTDIR"/xfce4/doc/%s/"PACKAGE".html", locale);
if (!g_file_test (filename, G_FILE_TEST_EXISTS))
{
offset = g_strrstr (locale, "_");
if (offset == NULL)
{
g_free (filename);
- filename = g_strdup (DATAROOTDIR"/xfce4/doc/C/"PACKAGE".html");
+ filename = g_strdup ("file://"DATAROOTDIR"/xfce4/doc/C/"PACKAGE".html");
}
else
{
*offset = '\0';
g_free (filename);
- filename = g_strdup_printf (DATAROOTDIR"/xfce4/doc/%s/"PACKAGE".html", locale);
+ filename = g_strdup_printf ("file://"DATAROOTDIR"/xfce4/doc/%s/"PACKAGE".html", locale);
if (!g_file_test (filename, G_FILE_TEST_EXISTS))
{
g_free (filename);
- filename = g_strdup (DATAROOTDIR"/xfce4/doc/C/"PACKAGE".html");
+ filename = g_strdup ("file://"DATAROOTDIR"/xfce4/doc/C/"PACKAGE".html");
}
}
}
g_free (locale);
#else
- filename = g_strdup (DATAROOTDIR"/xfce4/doc/C/"PACKAGE".html");
+ filename = g_strdup ("file://"DATAROOTDIR"/xfce4/doc/C/"PACKAGE".html");
#endif
screen = gtk_widget_get_screen (GTK_WIDGET (button));
- command = g_strdup_printf ("exo-open file://%s", filename);
+
+ command = g_strdup_printf ("exo-open --launch WebBrowser %s", filename);
if (gdk_spawn_command_line_on_screen (screen, command, NULL))
goto out;
g_free (command);
- command = g_strdup_printf ("firefox file://%s", filename);
+ command = g_strdup_printf ("firefox %s", filename);
if (gdk_spawn_command_line_on_screen (screen, command, NULL))
goto out;
More information about the Xfce4-commits
mailing list