#include "bar.h"
#include "metadata.h"
#include "bar_gps.h"
-
+#include "dupe.h"
+#include "ui_utildlg.h"
/*
*-----------------------------------------------------------------------------
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);
/*
*-----------------------------------------------------------------------------
- * write fuctions for elements (private)
+ * write functions for elements (private)
*-----------------------------------------------------------------------------
*/
{
/* General Options */
WRITE_NL(); WRITE_BOOL(*options, show_icon_names);
+ WRITE_NL(); WRITE_BOOL(*options, show_star_rating);
+ WRITE_NL(); WRITE_BOOL(*options, show_predefined_keyword_tree);
WRITE_SEPARATOR();
WRITE_NL(); WRITE_BOOL(*options, tree_descend_subdirs);
WRITE_NL(); WRITE_BOOL(*options, view_dir_list_single_click_enter);
+ WRITE_NL(); WRITE_BOOL(*options, circular_selection_lists);
WRITE_NL(); WRITE_BOOL(*options, lazy_image_sync);
WRITE_NL(); WRITE_BOOL(*options, update_on_time_change);
WRITE_SEPARATOR();
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_NL(); WRITE_BOOL(*options, sort_totals);
WRITE_SEPARATOR();
WRITE_NL(); WRITE_BOOL(*options, mousewheel_scrolls);
WRITE_NL(); WRITE_BOOL(*options, image_lm_click_nav);
+ WRITE_NL(); WRITE_BOOL(*options, image_l_click_archive);
+ WRITE_NL(); WRITE_BOOL(*options, image_l_click_video);
+ WRITE_NL(); WRITE_CHAR(*options, image_l_click_video_editor);
WRITE_NL(); WRITE_INT(*options, open_recent_list_maxsize);
WRITE_NL(); WRITE_INT(*options, dnd_icon_size);
+ WRITE_NL(); WRITE_UINT(*options, dnd_default_action);
WRITE_NL(); WRITE_BOOL(*options, place_dialogs_under_mouse);
+ WRITE_NL(); WRITE_INT(*options, clipboard_selection);
WRITE_NL(); WRITE_BOOL(*options, save_window_positions);
WRITE_NL(); WRITE_BOOL(*options, use_saved_window_positions_for_new_windows);
+ WRITE_NL(); WRITE_BOOL(*options, save_window_workspace);
WRITE_NL(); WRITE_BOOL(*options, tools_restore_state);
+ WRITE_NL(); WRITE_BOOL(*options, save_dialog_window_positions);
+ WRITE_NL(); WRITE_BOOL(*options, show_window_ids);
+ WRITE_NL(); WRITE_BOOL(*options, expand_menu_toolbar);
+
+ WRITE_NL(); WRITE_UINT(*options, log_window_lines);
+ WRITE_NL(); WRITE_BOOL(*options, log_window.timer_data);
+
+ WRITE_NL(); WRITE_BOOL(*options, marks_save);
+ WRITE_NL(); WRITE_CHAR(*options, help_search_engine);
+
+ WRITE_NL(); WRITE_BOOL(*options, external_preview.enable);
+ WRITE_NL(); WRITE_CHAR(*options, external_preview.select);
+ WRITE_NL(); WRITE_CHAR(*options, external_preview.extract);
+
+ WRITE_NL(); WRITE_BOOL(*options, with_rename);
+ WRITE_NL(); WRITE_BOOL(*options, collections_on_top);
+ WRITE_NL(); WRITE_BOOL(*options, hide_window_in_fullscreen);
/* File operations Options */
WRITE_NL(); WRITE_BOOL(*options, file_ops.enable_in_place_rename);
WRITE_NL(); WRITE_BOOL(*options, file_ops.confirm_delete);
+ WRITE_NL(); WRITE_BOOL(*options, file_ops.confirm_move_to_trash);
WRITE_NL(); WRITE_BOOL(*options, file_ops.enable_delete_key);
+ WRITE_NL(); WRITE_BOOL(*options, file_ops.use_system_trash);
WRITE_NL(); WRITE_BOOL(*options, file_ops.safe_delete_enable);
WRITE_NL(); WRITE_CHAR(*options, file_ops.safe_delete_path);
WRITE_NL(); WRITE_INT(*options, file_ops.safe_delete_folder_maxsize);
+ WRITE_NL(); WRITE_BOOL(*options, file_ops.no_trash);
/* Properties dialog Options */
WRITE_NL(); WRITE_CHAR(*options, properties.tabs_order);
WRITE_NL(); WRITE_BOOL(*options, image.zoom_to_fit_allow_expand);
WRITE_NL(); WRITE_UINT(*options, image.zoom_quality);
WRITE_NL(); WRITE_INT(*options, image.zoom_increment);
+ WRITE_NL(); WRITE_UINT(*options, image.zoom_style);
WRITE_NL(); WRITE_BOOL(*options, image.fit_window_to_image);
WRITE_NL(); WRITE_BOOL(*options, image.limit_window_size);
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);
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);
+ WRITE_NL(); WRITE_INT(*options, image.tile_size);
/* Thumbnails Options */
WRITE_NL(); WRITE_INT(*options, thumbnails.max_width);
WRITE_NL(); WRITE_BOOL(*options, thumbnails.spec_standard);
WRITE_NL(); WRITE_UINT(*options, thumbnails.quality);
WRITE_NL(); WRITE_BOOL(*options, thumbnails.use_exif);
+ WRITE_NL(); WRITE_BOOL(*options, thumbnails.use_color_management);
+ WRITE_NL(); WRITE_BOOL(*options, thumbnails.use_ft_metadata);
+ WRITE_NL(); WRITE_INT(*options, thumbnails.collection_preview);
+// WRITE_NL(); WRITE_BOOL(*options, thumbnails.use_ft_metadata_small);
/* File sorting Options */
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);
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);
WRITE_NL(); WRITE_BOOL(*options, metadata.confirm_on_dir_change);
WRITE_NL(); WRITE_BOOL(*options, metadata.keywords_case_sensitive);
WRITE_NL(); WRITE_BOOL(*options, metadata.write_orientation);
+ WRITE_NL(); WRITE_BOOL(*options, metadata.check_spelling);
WRITE_NL(); WRITE_INT(*options, stereo.mode);
WRITE_NL(); WRITE_INT(*options, stereo.fsmode);
WRITE_NL(); WRITE_INT(*options, stereo.fixed_y1);
WRITE_NL(); WRITE_INT(*options, stereo.fixed_x2);
WRITE_NL(); WRITE_INT(*options, stereo.fixed_y2);
+
+ WRITE_NL(); WRITE_BOOL(*options, read_metadata_in_idle);
+
+ WRITE_NL(); WRITE_UINT(*options, star_rating.star);
+ WRITE_NL(); WRITE_UINT(*options, star_rating.rejected);
+
+ /* copy move rename */
+ WRITE_NL(); WRITE_INT(*options, cp_mv_rn.auto_start);
+ WRITE_NL(); WRITE_INT(*options, cp_mv_rn.auto_padding);
+ WRITE_NL(); WRITE_CHAR(*options, cp_mv_rn.auto_end);
+ WRITE_NL(); WRITE_INT(*options, cp_mv_rn.formatted_start);
+
+ WRITE_SEPARATOR();
+
+ /* Print Text */
+ WRITE_NL(); WRITE_CHAR(*options, printer.template_string);
+ WRITE_NL(); WRITE_CHAR(*options, printer.image_font);
+ WRITE_NL(); WRITE_CHAR(*options, printer.page_font);
+ WRITE_NL(); WRITE_CHAR(*options, printer.page_text);
+ WRITE_NL(); WRITE_INT(*options, printer.image_text_position);
+ WRITE_NL(); WRITE_INT(*options, printer.page_text_position);
+ WRITE_NL(); WRITE_BOOL(*options, printer.show_image_text);
+ WRITE_NL(); WRITE_BOOL(*options, printer.show_page_text);
+ WRITE_SEPARATOR();
+
+ /* Threads */
+ WRITE_NL(); WRITE_INT(*options, threads.duplicates);
+ WRITE_SEPARATOR();
+
+ /* user-definable mouse buttons */
+ WRITE_NL(); WRITE_CHAR(*options, mouse_button_8);
+ WRITE_NL(); WRITE_CHAR(*options, mouse_button_9);
+ WRITE_SEPARATOR();
+
+ /* GPU - see main.c */
+ WRITE_NL(); WRITE_BOOL(*options, override_disable_gpu);
+ WRITE_SEPARATOR();
}
static void write_color_profile(GString *outstr, gint indent)
WRITE_BOOL(options->color_profile, use_image);
WRITE_INT(options->color_profile, input_type);
WRITE_BOOL(options->color_profile, use_x11_screen_profile);
+ WRITE_INT(options->color_profile, render_intent);
WRITE_STRING(">");
indent++;
WRITE_NL(); WRITE_STRING("</color_profiles>");
}
+static void write_marks_tooltips(GString *outstr, gint indent)
+{
+ gint i;
+
+ WRITE_NL(); WRITE_STRING("<marks_tooltips>");
+ indent++;
+ for (i = 0; i < FILEDATA_MARKS_SIZE; i++)
+ {
+ WRITE_NL();
+ write_char_option(outstr, indent, "<tooltip text", options->marks_tooltips[i]);
+ WRITE_STRING("/>");
+ }
+ indent--;
+ WRITE_NL(); WRITE_STRING("</marks_tooltips>");
+}
+
+static void write_class_filter(GString *outstr, gint indent)
+{
+ gint i;
+
+ WRITE_NL(); WRITE_STRING("<class_filter>");
+ indent++;
+ for (i = 0; i < FILE_FORMAT_CLASSES; i++)
+ {
+ WRITE_NL(); WRITE_STRING("<filter_type ");
+ write_char_option(outstr, indent, "filter", format_class_list[i]);
+ write_bool_option(outstr, indent, "enabled", options->class_filter[i]);
+ WRITE_STRING("/>");
+ }
+ indent--;
+ WRITE_NL(); WRITE_STRING("</class_filter>");
+}
+
+static void write_disabled_plugins(GString *outstr, gint indent)
+{
+ GtkTreeIter iter;
+ gboolean valid;
+ gboolean disabled;
+ gchar *desktop_path;
+
+ WRITE_NL(); WRITE_STRING("<disabled_plugins>");
+ indent++;
+
+ if (desktop_file_list)
+ {
+ valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(desktop_file_list), &iter);
+ while (valid)
+ {
+ gtk_tree_model_get(GTK_TREE_MODEL(desktop_file_list), &iter, DESKTOP_FILE_COLUMN_DISABLED, &disabled, -1);
+ gtk_tree_model_get(GTK_TREE_MODEL(desktop_file_list), &iter, DESKTOP_FILE_COLUMN_PATH, &desktop_path, -1);
+
+ if (disabled)
+ {
+ WRITE_NL();
+ write_char_option(outstr, indent, "<plugin path", desktop_path);
+ WRITE_STRING("/>");
+ }
+ g_free(desktop_path);
+ valid = gtk_tree_model_iter_next(GTK_TREE_MODEL(desktop_file_list), &iter);
+ }
+ }
+
+ indent--;
+ WRITE_NL(); WRITE_STRING("</disabled_plugins>");
+}
/*
*-----------------------------------------------------------------------------
*-----------------------------------------------------------------------------
*/
-gboolean save_config_to_file(const gchar *utf8_path, ConfOptions *options)
+gboolean save_config_to_file(const gchar *utf8_path, ConfOptions *options, LayoutWindow *lw)
{
SecureSaveInfo *ssi;
gchar *rc_pathl;
WRITE_STRING("<gq>\n");
indent++;
- WRITE_NL(); WRITE_STRING("<global\n");
- indent++;
- write_global_attributes(outstr, indent + 1);
- indent--;
- WRITE_STRING(">\n");
+ if (!lw)
+ {
+ WRITE_NL(); WRITE_STRING("<global\n");
+ indent++;
+ write_global_attributes(outstr, indent + 1);
+ indent--;
+ WRITE_STRING(">\n");
- indent++;
+ indent++;
- write_color_profile(outstr, indent);
+ write_color_profile(outstr, indent);
- WRITE_SEPARATOR();
- filter_write_list(outstr, indent);
+ WRITE_SEPARATOR();
+ filter_write_list(outstr, indent);
- WRITE_SEPARATOR();
- keyword_tree_write_config(outstr, indent);
- indent--;
- WRITE_NL(); WRITE_STRING("</global>\n");
+ WRITE_SEPARATOR();
+ write_marks_tooltips(outstr, indent);
+ WRITE_SEPARATOR();
+ write_disabled_plugins(outstr, indent);
+
+ WRITE_SEPARATOR();
+ write_class_filter(outstr, indent);
+
+ WRITE_SEPARATOR();
+ keyword_tree_write_config(outstr, indent);
+ indent--;
+ WRITE_NL(); WRITE_STRING("</global>\n");
+ }
WRITE_SEPARATOR();
/* Layout Options */
- work = layout_window_list;
- while (work)
+ if (!lw)
+ {
+ /* If not save_window_positions, do not include a <layout> section */
+ if (options->save_window_positions)
+ {
+ work = layout_window_list;
+ while (work)
+ {
+ LayoutWindow *lw = work->data;
+ layout_write_config(lw, outstr, indent);
+ work = work->next;
+ }
+ }
+ }
+ else
{
- LayoutWindow *lw = work->data;
layout_write_config(lw, outstr, indent);
- work = work->next;
}
indent--;
return TRUE;
}
+gboolean save_default_layout_options_to_file(const gchar *utf8_path, ConfOptions *options, LayoutWindow *lw)
+{
+ SecureSaveInfo *ssi;
+ gchar *rc_pathl;
+ GString *outstr;
+ gint indent = 0;
+
+ rc_pathl = path_from_utf8(utf8_path);
+ ssi = secure_open(rc_pathl);
+ g_free(rc_pathl);
+ if (!ssi)
+ {
+ log_printf(_("error saving default layout file: %s\n"), utf8_path);
+ return FALSE;
+ }
+
+ outstr = g_string_new("");
+ g_string_append_printf(outstr, "<!--\n");
+ g_string_append_printf(outstr, "######################################################################\n");
+ g_string_append_printf(outstr, "# %8s default layout file version %-10s #\n", GQ_APPNAME, VERSION);
+ g_string_append_printf(outstr, "######################################################################\n");
+ WRITE_SEPARATOR();
+
+ WRITE_STRING("# Note: This file is autogenerated. Options can be changed here,\n");
+ WRITE_STRING("# but user comments and formatting will be lost.\n");
+ WRITE_SEPARATOR();
+ WRITE_STRING("-->\n");
+ WRITE_SEPARATOR();
+
+ WRITE_STRING("<gq>\n");
+ indent++;
+
+ layout_write_config(lw, outstr, indent);
+
+ indent--;
+ WRITE_NL(); WRITE_STRING("</gq>\n");
+ WRITE_SEPARATOR();
+
+ secure_fputs(ssi, outstr->str);
+ g_string_free(outstr, TRUE);
+
+ if (secure_close(ssi))
+ {
+ log_printf(_("error saving config file: %s\nerror: %s\n"), utf8_path,
+ secsave_strerror(secsave_errno));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
/*
*-----------------------------------------------------------------------------
* loading attributes for elements (private)
/* General options */
if (READ_BOOL(*options, show_icon_names)) continue;
+ if (READ_BOOL(*options, show_star_rating)) continue;
+ if (READ_BOOL(*options, show_predefined_keyword_tree)) continue;
if (READ_BOOL(*options, tree_descend_subdirs)) continue;
if (READ_BOOL(*options, view_dir_list_single_click_enter)) continue;
+ if (READ_BOOL(*options, circular_selection_lists)) continue;
if (READ_BOOL(*options, lazy_image_sync)) continue;
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_ALL)) 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, sort_totals)) continue;
if (READ_BOOL(*options, progressive_key_scrolling)) continue;
if (READ_UINT_CLAMP(*options, keyboard_scroll_step, 1, 32)) continue;
if (READ_BOOL(*options, mousewheel_scrolls)) continue;
if (READ_BOOL(*options, image_lm_click_nav)) continue;
+ if (READ_BOOL(*options, image_l_click_archive)) continue;
+ if (READ_BOOL(*options, image_l_click_video)) continue;
+ if (READ_CHAR(*options, image_l_click_video_editor)) continue;
if (READ_INT(*options, open_recent_list_maxsize)) continue;
if (READ_INT(*options, dnd_icon_size)) continue;
+ if (READ_UINT(*options, dnd_default_action)) continue;
if (READ_BOOL(*options, place_dialogs_under_mouse)) continue;
+ if (READ_INT(*options, clipboard_selection)) continue;
if (READ_BOOL(*options, save_window_positions)) continue;
if (READ_BOOL(*options, use_saved_window_positions_for_new_windows)) continue;
+ if (READ_BOOL(*options, save_window_workspace)) continue;
if (READ_BOOL(*options, tools_restore_state)) continue;
+ if (READ_BOOL(*options, save_dialog_window_positions)) continue;
+ if (READ_BOOL(*options, show_window_ids)) continue;
+ if (READ_BOOL(*options, expand_menu_toolbar)) continue;
+
+ if (READ_INT(*options, log_window_lines)) continue;
+ if (READ_BOOL(*options, log_window.timer_data)) continue;
+
+ if (READ_BOOL(*options, marks_save)) continue;
+ if (READ_CHAR(*options, help_search_engine)) continue;
+
+ if (READ_BOOL(*options, external_preview.enable)) continue;
+ if (READ_CHAR(*options, external_preview.select)) continue;
+ if (READ_CHAR(*options, external_preview.extract)) continue;
+
+ if (READ_BOOL(*options, collections_on_top)) continue;
+ if (READ_BOOL(*options, hide_window_in_fullscreen)) continue;
/* Properties dialog options */
if (READ_CHAR(*options, properties.tabs_order)) continue;
+ if (READ_BOOL(*options, with_rename)) continue;
+
/* Image options */
if (READ_UINT_CLAMP(*options, image.zoom_mode, 0, ZOOM_RESET_NONE)) continue;
+ if (READ_UINT_CLAMP(*options, image.zoom_style, 0, ZOOM_ARITHMETIC)) continue;
if (READ_BOOL(*options, image.zoom_2pass)) continue;
if (READ_BOOL(*options, image.zoom_to_fit_allow_expand)) continue;
if (READ_BOOL(*options, image.fit_window_to_image)) continue;
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;
- if (READ_UINT_CLAMP(*options, image.zoom_quality, GDK_INTERP_NEAREST, GDK_INTERP_HYPER)) continue;
+ if (READ_UINT_CLAMP(*options, image.zoom_quality, GDK_INTERP_NEAREST, GDK_INTERP_BILINEAR)) continue;
if (READ_INT(*options, image.zoom_increment)) continue;
if (READ_BOOL(*options, image.enable_read_ahead)) continue;
if (READ_BOOL(*options, image.exif_rotate_enable)) continue;
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;
+ if (READ_INT(*options, image.tile_size)) continue;
/* Thumbnails options */
if (READ_INT_CLAMP(*options, thumbnails.max_width, 16, 512)) continue;
if (READ_BOOL(*options, thumbnails.cache_into_dirs)) continue;
if (READ_BOOL(*options, thumbnails.use_xvpics)) continue;
if (READ_BOOL(*options, thumbnails.spec_standard)) continue;
- if (READ_UINT_CLAMP(*options, thumbnails.quality, GDK_INTERP_NEAREST, GDK_INTERP_HYPER)) continue;
+ if (READ_UINT_CLAMP(*options, thumbnails.quality, GDK_INTERP_NEAREST, GDK_INTERP_BILINEAR)) continue;
if (READ_BOOL(*options, thumbnails.use_exif)) continue;
+ if (READ_BOOL(*options, thumbnails.use_color_management)) continue;
+ if (READ_INT(*options, thumbnails.collection_preview)) continue;
+ if (READ_BOOL(*options, thumbnails.use_ft_metadata)) continue;
+// if (READ_BOOL(*options, thumbnails.use_ft_metadata_small)) continue;
/* File sorting options */
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;
if (READ_BOOL(*options, file_ops.confirm_delete)) continue;
+ if (READ_BOOL(*options, file_ops.confirm_move_to_trash)) continue;
if (READ_BOOL(*options, file_ops.enable_delete_key)) continue;
+ if (READ_BOOL(*options, file_ops.use_system_trash)) continue;
if (READ_BOOL(*options, file_ops.safe_delete_enable)) continue;
if (READ_CHAR(*options, file_ops.safe_delete_path)) continue;
if (READ_INT(*options, file_ops.safe_delete_folder_maxsize)) continue;
+ if (READ_BOOL(*options, file_ops.no_trash)) continue;
/* Fullscreen options */
if (READ_INT(*options, fullscreen.screen)) continue;
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 */
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;
if (READ_BOOL(*options, metadata.confirm_on_dir_change)) continue;
if (READ_BOOL(*options, metadata.keywords_case_sensitive)) continue;
if (READ_BOOL(*options, metadata.write_orientation)) continue;
+ if (READ_BOOL(*options, metadata.check_spelling)) continue;
if (READ_INT(*options, stereo.mode)) continue;
if (READ_INT(*options, stereo.fsmode)) continue;
if (READ_INT(*options, stereo.fixed_x2)) continue;
if (READ_INT(*options, stereo.fixed_y2)) continue;
+ if (READ_BOOL(*options, read_metadata_in_idle)) continue;
+
+ if (READ_UINT(*options, star_rating.star)) continue;
+ if (READ_UINT(*options, star_rating.rejected)) continue;
+
+ /* copy move rename */
+ if (READ_INT(*options, cp_mv_rn.auto_start)) continue;
+ if (READ_INT(*options, cp_mv_rn.auto_padding)) continue;
+ if (READ_CHAR(*options, cp_mv_rn.auto_end)) continue;
+ if (READ_INT(*options, cp_mv_rn.formatted_start)) continue;
+
+ /* Printer text */
+ if (READ_CHAR(*options, printer.template_string)) continue;
+ if (READ_CHAR(*options, printer.image_font)) continue;
+ if (READ_CHAR(*options, printer.page_font)) continue;
+ if (READ_CHAR(*options, printer.page_text)) continue;
+ if (READ_INT(*options, printer.image_text_position)) continue;
+ if (READ_INT(*options, printer.page_text_position)) continue;
+ if (READ_BOOL(*options, printer.show_image_text)) continue;
+ if (READ_BOOL(*options, printer.show_page_text)) continue;
+
+ /* Threads */
+ if (READ_INT(*options, threads.duplicates)) continue;
+
+ /* user-definable mouse buttons */
+ if (READ_CHAR(*options, mouse_button_8)) continue;
+ if (READ_CHAR(*options, mouse_button_9)) continue;
+
+ /* GPU - see main.c */
+ if (READ_BOOL(*options, override_disable_gpu)) continue;
+
/* Dummy options */
if (READ_DUMMY(*options, image.dither_quality, "deprecated since 2012-08-13")) continue;
if (READ_INT(options->color_profile, input_type)) continue;
if (READ_CHAR(options->color_profile, screen_file)) continue;
if (READ_BOOL(options->color_profile, use_x11_screen_profile)) continue;
+ if (READ_INT(options->color_profile, render_intent)) continue;
log_printf("unknown attribute %s = %s\n", option, value);
}
}
+static void options_load_marks_tooltips(GQParserData *parser_data, GMarkupParseContext *context, const gchar *element_name, const gchar **attribute_names, const gchar **attribute_values, gpointer data, GError **error)
+{
+ gint i = GPOINTER_TO_INT(data);
+ if (i < 0 || i >= FILEDATA_MARKS_SIZE) return;
+ while (*attribute_names)
+ {
+ const gchar *option = *attribute_names++;
+ const gchar *value = *attribute_values++;
+ if (READ_CHAR_FULL("text", options->marks_tooltips[i])) continue;
+
+ log_printf("unknown attribute %s = %s\n", option, value);
+ }
+ i++;
+ options_parse_func_set_data(parser_data, GINT_TO_POINTER(i));
+
+}
+
+static void options_load_disabled_plugins(GQParserData *parser_data, GMarkupParseContext *context, const gchar *element_name, const gchar **attribute_names, const gchar **attribute_values, gpointer data, GError **error)
+{
+ gint i = GPOINTER_TO_INT(data);
+ struct {
+ gchar *path;
+ } tmp;
+
+ while (*attribute_names)
+ {
+ const gchar *option = *attribute_names++;
+ const gchar *value = *attribute_values++;
+ tmp.path = NULL;
+ if (READ_CHAR_FULL("path", tmp.path))
+ {
+ options->disabled_plugins = g_list_append(options->disabled_plugins, g_strdup(tmp.path));
+ continue;
+ }
+ log_printf("unknown attribute %s = %s\n", option, value);
+ }
+ i++;
+ options_parse_func_set_data(parser_data, GINT_TO_POINTER(i));
+}
/*
*-----------------------------------------------------------------------------
}
}
+static void options_parse_marks_tooltips(GQParserData *parser_data, GMarkupParseContext *context, const gchar *element_name, const gchar **attribute_names, const gchar **attribute_values, gpointer data, GError **error)
+{
+ if (g_ascii_strcasecmp(element_name, "tooltip") == 0)
+ {
+ options_load_marks_tooltips(parser_data, context, element_name, attribute_names, attribute_values, data, error);
+ options_parse_func_push(parser_data, options_parse_leaf, NULL, NULL);
+ }
+ else
+ {
+ log_printf("unexpected in <profile>: <%s>\n", element_name);
+ options_parse_func_push(parser_data, options_parse_leaf, NULL, NULL);
+ }
+}
+
+static void class_filter_load_filter_type(const gchar **attribute_names, const gchar **attribute_values)
+{
+ gint i;
+ gint index;
+
+ while (*attribute_names)
+ {
+ const gchar *option = *attribute_names++;
+ const gchar *value = *attribute_values++;
+ if (g_strcmp0("filter", option) == 0)
+ {
+ for (i = 0; i < FILE_FORMAT_CLASSES; i++)
+ {
+ if (g_strcmp0(format_class_list[i], value) == 0)
+ {
+ index = i;
+ }
+ }
+ continue;
+ }
+
+ if (READ_BOOL_FULL("enabled", options->class_filter[index]))
+ {
+ continue;
+ }
+ log_printf("unknown attribute %s = %s\n", option, value);
+ }
+}
+
+static void options_parse_class_filter(GQParserData *parser_data, GMarkupParseContext *context, const gchar *element_name, const gchar **attribute_names, const gchar **attribute_values, gpointer data, GError **error)
+{
+ if (g_ascii_strcasecmp(element_name, "filter_type") == 0)
+ {
+ class_filter_load_filter_type(attribute_names, attribute_values);
+ options_parse_func_push(parser_data, options_parse_leaf, NULL, NULL);
+ }
+ else
+ {
+ log_printf("unexpected in <profile>: <%s>\n", element_name);
+ options_parse_func_push(parser_data, options_parse_leaf, NULL, NULL);
+ }
+}
+
+static void options_parse_disabled_plugins(GQParserData *parser_data, GMarkupParseContext *context, const gchar *element_name, const gchar **attribute_names, const gchar **attribute_values, gpointer data, GError **error)
+{
+ if (g_ascii_strcasecmp(element_name, "plugin") == 0)
+ {
+ options_load_disabled_plugins(parser_data, context, element_name, attribute_names, attribute_values, data, error);
+ options_parse_func_push(parser_data, options_parse_leaf, NULL, NULL);
+ }
+ else
+ {
+ log_printf("unexpected in <profile>: <%s>\n", element_name);
+ options_parse_func_push(parser_data, options_parse_leaf, NULL, NULL);
+ }
+}
+
static void options_parse_filter(GQParserData *parser_data, GMarkupParseContext *context, const gchar *element_name, const gchar **attribute_names, const gchar **attribute_values, gpointer data, GError **error)
{
if (g_ascii_strcasecmp(element_name, "file_type") == 0)
{
options_parse_func_push(parser_data, options_parse_filter, options_parse_filter_end, NULL);
}
+ else if (g_ascii_strcasecmp(element_name, "marks_tooltips") == 0)
+ {
+ options_load_marks_tooltips(parser_data, context, element_name, attribute_names, attribute_values, data, error);
+ options_parse_func_push(parser_data, options_parse_marks_tooltips, NULL, NULL);
+ }
+ else if (g_ascii_strcasecmp(element_name, "class_filter") == 0)
+ {
+ options_parse_func_push(parser_data, options_parse_class_filter, NULL, NULL);
+ }
else if (g_ascii_strcasecmp(element_name, "keyword_tree") == 0)
{
if (!keyword_tree) keyword_tree_new();
options_parse_func_push(parser_data, options_parse_keyword_tree, NULL, NULL);
}
+ else if (g_ascii_strcasecmp(element_name, "disabled_plugins") == 0)
+ {
+ options_load_disabled_plugins(parser_data, context, element_name, attribute_names, attribute_values, data, error);
+ options_parse_func_push(parser_data, options_parse_disabled_plugins, NULL, NULL);
+ }
else
{
log_printf("unexpected in <global>: <%s>\n", element_name);
}
}
+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 <pane_keywords>: <%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;
#ifdef HAVE_LIBCHAMPLAIN_GTK
else if (g_ascii_strcasecmp(element_name, "pane_gps") == 0)
{
- GtkWidget *pane = bar_find_pane_by_id(bar, PANE_GPS, options_get_id(attribute_names, attribute_values));
- if (pane)
- {
- bar_pane_gps_update_from_config(pane, attribute_names, attribute_values);
- }
- else
+ /* Use this flag to determine if --disable-clutter has been issued */
+ if (!options->disable_gpu)
{
- pane = bar_pane_gps_new_from_config(attribute_names, attribute_values);
- bar_add(bar, pane);
+ GtkWidget *pane = bar_find_pane_by_id(bar, PANE_GPS, options_get_id(attribute_names, attribute_values));
+ if (pane)
+ {
+ bar_pane_gps_update_from_config(pane, attribute_names, attribute_values);
+ }
+ else
+ {
+ pane = bar_pane_gps_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_leaf, NULL, NULL);
}
#endif
#endif
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)
{
}
}
-/* Just a dummy function to parse out old leftovers
- *
- * This function can be cleaned somedays.
- */
-static void options_parse_toolbar_and_statusbar(GQParserData *parser_data, GMarkupParseContext *context, const gchar *element_name, const gchar **attribute_names, const gchar **attribute_values, gpointer data, GError **error)
+static void options_parse_toolbar(GQParserData *parser_data, GMarkupParseContext *context, const gchar *element_name, const gchar **attribute_names, const gchar **attribute_values, gpointer data, GError **error)
{
- options_parse_func_push(parser_data, options_parse_leaf, NULL, NULL);
+ LayoutWindow *lw = data;
+ if (g_ascii_strcasecmp(element_name, "toolitem") == 0)
+ {
+ layout_toolbar_add_from_config(lw, TOOLBAR_MAIN, attribute_names, attribute_values);
+ options_parse_func_push(parser_data, options_parse_leaf, NULL, NULL);
+ }
+ else if (g_ascii_strcasecmp(element_name, "clear") == 0)
+ {
+ layout_toolbar_clear(lw, TOOLBAR_MAIN);
+ options_parse_func_push(parser_data, options_parse_leaf, NULL, NULL);
+ }
+ else
+ {
+ log_printf("unexpected in <toolbar>: <%s>\n", element_name);
+ options_parse_func_push(parser_data, options_parse_leaf, NULL, NULL);
+ }
+}
+
+static void options_parse_statusbar(GQParserData *parser_data, GMarkupParseContext *context, const gchar *element_name, const gchar **attribute_names, const gchar **attribute_values, gpointer data, GError **error)
+{
+ LayoutWindow *lw = data;
+ if (g_ascii_strcasecmp(element_name, "toolitem") == 0)
+ {
+ layout_toolbar_add_from_config(lw, TOOLBAR_STATUS, attribute_names, attribute_values);
+ options_parse_func_push(parser_data, options_parse_leaf, NULL, NULL);
+ }
+ else if (g_ascii_strcasecmp(element_name, "clear") == 0)
+ {
+ layout_toolbar_clear(lw, TOOLBAR_STATUS);
+ options_parse_func_push(parser_data, options_parse_leaf, NULL, NULL);
+ }
+ else
+ {
+ log_printf("unexpected in <statusbar>: <%s>\n", element_name);
+ options_parse_func_push(parser_data, options_parse_leaf, NULL, NULL);
+ }
+}
+
+static void options_parse_dialogs(GQParserData *parser_data, GMarkupParseContext *context, const gchar *element_name, const gchar **attribute_names, const gchar **attribute_values, gpointer data, GError **error)
+{
+ if (g_ascii_strcasecmp(element_name, "window") == 0)
+ {
+ generic_dialog_windows_load_config(attribute_names, attribute_values);
+ options_parse_func_push(parser_data, options_parse_leaf, NULL, NULL);
+ }
+ else
+ {
+ log_printf("unexpected in <dialogs>: <%s>\n", element_name);
+ options_parse_func_push(parser_data, options_parse_leaf, NULL, NULL);
+ }
}
static void options_parse_layout(GQParserData *parser_data, GMarkupParseContext *context, const gchar *element_name, const gchar **attribute_names, const gchar **attribute_values, gpointer data, GError **error)
}
else
{
- bar_update_from_config(lw->bar, attribute_names, attribute_values);
+ bar_update_from_config(lw->bar, attribute_names, attribute_values, lw);
}
options_parse_func_push(parser_data, options_parse_bar, NULL, lw->bar);
}
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);
+ bar_sort_cold_start(lw, attribute_names, attribute_values);
options_parse_func_push(parser_data, options_parse_leaf, NULL, NULL);
}
else if (g_ascii_strcasecmp(element_name, "toolbar") == 0)
{
- options_parse_func_push(parser_data, options_parse_toolbar_and_statusbar, NULL, NULL);
+ options_parse_func_push(parser_data, options_parse_toolbar, NULL, lw);
}
else if (g_ascii_strcasecmp(element_name, "statusbar") == 0)
{
- options_parse_func_push(parser_data, options_parse_toolbar_and_statusbar, NULL, NULL);
+ options_parse_func_push(parser_data, options_parse_statusbar, NULL, lw);
+ }
+ else if (g_ascii_strcasecmp(element_name, "dialogs") == 0)
+ {
+ options_parse_func_push(parser_data, options_parse_dialogs, NULL, NULL);
}
else
{