[gnome-calendar/wip/gbsneto/edit-dialog-cleanup] edit-dialog: move bindings to UI file
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar/wip/gbsneto/edit-dialog-cleanup] edit-dialog: move bindings to UI file
- Date: Wed, 30 Dec 2015 17:06:31 +0000 (UTC)
commit de207f9c63d525be9e0512da10571293ecb3757f
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Wed Dec 30 15:05:20 2015 -0200
edit-dialog: move bindings to UI file
We don't need to manually bind these properties in
the source code if we can make it on the UI files.
data/ui/edit-dialog.ui | 3 +++
src/gcal-edit-dialog.c | 19 -------------------
2 files changed, 3 insertions(+), 19 deletions(-)
---
diff --git a/data/ui/edit-dialog.ui b/data/ui/edit-dialog.ui
index ddd4032..322ac08 100644
--- a/data/ui/edit-dialog.ui
+++ b/data/ui/edit-dialog.ui
@@ -15,6 +15,7 @@
<child type="titlebar">
<object class="GtkHeaderBar" id="titlebar">
<property name="visible">True</property>
+ <property name="title" bind-source="summary_entry" bind-property="text" bind-flags="default" />
<child>
<object class="GtkButton" id="cancel_button">
<property name="label" translatable="yes">Cancel</property>
@@ -232,6 +233,7 @@
<object class="GcalTimeSelector" id="start_time_selector">
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="sensitive" bind-source="all_day_check" bind-property="active"
bind-flags="invert-boolean|default" />
<signal name="modified" handler="update_time" object="GcalEditDialog" swapped="no"/>
</object>
<packing>
@@ -266,6 +268,7 @@
<object class="GcalTimeSelector" id="end_time_selector">
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="sensitive" bind-source="all_day_check" bind-property="active"
bind-flags="invert-boolean|default" />
<signal name="modified" handler="update_time" object="GcalEditDialog" swapped="no"/>
</object>
<packing>
diff --git a/src/gcal-edit-dialog.c b/src/gcal-edit-dialog.c
index 2abc8d3..651e0e6 100644
--- a/src/gcal-edit-dialog.c
+++ b/src/gcal-edit-dialog.c
@@ -546,25 +546,6 @@ gcal_edit_dialog_constructed (GObject* object)
g_action_map_add_action (G_ACTION_MAP (dialog->action_group), G_ACTION (dialog->action));
- /* bind title & symmary */
- g_object_bind_property (dialog->summary_entry,
- "text",
- dialog->titlebar,
- "title",
- G_BINDING_DEFAULT);
-
- /* bind all-day check button & time entries */
- g_object_bind_property (dialog->all_day_check,
- "active",
- dialog->start_time_selector,
- "sensitive",
- G_BINDING_DEFAULT | G_BINDING_INVERT_BOOLEAN);
- g_object_bind_property (dialog->all_day_check,
- "active",
- dialog->end_time_selector,
- "sensitive",
- G_BINDING_DEFAULT | G_BINDING_INVERT_BOOLEAN);
-
/* action area, buttons */
g_object_set_data (G_OBJECT (dialog->cancel_button),
"response",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]