Use a dedicated option to enable keywords and comment saving as XMP tags
authorLaurent Monin <geeqie@norz.org>
Tue, 6 May 2008 12:31:23 +0000 (12:31 +0000)
committerLaurent Monin <geeqie@norz.org>
Tue, 6 May 2008 12:31:23 +0000 (12:31 +0000)
in image's files.
This new option is named "save_metadata_in_image_file" in configuration file.
User can toggle it through Preferences > Advanced > Miscellaneous > Store keywords and comments as XMP tags in image files.
Description of enable_metadata_dirs was modified as an attempt to improve clarity.

src/bar_info.c
src/options.c
src/options.h
src/preferences.c
src/rcfile.c

index 176c627..fe37377 100644 (file)
@@ -333,7 +333,7 @@ gint comment_write(FileData *fd, GList *keywords, const gchar *comment)
 {
        if (!fd) return FALSE;
 
-       if (options->enable_metadata_dirs && /* FIXME - use dedicated option */
+       if (options->save_metadata_in_image_file &&
            comment_xmp_write(fd, keywords, comment))
                {
                comment_delete_legacy(fd);
index b680c9f..77d097d 100644 (file)
@@ -27,7 +27,7 @@ ConfOptions *init_options(ConfOptions *options)
        options->dnd_icon_size = 48;
        options->duplicates_similarity_threshold = 99;
        options->enable_metadata_dirs = FALSE;
-
+       
        options->file_filter.disable = FALSE;
        options->file_filter.show_dot_directory = FALSE;
        options->file_filter.show_hidden_files = FALSE;
@@ -111,6 +111,9 @@ ConfOptions *init_options(ConfOptions *options)
        options->panels.sort.selection_state = 0;
 
        options->progressive_key_scrolling = FALSE;
+       
+       options->save_metadata_in_image_file = FALSE;
+       
        options->show_copy_path = FALSE;
        options->show_icon_names = TRUE;
 
index ed9a2a2..3d5089b 100644 (file)
@@ -39,6 +39,8 @@ struct _ConfOptions
        gint open_recent_list_maxsize;
        gint dnd_icon_size;
 
+       gint save_metadata_in_image_file;
+
        /* file ops */
        struct {
                gint enable_in_place_rename;
index a0cc763..73d9f6d 100644 (file)
@@ -279,6 +279,8 @@ static void config_window_apply(void)
                layout_copy_path_update_all();
                }
 
+       options->save_metadata_in_image_file = c_options->save_metadata_in_image_file;
+
 #ifdef DEBUG
        set_debug_level(debug_c);
 #endif
@@ -1434,9 +1436,12 @@ static void config_tab_advanced(GtkWidget *notebook)
 
        group = pref_group_new(vbox, FALSE, _("Miscellaneous"), GTK_ORIENTATION_VERTICAL);
 
-       pref_checkbox_new_int(group, _("Store keywords and comments local to source images"),
+       pref_checkbox_new_int(group, _("Store metadata and cache files in source image's directory"),
                              options->enable_metadata_dirs, &c_options->enable_metadata_dirs);
 
+       pref_checkbox_new_int(group, _("Store keywords and comments as XMP tags in image files"),
+                             options->save_metadata_in_image_file, &c_options->save_metadata_in_image_file);
+
        pref_spin_new_int(group, _("Custom similarity threshold:"), NULL,
                          0, 100, 1, options->duplicates_similarity_threshold, &c_options->duplicates_similarity_threshold);
 
index 0a6f01b..c744c59 100644 (file)
@@ -314,6 +314,7 @@ void save_options(void)
 
        WRITE_BOOL(progressive_key_scrolling);
        WRITE_BOOL(enable_metadata_dirs);
+       WRITE_BOOL(save_metadata_in_image_file);
 
        WRITE_INT(duplicates_similarity_threshold);
        WRITE_SEPARATOR();
@@ -625,6 +626,7 @@ void load_options(void)
                READ_BOOL(progressive_key_scrolling);
 
                READ_BOOL(enable_metadata_dirs);
+               READ_BOOL(save_metadata_in_image_file);
 
                READ_BOOL(mousewheel_scrolls);