vinagre r426 - in trunk: . src
- From: jwendell svn gnome org
- To: svn-commits-list gnome org
- Subject: vinagre r426 - in trunk: . src
- Date: Mon, 18 Aug 2008 17:13:26 +0000 (UTC)
Author: jwendell
Date: Mon Aug 18 17:13:26 2008
New Revision: 426
URL: http://svn.gnome.org/viewvc/vinagre?rev=426&view=rev
Log:
2008-08-18 Jonh Wendell <jwendell gnome org>
* configure.ac: Requires gtk+ >= 2.13.1, glib >= 2.17.0
* src/vinagre-utils.c: Uses new gtk+ functions instead of gnome-open.
Closes #514064.
Modified:
trunk/ChangeLog
trunk/configure.ac
trunk/src/vinagre-utils.c
Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Mon Aug 18 17:13:26 2008
@@ -33,8 +33,8 @@
# Check required GNOME libraries
#*******************************************************************************
-GLIB_REQUIRED=2.15.3
-GTK_REQUIRED=2.12.0
+GLIB_REQUIRED=2.17.0
+GTK_REQUIRED=2.13.1
LIBGLADE_REQUIRED=2.6.0
GCONF_REQUIRED=2.16.0
GTHREAD_REQUIRED=2.0.0
Modified: trunk/src/vinagre-utils.c
==============================================================================
--- trunk/src/vinagre-utils.c (original)
+++ trunk/src/vinagre-utils.c Mon Aug 18 17:13:26 2008
@@ -20,6 +20,7 @@
#include <string.h>
#include <glib/gi18n.h>
+#include <gtk/gtk.h>
#include "vinagre-utils.h"
#define VINAGRE_GLADE_FILE "vinagre.glade"
@@ -356,78 +357,50 @@
const char *link,
gpointer data)
{
- GError *error = NULL;
- gchar *address, *command;
- gboolean has_window = GTK_IS_WINDOW (data);
+ GError *error = NULL;
+ gchar *address;
+ GdkScreen *screen;
if (g_strstr_len (link, strlen (link), "@"))
address = g_strdup_printf ("mailto:%s", link);
else
address = g_strdup (link);
- command = g_strconcat ("gnome-open ", address, NULL);
+ screen = GTK_IS_WINDOW (data) ? gtk_window_get_screen (GTK_WINDOW (data)) : NULL;
- if (has_window)
- gdk_spawn_command_line_on_screen (gtk_window_get_screen (GTK_WINDOW (data)),
- command,
- &error);
- else
- g_spawn_command_line_async (command, &error);
+ gtk_show_uri (screen,
+ address,
+ GDK_CURRENT_TIME,
+ &error);
if (error != NULL)
{
- vinagre_utils_show_error (error->message, has_window?GTK_WINDOW (data):NULL);
+ vinagre_utils_show_error (error->message, GTK_IS_WINDOW (data) ? GTK_WINDOW (data) : NULL);
g_error_free (error);
}
- g_free (command);
g_free (address);
}
void
vinagre_utils_help_contents (GtkWindow *window)
{
- GError *error = NULL;
- char *command;
- const char *lang;
- char *uri = NULL;
- int i;
- gboolean has_window = GTK_IS_WINDOW (window);
+ GError *error;
+ GdkScreen *screen;
- const char * const * langs = g_get_language_names ();
+ screen = GTK_IS_WINDOW (window) ? gtk_window_get_screen (GTK_WINDOW (window)) : NULL;
+ error = NULL;
- for (i = 0; langs[i]; i++)
- {
- lang = langs[i];
- if (strchr (lang, '.'))
- continue;
-
- if (uri)
- g_free (uri);
-
- uri = g_build_filename (DATADIR, "/gnome/help/vinagre/", lang, "/vinagre.xml", NULL);
-
- if (g_file_test (uri, G_FILE_TEST_EXISTS))
- break;
- }
-
- command = g_strconcat ("gnome-open ghelp://", uri, NULL);
-
- if (has_window)
- gdk_spawn_command_line_on_screen (gtk_window_get_screen (GTK_WINDOW (window)),
- command,
- &error);
- else
- g_spawn_command_line_async (command, &error);
+ gtk_show_uri (screen,
+ "ghelp:vinagre",
+ GDK_CURRENT_TIME,
+ &error);
if (error != NULL)
{
- vinagre_utils_show_error (error->message, has_window?window:NULL);
+ vinagre_utils_show_error (error->message, GTK_IS_WINDOW (window) ? window : NULL);
g_error_free (error);
}
-
- g_free (command);
- g_free (uri);
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]