[glade] Fix bug 588844 - query dialog cancels if deleted
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade] Fix bug 588844 - query dialog cancels if deleted
- Date: Tue, 18 Jun 2013 08:54:46 +0000 (UTC)
commit 7f78ea6f641b72a4cfeb56f0e4be956219f4b999
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date: Mon May 20 21:23:20 2013 +0900
Fix bug 588844 - query dialog cancels if deleted
Cancel the operation if the window close button is clicked or Escape is pressed.
gladeui/glade-editor.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/gladeui/glade-editor.c b/gladeui/glade-editor.c
index 6b0e198..25295ea 100644
--- a/gladeui/glade-editor.c
+++ b/gladeui/glade-editor.c
@@ -726,6 +726,15 @@ query_dialog_style_set_cb (GtkWidget *dialog,
gtk_box_set_spacing (GTK_BOX (action_area), 6);
}
+static gboolean
+query_dialog_delete_event_cb (GtkDialog *dialog,
+ GdkEvent *event,
+ gpointer user_data)
+{
+ gtk_dialog_response (dialog, GTK_RESPONSE_CANCEL);
+ return TRUE;
+}
+
gboolean
glade_editor_query_dialog (GladeWidget *widget)
{
@@ -769,6 +778,9 @@ glade_editor_query_dialog (GladeWidget *widget)
g_signal_connect (dialog, "style-set",
G_CALLBACK (query_dialog_style_set_cb), NULL);
+ g_signal_connect (dialog, "delete-event",
+ G_CALLBACK (query_dialog_delete_event_cb), NULL);
+
answer = gtk_dialog_run (GTK_DIALOG (dialog));
/*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]