goffice r2257 - in trunk: . goffice goffice/app goffice/gtk goffice/utils



Author: jbrefort
Date: Sat Nov  1 13:39:46 2008
New Revision: 2257
URL: http://svn.gnome.org/viewvc/goffice?rev=2257&view=rev

Log:
2008-11-01  Jean Brefort  <jean brefort normalesup org>

	* configure.in: add GOFFICE_WITH_GCONF and use gtk_show_uri when present.
	[#558709]
	* goffice/app/go-conf.c: ditto.
	* goffice/goffice-features.h.in: ditto.
	* goffice/gtk/goffice-gtk.c: (go_help_display): ditto.
	* goffice/utils/go-file.c: (go_url_show): ditto,
	(go_get_mime_type): simplify.



Modified:
   trunk/ChangeLog
   trunk/NEWS
   trunk/goffice/app/go-conf.c
   trunk/goffice/goffice-features.h.in
   trunk/goffice/gtk/goffice-gtk.c
   trunk/goffice/utils/go-file.c

Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS	(original)
+++ trunk/NEWS	Sat Nov  1 13:39:46 2008
@@ -6,6 +6,7 @@
 Jean:
 	* Fixed various regressions in contour plots.
 	* Add XYZ series based contour plots.
+	* Use gtk_show_uri when present (see #558709).
 
 Morten:
 	* Plug leaks.

Modified: trunk/goffice/app/go-conf.c
==============================================================================
--- trunk/goffice/app/go-conf.c	(original)
+++ trunk/goffice/app/go-conf.c	Sat Nov  1 13:39:46 2008
@@ -38,7 +38,7 @@
 #define d(code)
 #endif
 
-#ifdef GOFFICE_WITH_GNOME
+#ifdef GOFFICE_WITH_GCONF
 #include "go-conf-gconf.c"
 #elif defined G_OS_WIN32
 #include "go-conf-win32.c"

Modified: trunk/goffice/goffice-features.h.in
==============================================================================
--- trunk/goffice/goffice-features.h.in	(original)
+++ trunk/goffice/goffice-features.h.in	Sat Nov  1 13:39:46 2008
@@ -51,6 +51,9 @@
 /* Define if Goffice uses Cairo */
 #undef GOFFICE_WITH_CAIRO
 
+/* Define if GOffice uses GConf */
+#undef GOFFICE_WITH_GCONF
+
 /* Define if GOffice uses Gtk+ */
 #undef GOFFICE_WITH_GTK
 

Modified: trunk/goffice/gtk/goffice-gtk.c
==============================================================================
--- trunk/goffice/gtk/goffice-gtk.c	(original)
+++ trunk/goffice/gtk/goffice-gtk.c	Sat Nov  1 13:39:46 2008
@@ -842,12 +842,19 @@
 		g_free (path);
 	}
 #else
+#ifdef HAVE_GTK_SHOW_URI
+	char *uri = g_strconcat ("ghelp://", paths->app, "#", paths->link, NULL);
+	gtk_show_uri (NULL, uri, GDK_CURRENT_TIME, NULL);
+	g_free (uri);
+	return;
+#else
 #ifdef GOFFICE_WITH_GNOME
 	if (gnome_program_get () != NULL) {
 		gnome_help_display (paths->app, paths->link, NULL);
 		return;
 	}
 #endif
+#endif
 	go_gtk_notice_dialog (NULL, GTK_MESSAGE_ERROR,
 			      "TODO : launch help browser for %s", paths->link);
 #endif

Modified: trunk/goffice/utils/go-file.c
==============================================================================
--- trunk/goffice/utils/go-file.c	(original)
+++ trunk/goffice/utils/go-file.c	Sat Nov  1 13:39:46 2008
@@ -922,6 +922,7 @@
 	return g_string_free (result, FALSE);
 }
 
+#ifndef HAVE_GTK_SHOW_URI
 #ifndef GOFFICE_WITH_GNOME
 #ifndef G_OS_WIN32
 static char *
@@ -938,11 +939,16 @@
 }
 #endif
 #endif
+#endif
 
 GError *
 go_url_show (gchar const *url)
 {
-#ifdef G_OS_WIN32
+#ifdef HAVE_GTK_SHOW_URI
+	GError *err = NULL;
+	gtk_show_uri (NULL, url, GDK_CURRENT_TIME, &error);
+	return error;
+#elif defined(G_OS_WIN32)
 	ShellExecute (NULL, "open", url, NULL, NULL, SW_SHOWNORMAL);
 
 	return NULL;
@@ -1087,7 +1093,7 @@
 	 */
 	return g_strdup ("text/plain");
 #else
-	GFile *file = g_vfs_get_file_for_uri (g_vfs_get_default (), uri);
+	GFile *file = g_file_new_for_uri (uri);
 	GError *error = NULL;
 	gchar *content_type = NULL, *mime_type = NULL;
 	GFileInfo *info = g_file_query_info (file,



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