X-Git-Url: http://geeqie.org/cgi-bin/gitweb.cgi?p=geeqie.git;a=blobdiff_plain;f=src%2Frcfile.c;h=52aa2b9022dce442c3ca1a31b0c6c050b3a8eb42;hp=ed61511c5ff82974b7779350b013dd7e8bc4bada;hb=36d2e8e15cf7e6e230664cea85a6ddf492f766fe;hpb=177dc3a318cdbc7d9daced60e64c6075d834750f diff --git a/src/rcfile.c b/src/rcfile.c index ed61511c..52aa2b90 100644 --- a/src/rcfile.c +++ b/src/rcfile.c @@ -43,6 +43,7 @@ #include "bar.h" #include "metadata.h" #include "bar_gps.h" +#include "dupe.h" /* @@ -157,6 +158,31 @@ gboolean read_int_option(const gchar *option, const gchar *label, const gchar *v return TRUE; } +void write_ushort_option(GString *str, gint indent, const gchar *label, guint16 n) +{ + g_string_append_printf(str, "%s = \"%uh\" ", label, n); +} + +gboolean read_ushort_option(const gchar *option, const gchar *label, const gchar *value, guint16 *n) +{ + if (g_ascii_strcasecmp(option, label) != 0) return FALSE; + if (!n) return FALSE; + + if (g_ascii_isdigit(value[0])) + { + *n = strtoul(value, NULL, 10); + } + else + { + if (g_ascii_strcasecmp(value, "true") == 0) + *n = 1; + else + *n = 0; + } + + return TRUE; +} + void write_uint_option(GString *str, gint indent, const gchar *label, guint n) { g_string_append_printf(str, "%s = \"%u\" ", label, n); @@ -292,6 +318,9 @@ static void write_global_attributes(GString *outstr, gint indent) WRITE_NL(); WRITE_UINT(*options, keyboard_scroll_step); WRITE_NL(); WRITE_UINT(*options, duplicates_similarity_threshold); + WRITE_NL(); WRITE_UINT(*options, duplicates_match); + WRITE_NL(); WRITE_UINT(*options, duplicates_select_type); + WRITE_NL(); WRITE_BOOL(*options, duplicates_thumbnails); WRITE_NL(); WRITE_BOOL(*options, rot_invariant_sim); WRITE_SEPARATOR(); @@ -329,6 +358,7 @@ static void write_global_attributes(GString *outstr, gint indent) WRITE_NL(); WRITE_INT(*options, image.max_window_size); WRITE_NL(); WRITE_BOOL(*options, image.limit_autofit_size); WRITE_NL(); WRITE_INT(*options, image.max_autofit_size); + WRITE_NL(); WRITE_INT(*options, image.max_enlargement_size); WRITE_NL(); WRITE_UINT(*options, image.scroll_reset_method); WRITE_NL(); WRITE_INT(*options, image.tile_cache_max); WRITE_NL(); WRITE_INT(*options, image.image_cache_max); @@ -337,6 +367,8 @@ static void write_global_attributes(GString *outstr, gint indent) WRITE_NL(); WRITE_BOOL(*options, image.use_custom_border_color); WRITE_NL(); WRITE_BOOL(*options, image.use_custom_border_color_in_fullscreen); WRITE_NL(); WRITE_COLOR(*options, image.border_color); + WRITE_NL(); WRITE_COLOR(*options, image.alpha_color_1); + WRITE_NL(); WRITE_COLOR(*options, image.alpha_color_2); WRITE_NL(); WRITE_BOOL(*options, image.use_clutter_renderer); /* Thumbnails Options */ @@ -353,6 +385,7 @@ static void write_global_attributes(GString *outstr, gint indent) WRITE_NL(); WRITE_INT(*options, file_sort.method); WRITE_NL(); WRITE_BOOL(*options, file_sort.ascending); WRITE_NL(); WRITE_BOOL(*options, file_sort.case_sensitive); + WRITE_NL(); WRITE_BOOL(*options, file_sort.natural); /* Fullscreen Options */ WRITE_NL(); WRITE_INT(*options, fullscreen.screen); @@ -412,6 +445,7 @@ static void write_global_attributes(GString *outstr, gint indent) WRITE_NL(); WRITE_BOOL(*options, metadata.save_legacy_format); WRITE_NL(); WRITE_BOOL(*options, metadata.sync_grouped_files); WRITE_NL(); WRITE_BOOL(*options, metadata.confirm_write); + WRITE_NL(); WRITE_BOOL(*options, metadata.sidecar_extended_name); WRITE_NL(); WRITE_INT(*options, metadata.confirm_timeout); WRITE_NL(); WRITE_BOOL(*options, metadata.confirm_after_timeout); WRITE_NL(); WRITE_BOOL(*options, metadata.confirm_on_image_change); @@ -568,6 +602,9 @@ static gboolean load_global_params(const gchar **attribute_names, const gchar ** if (READ_BOOL(*options, update_on_time_change)) continue; if (READ_UINT_CLAMP(*options, duplicates_similarity_threshold, 0, 100)) continue; + if (READ_UINT_CLAMP(*options, duplicates_match, 0, DUPE_MATCH_NAME_CI)) continue; + if (READ_UINT_CLAMP(*options, duplicates_select_type, 0, DUPE_SELECT_GROUP2)) continue; + if (READ_BOOL(*options, duplicates_thumbnails)) continue; if (READ_BOOL(*options, rot_invariant_sim)) continue; if (READ_BOOL(*options, progressive_key_scrolling)) continue; @@ -596,6 +633,7 @@ static gboolean load_global_params(const gchar **attribute_names, const gchar ** if (READ_INT(*options, image.max_window_size)) continue; if (READ_BOOL(*options, image.limit_autofit_size)) continue; if (READ_INT(*options, image.max_autofit_size)) continue; + if (READ_INT(*options, image.max_enlargement_size)) continue; if (READ_UINT_CLAMP(*options, image.scroll_reset_method, 0, PR_SCROLL_RESET_COUNT - 1)) continue; if (READ_INT(*options, image.tile_cache_max)) continue; if (READ_INT(*options, image.image_cache_max)) continue; @@ -606,6 +644,8 @@ static gboolean load_global_params(const gchar **attribute_names, const gchar ** if (READ_BOOL(*options, image.use_custom_border_color)) continue; if (READ_BOOL(*options, image.use_custom_border_color_in_fullscreen)) continue; if (READ_COLOR(*options, image.border_color)) continue; + if (READ_COLOR(*options, image.alpha_color_1)) continue; + if (READ_COLOR(*options, image.alpha_color_2)) continue; if (READ_BOOL(*options, image.use_clutter_renderer)) continue; /* Thumbnails options */ @@ -623,6 +663,7 @@ static gboolean load_global_params(const gchar **attribute_names, const gchar ** if (READ_UINT(*options, file_sort.method)) continue; if (READ_BOOL(*options, file_sort.ascending)) continue; if (READ_BOOL(*options, file_sort.case_sensitive)) continue; + if (READ_BOOL(*options, file_sort.natural)) continue; /* File operations *options */ if (READ_BOOL(*options, file_ops.enable_in_place_rename)) continue; @@ -642,14 +683,14 @@ static gboolean load_global_params(const gchar **attribute_names, const gchar ** if (READ_CHAR(*options, image_overlay.template_string)) continue; if (READ_INT(*options, image_overlay.x)) continue; if (READ_INT(*options, image_overlay.y)) continue; - if (READ_INT(*options, image_overlay.text_red)) continue; - if (READ_INT(*options, image_overlay.text_green)) continue; - if (READ_INT(*options, image_overlay.text_blue)) continue; - if (READ_INT(*options, image_overlay.text_alpha)) continue; - if (READ_INT(*options, image_overlay.background_red)) continue; - if (READ_INT(*options, image_overlay.background_green)) continue; - if (READ_INT(*options, image_overlay.background_blue)) continue; - if (READ_INT(*options, image_overlay.background_alpha)) continue; + if (READ_USHORT(*options, image_overlay.text_red)) continue; + if (READ_USHORT(*options, image_overlay.text_green)) continue; + if (READ_USHORT(*options, image_overlay.text_blue)) continue; + if (READ_USHORT(*options, image_overlay.text_alpha)) continue; + if (READ_USHORT(*options, image_overlay.background_red)) continue; + if (READ_USHORT(*options, image_overlay.background_green)) continue; + if (READ_USHORT(*options, image_overlay.background_blue)) continue; + if (READ_USHORT(*options, image_overlay.background_alpha)) continue; if (READ_CHAR(*options, image_overlay.font)) continue; /* Slideshow options */ @@ -686,6 +727,7 @@ static gboolean load_global_params(const gchar **attribute_names, const gchar ** if (READ_BOOL(*options, metadata.save_legacy_format)) continue; if (READ_BOOL(*options, metadata.sync_grouped_files)) continue; if (READ_BOOL(*options, metadata.confirm_write)) continue; + if (READ_BOOL(*options, metadata.sidecar_extended_name)) continue; if (READ_BOOL(*options, metadata.confirm_after_timeout)) continue; if (READ_INT(*options, metadata.confirm_timeout)) continue; if (READ_BOOL(*options, metadata.confirm_on_image_change)) continue; @@ -906,6 +948,22 @@ static void options_parse_pane_exif(GQParserData *parser_data, GMarkupParseConte } } +static void options_parse_pane_keywords(GQParserData *parser_data, GMarkupParseContext *context, const gchar *element_name, const gchar **attribute_names, const gchar **attribute_values, gpointer data, GError **error) +{ + GtkWidget *pane = data; + + if (g_ascii_strcasecmp(element_name, "expanded") == 0) + { + bar_pane_keywords_entry_add_from_config(pane, attribute_names, attribute_values); + options_parse_func_push(parser_data, options_parse_leaf, NULL, NULL); + } + else + { + log_printf("unexpected in : <%s>\n", element_name); + options_parse_func_push(parser_data, options_parse_leaf, NULL, NULL); + } +} + static void options_parse_bar(GQParserData *parser_data, GMarkupParseContext *context, const gchar *element_name, const gchar **attribute_names, const gchar **attribute_values, gpointer data, GError **error) { GtkWidget *bar = data; @@ -981,7 +1039,7 @@ static void options_parse_bar(GQParserData *parser_data, GMarkupParseContext *co pane = bar_pane_keywords_new_from_config(attribute_names, attribute_values); bar_add(bar, pane); } - options_parse_func_push(parser_data, options_parse_leaf, NULL, NULL); + options_parse_func_push(parser_data, options_parse_pane_keywords, NULL, pane); } else if (g_ascii_strcasecmp(element_name, "clear") == 0) { @@ -1021,12 +1079,17 @@ static void options_parse_layout(GQParserData *parser_data, GMarkupParseContext options_parse_func_push(parser_data, options_parse_bar, NULL, lw->bar); } +#if 0 +/* FIXME: The sort manager and desktop files are set up in the idle loop. + * Setup is not yet completed when the layout is first displayed. + */ else if (g_ascii_strcasecmp(element_name, "bar_sort") == 0) { GtkWidget *bar = bar_sort_new_from_config(lw, attribute_names, attribute_values); layout_bar_sort_set(lw, bar); options_parse_func_push(parser_data, options_parse_leaf, NULL, NULL); } +#endif else if (g_ascii_strcasecmp(element_name, "toolbar") == 0) { options_parse_func_push(parser_data, options_parse_toolbar_and_statusbar, NULL, NULL);