[file-roller] Replace gtk_widget_get_action with gtk_activatable_get_related_action



commit f85020309c3c51f2b0d5c7b3608eed5d7048cff5
Author: Thomas Hindoe Paaboel Andersen <phomes gmail com>
Date:   Thu Apr 23 23:06:27 2009 +0200

    Replace gtk_widget_get_action with gtk_activatable_get_related_action
    
    Gtk dep is bumped to 2.16 for gtk_activatable_get_related_action.
    configure.ac: Simplified to drop the gtk 2.12 compatibility as per comment in the bug.
    stc/gtk-utils.c: Removed checks for gtk < 2.13 due to new dep on 2.16.
    
    Gnome Bug #578467
---
 configure.ac    |   14 ++------------
 src/fr-window.c |    4 ++--
 src/gtk-utils.c |    9 ---------
 3 files changed, 4 insertions(+), 23 deletions(-)

diff --git a/configure.ac b/configure.ac
index d9951df..21e2b5a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,18 +26,17 @@ dnl ==========================================================================
 
 GLIB_REQUIRED=2.16.0
 GIO_REQUIRED=2.16.0
-GTK_2_12_REQUIRED=2.12.0
-GTK_2_13_REQUIRED=2.13.0
+GTK_REQUIRED=2.16.0
 GCONF_REQUIRED=2.6.0
 NAUTILUS_REQUIRED=2.22.2
 
 AC_SUBST(GLIB_REQUIRED)
 AC_SUBST(GIO_REQUIRED)
+AC_SUBST(GTK_REQUIRED)
 AC_SUBST(NAUTILUS_REQUIRED)
 
 dnl ===========================================================================
 
-PKG_CHECK_MODULES(GTK, [gtk+-2.0 >= $GTK_2_12_REQUIRED])
 AC_SUBST([GTK_CFLAGS])
 AC_SUBST([GTK_LIBS])
 
@@ -55,14 +54,6 @@ AM_CONDITIONAL(RUN_IN_PLACE, test "x$enable_run_in_place" != xno)
 
 dnl ===========================================================================
 
-if pkg-config --atleast-version=$GTK_2_13_REQUIRED gtk+-2.0; then
-	GTK_REQUIRED=$GTK_2_13_REQUIRED
-	AC_DEFINE(GTK_2_13, "1", [Use the Gtk+ 2.13 series])
-else
-	GTK_REQUIRED=$GTK_2_12_REQUIRED
-fi
-AC_SUBST(GTK_REQUIRED)
-
 PKG_CHECK_MODULES(FR,					\
 	glib-2.0 >= $GLIB_REQUIRED			\
 	gthread-2.0					\
@@ -171,6 +162,5 @@ Configuration:
 	Compiler:               ${CC}
 	Internal mkdtemp:       ${mkdtemp_missing}
 	Nautilus support:       ${build_nautilus_actions}
-	Gtk+ series:            ${GTK_REQUIRED}
 	Run in place            ${enable_run_in_place}
 "
diff --git a/src/fr-window.c b/src/fr-window.c
index 3e21aee..1f4e7a3 100644
--- a/src/fr-window.c
+++ b/src/fr-window.c
@@ -5070,7 +5070,7 @@ menu_item_select_cb (GtkMenuItem *proxy,
 	GtkAction *action;
 	char      *message;
 
-	action = gtk_widget_get_action (GTK_WIDGET (proxy));
+	action = gtk_activatable_get_related_action (GTK_ACTIVATABLE (proxy));
 	g_return_if_fail (action != NULL);
 
 	g_object_get (G_OBJECT (action), "tooltip", &message, NULL);
@@ -5823,7 +5823,7 @@ fr_window_construct (FrWindow *window)
 			  "activate",
 			  G_CALLBACK (activate_action_open),
 			  window);
-	gtk_action_connect_proxy (window->priv->open_action, GTK_WIDGET (open_recent_tool_item));
+	gtk_activatable_set_related_action (GTK_ACTIVATABLE (open_recent_tool_item), window->priv->open_action);
 
 	gtk_widget_show (GTK_WIDGET (open_recent_tool_item));
 	gtk_toolbar_insert (GTK_TOOLBAR (toolbar), open_recent_tool_item, 1);
diff --git a/src/gtk-utils.c b/src/gtk-utils.c
index 2557567..8371fe3 100644
--- a/src/gtk-utils.c
+++ b/src/gtk-utils.c
@@ -753,16 +753,7 @@ show_uri (GdkScreen   *screen,
 {
 	gboolean result;
 
-#ifndef GTK_2_13
-	GAppLaunchContext *app_context;
-
-	app_context = g_app_launch_context_new ();
-	result = g_app_info_launch_default_for_uri (uri, G_APP_LAUNCH_CONTEXT (app_context), error);
-
-	g_object_unref (app_context);
-#else
 	result = gtk_show_uri (screen, uri, timestamp, error);
-#endif
 
 	return result;
 }



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