CallHistory: Use dial action for recall button
This commit is contained in:
committed by
Julian Sparber
parent
19632e428b
commit
62a327a0ae
@@ -45,6 +45,7 @@ struct _CallsCallRecordRow
|
|||||||
GtkImage *type;
|
GtkImage *type;
|
||||||
GtkLabel *target;
|
GtkLabel *target;
|
||||||
GtkLabel *time;
|
GtkLabel *time;
|
||||||
|
GtkButton *button;
|
||||||
|
|
||||||
CallsCallRecord *record;
|
CallsCallRecord *record;
|
||||||
gulong answered_notify_handler_id;
|
gulong answered_notify_handler_id;
|
||||||
@@ -70,18 +71,16 @@ enum {
|
|||||||
static GParamSpec *props[PROP_LAST_PROP];
|
static GParamSpec *props[PROP_LAST_PROP];
|
||||||
|
|
||||||
|
|
||||||
static void
|
static gboolean
|
||||||
redial_clicked_cb (CallsCallRecordRow *self)
|
string_to_variant (GBinding *binding,
|
||||||
|
const GValue *from_value,
|
||||||
|
GValue *to_value)
|
||||||
{
|
{
|
||||||
gchar *target;
|
const gchar *target = g_value_get_string (from_value);
|
||||||
|
GVariant *variant = g_variant_new_string (target);
|
||||||
|
|
||||||
g_object_get (self->record,
|
g_value_take_variant (to_value, variant);
|
||||||
"target", &target,
|
return TRUE;
|
||||||
NULL);
|
|
||||||
g_assert (target != NULL);
|
|
||||||
|
|
||||||
calls_new_call_box_dial (self->new_call, target);
|
|
||||||
g_free (target);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -488,6 +487,16 @@ constructed (GObject *object)
|
|||||||
"end", &end,
|
"end", &end,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
g_object_bind_property_full (self->record,
|
||||||
|
"target",
|
||||||
|
self->button,
|
||||||
|
"action-target",
|
||||||
|
G_BINDING_SYNC_CREATE,
|
||||||
|
(GBindingTransformFunc) string_to_variant,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL);
|
||||||
|
|
||||||
setup_time (self, inbound, answered, end);
|
setup_time (self, inbound, answered, end);
|
||||||
calls_date_time_unref (answered);
|
calls_date_time_unref (answered);
|
||||||
calls_date_time_unref (end);
|
calls_date_time_unref (end);
|
||||||
@@ -579,7 +588,7 @@ calls_call_record_row_class_init (CallsCallRecordRowClass *klass)
|
|||||||
gtk_widget_class_bind_template_child (widget_class, CallsCallRecordRow, type);
|
gtk_widget_class_bind_template_child (widget_class, CallsCallRecordRow, type);
|
||||||
gtk_widget_class_bind_template_child (widget_class, CallsCallRecordRow, target);
|
gtk_widget_class_bind_template_child (widget_class, CallsCallRecordRow, target);
|
||||||
gtk_widget_class_bind_template_child (widget_class, CallsCallRecordRow, time);
|
gtk_widget_class_bind_template_child (widget_class, CallsCallRecordRow, time);
|
||||||
gtk_widget_class_bind_template_callback (widget_class, redial_clicked_cb);
|
gtk_widget_class_bind_template_child (widget_class, CallsCallRecordRow, button);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,7 @@
|
|||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkButton" id="redial">
|
<object class="GtkButton" id="button">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="margin_left">12</property>
|
<property name="margin_left">12</property>
|
||||||
<property name="margin_right">8</property>
|
<property name="margin_right">8</property>
|
||||||
@@ -55,7 +55,7 @@
|
|||||||
<property name="margin_bottom">8</property>
|
<property name="margin_bottom">8</property>
|
||||||
<property name="halign">center</property>
|
<property name="halign">center</property>
|
||||||
<property name="valign">center</property>
|
<property name="valign">center</property>
|
||||||
<signal name="clicked" handler="redial_clicked_cb" swapped="yes"/>
|
<property name="action-name">app.dial</property>
|
||||||
<style>
|
<style>
|
||||||
<class name="image-button"/>
|
<class name="image-button"/>
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user