gucharmap r1859 - in trunk: . gucharmap



Author: chpe
Date: Sat Aug 23 19:16:34 2008
New Revision: 1859
URL: http://svn.gnome.org/viewvc/gucharmap?rev=1859&view=rev

Log:
Use GIO to launch the help URI instead of calling gnome-open.

Modified:
   trunk/configure.ac
   trunk/gucharmap/gucharmap-window.c

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	(original)
+++ trunk/configure.ac	Sat Aug 23 19:16:34 2008
@@ -76,7 +76,7 @@
 AM_CONDITIONAL(OS_WIN32, test "x$os_win32" = "xyes")
 
 GLIB_REQUIRED=2.16.3
-GTK_REQUIRED=2.12.0
+GTK_REQUIRED=2.13.6
 PKG_CHECK_MODULES([GTK],[glib-2.0 >= $GLIB_REQUIRED gtk+-2.0 >= $GTK_REQUIRED])
 
 GLIB_GENMARSHAL="$($PKG_CONFIG --variable=glib_genmarshal glib-2.0)"

Modified: trunk/gucharmap/gucharmap-window.c
==============================================================================
--- trunk/gucharmap/gucharmap-window.c	(original)
+++ trunk/gucharmap/gucharmap-window.c	Sat Aug 23 19:16:34 2008
@@ -391,17 +391,22 @@
 
 static void
 open_url (GtkWindow *parent,
-          const char *url)
+          const char *uri,
+          guint32 user_time)
 {
+  GdkAppLaunchContext *context;
   GError *error = NULL;
-  GdkScreen *screen;
-  char *command;
 
-  screen = gtk_widget_get_screen (GTK_WIDGET (parent));
+  context = gdk_app_launch_context_new ();
+  gdk_app_launch_context_set_timestamp (context, user_time);
+
+  if (parent)
+    gdk_app_launch_context_set_screen (context, gtk_widget_get_screen (GTK_WIDGET (parent)));
+  else
+    gdk_app_launch_context_set_screen (context, gdk_screen_get_default ());
 
-  command = g_strconcat ("gnome-open ", url, NULL);
-  gdk_spawn_command_line_on_screen (screen, command, &error);
-  g_free (command);
+  g_app_info_launch_default_for_uri (uri, G_APP_LAUNCH_CONTEXT (context), &error);
+  g_object_unref (context);
 
   if (error) {
     show_error_dialog (parent, error);
@@ -411,7 +416,7 @@
 
 static void
 help_contents (GtkAction *action,
-               GtkWindow *window)
+               GucharmapWindow *window)
 {
   const char *lang;
   char *uri = NULL, *url;
@@ -439,7 +444,7 @@
     return;
 
   url = g_strconcat ("ghelp://", uri, NULL);
-  open_url (window, url);
+  open_url (GTK_WINDOW (window), url, gtk_get_current_event_time ());
   g_free (url);
 }
 
@@ -448,7 +453,7 @@
                 const char *link,
                 gpointer data)
 {
-  open_url (GTK_WINDOW (about), link);
+  open_url (GTK_WINDOW (about), link, gtk_get_current_event_time ());
 }
 
 static void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]