ekiga r7334 - in trunk: . lib/gui lib/toolbox src/gui



Author: sfre
Date: Wed Nov 12 10:43:16 2008
New Revision: 7334
URL: http://svn.gnome.org/viewvc/ekiga?rev=7334&view=rev

Log:
Get rid of libgnome when compiled against gtk+ >= 2.13

libgnome was used for help display (now superseeded by gtk_show_uri) and
for the GtkFileChooser backend through gnomevfs (now superseeded by GIO
at the Glib level). So it is safe to drop libgnome once and for all.

Modified:
   trunk/ChangeLog
   trunk/configure.ac
   trunk/lib/gui/gmdialog.c
   trunk/lib/toolbox/toolbox-gtk.c
   trunk/src/gui/callbacks.cpp

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	(original)
+++ trunk/configure.ac	Wed Nov 12 10:43:16 2008
@@ -214,12 +214,14 @@
 if test "x${gm_platform}" != "xmingw" ; then
   AC_ARG_ENABLE(gnome, [  --disable-gnome		Disable GNOME support],,enable_gnome=yes)
   
-  if test "x$enable_gnome" = "xyes"; then
-    PKG_CHECK_MODULES([GNOME], [libgnome-2.0 >= 2.14.0 libgnomeui-2.0 >= 2.14.0], [found_gnome=yes])
-    AC_SUBST(GNOME_CFLAGS)
-    AC_SUBST(GNOME_LIBS)
-    GNOME="enabled"
-    AC_DEFINE(HAVE_GNOME,1,[GNOME support])
+  if $PKG_CONFIG --max-version 2.13.1 gtk+-2.0; then
+    if test "x$enable_gnome" = "xyes"; then
+      PKG_CHECK_MODULES([GNOME], [libgnome-2.0 >= 2.14.0 libgnomeui-2.0 >= 2.14.0], [found_gnome=yes])
+      AC_SUBST(GNOME_CFLAGS)
+      AC_SUBST(GNOME_LIBS)
+      GNOME="enabled"
+      AC_DEFINE(HAVE_GNOME,1,[GNOME support])
+    fi
   fi
 fi
 AM_CONDITIONAL(HAVE_GNOME, test "x$found_gnome" = "xyes")

Modified: trunk/lib/gui/gmdialog.c
==============================================================================
--- trunk/lib/gui/gmdialog.c	(original)
+++ trunk/lib/gui/gmdialog.c	Wed Nov 12 10:43:16 2008
@@ -55,10 +55,6 @@
 #define vsnprintf _vsnprintf
 #endif
 
-#ifdef HAVE_GNOME
-#include <gnome.h>
-#endif
-
 #include "config.h"
 
 

Modified: trunk/lib/toolbox/toolbox-gtk.c
==============================================================================
--- trunk/lib/toolbox/toolbox-gtk.c	(original)
+++ trunk/lib/toolbox/toolbox-gtk.c	Wed Nov 12 10:43:16 2008
@@ -36,11 +36,21 @@
 
 #include "toolbox.h"
 #include "toolbox-internal.h"
+#include <gtk/gtk.h>
 
 void
 gm_open_uri (const gchar *uri)
 {
+  GError *error = NULL;
+
   g_return_if_fail (uri != NULL);
 
+#if GTK_CHECK_VERSION(2,13,1)
+  if (!gtk_show_uri (NULL, uri, GDK_CURRENT_TIME, &error)) {
+    g_error_free (error);
+    gm_open_uri_fallback (uri);
+  }
+#else
   gm_open_uri_fallback (uri);
+#endif
 }

Modified: trunk/src/gui/callbacks.cpp
==============================================================================
--- trunk/src/gui/callbacks.cpp	(original)
+++ trunk/src/gui/callbacks.cpp	Wed Nov 12 10:43:16 2008
@@ -59,10 +59,7 @@
 #endif
 
 #ifdef HAVE_GNOME
-#undef _
-#undef N_
 #include <gnome.h>
-#include <libbonobo.h>
 #endif
 
 
@@ -130,6 +127,7 @@
       N_("Contributors:"),
       "Howard Chu <hyc symas com>",
       "Yannick Defais <sevmek free fr>",
+      "Steve Fr\303\251cinaux <code istique net>",
       "Kilian Krause <kk verfaction de>", 
       "Vincent Luba <luba novacom be>",
       "Julien Puydt <julien puydt laposte net>",
@@ -217,10 +215,6 @@
 help_cb (G_GNUC_UNUSED GtkWidget *widget,
 	 G_GNUC_UNUSED gpointer data)
 {
-#ifdef HAVE_GNOME
-  GError *err = NULL;
-  gnome_help_display (PACKAGE_NAME ".xml", NULL, &err);
-#else
 #ifdef WIN32
   gchar *locale, *loc_ , *index_path;
   int hinst = 0;
@@ -256,7 +250,33 @@
 			DATA_DIR, SW_SHOWNORMAL);
     g_free (index_path);
   }
+#else /* !WIN32 */
+  GError *err = NULL;
+  gboolean success = FALSE;
+
+#ifdef HAVE_GNOME
+  success = gnome_help_display (PACKAGE_NAME ".xml", NULL, &err);
+#elif GTK_CHECK_VERSION(2, 13, 1)
+  success = gtk_show_uri (NULL, "ghelp:" PACKAGE_NAME, GDK_CURRENT_TIME, &err);
+#else
+  success = FALSE;
+  err = g_error_new_literal (g_quark_from_static_string ("ekiga"),
+                             0,
+			     _("Help display is not supported by your GTK+ version"));
 #endif
+
+  if (!success) {
+    GtkWidget *d;
+    d = gtk_message_dialog_new (GTK_WINDOW (GnomeMeeting::Process ()->GetMainWindow ()), 
+                                (GtkDialogFlags) (GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT),
+                                GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, 
+                                "%s", _("Unable to open help file."));
+    gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (d),
+                                              "%s", err->message);
+    g_signal_connect (d, "response", G_CALLBACK (gtk_widget_destroy), NULL);
+    gtk_window_present (GTK_WINDOW (d));
+    g_error_free (err);
+  }
 #endif
 }
 



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