e/connman: trigger connecting animation
It should happens while state is association or configuration. SVN revision: 76059
This commit is contained in:
parent
35007e200a
commit
ac49b72e17
|
@ -7955,18 +7955,30 @@ CONNMAN_ICON(ethernet)
|
||||||
|
|
||||||
script {
|
script {
|
||||||
public message(Msg_Type:type, id, ...) {
|
public message(Msg_Type:type, id, ...) {
|
||||||
if ((type == MSG_INT) && (id == MSG_ID_STRENGHT)) {
|
if ((type == MSG_INT_SET) && (id == MSG_ID_STRENGHT)) {
|
||||||
new Float:st = getarg(2);
|
new state = getarg(2);
|
||||||
|
new Float:str = getarg(3);
|
||||||
new buf[8];
|
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),
|
snprintf(buf, sizeof(buf), "%i%%", str);
|
||||||
"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);
|
|
||||||
set_text(PART:"e.text.strenght", buf);
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,23 +31,21 @@ static Evas_Object * _econnman_service_new_icon(struct Connman_Service *cs,
|
||||||
Evas *evas)
|
Evas *evas)
|
||||||
{
|
{
|
||||||
const char *type = econnman_service_type_to_str(cs->type);
|
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;
|
Evas_Object *icon;
|
||||||
Edje_Message_Int msg;
|
|
||||||
char buf[128];
|
char buf[128];
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "e/modules/connman/icon/%s", type);
|
snprintf(buf, sizeof(buf), "e/modules/connman/icon/%s", type);
|
||||||
icon = edje_object_add(evas);
|
icon = edje_object_add(evas);
|
||||||
e_theme_edje_object_set(icon, "base/theme/modules/connman", buf);
|
e_theme_edje_object_set(icon, "base/theme/modules/connman", buf);
|
||||||
|
|
||||||
if (state)
|
msg = malloc(sizeof(*msg) + sizeof(int));
|
||||||
{
|
msg->count = 2;
|
||||||
snprintf(buf, sizeof(buf), "e,state,%s", state);
|
msg->val[0] = cs->state;
|
||||||
edje_object_signal_emit(icon, buf, "e");
|
msg->val[1] = cs->strength;
|
||||||
}
|
|
||||||
|
|
||||||
msg.val = cs->strength;
|
edje_object_message_send(icon, EDJE_MESSAGE_INT_SET, 1, msg);
|
||||||
edje_object_message_send(icon, EDJE_MESSAGE_INT, 1, &msg);
|
free(msg);
|
||||||
|
|
||||||
return icon;
|
return icon;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue