hook into entry activated callback so we can start sending text to

channels

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2014-12-19 14:01:35 -05:00
parent bb477ea448
commit 2c8ed6a5b0
1 changed files with 18 additions and 1 deletions

View File

@ -137,6 +137,23 @@ _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_go(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
{
Channel *chl;
char *txt;
chl = data;
if ((txt = (char *)elm_entry_entry_get(chl->o_entry)))
{
if ((txt = elm_entry_markup_to_utf8(txt)))
{
DBG("Send Text To Channel %s", chl->name);
DBG("\t%s", txt);
}
}
}
/* external functions */
Channel *
_channel_create(Evas *evas, const char *name, const char *server)
@ -513,7 +530,7 @@ _channel_window_set(Channel *chl, Evas_Object *win)
ELM_INPUT_PANEL_RETURN_KEY_TYPE_GO);
elm_entry_prediction_allow_set(chl->o_entry, EINA_FALSE);
/* TODO: callbacks */
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, "");