Create _connman_service_new_list_item()

In order to be able to share item creation with config dialog.



SVN revision: 45810
This commit is contained in:
Gustavo Sverzut Barbieri 2010-02-02 17:31:52 +00:00
parent 0f1322c04b
commit 0384befb49
1 changed files with 48 additions and 38 deletions

View File

@ -917,34 +917,12 @@ _connman_popup_service_selected(void *data)
_connman_service_connect(service);
}
static void
_connman_popup_update(E_Connman_Instance *inst)
Evas_Object *
_connman_service_new_list_item(Evas *evas, E_Connman_Service *service)
{
Evas_Object *list = inst->ui.list;
E_Connman_Service *service;
const char *default_path;
Evas *evas = evas_object_evas_get(list);
int i, selected;
char buf[128];
default_path = inst->ctxt->default_service ?
inst->ctxt->default_service->path : NULL;
/* TODO: replace this with a scroller + list of edje
* objects that are more full of features
*/
e_widget_ilist_freeze(list);
e_widget_ilist_clear(list);
i = 0;
selected = -1;
EINA_INLIST_FOREACH(inst->ctxt->services, service)
{
Evas_Object *icon;
Edje_Message_Int msg;
if (service->path == default_path)
selected = i;
i++;
char buf[128];
snprintf(buf, sizeof(buf), "e/modules/connman/icon/%s", service->type);
icon = edje_object_add(evas);
@ -983,6 +961,38 @@ _connman_popup_update(E_Connman_Instance *inst)
msg.val = service->strength;
edje_object_message_send(icon, EDJE_MESSAGE_INT, 1, &msg);
return icon;
}
static void
_connman_popup_update(E_Connman_Instance *inst)
{
Evas_Object *list = inst->ui.list;
E_Connman_Service *service;
const char *default_path;
Evas *evas = evas_object_evas_get(list);
int i, selected;
default_path = inst->ctxt->default_service ?
inst->ctxt->default_service->path : NULL;
/* TODO: replace this with a scroller + list of edje
* objects that are more full of features
*/
e_widget_ilist_freeze(list);
e_widget_ilist_clear(list);
i = 0;
selected = -1;
EINA_INLIST_FOREACH(inst->ctxt->services, service)
{
Evas_Object *icon;
if (service->path == default_path)
selected = i;
i++;
icon = _connman_service_new_list_item(evas, service);
e_widget_ilist_append
(list, icon, service->name, _connman_popup_service_selected,
inst, service->path);