Skip to content
Snippets Groups Projects
Commit 9e78fcdb authored by Alexandre Savard's avatar Alexandre Savard
Browse files

[#3850] Make addressbook queries only when hitting enter

parent c1322e80
No related branches found
No related tags found
No related merge requests found
......@@ -53,27 +53,8 @@ addressbook_search (GtkEntry* entry)
addressbook_config_load_parameters (&addressbook_config);
// search_by_contacts(gtk_entry_get_text(GTK_ENTRY(entry)), addressbook_config->max_results, &handler_async_search, addressbook_config);
search_async_by_contacts (gtk_entry_get_text (GTK_ENTRY (entry)), addressbook_config->max_results, &handler_async_search, addressbook_config);
// addressbook_config_books
/*
if (strlen(query) >= 3) {
AddressBook_Config *addressbook_config;
// Activate waiting layer
activateWaitingLayer();
// Load the address book parameters
addressbook_config_load_parameters(&addressbook_config);
// Start the asynchronous search as soon as we have an entry
search_async(gtk_entry_get_text(GTK_ENTRY (entry)), addressbook_config->max_results, &handler_async_search, addressbook_config);
}
*/
}
......
......@@ -46,12 +46,21 @@ GdkPixbuf *incoming_pixbuf = NULL;
GdkPixbuf *outgoing_pixbuf = NULL;
GdkPixbuf *missed_pixbuf = NULL;
void searchbar_addressbook_activated (GtkEntry *entry, gchar *arg1 UNUSED, gpointer data UNUSED)
{
DEBUG ("Searchbar: Entry activated");
addressbook_search (entry);
}
void searchbar_entry_changed (GtkEntry* entry, gchar* arg1 UNUSED, gpointer data UNUSED)
{
DEBUG ("searchbar_entry_changed");
DEBUG ("Searchbar: Entry changed");
if (active_calltree == contacts) {
addressbook_search (entry);
// Search made only when text entry is activated
// addressbook_search (entry);
} else if (active_calltree == history) {
history_search (HistorySearchType);
}
......@@ -304,6 +313,9 @@ GtkWidget* contacts_searchbar_new ()
sexy_icon_entry_add_clear_button (SEXY_ICON_ENTRY (searchbox));
#endif
gtk_entry_set_activates_default (GTK_ENTRY (searchbox), TRUE);
g_signal_connect_after (GTK_ENTRY (searchbox), "activate", G_CALLBACK (searchbar_addressbook_activated), NULL);
g_signal_connect_after (GTK_ENTRY (searchbox), "changed", G_CALLBACK (searchbar_entry_changed), NULL);
g_signal_connect_after (G_OBJECT (searchbox), "focus-in-event",
......@@ -311,6 +323,7 @@ GtkWidget* contacts_searchbar_new ()
g_signal_connect_after (G_OBJECT (searchbox), "focus-out-event",
G_CALLBACK (focus_on_searchbar_out), NULL);
gtk_box_pack_start (GTK_BOX (ret), searchbox, TRUE, TRUE, 0);
return ret;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment