[seahorse] Remove GTK+2 dependency and depend on new GCK and GCR



commit 42ff44299ce5131ddf83532fb7ab8522682377c0
Author: Stef Walter <stef memberwebs com>
Date:   Sat Jul 9 09:45:41 2011 +0200

    Remove GTK+2 dependency and depend on new GCK and GCR
    
     * gnome-keyring no longer has support for GTK+2, discussed on
       the mailing list.
     * In order for seahorse to build with gnome-keyring, remove
       GTK+2 support from seahorse too.

 configure.ac                         |   43 ++++++---------------------------
 gkr/seahorse-gkr-dialogs.c           |    8 ------
 libcryptui/Makefile.am               |    4 +-
 libcryptui/cryptui-key-chooser.c     |    7 -----
 libegg/egg-datetime.c                |   21 +---------------
 libseahorse/seahorse-passphrase.c    |    2 -
 libseahorse/seahorse-prefs.c         |    6 ----
 pgp/seahorse-gpgme-generate.c        |    6 ----
 pkcs11/seahorse-pkcs11-certificate.c |    2 +-
 pkcs11/seahorse-pkcs11-helpers.c     |    3 +-
 pkcs11/seahorse-pkcs11-module.c      |    2 +-
 pkcs11/seahorse-pkcs11-object.c      |    2 +-
 pkcs11/seahorse-pkcs11-operations.c  |    2 +-
 reference/libcryptui/Makefile.am     |    4 ---
 reference/libseahorse/Makefile.am    |    4 ---
 src/seahorse-key-manager.c           |    8 ++----
 ssh/seahorse-ssh-generate.c          |   10 +-------
 17 files changed, 21 insertions(+), 113 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index ea0a620..1b6a075 100644
--- a/configure.ac
+++ b/configure.ac
@@ -45,39 +45,13 @@ AC_CHECK_FUNCS(strsep)
 
 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
 
-AC_MSG_CHECKING([which GTK+ version to compile against])
-AC_ARG_WITH([gtk],
-	[AS_HELP_STRING([--with-gtk=2|3],[which GTK+ version to compile against (default: 3)])],
-	[case "$with_gtk" in
-		2*|3*) ;;
-		*) AC_MSG_ERROR([invalid GTK+ version specified]) ;;
-	esac],
-	[with_gtk=3])
-AC_MSG_RESULT([$with_gtk])
-
-case "$with_gtk" in
-	2*)
-		GCR_LIBRARY=gcr-0
-		GTK_API_VERSION=2.0
-		GTK_REQUIRED=2.20.0
-		with_gtk=2.0
-	;;
-	3*)
-		GCR_LIBRARY=gcr-3
-		GTK_API_VERSION=3.0
-		GTK_REQUIRED=2.90.0
-		with_gtk=3.0
-	;;
-esac
-
-AC_SUBST(GTK_API_VERSION)
-AM_CONDITIONAL([WITH_GTK3],[test "$with_gtk" = "3.0"])
+GTK_REQUIRED=2.90.0
 
-PKG_CHECK_MODULES(GTK, gtk+-$GTK_API_VERSION >= $GTK_REQUIRED)
+PKG_CHECK_MODULES(GTK, gtk+-3.0 >= $GTK_REQUIRED)
 AC_SUBST(GTK_CFLAGS)
 AC_SUBST(GTK_LIBS)
 
-PKG_CHECK_MODULES(SEAHORSE, gmodule-2.0 gio-2.0 gconf-2.0 gthread-2.0 gtk+-$GTK_API_VERSION >= $GTK_REQUIRED)
+PKG_CHECK_MODULES(SEAHORSE, gmodule-2.0 gio-2.0 gconf-2.0 gthread-2.0 gtk+-3.0 >= $GTK_REQUIRED)
 
 AC_MSG_CHECKING([for some Win32 platform])
 case "$host" in
