[gthumb] delete metadata: added a confirmation dialog



commit c7a916ee3b52de3444a38375af9211fd1cdbd2e2
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sun May 29 17:19:23 2011 +0200

    delete metadata: added a confirmation dialog

 extensions/edit_metadata/actions.c   |   29 +++++++++++++++++++++++++----
 extensions/edit_metadata/callbacks.c |    2 +-
 2 files changed, 26 insertions(+), 5 deletions(-)
---
diff --git a/extensions/edit_metadata/actions.c b/extensions/edit_metadata/actions.c
index b086579..429c2de 100644
--- a/extensions/edit_metadata/actions.c
+++ b/extensions/edit_metadata/actions.c
@@ -115,10 +115,31 @@ void
 gth_browser_activate_action_tool_delete_metadata (GtkAction  *action,
 						  GthBrowser *browser)
 {
-	GList   *items;
-	GList   *file_data_list;
-	GList   *file_list;
-	GthTask *task;
+	GtkWidget *dialog;
+	int        result;
+	GList     *items;
+	GList     *file_data_list;
+	GList     *file_list;
+	GthTask   *task;
+
+	dialog =  gtk_message_dialog_new (GTK_WINDOW (browser),
+					  GTK_DIALOG_MODAL,
+					  GTK_MESSAGE_QUESTION,
+					  GTK_BUTTONS_NONE,
+					  _("Are you sure you want to permanently delete the metadata of the selected files?"));
+	gtk_dialog_add_buttons (GTK_DIALOG (dialog),
+			        GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+			        GTK_STOCK_DELETE, GTK_RESPONSE_YES,
+			        NULL);
+	gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
+						  "%s",
+						  _("If you delete the metadata, it will be permanently lost."));
+
+	result = gtk_dialog_run (GTK_DIALOG (dialog));
+	gtk_widget_destroy (dialog);
+
+	if (result != GTK_RESPONSE_YES)
+		return;
 
 	items = gth_file_selection_get_selected (GTH_FILE_SELECTION (gth_browser_get_file_list_view (browser)));
 	file_data_list = gth_file_list_get_files (GTH_FILE_LIST (gth_browser_get_file_list (browser)), items);
diff --git a/extensions/edit_metadata/callbacks.c b/extensions/edit_metadata/callbacks.c
index 4881298..53c1929 100644
--- a/extensions/edit_metadata/callbacks.c
+++ b/extensions/edit_metadata/callbacks.c
@@ -119,7 +119,7 @@ static GtkActionEntry edit_metadata_action_entries[] = {
 
 	{ "Tool_DeleteMetadata", NULL,
 	  N_("Delete Metadata"), NULL,
-	  N_("Delete the embedded and attached metadata of the selected files"),
+	  N_("Delete the comment and the embedded metadata of the selected files"),
 	  G_CALLBACK (gth_browser_activate_action_tool_delete_metadata) }
 };
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]