Commit 78cd14d6 authored by Mohammed Sadiq's avatar Mohammed Sadiq Committed by Mohammed Sadiq
Browse files

new-chat-dialog: Improve 'Add in contacts' workflow

The user was never informed about what's happening when the
user clicks "Add in contacts" button for SMS accounts.

Show a spinner and wait until the contact app is opened
before the view is switched

Fixes #228
parent 5081b97b
Pipeline #70839 passed with stages
in 10 minutes and 51 seconds
......@@ -197,6 +197,8 @@ open_contacts_finish_cb (GObject *object,
g_assert (CHATTY_IS_EDS (chatty_eds));
chatty_eds_open_contacts_app_finish (chatty_eds, result, &error);
gtk_widget_set_sensitive (self->add_in_contacts_button, TRUE);
gtk_stack_set_visible_child_name (GTK_STACK (self->new_chat_stack), "view-new-chat");
if (!error)
return;
......@@ -219,11 +221,10 @@ add_in_contacts_button_clicked_cb (ChattyNewChatDialog *self)
g_assert (CHATTY_IS_NEW_CHAT_DIALOG (self));
chatty_eds = chatty_manager_get_eds (self->manager);
gtk_widget_set_sensitive (self->add_in_contacts_button, FALSE);
chatty_eds_open_contacts_app (chatty_eds,
self->cancellable,
open_contacts_finish_cb, self);
gtk_stack_set_visible_child_name (GTK_STACK (self->new_chat_stack), "view-new-chat");
}
......
......@@ -92,6 +92,16 @@
<property name="pack_type">end</property>
</packing>
</child>
<child>
<object class="GtkSpinner" id="open_contact_spinner">
<property name="margin-end">6</property>
<property name="visible" bind-source="add_contact_button" bind-property="visible" bind-flags="invert-boolean"/>
<property name="active" bind-source="add_in_contacts_button" bind-property="sensitive" bind-flags="invert-boolean"/>
</object>
<packing>
<property name="pack_type">end</property>
</packing>
</child>
</object>
<packing>
<property name="name">view-new-contact</property>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment