goffice r2260 - in trunk: . goffice goffice/gtk goffice/utils
- From: jbrefort svn gnome org
- To: svn-commits-list gnome org
- Subject: goffice r2260 - in trunk: . goffice goffice/gtk goffice/utils
- Date: Sat, 1 Nov 2008 16:26:21 +0000 (UTC)
Author: jbrefort
Date: Sat Nov 1 16:26:21 2008
New Revision: 2260
URL: http://svn.gnome.org/viewvc/goffice?rev=2260&view=rev
Log:
2008-11-01 Jean Brefort <jean brefort normalesup org>
* configure.in: drop the libgnome related code. [#558709]
* goffice/goffice-features.h.in: ditto.
* goffice/gtk/goffice-gtk.c: (go_help_display): ditto.
* goffice/utils/go-file.c: (go_url_show): ditto.
Modified:
trunk/ChangeLog
trunk/NEWS
trunk/configure.in
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 16:26:21 2008
@@ -6,7 +6,7 @@
Jean:
* Fixed various regressions in contour plots.
* Add XYZ series based contour plots.
- * Use gtk_show_uri when present (see #558709).
+ * Drop the libgome dependency. [#558709]
Morten:
* Plug leaks.
Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in (original)
+++ trunk/configure.in Sat Nov 1 16:26:21 2008
@@ -108,9 +108,6 @@
gtk+-2.0 >= 2.6.0
libglade-2.0 >= 2.3.6
"
-goffice_gnome_reqs="
- libgnomeui-2.0 >= 2.0.0
-"
dnl *******************
dnl Should we use gconf ?
@@ -146,7 +143,6 @@
PKG_CHECK_MODULES(GTK, [$goffice_gtk_reqs])
fi
-goffice_with_gnome=$goffice_with_gtk
if test "x$goffice_with_gtk" = "xtrue" ; then
AC_DEFINE(GOFFICE_WITH_GTK, 1, [Define if UI is built])
goffice_reqs="$goffice_reqs $goffice_gtk_reqs"
@@ -164,35 +160,10 @@
LIBS=$SAVE_LIBS
if test "x$have_gtk_show_uri" = xyes; then
AC_DEFINE(HAVE_GTK_SHOW_URI, 1, [Define to 1 if you have the `have_gtk_show_uri' function.])
- goffice_with_gnome=false
- else
-
- dnl ************************************
- dnl Are the GNOME extensions available ?
- dnl ************************************
-
- goffice_with_gnome=true
- AC_ARG_WITH(gnome,
- [ --{with,without}-gnome Use GNOME extensions],
- [if test "x$withval" = xno; then
- goffice_with_gnome=false
- ui_msg="Gtk+ (Gnome disabled by request)"
- fi]
- )
- if test "x$goffice_with_gnome" = "xtrue"; then
- PKG_CHECK_MODULES(GNOME, [$goffice_gnome_reqs],
- [ui_msg="Gnome"],
- [ui_msg="Gtk (missing gnome dependencies)" ; goffice_with_gnome=false])
- fi
-
- if test "x$goffice_with_gnome" = "xtrue"; then
- AC_DEFINE(GOFFICE_WITH_GNOME, 1, [Define if GNOME extensions are available])
- goffice_reqs="$goffice_reqs $goffice_gnome_reqs"
- fi
fi
fi
+
AM_CONDITIONAL(WITH_GTK, $goffice_with_gtk)
-AM_CONDITIONAL(WITH_GNOME, $goffice_with_gnome)
AC_DEFINE(GOFFICE_WITH_CAIRO, 1, [Goffice uses Cairo])
Modified: trunk/goffice/goffice-features.h.in
==============================================================================
--- trunk/goffice/goffice-features.h.in (original)
+++ trunk/goffice/goffice-features.h.in Sat Nov 1 16:26:21 2008
@@ -57,7 +57,4 @@
/* Define if GOffice uses Gtk+ */
#undef GOFFICE_WITH_GTK
-/* Define if GOffice uses Gnome */
-#undef GOFFICE_WITH_GNOME
-
#endif /* GOFFICE_FEATURES_H */
Modified: trunk/goffice/gtk/goffice-gtk.c
==============================================================================
--- trunk/goffice/gtk/goffice-gtk.c (original)
+++ trunk/goffice/gtk/goffice-gtk.c Sat Nov 1 16:26:21 2008
@@ -779,9 +779,7 @@
char const *link;
} CBHelpPaths;
-#ifdef GOFFICE_WITH_GNOME
-#include <libgnome/gnome-help.h>
-#elif defined(G_OS_WIN32)
+#ifdef G_OS_WIN32
#include <windows.h>
#include <htmlhelp.h>
#endif
@@ -842,21 +840,10 @@
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);
+ char *uri = g_strconcat ("ghelp:", paths->app, "#", paths->link, NULL);
+ go_url_show (uri);
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 16:26:21 2008
@@ -31,9 +31,7 @@
#include <glib/gi18n-lib.h>
#include <gsf/gsf-input-gio.h>
#include <gsf/gsf-output-gio.h>
-#ifdef GOFFICE_WITH_GNOME
-#include <libgnome/gnome-url.h>
-#elif defined G_OS_WIN32
+#ifdef G_OS_WIN32
#include <urlmon.h>
#include <io.h>
#endif
@@ -922,104 +920,21 @@
return g_string_free (result, FALSE);
}
-#ifndef HAVE_GTK_SHOW_URI
-#ifndef GOFFICE_WITH_GNOME
-#ifndef G_OS_WIN32
-static char *
-check_program (char const *prog)
-{
- if (NULL == prog)
- return NULL;
- if (g_path_is_absolute (prog)) {
- if (!g_file_test (prog, G_FILE_TEST_IS_EXECUTABLE))
- return NULL;
- } else if (!g_find_program_in_path (prog))
- return NULL;
- return g_strdup (prog);
-}
-#endif
-#endif
-#endif
-
GError *
go_url_show (gchar const *url)
{
-#ifdef HAVE_GTK_SHOW_URI
- GError *err = NULL;
- gtk_show_uri (NULL, url, GDK_CURRENT_TIME, &error);
- return error;
-#elif defined(G_OS_WIN32)
+#ifdef G_OS_WIN32
ShellExecute (NULL, "open", url, NULL, NULL, SW_SHOWNORMAL);
return NULL;
#else
GError *err = NULL;
-#ifdef GOFFICE_WITH_GNOME
- gnome_url_show (url, &err);
- return err;
+#ifdef HAVE_GTK_SHOW_URI
+ GError *err = NULL;
+ gtk_show_uri (NULL, url, GDK_CURRENT_TIME, &error);
+ return error;
#else
- guint8 *browser = NULL;
- guint8 *clean_url = NULL;
-
- /* 1) Check BROWSER env var */
- browser = check_program (getenv ("BROWSER"));
-
- if (browser == NULL) {
- static char const * const browsers[] = {
- "sensible-browser", /* debian */
- "epiphany", /* primary gnome */
- "galeon", /* secondary gnome */
- "encompass",
- "firefox",
- "mozilla-firebird",
- "mozilla",
- "netscape",
- "konqueror",
- "xterm -e w3m",
- "xterm -e lynx",
- "xterm -e links"
- };
- unsigned i;
- for (i = 0 ; i < G_N_ELEMENTS (browsers) ; i++)
- if (NULL != (browser = check_program (browsers[i])))
- break;
- }
-
- if (browser != NULL) {
- gint argc;
- gchar **argv = NULL;
- char *cmd_line = g_strconcat (browser, " %1", NULL);
-
- if (g_shell_parse_argv (cmd_line, &argc, &argv, &err)) {
- /* check for '%1' in an argument and substitute the url
- * otherwise append it */
- gint i;
- char *tmp;
-
- for (i = 1 ; i < argc ; i++)
- if (NULL != (tmp = strstr (argv[i], "%1"))) {
- *tmp = '\0';
- tmp = g_strconcat (argv[i],
- (clean_url != NULL) ? (char const *)clean_url : url,
- tmp+2, NULL);
- g_free (argv[i]);
- argv[i] = tmp;
- break;
- }
-
- /* there was actually a %1, drop the one we added */
- if (i != argc-1) {
- g_free (argv[argc-1]);
- argv[argc-1] = NULL;
- }
- g_spawn_async (NULL, argv, NULL, G_SPAWN_SEARCH_PATH,
- NULL, NULL, NULL, &err);
- g_strfreev (argv);
- }
- g_free (cmd_line);
- }
- g_free (browser);
- g_free (clean_url);
+ g_app_info_launch_default_for_uri (url, NULL, &err);
return err;
#endif
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]