changeset 1586:249b539cc952

force the metadata dialog if it was triggered by the menu or the button
author nadvornik
date Sat, 02 May 2009 11:14:24 +0000
parents 15de7b420b69
children 0b10c7864af9
files src/layout.c src/layout_util.c src/main.c src/metadata.c src/metadata.h src/utilops.c src/utilops.h
diffstat 7 files changed, 11 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/layout.c	Sat May 02 10:59:36 2009 +0000
+++ b/src/layout.c	Sat May 02 11:14:24 2009 +0000
@@ -926,7 +926,7 @@
 		}
 
 	if (options->metadata.confirm_on_dir_change && dir_changed)
-		metadata_write_queue_confirm(NULL, NULL);
+		metadata_write_queue_confirm(FALSE, NULL, NULL);
 
 	return TRUE;
 }
--- a/src/layout_util.c	Sat May 02 10:59:36 2009 +0000
+++ b/src/layout_util.c	Sat May 02 11:14:24 2009 +0000
@@ -1038,7 +1038,7 @@
 
 static void layout_menu_metadata_write_cb(GtkAction *action, gpointer data)
 {
-	metadata_write_queue_confirm(NULL, NULL);
+	metadata_write_queue_confirm(TRUE, NULL, NULL);
 }
 
 
@@ -2390,7 +2390,7 @@
 
 	/* this should be called here to handle the metadata edited in bars */
 	if (options->metadata.confirm_on_image_change)
-		metadata_write_queue_confirm(NULL, NULL);
+		metadata_write_queue_confirm(FALSE, NULL, NULL);
 }
 
 void layout_bars_new_selection(LayoutWindow *lw, gint count)
--- a/src/main.c	Sat May 02 10:59:36 2009 +0000
+++ b/src/main.c	Sat May 02 11:14:24 2009 +0000
@@ -668,7 +668,7 @@
 {
 	layout_image_full_screen_stop(NULL);
 
-	if (metadata_write_queue_confirm(exit_program_write_metadata_cb, NULL)) return;
+	if (metadata_write_queue_confirm(FALSE, exit_program_write_metadata_cb, NULL)) return;
 
 	if (exit_confirm_dlg()) return;
 
--- a/src/metadata.c	Sat May 02 10:59:36 2009 +0000
+++ b/src/metadata.c	Sat May 02 11:14:24 2009 +0000
@@ -104,7 +104,7 @@
 }
 
 
-gboolean metadata_write_queue_confirm(FileUtilDoneFunc done_func, gpointer done_data)
+gboolean metadata_write_queue_confirm(gboolean force_dialog, FileUtilDoneFunc done_func, gpointer done_data)
 {
 	GList *work;
 	GList *to_approve = NULL;
@@ -120,7 +120,7 @@
 		to_approve = g_list_prepend(to_approve, file_data_ref(fd));
 		}
 
-	file_util_write_metadata(NULL, to_approve, NULL, done_func, done_data);
+	file_util_write_metadata(NULL, to_approve, NULL, force_dialog, done_func, done_data);
 	
 	filelist_free(to_approve);
 	
@@ -129,7 +129,7 @@
 
 static gboolean metadata_write_queue_idle_cb(gpointer data)
 {
-	metadata_write_queue_confirm(NULL, NULL);
+	metadata_write_queue_confirm(FALSE, NULL, NULL);
 	metadata_write_idle_id = 0;
 	return FALSE;
 }
--- a/src/metadata.h	Sat May 02 10:59:36 2009 +0000
+++ b/src/metadata.h	Sat May 02 11:14:24 2009 +0000
@@ -21,7 +21,7 @@
 gboolean metadata_write_queue_remove(FileData *fd);
 gboolean metadata_write_queue_remove_list(GList *list);
 gboolean metadata_write_perform(FileData *fd);
-gboolean metadata_write_queue_confirm(FileUtilDoneFunc done_func, gpointer done_data);
+gboolean metadata_write_queue_confirm(gboolean force_dialog, FileUtilDoneFunc done_func, gpointer done_data);
 
 gint metadata_queue_length(void);
 
--- a/src/utilops.c	Sat May 02 10:59:36 2009 +0000
+++ b/src/utilops.c	Sat May 02 11:14:24 2009 +0000
@@ -2619,10 +2619,10 @@
 	file_util_delete_full(source_fd, source_list, parent, options->file_ops.confirm_delete ? UTILITY_PHASE_START : UTILITY_PHASE_ENTERING);
 }
 
-void file_util_write_metadata(FileData *source_fd, GList *source_list, GtkWidget *parent, FileUtilDoneFunc done_func, gpointer done_data)
+void file_util_write_metadata(FileData *source_fd, GList *source_list, GtkWidget *parent, gboolean force_dialog, FileUtilDoneFunc done_func, gpointer done_data)
 {
 	file_util_write_metadata_full(source_fd, source_list, parent, 
-	                              (options->metadata.save_in_image_file && options->metadata.confirm_write) ? UTILITY_PHASE_START : UTILITY_PHASE_ENTERING,
+	                              ((options->metadata.save_in_image_file && options->metadata.confirm_write) || force_dialog) ? UTILITY_PHASE_START : UTILITY_PHASE_ENTERING,
 	                              done_func, done_data);
 }
 
--- a/src/utilops.h	Sat May 02 10:59:36 2009 +0000
+++ b/src/utilops.h	Sat May 02 11:14:24 2009 +0000
@@ -37,7 +37,7 @@
 void file_util_move(FileData *source_fd, GList *source_list, const gchar *dest_path, GtkWidget *parent);
 void file_util_copy(FileData *source_fd, GList *source_list, const gchar *dest_path, GtkWidget *parent);
 void file_util_rename(FileData *source_fd, GList *source_list, GtkWidget *parent);
-void file_util_write_metadata(FileData *source_fd, GList *source_list, GtkWidget *parent, FileUtilDoneFunc done_func, gpointer done_data);
+void file_util_write_metadata(FileData *source_fd, GList *source_list, GtkWidget *parent, gboolean force_dialog, FileUtilDoneFunc done_func, gpointer done_data);
 
 void file_util_create_dir(FileData *dir_fd, GtkWidget *parent, FileUtilDoneFunc done_func, gpointer done_data);