[TSAM-9165] Changed font color of sub-text 25/99225/2
authorSeonah Moon <seonah1.moon@samsung.com>
Tue, 22 Nov 2016 07:34:43 +0000 (16:34 +0900)
committerseonah moon <seonah1.moon@samsung.com>
Tue, 22 Nov 2016 07:48:49 +0000 (23:48 -0800)
Change-Id: I8e3b6f1dd774afa05eebc304e3bae0ed25a92c6f
Signed-off-by: Seonah Moon <seonah1.moon@samsung.com>
packaging/wifi-efl-ug.spec
sources/wearable/src/wearable-circle/app_main.c

index 494ac1a..8c75a7a 100644 (file)
@@ -1,7 +1,7 @@
 %define _unpackaged_files_terminate_build 0
 Name:          wifi-efl-ug
 Summary:       Wi-Fi UI Gadget for TIZEN
-Version:       1.0.215
+Version:       1.0.216
 Release:       1
 Group:         App/Network
 License:       Flora-1.1
index 56ec86f..2bb83de 100755 (executable)
@@ -48,6 +48,7 @@
 #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
@@ -758,6 +759,9 @@ static char *__detail_menu_status_text_get_cb(void *data, Evas_Object *obj, cons
        } 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;
@@ -767,25 +771,31 @@ static char *__detail_menu_status_text_get_cb(void *data, Evas_Object *obj, cons
                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;
 }
@@ -1062,6 +1072,8 @@ static char *__scan_menu_ap_item_text_get_cb(void *data, Evas_Object *obj, const
                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);
 
@@ -1070,28 +1082,35 @@ static char *__scan_menu_ap_item_text_get_cb(void *data, Evas_Object *obj, const
 
                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;
 }
@@ -2487,12 +2506,20 @@ static void __static_ip_del_cb(void *data, Evas *e,
 
 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)
@@ -3137,10 +3164,15 @@ static char *__proxy_setting_menu_address_text_get_cb(void *data, Evas_Object *o
        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;
 }
@@ -3150,10 +3182,15 @@ static char *__proxy_setting_menu_port_text_get_cb(void *data, Evas_Object *obj,
        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;
 }
@@ -3279,16 +3316,17 @@ static void __proxy_setting_menu_tap_cb(void *data, Evas_Object *obj, void *even
 
        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;
 
@@ -3957,6 +3995,8 @@ static char *__main_menu_scan_text_get_cb(void *data, Evas_Object *obj, const ch
        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");
@@ -3980,20 +4020,27 @@ static char *__main_menu_scan_text_get_cb(void *data, Evas_Object *obj, const ch
                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;
 }