#define MAX_WEP_PASSWORD_LENGTH 13
#define MAX_WEP_DIGIT_PASSWORD_LENGTH 26
#define MAX_POPUP_TEXT_LENGTH 1024
+#define MAX_SUB_TEXT_LENGTH 100
typedef struct {
// network module
} else if (!g_strcmp0(part, "elm.text.1")) {
app_object *app_obj = data;
wifi_connection_state_e conn_state;
+ char status_text[MAX_SUB_TEXT_LENGTH] = {0, };
+ char *text_color = "<font color=#4DCFFFC9>%s</font>";
+
if (!app_obj) {
WIFI_LOG_ERR("app object is NULL");
return NULL;
conn_state = wifi_manager_ap_get_connection_state(app_obj->selected_wifi_ap);
switch (conn_state) {
case WIFI_CONNECTION_STATE_CONNECTED:
- return g_strdup(STR_CONNECTED);
+ snprintf(status_text, MAX_SUB_TEXT_LENGTH, text_color, STR_CONNECTED);
+ break;
case WIFI_CONNECTION_STATE_DISCONNECTED:
case WIFI_CONNECTION_STATE_FAILURE:
WIFI_LOG_ERR("ap connection state is failure");
- return g_strdup(STR_DISCONNECTED);
+ snprintf(status_text, MAX_SUB_TEXT_LENGTH, text_color, STR_DISCONNECTED);
+ break;
case WIFI_CONNECTION_STATE_ASSOCIATION:
WIFI_LOG_ERR("ap connection state is disconnected");
- return g_strdup(STR_DISCONNECTED);
+ snprintf(status_text, MAX_SUB_TEXT_LENGTH, text_color, STR_DISCONNECTED);
+ break;
case WIFI_CONNECTION_STATE_CONFIGURATION:
WIFI_LOG_ERR("ap connection state is configuration");
- return g_strdup(STR_DISCONNECTED);
+ snprintf(status_text, MAX_SUB_TEXT_LENGTH, text_color, STR_DISCONNECTED);
+ break;
default:
WIFI_LOG_ERR("ap connection state error");
- return g_strdup(STR_DISCONNECTED);
+ snprintf(status_text, MAX_SUB_TEXT_LENGTH, text_color, STR_DISCONNECTED);
+ break;
}
+ return g_strdup(status_text);
}
return NULL;
}
app_object *app_obj = evas_object_data_get(obj,
LAYOUT_SCAN_DATA_KEY_WIFI_AP_ITEM_SELECT);
wifi_connection_state_e state;
+ char status_text[MAX_SUB_TEXT_LENGTH] = {0, };
+ char *text_color = "<font color=#4DCFFFC9>%s</font>";
WIFI_RET_VAL_IF_FAIL(app_obj != NULL, NULL);
switch (state) {
case WIFI_CONNECTION_STATE_CONNECTED:
- return g_strdup(STR_CONNECTED);
+ snprintf(status_text, MAX_SUB_TEXT_LENGTH, text_color, STR_CONNECTED);
+ break;
case WIFI_CONNECTION_STATE_CONFIGURATION:
- return g_strdup(STR_OBTAINING_IP);
+ snprintf(status_text, MAX_SUB_TEXT_LENGTH, text_color, STR_OBTAINING_IP);
+ break;
case WIFI_CONNECTION_STATE_ASSOCIATION:
- return g_strdup(STR_CONNECTING);
+ snprintf(status_text, MAX_SUB_TEXT_LENGTH, text_color, STR_CONNECTING);
+ break;
case WIFI_CONNECTION_STATE_FAILURE:
case WIFI_CONNECTION_STATE_DISCONNECTED:
default:
if (wifi_manager_ap_is_captiveportal(app_obj->wifi_manager, ap_obj))
- return g_strdup(STR_NOT_SUPPORTED);
+ snprintf(status_text, MAX_SUB_TEXT_LENGTH, text_color, STR_NOT_SUPPORTED);
wifi_error_e connection_error = wifi_manager_ap_get_last_connection_error(
app_obj->wifi_manager, ap_obj);
+
if (connection_error == WIFI_ERROR_INVALID_KEY)
- return g_strdup(STR_AUTH_ERR);
+ snprintf(status_text, MAX_SUB_TEXT_LENGTH, text_color, STR_AUTH_ERR);
+
if (connection_error == WIFI_ERROR_DHCP_FAILED)
- return g_strdup(STR_FAILED_TO_OBTAIN_IP);
- return _wifi_ap_ssid_strdup(app_obj->wifi_manager, ap_obj);
+ snprintf(status_text, MAX_SUB_TEXT_LENGTH, text_color, STR_FAILED_TO_OBTAIN_IP);
+
+ snprintf(status_text, MAX_SUB_TEXT_LENGTH, text_color, _wifi_ap_ssid_strdup(app_obj->wifi_manager, ap_obj));
}
+ return g_strdup(status_text);
}
return NULL;
}
static gchar *_make_static_ip_menu_text(const gchar *text, const gchar *default_text)
{
- if (text != NULL)
- return g_strdup(text);
- else if (default_text != NULL)
- return g_strdup(default_text);
- else
+ char ip_menu_text[MAX_SUB_TEXT_LENGTH] = {0, };
+ char *text_color = "<font color=#4DCFFFC9>%s</font>";
+
+ if (text != NULL) {
+ snprintf(ip_menu_text, MAX_SUB_TEXT_LENGTH, text_color, text);
+ return g_strdup(ip_menu_text);
+ }
+ else if (default_text != NULL) {
+ snprintf(ip_menu_text, MAX_SUB_TEXT_LENGTH, text_color, default_text);
+ return g_strdup(ip_menu_text);
+ }
+ else {
return NULL;
+ }
}
static char *__static_ip_menu_ip_address_text_get_cb(void *data, Evas_Object *obj, const char *part)
app_object *app_obj = data;
WIFI_RET_VAL_IF_FAIL(app_obj != NULL, NULL);
+ char proxy_addr[MAX_SUB_TEXT_LENGTH] = {0, };
+ char *text_color = "<font color=#4DCFFFC9>%s</font>";
+
if (!g_strcmp0(part, "elm.text")) {
return g_strdup(STR_PROXY_ADDRESS);
} else if (!g_strcmp0(part, "elm.text.1")) {
- return g_strdup(wifi_address_get_proxy_address(app_obj->address_for_edit));
+ snprintf(proxy_addr, MAX_SUB_TEXT_LENGTH, text_color,
+ wifi_address_get_proxy_address(app_obj->address_for_edit));
+ return g_strdup(proxy_addr);
}
return NULL;
}
app_object *app_obj = data;
WIFI_RET_VAL_IF_FAIL(app_obj != NULL, NULL);
+ char proxy_port[MAX_SUB_TEXT_LENGTH] = {0, };
+ char *text_color = "<font color=#4DCFFFC9>%s</font>";
+
if (!g_strcmp0(part, "elm.text")) {
return g_strdup(STR_PROXY_PORT);
} else if (!g_strcmp0(part, "elm.text.1")) {
- return g_strdup(wifi_address_get_proxy_port(app_obj->address_for_edit));
+ snprintf(proxy_port, MAX_SUB_TEXT_LENGTH, text_color,
+ wifi_address_get_proxy_port(app_obj->address_for_edit));
+ return g_strdup(proxy_port);
}
return NULL;
}
WIFI_RET_IF_FAIL(app_obj->wearable_input == NULL);
- proxy_text = elm_object_item_part_text_get(item, "elm.text.1");
menu_item_type = layout_proxy_setting_get_menu_type(app_obj->proxy_setting, item);
switch (menu_item_type) {
case PROXY_SETTING_ITEM_ADDRESS:
input_type = ELM_INPUT_PANEL_LAYOUT_NORMAL;
+ proxy_text = wifi_address_get_proxy_address(app_obj->address_for_edit);
is_guide_text = _is_default_proxy_address(proxy_text);
break;
case PROXY_SETTING_ITEM_PORT:
input_type = ELM_INPUT_PANEL_LAYOUT_NUMBERONLY;
+ proxy_text = wifi_address_get_proxy_port(app_obj->address_for_edit);
is_guide_text = _is_default_proxy_port(proxy_text);
break;
app_object *app_obj = data;
wifi_error_e err = WIFI_ERROR_INVALID_PARAMETER;
wifi_connection_state_e connection_state = WIFI_CONNECTION_STATE_FAILURE;
+ char status_text[MAX_SUB_TEXT_LENGTH] = {0, };
+ char *text_color = "<font color=#4DCFFFC9>%s</font>";
if (!app_obj) {
WIFI_LOG_ERR("app object is NULL");
switch (connection_state) {
case WIFI_CONNECTION_STATE_FAILURE:
case WIFI_CONNECTION_STATE_DISCONNECTED:
- return g_strdup(STR_NOT_CONNECTED);
+ snprintf(status_text, MAX_SUB_TEXT_LENGTH, text_color, STR_NOT_CONNECTED);
+ break;
case WIFI_CONNECTION_STATE_ASSOCIATION:
- return g_strdup(STR_CONNECTING);
+ snprintf(status_text, MAX_SUB_TEXT_LENGTH, text_color, STR_CONNECTING);
+ break;
case WIFI_CONNECTION_STATE_CONFIGURATION:
- return g_strdup(STR_OBTAINING_IP);
+ snprintf(status_text, MAX_SUB_TEXT_LENGTH, text_color, STR_OBTAINING_IP);
+ break;
case WIFI_CONNECTION_STATE_CONNECTED:
- return __main_menu_scan_get_connected_state_text(app_obj->wifi_manager);
+ snprintf(status_text, MAX_SUB_TEXT_LENGTH, text_color,
+ __main_menu_scan_get_connected_state_text(app_obj->wifi_manager));
+ break;
default:
- return g_strdup(STR_NOT_CONNECTED);
+ snprintf(status_text, MAX_SUB_TEXT_LENGTH, text_color, STR_NOT_CONNECTED);
+ break;
}
+ return g_strdup(status_text);
}
return NULL;
}