@@ -468,11 +442,11 @@ if test "$enable_pkcs11" = "no"; then
 	echo "disabling pkcs11 support"
 	enable_pkcs11="no"
 else
-	PKG_CHECK_MODULES(GCR, $GCR_LIBRARY >= 3.0.0, gcr_is_present="yes", gcr_is_present="no")
+	PKG_CHECK_MODULES(GCR, gcr-3 >= 3.0.0, gcr_is_present="yes", gcr_is_present="no")
 	if test "$gcr_is_present" = "no"; then
 		echo "disabling pkcs11 support"
 	fi
-	PKG_CHECK_MODULES(GCK, gck-0 >= 2.91.2, enable_pkcs11="yes", enable_pkcs11="no")
+	PKG_CHECK_MODULES(GCK, gck-1 >= 3.1.2, enable_pkcs11="yes", enable_pkcs11="no")
 	if test "$enable_pkcs11" = "yes" && test "$gcr_is_present" = "yes"; then
 		AC_DEFINE(WITH_PKCS11, 1, [gck library available])
 		SEAHORSE_CFLAGS="$SEAHORSE_CFLAGS $GCK_CFLAGS $GCR_CFLAGS"
@@ -559,7 +533,7 @@ AC_SUBST(LIBCRYPTUI_LT_RELEASE)
 LIBCRYPTUI_MAJOR=$LIBCRYPTUI_CURRENT.$LIBCRYPTUI_REVISION
 AC_SUBST(LIBCRYPTUI_MAJOR)
 
-PKG_CHECK_MODULES(LIBCRYPTUI, gtk+-$GTK_API_VERSION >= $GTK_REQUIRED gconf-2.0)
+PKG_CHECK_MODULES(LIBCRYPTUI, gtk+-3.0 >= $GTK_REQUIRED gconf-2.0)
 
 cryptuitargetlib=libcryptui.la
 AC_SUBST(cryptuitargetlib)
@@ -609,11 +583,11 @@ AM_GLIB_GNU_GETTEXT
 
 dnl ****************************************************************************
 ## here we get the flags we'll actually use
-PKG_CHECK_MODULES(EGG, gtk+-$GTK_API_VERSION >= $GTK_REQUIRED)
+PKG_CHECK_MODULES(EGG, gtk+-3.0 >= $GTK_REQUIRED)
 AC_SUBST(EGG_LIBS)
 AC_SUBST(EGG_CFLAGS)
 
-PKG_CHECK_MODULES(EGG_SMCLIENT, gtk+-$GTK_API_VERSION)
+PKG_CHECK_MODULES(EGG_SMCLIENT, gtk+-3.0)
 AC_SUBST(EGG_SMCLIENT_LIBS)
 AC_SUBST(EGG_SMCLIENT_CFLAGS)
 
@@ -655,7 +629,6 @@ dnl  SUMMARY
 dnl ****************************************************************************
 
 echo "
-GTK+ Version:               $GTK_API_VERSION
 PKCS11 Support:             $enable_pkcs11
 PGP Support:                $enable_pgp
   GnuPG Version:            $have_gpg
diff --git a/gkr/seahorse-gkr-dialogs.c b/gkr/seahorse-gkr-dialogs.c
index 1fe5a2b..1c3eca3 100644
--- a/gkr/seahorse-gkr-dialogs.c
+++ b/gkr/seahorse-gkr-dialogs.c
@@ -72,11 +72,7 @@ seahorse_gkr_dialog_begin_request (SeahorseWidget *swidget, gpointer request)
 	g_object_set_data_full (G_OBJECT (dialog), "gkr-request", request, 
 				gnome_keyring_cancel_request); 
 
-#if GTK_CHECK_VERSION(2,20,0)
 	if (gtk_widget_get_realized (dialog))
-#else
-	if (GTK_WIDGET_REALIZED (dialog))
-#endif
 		update_wait_cursor (dialog, NULL);
 	else
 		g_signal_connect (dialog, "realize", G_CALLBACK (update_wait_cursor), dialog);
@@ -97,11 +93,7 @@ seahorse_gkr_dialog_complete_request (SeahorseWidget *swidget, gboolean cancel)
 	if (request && cancel)
 		gnome_keyring_cancel_request (request);
 
-#if GTK_CHECK_VERSION(2,20,0)
 	if (gtk_widget_get_realized (dialog))
-#else
-	if (GTK_WIDGET_REALIZED (dialog))
-#endif
 		update_wait_cursor (dialog, NULL);
 	gtk_widget_set_sensitive (dialog, TRUE);
 }
diff --git a/libcryptui/Makefile.am b/libcryptui/Makefile.am
index abbd072..8fca33b 100644
--- a/libcryptui/Makefile.am
+++ b/libcryptui/Makefile.am
@@ -101,9 +101,9 @@ CryptUI- LIBCRYPTUI_MAJOR@.gir: $(INTROSPECTION_SCANNER) libcryptui.la
 	$(QUIET_GEN)$(INTROSPECTION_SCANNER) -v \
 	--namespace CryptUI --nsversion= LIBCRYPTUI_MAJOR@ \
 	$(INCLUDES) \
-	--include=Gtk-$(GTK_API_VERSION) \
+	--include=Gtk-3.0 \
 	--library=libcryptui.la \
-	--pkg gtk+-$(GTK_API_VERSION) \
+	--pkg gtk+-3.0 \
 	--output $@ \
 	$(inc_HEADERS) \
 	$(libcryptui_src)
diff --git a/libcryptui/cryptui-key-chooser.c b/libcryptui/cryptui-key-chooser.c
index 5adda48..d98a51e 100644
--- a/libcryptui/cryptui-key-chooser.c
+++ b/libcryptui/cryptui-key-chooser.c
@@ -169,17 +169,10 @@ construct_recipients (CryptUIKeyChooser *chooser, GtkBox *box)
     hbox = gtk_hbox_new (FALSE, 12);
     
     /* Filter Combo */
-#if GTK_CHECK_VERSION (2,91,2)
     chooser->priv->filtermode = GTK_COMBO_BOX (gtk_combo_box_text_new ());
     gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (chooser->priv->filtermode), _("All Keys"));
     gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (chooser->priv->filtermode), _("Selected Recipients"));
     gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (chooser->priv->filtermode), _("Search Results"));
-#else
-    chooser->priv->filtermode = GTK_COMBO_BOX (gtk_combo_box_new_text ());
-    gtk_combo_box_append_text (chooser->priv->filtermode, _("All Keys"));
-    gtk_combo_box_append_text (chooser->priv->filtermode, _("Selected Recipients"));
-    gtk_combo_box_append_text (chooser->priv->filtermode, _("Search Results"));
-#endif
     gtk_combo_box_set_active (chooser->priv->filtermode, 0);
     g_signal_connect (chooser->priv->filtermode, "changed", 
                         G_CALLBACK (filtermode_changed), chooser);
diff --git a/libegg/egg-datetime.c b/libegg/egg-datetime.c
index 59e88be..6e52f5f 100644
--- a/libegg/egg-datetime.c
+++ b/libegg/egg-datetime.c
@@ -30,9 +30,7 @@
 
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
-#if GTK_CHECK_VERSION (2,90,0)
 #include <gdk/gdkkeysyms-compat.h>
-#endif
 
 #include "egg-datetime.h"
 
@@ -235,11 +233,7 @@ static void  egg_datetime_get_property (GObject    *object,
                    GValue        *value,
                    GParamSpec    *pspec);
 
-#if GTK_CHECK_VERSION (2, 90, 0)
 static void  egg_datetime_destroy      (GtkWidget *widget);
-#else
-static void  egg_datetime_destroy      (GtkObject *widget);
-#endif
 
 static void  egg_datetime_finalize     (GObject    *object);
 
