From 74dcc3c4dbf1aa167f0e0adaf49ec0471479f4bb Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Tue, 15 Jul 2008 20:01:46 +0200 Subject: [PATCH] Fix file choosers for GTk+ < 2.12 --- katze/katze-utils.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/katze/katze-utils.c b/katze/katze-utils.c index 1353fa1b..8af1bbdd 100644 --- a/katze/katze-utils.c +++ b/katze/katze-utils.c @@ -163,8 +163,14 @@ katze_property_proxy (gpointer object, string = g_strdup (G_PARAM_SPEC_STRING (pspec)->default_value); gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (widget), string ? string : ""); + #if GTK_CHECK_VERSION (2, 12, 0) g_signal_connect (widget, "file-set", G_CALLBACK (proxy_file_file_set_cb), object); + #else + if (pspec->flags & G_PARAM_WRITABLE) + g_signal_connect (widget, "selection-changed", + G_CALLBACK (proxy_file_file_set_cb), object); + #endif } else if (type == G_TYPE_PARAM_STRING && _hint == g_intern_string ("folder")) { @@ -175,8 +181,14 @@ katze_property_proxy (gpointer object, string = g_strdup (G_PARAM_SPEC_STRING (pspec)->default_value); gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (widget), string ? string : ""); + #if GTK_CHECK_VERSION (2, 12, 0) g_signal_connect (widget, "file-set", G_CALLBACK (proxy_folder_file_set_cb), object); + #else + if (pspec->flags & G_PARAM_WRITABLE) + g_signal_connect (widget, "selection-changed", + G_CALLBACK (proxy_folder_file_set_cb), object); + #endif } else if (type == G_TYPE_PARAM_STRING && _hint == g_intern_string ("uri")) { @@ -187,8 +199,14 @@ katze_property_proxy (gpointer object, string = g_strdup (G_PARAM_SPEC_STRING (pspec)->default_value); gtk_file_chooser_set_uri (GTK_FILE_CHOOSER (widget), string ? string : ""); + #if GTK_CHECK_VERSION (2, 12, 0) g_signal_connect (widget, "file-set", G_CALLBACK (proxy_uri_file_set_cb), object); + #else + if (pspec->flags & G_PARAM_WRITABLE) + g_signal_connect (widget, "selection-changed", + G_CALLBACK (proxy_uri_file_set_cb), object); + #endif } else if (type == G_TYPE_PARAM_STRING && _hint == g_intern_string ("font")) {