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];
+
+ 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", (st - (100/3) * 0) / (100/3),
+ 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", (st - (100/3) * 1) / (100/3),
+ 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", (st - (100/3) * 2) / (100/3),
+ set_tween_state(PART:"bar_3_on", (str - (100/3) * 2) / (100/3),
"default", 0.0, "visible", 0.0);
- snprintf(buf, sizeof(buf), "%i%%", st);
- set_text(PART:"e.text.strenght", buf);
}
}
}
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;
}