@@ -314,11 +308,7 @@ egg_datetime_class_init (EggDateTimeClass *klass)
         o_class->set_property = egg_datetime_set_property;
         o_class->get_property = egg_datetime_get_property;
 
-#if GTK_CHECK_VERSION (2,90,0)
-        ((GtkWidgetClass*)klass)->destroy     = egg_datetime_destroy;
-#else
-        ((GtkObjectClass*)klass)->destroy     = egg_datetime_destroy;
-#endif
+    ((GtkWidgetClass*)klass)->destroy     = egg_datetime_destroy;
 
 
    /* Properties */
@@ -746,11 +736,7 @@ egg_datetime_get_property (GObject  *object,
 }
 
 static void
-#if GTK_CHECK_VERSION (2, 90, 0)
 egg_datetime_destroy (GtkWidget *widget)
-#else
-egg_datetime_destroy (GtkObject *widget)
-#endif
 {
    EggDateTime *edt = EGG_DATETIME (widget);
    EggDateTimePrivate *priv = edt->priv;
@@ -765,13 +751,8 @@ egg_datetime_destroy (GtkObject *widget)
       priv->time_popup = NULL;
    }
 
-#if GTK_CHECK_VERSION (2, 90, 0)
 	if (GTK_WIDGET_CLASS (parent_class)->destroy)
 		(* GTK_WIDGET_CLASS (parent_class)->destroy) (widget);
-#else
-	if (GTK_OBJECT_CLASS (parent_class)->destroy)
-		(* GTK_OBJECT_CLASS (parent_class)->destroy) (widget);
-#endif
 }
 
 static void
diff --git a/libseahorse/seahorse-passphrase.c b/libseahorse/seahorse-passphrase.c
index 0b621ba..9bbdf1c 100644
--- a/libseahorse/seahorse-passphrase.c
+++ b/libseahorse/seahorse-passphrase.c
@@ -43,9 +43,7 @@
 
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
-#if GTK_CHECK_VERSION (2,90,0)
 #include <gdk/gdkkeysyms-compat.h>
-#endif
 
 #include "seahorse-libdialogs.h"
 #include "seahorse-widget.h"
diff --git a/libseahorse/seahorse-prefs.c b/libseahorse/seahorse-prefs.c
index 44be3fd..af610b4 100644
--- a/libseahorse/seahorse-prefs.c
+++ b/libseahorse/seahorse-prefs.c
@@ -351,15 +351,9 @@ on_prefs_keyserver_add_clicked (GtkButton *button, SeahorseWidget *sw)
 	    descriptions = g_slist_append (descriptions, seahorse_servers_get_description (l->data));
     descriptions = g_slist_append (descriptions, g_strdup (_("Custom")));
 
-#if GTK_CHECK_VERSION (2,91,2)
     gtk_combo_box_text_remove (GTK_COMBO_BOX_TEXT (widget), 0);
     for (l = descriptions; l; l = g_slist_next (l))
         gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), l->data ? l->data : "");
-#else
-    gtk_combo_box_remove_text (GTK_COMBO_BOX (widget), 0);
-    for (l = descriptions; l; l = g_slist_next (l))
-        gtk_combo_box_append_text (GTK_COMBO_BOX (widget), l->data ? l->data : "");
-#endif
     gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0);
     seahorse_util_string_slist_free (descriptions);
 
diff --git a/pgp/seahorse-gpgme-generate.c b/pgp/seahorse-gpgme-generate.c
index 88693b2..b1977cb 100644
--- a/pgp/seahorse-gpgme-generate.c
+++ b/pgp/seahorse-gpgme-generate.c
@@ -436,15 +436,9 @@ seahorse_gpgme_generate_show (SeahorseGpgmeSource *sksrc, GtkWindow *parent, con
     /* The algoritms */
     widget = seahorse_widget_get_widget (swidget, "algorithm-choice");
     g_return_if_fail (widget != NULL);
-#if GTK_CHECK_VERSION (2,91,2)
     gtk_combo_box_text_remove (GTK_COMBO_BOX_TEXT (widget), 0);
     for(i = 0; i < G_N_ELEMENTS(available_algorithms); i++)
         gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), _(available_algorithms[i].desc));
