Skip to content
Snippets Groups Projects
Commit 2e15fa20 authored by Bruce Cowan's avatar Bruce Cowan
Browse files

Use GBinding

parent 66449ae4
No related branches found
No related tags found
No related merge requests found
...@@ -107,7 +107,6 @@ ...@@ -107,7 +107,6 @@
<object class="GtkSwitch" id="tryfilter"> <object class="GtkSwitch" id="tryfilter">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<signal name="notify::active" handler="tryfilter_active_cb" swapped="no"/>
</object> </object>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
...@@ -118,7 +117,6 @@ ...@@ -118,7 +117,6 @@
<object class="GtkSwitch" id="kickfilter"> <object class="GtkSwitch" id="kickfilter">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<signal name="notify::active" handler="kickfilter_active_cb" swapped="no"/>
</object> </object>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
......
...@@ -54,24 +54,6 @@ scorespin_value_changed_cb (GtkSpinButton *spin, ...@@ -54,24 +54,6 @@ scorespin_value_changed_cb (GtkSpinButton *spin,
gtk_range_set_range (GTK_RANGE (self->kickscale), 0.0, max_kicks); gtk_range_set_range (GTK_RANGE (self->kickscale), 0.0, max_kicks);
} }
static void
tryfilter_active_cb (GObject *gobject,
GParamSpec *pspec,
RugbyAppWindow *self)
{
gboolean active = gtk_switch_get_active (GTK_SWITCH (gobject));
gtk_widget_set_sensitive (self->tryscale, active);
}
static void
kickfilter_active_cb (GObject *gobject,
GParamSpec *pspec,
RugbyAppWindow *self)
{
gboolean active = gtk_switch_get_active (GTK_SWITCH (gobject));
gtk_widget_set_sensitive (self->kickscale, active);
}
static void static void
scale_value_changed_cb (GtkRange *range, scale_value_changed_cb (GtkRange *range,
RugbyAppWindow *self) RugbyAppWindow *self)
...@@ -132,6 +114,14 @@ rugby_app_window_init (RugbyAppWindow *self) ...@@ -132,6 +114,14 @@ rugby_app_window_init (RugbyAppWindow *self)
gtk_tree_model_filter_set_visible_func (GTK_TREE_MODEL_FILTER (self->filter), gtk_tree_model_filter_set_visible_func (GTK_TREE_MODEL_FILTER (self->filter),
filter_visible_func, self, NULL); filter_visible_func, self, NULL);
gtk_tree_view_set_model (GTK_TREE_VIEW (self->treeview), self->filter); gtk_tree_view_set_model (GTK_TREE_VIEW (self->treeview), self->filter);
g_object_bind_property (self->tryfilter, "active",
self->tryscale, "sensitive",
G_BINDING_DEFAULT);
g_object_bind_property (self->kickfilter, "active",
self->kickscale, "sensitive",
G_BINDING_DEFAULT);
} }
static void static void
...@@ -162,8 +152,6 @@ rugby_app_window_class_init (RugbyAppWindowClass *klass) ...@@ -162,8 +152,6 @@ rugby_app_window_class_init (RugbyAppWindowClass *klass)
gtk_widget_class_bind_template_child (widget_class, RugbyAppWindow, treeview); gtk_widget_class_bind_template_child (widget_class, RugbyAppWindow, treeview);
gtk_widget_class_bind_template_callback (widget_class, scorespin_value_changed_cb); gtk_widget_class_bind_template_callback (widget_class, scorespin_value_changed_cb);
gtk_widget_class_bind_template_callback (widget_class, tryfilter_active_cb);
gtk_widget_class_bind_template_callback (widget_class, kickfilter_active_cb);
gtk_widget_class_bind_template_callback (widget_class, scale_value_changed_cb); gtk_widget_class_bind_template_callback (widget_class, scale_value_changed_cb);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment