[gedit] Override delete-event in the replace dialog directly
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] Override delete-event in the replace dialog directly
- Date: Tue, 17 Jul 2012 17:36:16 +0000 (UTC)
commit e19be049f42fefbdb2ae080922bf10291cbb45f8
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Tue Jul 17 19:37:44 2012 +0200
Override delete-event in the replace dialog directly
gedit/gedit-commands-search.c | 15 ---------------
gedit/gedit-replace-dialog.c | 10 ++++++++++
2 files changed, 10 insertions(+), 15 deletions(-)
---
diff --git a/gedit/gedit-commands-search.c b/gedit/gedit-commands-search.c
index 074af87..515b599 100644
--- a/gedit/gedit-commands-search.c
+++ b/gedit/gedit-commands-search.c
@@ -499,17 +499,6 @@ replace_dialog_response_cb (GeditReplaceDialog *dialog,
}
}
-static gboolean
-replace_dialog_delete_event_cb (GtkWidget *widget,
- GdkEventAny *event,
- gpointer user_data)
-{
- gedit_debug (DEBUG_COMMANDS);
-
- /* prevent destruction */
- return TRUE;
-}
-
static void
replace_dialog_destroyed (GeditWindow *window,
GeditReplaceDialog *dialog)
@@ -535,10 +524,6 @@ create_dialog (GeditWindow *window)
"response",
G_CALLBACK (replace_dialog_response_cb),
window);
- g_signal_connect (dialog,
- "delete-event",
- G_CALLBACK (replace_dialog_delete_event_cb),
- NULL);
g_object_set_data (G_OBJECT (window),
GEDIT_REPLACE_DIALOG_KEY,
diff --git a/gedit/gedit-replace-dialog.c b/gedit/gedit-replace-dialog.c
index 779507a..cb1efed 100644
--- a/gedit/gedit-replace-dialog.c
+++ b/gedit/gedit-replace-dialog.c
@@ -79,6 +79,14 @@ gedit_replace_dialog_present_with_time (GeditReplaceDialog *dialog,
gtk_widget_grab_focus (dialog->priv->search_text_entry);
}
+static gboolean
+gedit_replace_dialog_delete_event (GtkWidget *widget,
+ GdkEventAny *event)
+{
+ /* prevent destruction */
+ return TRUE;
+}
+
static void
gedit_replace_dialog_response (GtkDialog *dialog,
gint response_id)
@@ -123,8 +131,10 @@ static void
gedit_replace_dialog_class_init (GeditReplaceDialogClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GtkWidgetClass *gtkwidget_class = GTK_WIDGET_CLASS (klass);
GtkDialogClass *gtkdialog_class = GTK_DIALOG_CLASS (klass);
+ gtkwidget_class->delete_event = gedit_replace_dialog_delete_event;
gtkdialog_class->response = gedit_replace_dialog_response;
g_type_class_add_private (object_class, sizeof (GeditReplaceDialogPrivate));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]