From 4ca49cebcd8cb8ed64fd8e2f4c0f9dd8f4db6f01 Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Wed, 11 Feb 2015 15:55:47 -0500 Subject: [PATCH] hook into entry changed signal so we can start work on nickname completion Signed-off-by: Chris Michael --- src/bin/channel.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/bin/channel.c b/src/bin/channel.c index 1e2f0bf..fd642bb 100644 --- a/src/bin/channel.c +++ b/src/bin/channel.c @@ -29,6 +29,7 @@ struct _Channel Evas_Object *o_list; Evas_Object *o_dismiss; Eina_Bool visible : 1; + Eina_List *users; } userlist; struct @@ -221,6 +222,14 @@ _cb_options(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED) _window_options_toggle(chl->o_grid, _cb_options_done, chl); } +static void +_cb_entry_changed(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED) +{ + Channel *chl; + + chl = data; +} + static void _cb_entry_go(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED) { @@ -758,7 +767,10 @@ _channel_window_set(Channel *chl, Evas_Object *win) ELM_INPUT_PANEL_RETURN_KEY_TYPE_GO); elm_entry_prediction_allow_set(chl->o_entry, EINA_TRUE); - evas_object_smart_callback_add(chl->o_entry, "activated", _cb_entry_go, chl); + evas_object_smart_callback_add(chl->o_entry, "changed,user", + _cb_entry_changed, chl); + evas_object_smart_callback_add(chl->o_entry, "activated", + _cb_entry_go, chl); edje_object_part_swallow(chl->o_base, "channel.entry", chl->o_entry); elm_entry_entry_set(chl->o_entry, ""); @@ -774,6 +786,9 @@ _channel_network_set(Channel *chl, Express_Network *net) void _channel_userlist_user_append(Channel *chl, const char *user, Eina_Bool op) { + /* append to list of users for autocomplete */ + chl->userlist.users = eina_list_append(chl->userlist.users, user); + if (!op) elm_list_item_sorted_insert(chl->userlist.o_list, user, NULL, NULL, NULL, NULL, _cb_userlist_compare);