[epiphany] ClearDataDialog: Define signals in the UI file.
- From: Arnaud Bonatti <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] ClearDataDialog: Define signals in the UI file.
- Date: Sun, 1 Nov 2015 15:30:14 +0000 (UTC)
commit 1353440ab74b5f2d4daf3fe5b9aed0bb3213600d
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Sat Oct 31 17:04:21 2015 +0100
ClearDataDialog: Define signals in the UI file.
https://bugzilla.gnome.org/show_bug.cgi?id=757414
src/clear-data-dialog.c | 63 +++++++++++-------------------------
src/resources/clear-data-dialog.ui | 5 +++
2 files changed, 24 insertions(+), 44 deletions(-)
---
diff --git a/src/clear-data-dialog.c b/src/clear-data-dialog.c
index 6286142..8046929 100644
--- a/src/clear-data-dialog.c
+++ b/src/clear-data-dialog.c
@@ -48,21 +48,6 @@ struct ClearDataDialogPrivate
G_DEFINE_TYPE_WITH_PRIVATE (ClearDataDialog, clear_data_dialog, GTK_TYPE_DIALOG)
-static void
-clear_data_dialog_class_init (ClearDataDialogClass *klass)
-{
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
-
- gtk_widget_class_set_template_from_resource (widget_class,
- "/org/gnome/epiphany/clear-data-dialog.ui");
-
- gtk_widget_class_bind_template_child_private (widget_class, ClearDataDialog, cookies_checkbutton);
- gtk_widget_class_bind_template_child_private (widget_class, ClearDataDialog, cache_checkbutton);
- gtk_widget_class_bind_template_child_private (widget_class, ClearDataDialog, passwords_checkbutton);
- gtk_widget_class_bind_template_child_private (widget_class, ClearDataDialog, history_checkbutton);
- gtk_widget_class_bind_template_child_private (widget_class, ClearDataDialog, clear_button);
-}
-
static WebKitCookieManager *
get_cookie_manager (void)
{
@@ -154,6 +139,24 @@ checkbutton_toggled_cb (GtkToggleButton *toggle,
}
static void
+clear_data_dialog_class_init (ClearDataDialogClass *klass)
+{
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+
+ gtk_widget_class_set_template_from_resource (widget_class,
+ "/org/gnome/epiphany/clear-data-dialog.ui");
+
+ gtk_widget_class_bind_template_child_private (widget_class, ClearDataDialog, cookies_checkbutton);
+ gtk_widget_class_bind_template_child_private (widget_class, ClearDataDialog, cache_checkbutton);
+ gtk_widget_class_bind_template_child_private (widget_class, ClearDataDialog, passwords_checkbutton);
+ gtk_widget_class_bind_template_child_private (widget_class, ClearDataDialog, history_checkbutton);
+ gtk_widget_class_bind_template_child_private (widget_class, ClearDataDialog, clear_button);
+
+ gtk_widget_class_bind_template_callback (widget_class, checkbutton_toggled_cb);
+ gtk_widget_class_bind_template_callback (widget_class, clear_data_dialog_response_cb);
+}
+
+static void
update_flags (ClearDataDialog *dialog)
{
ClearDataDialogPrivate *priv = dialog->priv;
@@ -169,40 +172,12 @@ update_flags (ClearDataDialog *dialog)
}
static void
-setup_page (ClearDataDialog *dialog)
-{
- ClearDataDialogPrivate *priv = dialog->priv;
-
- g_signal_connect (priv->cookies_checkbutton,
- "toggled",
- G_CALLBACK (checkbutton_toggled_cb),
- dialog);
- g_signal_connect (priv->history_checkbutton,
- "toggled",
- G_CALLBACK (checkbutton_toggled_cb),
- dialog);
- g_signal_connect (priv->cache_checkbutton,
- "toggled",
- G_CALLBACK (checkbutton_toggled_cb),
- dialog);
- g_signal_connect (priv->passwords_checkbutton,
- "toggled",
- G_CALLBACK (checkbutton_toggled_cb),
- dialog);
-
- update_flags (dialog);
-}
-
-static void
clear_data_dialog_init (ClearDataDialog *dialog)
{
dialog->priv = clear_data_dialog_get_instance_private (dialog);
gtk_widget_init_template (GTK_WIDGET (dialog));
- setup_page (dialog);
-
- g_signal_connect (dialog, "response",
- G_CALLBACK (clear_data_dialog_response_cb), dialog);
+ update_flags (dialog); // FIXME flags is unset at this moment...
}
void
diff --git a/src/resources/clear-data-dialog.ui b/src/resources/clear-data-dialog.ui
index ffdba1a..82b557e 100644
--- a/src/resources/clear-data-dialog.ui
+++ b/src/resources/clear-data-dialog.ui
@@ -8,6 +8,7 @@
<property name="destroy_with_parent">True</property>
<property name="type_hint">dialog</property>
<property name="resizable">False</property>
+ <signal name="response" handler="clear_data_dialog_response_cb"/>
<child internal-child="headerbar">
<object class="GtkHeaderBar">
<property name="title" translatable="yes">Clear Personal Data</property>
@@ -79,6 +80,7 @@
<property name="visible">True</property>
<property name="use_underline">True</property>
<property name="halign">start</property>
+ <signal name="toggled" handler="checkbutton_toggled_cb"/>
</object>
</child>
<child>
@@ -87,6 +89,7 @@
<property name="visible">True</property>
<property name="use_underline">True</property>
<property name="halign">start</property>
+ <signal name="toggled" handler="checkbutton_toggled_cb"/>
</object>
</child>
<child>
@@ -95,6 +98,7 @@
<property name="visible">True</property>
<property name="use_underline">True</property>
<property name="halign">start</property>
+ <signal name="toggled" handler="checkbutton_toggled_cb"/>
</object>
</child>
<child>
@@ -103,6 +107,7 @@
<property name="visible">True</property>
<property name="use_underline">True</property>
<property name="halign">start</property>
+ <signal name="toggled" handler="checkbutton_toggled_cb"/>
</object>
</child>
</object>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]