# HG changeset patch
# User zas_
# Date 1207655615 0
# Node ID a9adf9e1a746649f0f5d8e47b55c8614f6714a45
# Parent 65187a2309d3ab83a4977b8c41f53ec55a0c4b24
Remove dependency on GTK 2.12, reported by John Vodden and Vladimir
Nadvornik.
gtk_set_tooltip_markup() calls were disabled for GTK+ versions < 2.12.
gdk_color_to_string() was replaced by a equivalent function.
diff -r 65187a2309d3 -r a9adf9e1a746 src/preferences.c
--- a/src/preferences.c Mon Apr 07 19:47:22 2008 +0000
+++ b/src/preferences.c Tue Apr 08 11:53:35 2008 +0000
@@ -1346,6 +1346,8 @@
gtk_widget_show(scrolled);
fullscreen_info_view = gtk_text_view_new();
+
+#if GTK_CHECK_VERSION(2,12,0)
gtk_widget_set_tooltip_markup(fullscreen_info_view,
_("%name% results in the filename of the picture.\n"
"Also available: %collection%, %number%, %total%, %date%,\n"
@@ -1357,7 +1359,7 @@
"if there's no ISO information in the Exif data.\n"
"If a line is empty, it is removed. This allows to add lines that totally disappear when no data is available.\n"
));
-
+#endif
gtk_container_add(GTK_CONTAINER(scrolled), fullscreen_info_view);
gtk_widget_show(fullscreen_info_view);
@@ -1393,8 +1395,9 @@
pref_spacer(hbox, PREF_PAD_INDENT - PREF_PAD_GAP);
spin = pref_spin_new_int(hbox, _("Maximum size:"), _("MB"),
0, 2048, 1, safe_delete_size, &safe_delete_size_c);
+#if GTK_CHECK_VERSION(2,12,0)
gtk_widget_set_tooltip_markup(spin, _("Set to 0 for unlimited size"));
-
+#endif
button = pref_button_new(NULL, NULL, _("View"), FALSE,
G_CALLBACK(safe_delete_view_cb), NULL);
gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
diff -r 65187a2309d3 -r a9adf9e1a746 src/rcfile.c
--- a/src/rcfile.c Mon Apr 07 19:47:22 2008 +0000
+++ b/src/rcfile.c Tue Apr 08 11:53:35 2008 +0000
@@ -121,11 +121,18 @@
return text;
}
+/* Since gdk_color_to_string() is only available since gtk 2.12
+ * here is an equivalent stub function. */
+static gchar *color_to_string(GdkColor *color)
+{
+ return g_strdup_printf("#%04X%04X%04X", color->red, color->green, color->blue);
+}
+
static void write_color_option(FILE *f, gchar *label, GdkColor *color)
{
if (color)
{
- gchar *colorstring = gdk_color_to_string (color);
+ gchar *colorstring = color_to_string(color);
write_char_option(f, label, colorstring);
g_free(colorstring);