mirror of
https://gitlab.gnome.org/GNOME/calls.git
synced 2024-11-15 12:55:36 +00:00
record-row: hide copy number menu item
for anonymous callers
This commit is contained in:
parent
78a47918be
commit
9f295a729b
2 changed files with 9 additions and 9 deletions
|
@ -330,6 +330,12 @@ static void
|
|||
contact_name_cb (CallsCallRecordRow *self)
|
||||
{
|
||||
const gchar *name = NULL;
|
||||
g_autofree gchar *target = NULL;
|
||||
GAction *act = g_action_map_lookup_action (self->action_map, "copy-number");
|
||||
|
||||
g_object_get (G_OBJECT (self->record),
|
||||
"target", &target,
|
||||
NULL);
|
||||
|
||||
if (self->contact)
|
||||
{
|
||||
|
@ -342,21 +348,17 @@ contact_name_cb (CallsCallRecordRow *self)
|
|||
}
|
||||
else
|
||||
{
|
||||
g_autofree gchar *target = NULL;
|
||||
|
||||
g_object_get (G_OBJECT (self->record),
|
||||
"target", &target,
|
||||
NULL);
|
||||
|
||||
if (!g_strcmp0 (target, ""))
|
||||
{
|
||||
gtk_label_set_text (self->target, ANONYMOUS_CALLER);
|
||||
gtk_actionable_set_action_name (GTK_ACTIONABLE (self->button), NULL);
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION (act), FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_label_set_text (self->target, target);
|
||||
gtk_actionable_set_action_name (GTK_ACTIONABLE (self->button), "app.dial");
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION (act), TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -648,9 +650,6 @@ calls_call_record_row_init (CallsCallRecordRow *self)
|
|||
act = g_action_map_lookup_action (self->action_map, "delete-call");
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION (act), TRUE);
|
||||
|
||||
act = g_action_map_lookup_action (self->action_map, "copy-number");
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION (act), TRUE);
|
||||
|
||||
self->gesture = gtk_gesture_long_press_new (GTK_WIDGET (self->event_box));
|
||||
gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (self->gesture), TRUE);
|
||||
g_signal_connect (self->gesture, "pressed", G_CALLBACK (long_pressed), self);
|
||||
|
|
|
@ -116,6 +116,7 @@
|
|||
<!-- Translators: This is a phone number -->
|
||||
<attribute name="label" translatable="yes">_Copy number</attribute>
|
||||
<attribute name="action">copy-number</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</menu>
|
||||
|
|
Loading…
Reference in a new issue