[epiphany] EphyHistoryWindow: Call response_cb from the UI file.



commit 78b447b99b4182036291f7f05dbff4417c2052fc
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Wed Oct 28 05:26:43 2015 +0100

    EphyHistoryWindow: Call response_cb from the UI file.

 src/ephy-history-window.c       |   31 +++++++++++++++----------------
 src/resources/history-dialog.ui |    1 +
 2 files changed, 16 insertions(+), 16 deletions(-)
---
diff --git a/src/ephy-history-window.c b/src/ephy-history-window.c
index f37dbca..7bd6900 100644
--- a/src/ephy-history-window.c
+++ b/src/ephy-history-window.c
@@ -685,6 +685,19 @@ ephy_history_window_finalize (GObject *object)
 }
 
 static void
+response_cb (GtkDialog *widget,
+            int response,
+            EphyHistoryWindow *self)
+{
+       if (response == GTK_RESPONSE_REJECT) {
+               clear_all_history (self);
+               return;
+       }
+
+       gtk_widget_destroy (GTK_WIDGET (self));
+}
+
+static void
 ephy_history_window_class_init (EphyHistoryWindowClass *klass)
 {
        GObjectClass *object_class = G_OBJECT_CLASS (klass);
@@ -733,6 +746,8 @@ ephy_history_window_class_init (EphyHistoryWindowClass *klass)
        gtk_widget_class_bind_template_callback (widget_class, on_copy_location_menuitem_activate);
        gtk_widget_class_bind_template_callback (widget_class, on_bookmark_menuitem_activate);
        gtk_widget_class_bind_template_callback (widget_class, on_delete_menuitem_activate);
+
+       gtk_widget_class_bind_template_callback (widget_class, response_cb);
 }
 
 static void
@@ -781,19 +796,6 @@ convert_location_data_func (GtkTreeViewColumn *column,
        g_free (unescaped_url);
 }
 
-static void
-response_cb (GtkDialog *widget,
-            int response,
-            EphyHistoryWindow *self)
-{
-       if (response == GTK_RESPONSE_REJECT) {
-               clear_all_history (self);
-               return;
-       }
-
-       gtk_widget_destroy (GTK_WIDGET (self));
-}
-
 void
 ephy_history_window_set_parent (EphyHistoryWindow *ebe,
                                GtkWidget *window)
@@ -864,7 +866,4 @@ ephy_history_window_init (EphyHistoryWindow *self)
                                                 (GtkTreeCellDataFunc) convert_location_data_func,
                                                 GINT_TO_POINTER (COLUMN_LOCATION),
                                                 NULL);
-
-       g_signal_connect (self, "response",
-                         G_CALLBACK (response_cb), self);
 }
diff --git a/src/resources/history-dialog.ui b/src/resources/history-dialog.ui
index cab1999..5880ad8 100644
--- a/src/resources/history-dialog.ui
+++ b/src/resources/history-dialog.ui
@@ -19,6 +19,7 @@
     <property name="default_height">600</property>
     <property name="destroy_with_parent">True</property>
     <property name="type_hint">dialog</property>
+    <signal name="response" handler="response_cb"/>
     <child internal-child="headerbar">
       <object class="GtkHeaderBar">
         <property name="title" translatable="yes">History</property>


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