From ac49b72e17cc314e59f0c41279e68914a4b158fd Mon Sep 17 00:00:00 2001 From: Bruno Dilly Date: Mon, 3 Sep 2012 22:01:30 +0000 Subject: [PATCH] e/connman: trigger connecting animation It should happens while state is association or configuration. SVN revision: 76059 --- data/themes/default.edc | 32 ++++++++++++++++++++++---------- src/modules/connman/e_mod_main.c | 16 +++++++--------- 2 files changed, 29 insertions(+), 19 deletions(-) diff --git a/data/themes/default.edc b/data/themes/default.edc index 692c8e251..401848dff 100644 --- a/data/themes/default.edc +++ b/data/themes/default.edc @@ -7955,18 +7955,30 @@ CONNMAN_ICON(ethernet) script { public message(Msg_Type:type, id, ...) { - if ((type == MSG_INT) && (id == MSG_ID_STRENGHT)) { - new Float:st = getarg(2); + if ((type == MSG_INT_SET) && (id == MSG_ID_STRENGHT)) { + new state = getarg(2); + new Float:str = getarg(3); new buf[8]; - set_state(PART:"bar_0_on", "visible", 0.0); - set_tween_state(PART:"bar_1_on", (st - (100/3) * 0) / (100/3), - "default", 0.0, "visible", 0.0); - set_tween_state(PART:"bar_2_on", (st - (100/3) * 1) / (100/3), - "default", 0.0, "visible", 0.0); - set_tween_state(PART:"bar_3_on", (st - (100/3) * 2) / (100/3), - "default", 0.0, "visible", 0.0); - snprintf(buf, sizeof(buf), "%i%%", st); + + snprintf(buf, sizeof(buf), "%i%%", str); set_text(PART:"e.text.strenght", buf); + + /* Connecting if in association or configuration */ + if ((state == 2)) + { + run_program(PROGRAM:"connecting"); + return; + } + if ((state == 3)) + return; + + set_state(PART:"bar_0_on", "visible", 0.0); + set_tween_state(PART:"bar_1_on", (str - (100/3) * 0) / (100/3), + "default", 0.0, "visible", 0.0); + set_tween_state(PART:"bar_2_on", (str - (100/3) * 1) / (100/3), + "default", 0.0, "visible", 0.0); + set_tween_state(PART:"bar_3_on", (str - (100/3) * 2) / (100/3), + "default", 0.0, "visible", 0.0); } } } diff --git a/src/modules/connman/e_mod_main.c b/src/modules/connman/e_mod_main.c index 342c8504e..f4049142f 100644 --- a/src/modules/connman/e_mod_main.c +++ b/src/modules/connman/e_mod_main.c @@ -31,23 +31,21 @@ static Evas_Object * _econnman_service_new_icon(struct Connman_Service *cs, Evas *evas) { const char *type = econnman_service_type_to_str(cs->type); - const char *state = econnman_state_to_str(cs->state); + Edje_Message_Int_Set *msg; Evas_Object *icon; - Edje_Message_Int msg; char buf[128]; snprintf(buf, sizeof(buf), "e/modules/connman/icon/%s", type); icon = edje_object_add(evas); e_theme_edje_object_set(icon, "base/theme/modules/connman", buf); - if (state) - { - snprintf(buf, sizeof(buf), "e,state,%s", state); - edje_object_signal_emit(icon, buf, "e"); - } + msg = malloc(sizeof(*msg) + sizeof(int)); + msg->count = 2; + msg->val[0] = cs->state; + msg->val[1] = cs->strength; - msg.val = cs->strength; - edje_object_message_send(icon, EDJE_MESSAGE_INT, 1, &msg); + edje_object_message_send(icon, EDJE_MESSAGE_INT_SET, 1, msg); + free(msg); return icon; }