return FALSE;
}
+static void
+hide_check_names_banner (GtkWidget **banner, guint banner_timeout)
+{
+ g_source_remove (banner_timeout);
+ if (*banner != NULL) {
+ gtk_widget_destroy (*banner);
+ *banner = NULL;
+ } else {
+ g_source_remove (banner_timeout);
+ }
+
+}
+
gboolean
modest_address_book_check_names (ModestRecptEditor *recpt_editor, gboolean update_addressbook)
{
gint offset_delta = 0;
gint last_length;
GtkTextIter start_iter, end_iter;
- guint banner_timeout;
- GtkWidget *banner = NULL;
g_return_val_if_fail (MODEST_IS_RECPT_EDITOR (recpt_editor), FALSE);
}
}
- banner_timeout = g_timeout_add (500, show_check_names_banner, &banner);
-
current_start = start_indexes;
current_end = end_indexes;
buffer = modest_recpt_editor_get_buffer (recpt_editor);
/* here goes searching in addressbook */
gchar *contact_id = NULL;
GSList *resolved_addresses = NULL;
+
result = resolve_address (address, &resolved_addresses, &contact_id);
if (result) {
g_slist_free (start_indexes);
g_slist_free (end_indexes);
- g_source_remove (banner_timeout);
- if (banner != NULL) {
- gtk_widget_destroy (banner);
- banner = NULL;
- } else {
- g_source_remove (banner_timeout);
- }
-
return result;
}
resolve_address (const gchar *address, GSList **resolved_addresses, gchar **contact_id)
{
GList *resolved_contacts;
+ guint banner_timeout;
+ GtkWidget *banner = NULL;
+
+ banner_timeout = g_timeout_add (500, show_check_names_banner, &banner);
contact_model = osso_abook_contact_model_new ();
if (!open_addressbook_sync ()) {
if (resolved_contacts == NULL) {
/* no matching contacts for the search string */
modest_platform_run_information_dialog (NULL, _("mcen_nc_no_matching_contacts"), FALSE);
+ hide_check_names_banner (&banner, banner_timeout);
+
return FALSE;
}
/* show a dialog to select the contact from the resolved ones */
g_list_free (resolved_contacts);
+ hide_check_names_banner (&banner, banner_timeout);
resolved_contacts = select_contacts_for_name_dialog (address);
+ banner_timeout = g_timeout_add (500, show_check_names_banner, &banner);
+
}
/* get the resolved contacts (can be no contact) */
EContact *contact = (EContact *) resolved_contacts->data;
*resolved_addresses = get_recipients_for_given_contact (contact);
+ hide_check_names_banner (&banner, banner_timeout);
if (*resolved_addresses) {
*contact_id = g_strdup (e_contact_get_const (contact, E_CONTACT_UID));
found = TRUE;
} else {
/* cancelled dialog to select more than one contact or
* selected no contact */
+ hide_check_names_banner (&banner, banner_timeout);
return FALSE;
}