mirror of
https://gitlab.gnome.org/GNOME/calls.git
synced 2025-01-07 12:25:31 +00:00
Merge branch 'sadiq-review-fixes' into 'master'
Sadiq review fixes Closes #20, #19, and #18 See merge request Librem5/calls!29
This commit is contained in:
commit
cc0c0744ec
3 changed files with 26 additions and 25 deletions
|
@ -97,8 +97,11 @@ set_call (CallsCallHolder *self, CallsCall *call)
|
||||||
g_object_unref (party);
|
g_object_unref (party);
|
||||||
|
|
||||||
self->display = calls_call_display_new (self->data);
|
self->display = calls_call_display_new (self->data);
|
||||||
|
g_object_ref_sink (self->display);
|
||||||
|
|
||||||
self->selector_item =
|
self->selector_item =
|
||||||
calls_call_selector_item_new (self);
|
calls_call_selector_item_new (self);
|
||||||
|
g_object_ref_sink (self->selector_item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -134,10 +137,17 @@ dispose (GObject *object)
|
||||||
GObjectClass *parent_class = g_type_class_peek (G_TYPE_OBJECT);
|
GObjectClass *parent_class = g_type_class_peek (G_TYPE_OBJECT);
|
||||||
CallsCallHolder *self = CALLS_CALL_HOLDER (object);
|
CallsCallHolder *self = CALLS_CALL_HOLDER (object);
|
||||||
|
|
||||||
g_clear_object (&self->selector_item);
|
// Mutual reference
|
||||||
|
if (self->selector_item)
|
||||||
|
{
|
||||||
|
GObject *selector_item = G_OBJECT (self->selector_item);
|
||||||
|
self->selector_item = NULL;
|
||||||
|
g_object_unref (selector_item);
|
||||||
|
}
|
||||||
|
|
||||||
g_clear_object (&self->display);
|
g_clear_object (&self->display);
|
||||||
g_clear_object (&self->data);
|
g_clear_object (&self->data);
|
||||||
|
|
||||||
parent_class->dispose (object);
|
parent_class->dispose (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -191,7 +191,13 @@ dispose (GObject *object)
|
||||||
GObjectClass *parent_class = g_type_class_peek (GTK_TYPE_EVENT_BOX);
|
GObjectClass *parent_class = g_type_class_peek (GTK_TYPE_EVENT_BOX);
|
||||||
CallsCallSelectorItem *self = CALLS_CALL_SELECTOR_ITEM (object);
|
CallsCallSelectorItem *self = CALLS_CALL_SELECTOR_ITEM (object);
|
||||||
|
|
||||||
g_clear_object (&self->holder);
|
// Mutual reference
|
||||||
|
if (self->holder)
|
||||||
|
{
|
||||||
|
GObject *holder = G_OBJECT (self->holder);
|
||||||
|
self->holder = NULL;
|
||||||
|
g_object_unref (holder);
|
||||||
|
}
|
||||||
|
|
||||||
parent_class->dispose (object);
|
parent_class->dispose (object);
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,6 @@ struct _CallsCallWindow
|
||||||
GtkApplicationWindow parent_instance;
|
GtkApplicationWindow parent_instance;
|
||||||
|
|
||||||
GListStore *call_holders;
|
GListStore *call_holders;
|
||||||
CallsCallHolder *focus;
|
|
||||||
|
|
||||||
GtkInfoBar *info;
|
GtkInfoBar *info;
|
||||||
GtkLabel *info_label;
|
GtkLabel *info_label;
|
||||||
|
@ -111,7 +110,10 @@ static GtkWidget *
|
||||||
call_holders_create_widget_cb (CallsCallHolder *holder,
|
call_holders_create_widget_cb (CallsCallHolder *holder,
|
||||||
CallsCallWindow *self)
|
CallsCallWindow *self)
|
||||||
{
|
{
|
||||||
return GTK_WIDGET (calls_call_holder_get_selector_item (holder));
|
CallsCallSelectorItem *item =
|
||||||
|
calls_call_holder_get_selector_item (holder);
|
||||||
|
g_object_ref (G_OBJECT (item));
|
||||||
|
return GTK_WIDGET (item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -160,6 +162,7 @@ find_call_holder (CallsCallWindow *self,
|
||||||
for (position = 0; position < n_items; ++position)
|
for (position = 0; position < n_items; ++position)
|
||||||
{
|
{
|
||||||
holder = CALLS_CALL_HOLDER (g_list_model_get_item (model, position));
|
holder = CALLS_CALL_HOLDER (g_list_model_get_item (model, position));
|
||||||
|
g_object_unref (G_OBJECT (holder));
|
||||||
|
|
||||||
if (predicate (holder, user_data))
|
if (predicate (holder, user_data))
|
||||||
{
|
{
|
||||||
|
@ -187,20 +190,6 @@ static void
|
||||||
set_focus (CallsCallWindow *self,
|
set_focus (CallsCallWindow *self,
|
||||||
CallsCallHolder *holder)
|
CallsCallHolder *holder)
|
||||||
{
|
{
|
||||||
if (!holder)
|
|
||||||
{
|
|
||||||
holder = g_list_model_get_item (G_LIST_MODEL (self->call_holders), 0);
|
|
||||||
|
|
||||||
if (!holder)
|
|
||||||
{
|
|
||||||
/* No calls */
|
|
||||||
self->focus = NULL;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
self->focus = holder;
|
|
||||||
|
|
||||||
gtk_stack_set_visible_child_name (self->main_stack, "active-call");
|
gtk_stack_set_visible_child_name (self->main_stack, "active-call");
|
||||||
gtk_stack_set_visible_child_name (self->header_bar_stack, "active-call");
|
gtk_stack_set_visible_child_name (self->header_bar_stack, "active-call");
|
||||||
gtk_stack_set_visible_child
|
gtk_stack_set_visible_child
|
||||||
|
@ -228,7 +217,6 @@ call_selector_child_activated_cb (GtkFlowBox *box,
|
||||||
CallsCallSelectorItem *item = CALLS_CALL_SELECTOR_ITEM (widget);
|
CallsCallSelectorItem *item = CALLS_CALL_SELECTOR_ITEM (widget);
|
||||||
CallsCallHolder *holder = calls_call_selector_item_get_holder (item);
|
CallsCallHolder *holder = calls_call_selector_item_get_holder (item);
|
||||||
|
|
||||||
update_visibility (self);
|
|
||||||
set_focus (self, holder);
|
set_focus (self, holder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -253,6 +241,7 @@ add_call (CallsCallWindow *self,
|
||||||
calls_call_get_number (call));
|
calls_call_get_number (call));
|
||||||
|
|
||||||
g_list_store_append (self->call_holders, holder);
|
g_list_store_append (self->call_holders, holder);
|
||||||
|
g_object_unref (holder);
|
||||||
|
|
||||||
update_visibility (self);
|
update_visibility (self);
|
||||||
set_focus (self, holder);
|
set_focus (self, holder);
|
||||||
|
@ -265,15 +254,11 @@ remove_call_holder (CallsCallWindow *self,
|
||||||
guint position,
|
guint position,
|
||||||
CallsCallHolder *holder)
|
CallsCallHolder *holder)
|
||||||
{
|
{
|
||||||
g_list_store_remove (self->call_holders, position);
|
|
||||||
gtk_container_remove (GTK_CONTAINER (self->call_stack),
|
gtk_container_remove (GTK_CONTAINER (self->call_stack),
|
||||||
GTK_WIDGET (calls_call_holder_get_display (holder)));
|
GTK_WIDGET (calls_call_holder_get_display (holder)));
|
||||||
|
g_list_store_remove (self->call_holders, position);
|
||||||
|
|
||||||
update_visibility (self);
|
update_visibility (self);
|
||||||
if (self->focus == holder)
|
|
||||||
{
|
|
||||||
set_focus (self, NULL);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in a new issue