Commit 6d2d4468 authored by Arnaud B.'s avatar Arnaud B.

CookiesDialog: Call response_cb from the UI file.

https://bugzilla.gnome.org/show_bug.cgi?id=757401
parent 242b5592
......@@ -249,6 +249,20 @@ on_search_entry_changed (GtkSearchEntry *entry,
gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER (dialog->priv->treemodelfilter));
}
static void
cookies_dialog_response_cb (GtkDialog *widget,
int response,
CookiesDialog *dialog)
{
if (response == GTK_RESPONSE_REJECT) {
webkit_cookie_manager_delete_all_cookies (dialog->priv->cookie_manager);
reload_model (dialog);
return;
}
gtk_widget_destroy (GTK_WIDGET (dialog));
}
static void
cookies_dialog_class_init (CookiesDialogClass *klass)
{
......@@ -272,20 +286,8 @@ cookies_dialog_class_init (CookiesDialogClass *klass)
gtk_widget_class_bind_template_callback (widget_class, on_treeview_selection_changed);
gtk_widget_class_bind_template_callback (widget_class, on_remove_toolbutton_clicked);
gtk_widget_class_bind_template_callback (widget_class, on_search_entry_changed);
}
static void
cookies_dialog_response_cb (GtkDialog *widget,
int response,
CookiesDialog *dialog)
{
if (response == GTK_RESPONSE_REJECT) {
webkit_cookie_manager_delete_all_cookies (dialog->priv->cookie_manager);
reload_model (dialog);
return;
}
gtk_widget_destroy (GTK_WIDGET (dialog));
gtk_widget_class_bind_template_callback (widget_class, cookies_dialog_response_cb);
}
static gboolean
......@@ -461,7 +463,4 @@ cookies_dialog_init (CookiesDialog *dialog)
dialog->priv->cookie_manager = webkit_web_context_get_cookie_manager (web_context);
setup_page (dialog);
g_signal_connect (dialog, "response",
G_CALLBACK (cookies_dialog_response_cb), dialog);
}
......@@ -25,6 +25,7 @@
<property name="default_height">600</property>
<property name="destroy_with_parent">True</property>
<property name="type_hint">dialog</property>
<signal name="response" handler="cookies_dialog_response_cb"/>
<child internal-child="headerbar">
<object class="GtkHeaderBar">
<property name="title" translatable="yes">Cookies</property>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment