[gthumb] ask confirmation before deleting a command/script



commit 3369fda400f9caf382dca07134f1c81d3880e828
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Thu Jul 7 20:48:21 2011 +0200

    ask confirmation before deleting a command/script
    
    [bug #627475]

 extensions/list_tools/dlg-personalize-scripts.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/extensions/list_tools/dlg-personalize-scripts.c b/extensions/list_tools/dlg-personalize-scripts.c
index a6c5204..8805a7b 100644
--- a/extensions/list_tools/dlg-personalize-scripts.c
+++ b/extensions/list_tools/dlg-personalize-scripts.c
@@ -446,12 +446,27 @@ static void
 delete_script_cb (GtkButton  *button,
 	          DialogData *data)
 {
+	GtkWidget        *d;
+	int               result;
 	GtkTreeSelection *selection;
 	GtkTreeModel     *model = GTK_TREE_MODEL (data->list_store);
 	GtkTreeIter       iter;
 	GthScript        *script;
 	GthScriptFile    *script_file;
 
+	d = _gtk_message_dialog_new (GTK_WINDOW (data->dialog),
+				     GTK_DIALOG_MODAL,
+				     GTK_STOCK_DIALOG_QUESTION,
+				     _("Are you sure you want to delete the selected command?"),
+				     NULL,
+				     GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+				     GTK_STOCK_DELETE, GTK_RESPONSE_OK,
+				     NULL);
+	result = gtk_dialog_run (GTK_DIALOG (d));
+	gtk_widget_destroy (d);
+	if (result != GTK_RESPONSE_OK)
+		return;
+
 	selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (data->list_view));
 	if (! gtk_tree_selection_get_selected (selection, &model, &iter))
 		return;



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