description {
state, "wrong.pw" 0.0;
inherit, "default" 0.0;
- text.text, "Wrong Password";
+ text.text, "Enter Password";
+ color, 255 0 0 255;
+ visible, 1;
+ }
+ description {
+ state, "system.fail" 0.0;
+ inherit, "default" 0.0;
+ text.text, "System Failure";
color, 255 0 0 255;
visible, 1;
}
action, STATE_SET "default" 0.0;
target, "message.pw";
}
+ program {
+ name, "show,system,fail";
+ signal, SIG_SHOW_SYSTEM_FAIL;
+ source, SRC_PROG;
+ action, STATE_SET "system.fail" 0.0;
+ target, "message.pw";
+ }
}
}
inherit, "default" 0.0;
visible, 1;
}
- description{
+ description {
state, "wrong.pw" 0.0;
inherit, "default" 0.0;
- text.text, "Wrong Password";
+ text.text, "Enter Password";
+ color, 255 0 0 255;
+ visible, 1;
+ }
+ description {
+ state, "system.fail" 0.0;
+ inherit, "default" 0.0;
+ text.text, "System Failure";
color, 255 0 0 255;
visible, 1;
}
action, STATE_SET "default" 0.0;
target, "message.pw";
}
+ program {
+ name, "show,system,fail";
+ signal, SIG_SHOW_SYSTEM_FAIL;
+ source, SRC_PROG;
+ action, STATE_SET "system.fail" 0.0;
+ target, "message.pw";
+ }
}
}
description {
state, "wrong.pw" 0.0;
inherit, "default" 0.0;
- text.text, "Wrong Password";
+ text.text, "Enter Password";
+ color, 255 0 0 255;
+ visible, 1;
+ }
+ description {
+ state, "system.fail" 0.0;
+ inherit, "default" 0.0;
+ text.text, "System Failure";
color, 255 0 0 255;
visible, 1;
}
action, STATE_SET "wrong.pw" 0.0;
target, "message.pw";
}
+ program {
+ name, "show,system,fail";
+ signal, SIG_SHOW_SYSTEM_FAIL;
+ source, SRC_PROG;
+ action, STATE_SET "system.fail" 0.0;
+ target, "message.pw";
+ }
}
}
return popup;
}
-static void _show_wrong_password(struct _ubar_item *item)
+static void _show_message(struct _ubar_item *item, const char *signal)
{
Evas_Object *ly;
- if (!item) {
+ if (!item || !signal) {
_ERR("Invalid argument");
return;
}
return;
}
- elm_object_signal_emit(ly, SIG_SHOW_WRONG_PW, SRC_PROG);
+ elm_object_signal_emit(ly, signal, SRC_PROG);
}
static Eina_Bool _check_delete_user(struct _ubar_item *item)
password = elm_entry_entry_get(item->pw_entry);
if (!password || strlen(password) == 0) {
_ERR("wrong password");
- goto err;
+ _show_message(item, SIG_SHOW_WRONG_PW);
+ return EINA_FALSE;
}
if (!engine_ubar_item_delete(bar->eng, item->it, password)) {
_ERR("failed to delete user");
- goto err;
+ _show_message(item, SIG_SHOW_SYSTEM_FAIL);
+ return EINA_FALSE;
}
_destroy_popup(item);
_update_items(bar, bar->eng);
return EINA_TRUE;
-err:
- _show_wrong_password(item);
- return EINA_FALSE;
}
static void _popup_delete_clicked(void *data, Evas *e, Evas_Object *obj,
password = elm_entry_entry_get(item->pw_entry);
if (!password || strlen(password) == 0) {
_ERR("wrong password");
- goto err;
+ _show_message(item, SIG_SHOW_WRONG_PW);
+ return EINA_FALSE;
}
elm_image_file_get(cur->ic, &icon, NULL);
if (!engine_ubar_item_update(bar->eng, item->it, icon, password)) {
_ERR("failed to update user");
- goto err;
+ _show_message(item, SIG_SHOW_SYSTEM_FAIL);
+ return EINA_FALSE;
}
_destroy_popup(item);
_update_items(bar, bar->eng);
return EINA_TRUE;
-err:
- _show_wrong_password(item);
- return EINA_FALSE;
}
static void _popup_edit_clicked(void *data, Evas *e, Evas_Object *obj,
password = elm_entry_entry_get(item->pw_entry);
if (!password || strlen(password) == 0) {
_ERR("wrong password");
- goto err;
+ _show_message(item, SIG_SHOW_WRONG_PW);
+ return EINA_FALSE;
}
if (!engine_ubar_item_change_user(item->bar->eng, item->it, password)) {
- _ERR("failed to change user");
- goto err;
+ _ERR("failed to delete user");
+ _show_message(item, SIG_SHOW_SYSTEM_FAIL);
+ return EINA_FALSE;
}
item->pw_entry = NULL;
_destroy_popup(item);
return EINA_TRUE;
-err:
- _show_wrong_password(item);
- return EINA_FALSE;
}
static void _login_clicked(void *data, Evas *e, Evas_Object *obj, void *ei)
password = elm_entry_entry_get(item->pw_entry);
if (!password || strlen(password) == 0) {
_ERR("wrong password");
- goto err;
+ _show_message(item, SIG_SHOW_WRONG_PW);
+ return EINA_FALSE;
}
elm_image_file_get(cur->ic, &icon, NULL);
if (!engine_ubar_item_add(bar->eng, id, password, icon)) {
_ERR("failed to add user");
- goto err;
+ _show_message(item, SIG_SHOW_SYSTEM_FAIL);
+ return EINA_FALSE;
}
_destroy_popup(item);
_update_items(bar, bar->eng);
return EINA_TRUE;
-err:
- _show_wrong_password(item);
- return EINA_FALSE;
}
static Eina_Bool _check_popup_state(struct _ubar_item *item)