-#else
-    gtk_combo_box_remove_text (GTK_COMBO_BOX (widget), 0);
-    for(i = 0; i < G_N_ELEMENTS(available_algorithms); i++)
-        gtk_combo_box_append_text (GTK_COMBO_BOX (widget), _(available_algorithms[i].desc));
-#endif
     gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0);
     on_gpgme_generate_algorithm_changed (GTK_COMBO_BOX (widget), swidget);
     
diff --git a/pkcs11/seahorse-pkcs11-certificate.c b/pkcs11/seahorse-pkcs11-certificate.c
index d5393fc..b59d411 100644
--- a/pkcs11/seahorse-pkcs11-certificate.c
+++ b/pkcs11/seahorse-pkcs11-certificate.c
@@ -31,7 +31,7 @@
 
 #include <gcr/gcr.h>
 
-#include <pkcs11.h>
+#include <gck/pkcs11.h>
 
 #include <glib/gi18n-lib.h>
 
diff --git a/pkcs11/seahorse-pkcs11-helpers.c b/pkcs11/seahorse-pkcs11-helpers.c
index e3c4b9f..d516e7d 100644
--- a/pkcs11/seahorse-pkcs11-helpers.c
+++ b/pkcs11/seahorse-pkcs11-helpers.c
@@ -24,7 +24,8 @@
 
 #include <stdlib.h>
 #include <string.h>
-#include <pkcs11.h>
+
+#include <gck/pkcs11.h>
 
 static char* 
 seahorse_pkcs11_klass_to_string (gulong klass) 
