Include a Other Software section in Help file
[geeqie.git] / src / rcfile.c
index 9484132..7f3d384 100644 (file)
@@ -298,7 +298,7 @@ gboolean read_bool_option(const gchar *option, const gchar *label, const gchar *
 
 /*
  *-----------------------------------------------------------------------------
- * write fuctions for elements (private)
+ * write functions for elements (private)
  *-----------------------------------------------------------------------------
  */
 
@@ -313,6 +313,7 @@ static void write_global_attributes(GString *outstr, gint indent)
 
        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();
@@ -334,14 +335,17 @@ static void write_global_attributes(GString *outstr, gint indent)
        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);
@@ -349,8 +353,13 @@ static void write_global_attributes(GString *outstr, gint indent)
        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);
@@ -401,6 +410,7 @@ static void write_global_attributes(GString *outstr, gint indent)
        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);
@@ -515,6 +525,10 @@ static void write_global_attributes(GString *outstr, gint indent)
        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)
@@ -562,6 +576,23 @@ static void write_marks_tooltips(GString *outstr, gint 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;
@@ -601,7 +632,7 @@ static void write_disabled_plugins(GString *outstr, gint indent)
  *-----------------------------------------------------------------------------
  */
 
-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;
@@ -634,39 +665,51 @@ gboolean save_config_to_file(const gchar *utf8_path, ConfOptions *options)
        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();
-       write_marks_tooltips(outstr, indent);
+               WRITE_SEPARATOR();
+               write_marks_tooltips(outstr, indent);
 
-       WRITE_SEPARATOR();
-       write_disabled_plugins(outstr, indent);
+               WRITE_SEPARATOR();
+               write_disabled_plugins(outstr, indent);
 
-       WRITE_SEPARATOR();
-       keyword_tree_write_config(outstr, indent);
-       indent--;
-       WRITE_NL(); WRITE_STRING("</global>\n");
+               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)
+               {
+               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--;
@@ -708,11 +751,12 @@ static gboolean load_global_params(const gchar **attribute_names, const gchar **
 
                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_NAME_CI)) 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;
@@ -728,14 +772,17 @@ static gboolean load_global_params(const gchar **attribute_names, const gchar **
 
                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;
@@ -743,7 +790,12 @@ static gboolean load_global_params(const gchar **attribute_names, const gchar **
                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;
@@ -763,7 +815,7 @@ static gboolean load_global_params(const gchar **attribute_names, const gchar **
                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;
@@ -782,8 +834,9 @@ static gboolean load_global_params(const gchar **attribute_names, const gchar **
                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;
@@ -902,6 +955,9 @@ static gboolean load_global_params(const gchar **attribute_names, const gchar **
                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;
 
@@ -1050,6 +1106,49 @@ static void options_parse_marks_tooltips(GQParserData *parser_data, GMarkupParse
                }
 }
 
+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)
@@ -1139,6 +1238,10 @@ static void options_parse_global(GQParserData *parser_data, GMarkupParseContext
                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();
@@ -1219,17 +1322,21 @@ static void options_parse_bar(GQParserData *parser_data, GMarkupParseContext *co
 #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)
+               /* Use this flag to determine if --disable-clutter has been issued */
+               if (!options->disable_gpu)
                        {
-                       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);
+                       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