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.
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user