Addl fix #521: zoom increment is not multiplicative
[geeqie.git] / src / rcfile.c
index ba2f0fd..e546b1b 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)
  *-----------------------------------------------------------------------------
  */
 
@@ -307,12 +307,12 @@ static void write_global_attributes(GString *outstr, gint indent)
        /* General Options */
        WRITE_NL(); WRITE_BOOL(*options, show_icon_names);
        WRITE_NL(); WRITE_BOOL(*options, show_star_rating);
-       WRITE_NL(); WRITE_BOOL(*options, show_guidelines);
        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();
@@ -330,6 +330,7 @@ static void write_global_attributes(GString *outstr, gint indent)
 
        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);
@@ -340,6 +341,7 @@ static void write_global_attributes(GString *outstr, gint indent)
 
        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);
@@ -351,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);
@@ -376,6 +383,7 @@ static void write_global_attributes(GString *outstr, gint indent)
        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);
@@ -393,6 +401,7 @@ static void write_global_attributes(GString *outstr, gint indent)
        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);
@@ -403,6 +412,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);
@@ -513,10 +523,18 @@ static void write_global_attributes(GString *outstr, gint indent)
        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)
@@ -687,12 +705,16 @@ gboolean save_config_to_file(const gchar *utf8_path, ConfOptions *options, Layou
        /* Layout Options */
        if (!lw)
                {
-               work = layout_window_list;
-               while (work)
+               /* If not save_window_positions, do not include a <layout> section */
+               if (options->save_window_positions)
                        {
-                       LayoutWindow *lw = work->data;
-                       layout_write_config(lw, outstr, indent);
-                       work = work->next;
+                       work = layout_window_list;
+                       while (work)
+                               {
+                               LayoutWindow *lw = work->data;
+                               layout_write_config(lw, outstr, indent);
+                               work = work->next;
+                               }
                        }
                }
        else
@@ -717,6 +739,57 @@ gboolean save_config_to_file(const gchar *utf8_path, ConfOptions *options, Layou
        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)
@@ -734,11 +807,11 @@ static gboolean load_global_params(const gchar **attribute_names, const gchar **
                /* General options */
                if (READ_BOOL(*options, show_icon_names)) continue;
                if (READ_BOOL(*options, show_star_rating)) continue;
-               if (READ_BOOL(*options, show_guidelines)) 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;
 
@@ -754,6 +827,7 @@ static gboolean load_global_params(const gchar **attribute_names, const gchar **
 
                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;
 
@@ -765,6 +839,7 @@ static gboolean load_global_params(const gchar **attribute_names, const gchar **
 
                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;
@@ -776,7 +851,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;
@@ -785,6 +865,7 @@ static gboolean load_global_params(const gchar **attribute_names, const gchar **
 
                /* 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;
@@ -796,7 +877,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;
@@ -806,6 +887,7 @@ static gboolean load_global_params(const gchar **attribute_names, const gchar **
                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;
@@ -815,8 +897,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;
@@ -931,10 +1014,16 @@ static gboolean load_global_params(const gchar **attribute_names, const gchar **
                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;
 
@@ -1299,17 +1388,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)
-                       {
-                       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
@@ -1433,7 +1526,7 @@ static void options_parse_layout(GQParserData *parser_data, GMarkupParseContext
                        }
                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);