diff --git a/pkcs11/seahorse-pkcs11-module.c b/pkcs11/seahorse-pkcs11-module.c
index 8862128..105c5f7 100644
--- a/pkcs11/seahorse-pkcs11-module.c
+++ b/pkcs11/seahorse-pkcs11-module.c
@@ -44,7 +44,7 @@ seahorse_pkcs11_module_init (void)
 	module_paths = seahorse_gconf_get_string_list ("/system/pkcs11/modules");
 	for (l = module_paths; l; l = g_slist_next (l)) {
 
-		module = gck_module_initialize (l->data, NULL, 0, &err);
+		module = gck_module_initialize (l->data, &err);
 		if (!module) {
 			g_warning ("couldn't initialize %s pkcs11 module: %s", 
 			           (gchar*)l->data, err ? err->message : NULL);
diff --git a/pkcs11/seahorse-pkcs11-object.c b/pkcs11/seahorse-pkcs11-object.c
index 2b913e1..44a3af5 100644
--- a/pkcs11/seahorse-pkcs11-object.c
+++ b/pkcs11/seahorse-pkcs11-object.c
@@ -28,7 +28,7 @@
 #include "seahorse-pkcs11.h"
 #include "seahorse-util.h"
 
-#include <pkcs11.h>
+#include <gck/pkcs11.h>
 
 #include <glib/gi18n-lib.h>
 
diff --git a/pkcs11/seahorse-pkcs11-operations.c b/pkcs11/seahorse-pkcs11-operations.c
index 1085b09..a1a96ac 100644
--- a/pkcs11/seahorse-pkcs11-operations.c
+++ b/pkcs11/seahorse-pkcs11-operations.c
@@ -27,8 +27,8 @@
 
 #include "common/seahorse-object-list.h"
 
-#include <pkcs11.h>
 #include <gck/gck.h>
+#include <gck/pkcs11.h>
 
 #include <glib/gi18n.h>
 
diff --git a/reference/libcryptui/Makefile.am b/reference/libcryptui/Makefile.am
index 44d2df4..bd300ef 100644
--- a/reference/libcryptui/Makefile.am
+++ b/reference/libcryptui/Makefile.am
@@ -36,10 +36,6 @@ CPPFLAGS += \
 	-UGTK_DISABLE_SINGLE_INCLUDES
 
 GTKDOC_LIBS = $(top_builddir)/libcryptui/$(cryptuitargetlib)
-#	$(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la	\
-#	$(top_builddir)/gdk/$(gdktargetlib)        			\
-#	$(top_builddir)/gtk/$(gtktargetlib)
-
 
 # Extra options to supply to gtkdoc-mkdb
 MKDB_OPTIONS=--sgml-mode --output-format=xml --name-space=cryptui
diff --git a/reference/libseahorse/Makefile.am b/reference/libseahorse/Makefile.am
index 98f7bb2..ef2e31e 100644
--- a/reference/libseahorse/Makefile.am
+++ b/reference/libseahorse/Makefile.am
@@ -36,10 +36,6 @@ CPPFLAGS += \
 	-UGTK_DISABLE_SINGLE_INCLUDES
 
 GTKDOC_LIBS = ../../libseahorse/libseahorse.la
-#	$(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la	\
-#	$(top_builddir)/gdk/$(gdktargetlib)        			\
-#	$(top_builddir)/gtk/$(gtktargetlib)
-
 
 # Extra options to supply to gtkdoc-mkdb
 MKDB_OPTIONS=--sgml-mode --output-format=xml --name-space=seahorse
diff --git a/src/seahorse-key-manager.c b/src/seahorse-key-manager.c
index 029fa05..6a3d357 100644
--- a/src/seahorse-key-manager.c
+++ b/src/seahorse-key-manager.c
@@ -919,11 +919,9 @@ seahorse_key_manager_constructor (GType type, guint n_props, GObjectConstructPar
 				GtkBox* box;
 				GtkToolItem* item;
 
-#if GTK_CHECK_VERSION (3, 0, 0)
-                                gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (toolbar)),
-                                                             GTK_STYLE_CLASS_PRIMARY_TOOLBAR);
-                                gtk_widget_reset_style (GTK_WIDGET (toolbar));
-#endif
+				gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (toolbar)),
+				                             GTK_STYLE_CLASS_PRIMARY_TOOLBAR);
+				gtk_widget_reset_style (GTK_WIDGET (toolbar));
 				
 				/* Insert a separator to right align the filter */
 				sep = GTK_SEPARATOR_TOOL_ITEM (gtk_separator_tool_item_new ());
diff --git a/ssh/seahorse-ssh-generate.c b/ssh/seahorse-ssh-generate.c
index f10da2f..5fce7b7 100644
--- a/ssh/seahorse-ssh-generate.c
+++ b/ssh/seahorse-ssh-generate.c
@@ -124,12 +124,8 @@ on_change (GtkComboBox *combo, SeahorseWidget *swidget)
     
     widget = seahorse_widget_get_widget (swidget, "bits-entry");
     g_return_if_fail (widget != NULL);
-    
-#if GTK_CHECK_VERSION (2,91,2)
+
     t = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (combo));
-#else
-    t = gtk_combo_box_get_active_text (combo);
-#endif
     if (t && strstr (t, "DSA")) {
         gtk_spin_button_set_value (GTK_SPIN_BUTTON (widget), DSA_SIZE);
         gtk_widget_set_sensitive (widget, FALSE);
@@ -173,11 +169,7 @@ on_response (GtkDialog *dialog, guint response, SeahorseWidget *swidget)
     /* The algorithm */
     widget = seahorse_widget_get_widget (swidget, "algorithm-choice");
     g_return_if_fail (widget != NULL);
-#if GTK_CHECK_VERSION (2,91,2)
     t = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (widget));
-#else
-    t = gtk_combo_box_get_active_text (GTK_COMBO_BOX (widget));
-#endif
     if (t && strstr (t, "DSA"))
         type = SSH_ALGO_DSA;
     else



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