e/connman: trigger connecting animation

It should happens while state is association or configuration.



SVN revision: 76059
This commit is contained in:
Bruno Dilly 2012-09-03 22:01:30 +00:00
parent 35007e200a
commit ac49b72e17
2 changed files with 29 additions and 19 deletions

View File

@ -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);
}
}
}

View File

@ -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;
}