From 764b9340c482dcbcd18dd152c8ac3ce8bbadacb0 Mon Sep 17 00:00:00 2001 From: Seonah Moon Date: Mon, 2 Nov 2015 15:00:46 +0900 Subject: [PATCH] Adopt new genlist style for Tizen 2.4 Change-Id: Ia1f91cf65da0ec8eb8ebe8de6e4e8ab5606a79db Signed-off-by: Seonah Moon --- packaging/wifi-efl-ug.spec | 2 +- sources/libraries/Common/include/common.h | 10 ++++++++++ sources/ui-gadget/include/viewer_manager.h | 2 ++ sources/ui-gadget/viewers-layout/view_detail.c | 9 ++++----- sources/ui-gadget/viewers-layout/viewer_manager.c | 12 +++++------- sources/ui-gadget/viewers-layout/wifi_viewer_list.c | 20 ++++++++++---------- sources/wifi-syspopup/viewer-popups/view-main.c | 15 ++++++++------- 7 files changed, 40 insertions(+), 30 deletions(-) mode change 100644 => 100755 sources/libraries/Common/include/common.h diff --git a/packaging/wifi-efl-ug.spec b/packaging/wifi-efl-ug.spec index 56e8b85..7c51a11 100644 --- a/packaging/wifi-efl-ug.spec +++ b/packaging/wifi-efl-ug.spec @@ -1,7 +1,7 @@ %define _unpackaged_files_terminate_build 0 Name: wifi-efl-ug Summary: Wi-Fi UI Gadget for TIZEN -Version: 1.0.155 +Version: 1.0.156 Release: 1 Group: App/Network License: Flora-1.1 diff --git a/sources/libraries/Common/include/common.h b/sources/libraries/Common/include/common.h old mode 100644 new mode 100755 index a26e09e..a04c432 --- a/sources/libraries/Common/include/common.h +++ b/sources/libraries/Common/include/common.h @@ -68,6 +68,16 @@ extern "C" /* Device-picker width for landscape mode */ #define DEVICE_PICKER_POPUP_LN_W 600 +/* Genlist new style for Tizen 2.4 */ +#define WIFI_GENLIST_1LINE_TEXT_STYLE "type1" +#define WIFI_GENLIST_1LINE_TEXT_ICON_STYLE "type1" +#define WIFI_GENLIST_2LINE_TOP_TEXT_STYLE "type1" +#define WIFI_GENLIST_2LINE_TOP_TEXT_ICON_STYLE "type1" +#define WIFI_GENLIST_2LINE_BOTTOM_TEXT_STYLE "type2" +#define WIFI_GENLIST_2LINE_BOTTOM_TEXT_ICON_STYLE "type2" +#define WIFI_GENLIST_MULTILINE_TEXT_STYLE "multiline" +#define WIFI_GENLIST_GROUP_INDEX_STYLE "group_index" + typedef enum { UG_VIEW_DEFAULT = 0, UG_VIEW_SETUP_WIZARD diff --git a/sources/ui-gadget/include/viewer_manager.h b/sources/ui-gadget/include/viewer_manager.h index c5f2c31..e0eafa8 100755 --- a/sources/ui-gadget/include/viewer_manager.h +++ b/sources/ui-gadget/include/viewer_manager.h @@ -86,7 +86,9 @@ void viewer_manager_ctxpopup_cleanup(void); void viewer_manager_cleanup_views(void); void viewer_manager_rotate_top_setupwizard_layout(void); Evas_Object *viewer_manager_naviframe_power_item_get(void); +#if 0 /* not used */ Evas_Object *viewer_manager_create_bg(Evas_Object *parent, char *style); +#endif void viewer_manager_update_hidden_btn(void); int viewer_manager_create_scan_btn(void); void viewer_manager_setup_wizard_btns_color_set(bool state); diff --git a/sources/ui-gadget/viewers-layout/view_detail.c b/sources/ui-gadget/viewers-layout/view_detail.c index 0114f83..95711ef 100755 --- a/sources/ui-gadget/viewers-layout/view_detail.c +++ b/sources/ui-gadget/viewers-layout/view_detail.c @@ -256,10 +256,9 @@ static char *_view_detail_grouptitle_text_get(void *data, char *tmp = NULL; char *txt = NULL; - if (!strncmp(part, "elm.text.sub.left.top", strlen(part))) { + if (!strcmp("elm.text.sub", part)) { ret = (char*) g_strdup(dgettext(PACKAGE, "IDS_WIFI_BODY_NAME")); - } else if (!strncmp(part, "elm.text.main.left.bottom", strlen(part))) { -// view_detail_data *_detail_data = (view_detail_data *)data; + } else if (!strcmp("elm.text", part)) { _detail_data = (view_detail_data *)data; retvm_if(NULL == _detail_data, NULL); @@ -286,7 +285,7 @@ static Evas_Object *_view_detail_grouptitle_content_get(void *data, Evas_Object Evas_Object* icon = NULL; Evas_Object* ic = NULL; - if (!strncmp(part, "elm.icon.2", strlen(part))) { + if (!strcmp("elm.swallow.end", part)) { char *temp_str = NULL; ic = elm_layout_add(obj); @@ -657,7 +656,7 @@ void view_detail(wifi_device_info_t *device_info, Evas_Object *win_main, evas_object_smart_callback_add(detailview_list, "language,changed", gl_lang_changed, NULL); - grouptitle_itc.item_style = "2line.bottom"; + grouptitle_itc.item_style = WIFI_GENLIST_2LINE_BOTTOM_TEXT_ICON_STYLE; grouptitle_itc.func.text_get = _view_detail_grouptitle_text_get; grouptitle_itc.func.content_get = _view_detail_grouptitle_content_get; grouptitle_itc.func.state_get = NULL; diff --git a/sources/ui-gadget/viewers-layout/viewer_manager.c b/sources/ui-gadget/viewers-layout/viewer_manager.c index 2840230..22a4df6 100755 --- a/sources/ui-gadget/viewers-layout/viewer_manager.c +++ b/sources/ui-gadget/viewers-layout/viewer_manager.c @@ -670,7 +670,7 @@ static char *_gl_wifi_onoff_text_get(void *data, Evas_Object *obj, const char *p retvm_if(NULL == manager_object, NULL); - if (!strncmp(part, "elm.text.main.left", strlen(part))) { + if (!strcmp("elm.text", part)) { det = g_strdup(manager_object->item_wifi_onoff_text); assertm_if(NULL == det, "NULL!!"); } @@ -691,7 +691,7 @@ static Evas_Object *_gl_wifi_onoff_content_get(void *data, Evas_Object *ao = NULL; #endif - if (!strncmp(part, "elm.icon.2", strlen(part))) { + if (!strcmp("elm.swallow.end", part)) { icon = elm_layout_add(obj); elm_layout_theme_set(icon, "layout", "list/C/type.3", "default"); @@ -750,7 +750,7 @@ static void __viewer_manager_wifi_onoff_item_create(Evas_Object* genlist) manager_object->item_wifi_onoff_text = g_strdup(sc(PACKAGE, I18N_TYPE_Wi_Fi)); - wifi_onoff_itc.item_style = "1line"; + wifi_onoff_itc.item_style = WIFI_GENLIST_1LINE_TEXT_ICON_STYLE; wifi_onoff_itc.func.text_get = _gl_wifi_onoff_text_get; wifi_onoff_itc.func.content_get = _gl_wifi_onoff_content_get; wifi_onoff_itc.func.state_get = NULL; @@ -1112,6 +1112,7 @@ static void __viewer_manager_create_wifi_ug_content(Evas_Object *layout, __COMMON_FUNC_EXIT__; } +#if 0 /* not used */ Evas_Object *viewer_manager_create_bg(Evas_Object *parent, char *style) { Evas_Object *bg; @@ -1128,6 +1129,7 @@ Evas_Object *viewer_manager_create_bg(Evas_Object *parent, char *style) return bg; } +#endif Evas_Object *viewer_manager_create(Evas_Object *_parent, Evas_Object *_win_main) { @@ -1137,7 +1139,6 @@ Evas_Object *viewer_manager_create(Evas_Object *_parent, Evas_Object *_win_main) Evas_Object *layout = NULL; Evas_Object *view_content = NULL; - Evas_Object *bg = NULL; manager_object = g_new0(viewer_manager_object, 1); retvm_if(NULL == manager_object, NULL); @@ -1180,9 +1181,6 @@ Evas_Object *viewer_manager_create(Evas_Object *_parent, Evas_Object *_win_main) __viewer_manager_create_setup_wizard_content(view_content); } else { __viewer_manager_create_wifi_ug_content(view_content, _win_main); - - bg = viewer_manager_create_bg(_win_main, "group_list"); - elm_object_part_content_set(view_content, "elm.swallow.bg", bg); } evas_object_show(layout); diff --git a/sources/ui-gadget/viewers-layout/wifi_viewer_list.c b/sources/ui-gadget/viewers-layout/wifi_viewer_list.c index e72731b..68c6ef1 100755 --- a/sources/ui-gadget/viewers-layout/wifi_viewer_list.c +++ b/sources/ui-gadget/viewers-layout/wifi_viewer_list.c @@ -86,7 +86,7 @@ char* ConvertRGBAtoHex(int r, int g, int b, int a) static char* _gl_listview_text_get(void *data, Evas_Object *obj, const char *part) { char* det = NULL; - char* buf =NULL; + char* buf = NULL; int r = 0, g = 0, b = 0, a = 0; ug_genlist_data_t* gdata = (ug_genlist_data_t*) data; @@ -94,7 +94,7 @@ static char* _gl_listview_text_get(void *data, Evas_Object *obj, const char *par assertm_if(NULL == gdata->device_info->ssid, "NULL!!"); - if (!strncmp(part, "elm.text.main.left.top", strlen(part))) { + if (!strcmp("elm.text", part)) { det = evas_textblock_text_utf8_to_markup(NULL, gdata->device_info->ssid); assertm_if(NULL == det, "NULL!!"); @@ -108,8 +108,8 @@ static char* _gl_listview_text_get(void *data, Evas_Object *obj, const char *par g_free(det); return buf; } - } else if (!strncmp(part, "elm.text.sub.left.bottom", strlen(part)) && - gdata->device_info->ap_status_txt != NULL) { + } else if (!strcmp("elm.text.sub", part) + && gdata->device_info->ap_status_txt != NULL) { det = g_strdup(gdata->device_info->ap_status_txt); assertm_if(NULL == det, "NULL!!"); @@ -130,7 +130,7 @@ static Evas_Object *_gl_listview_content_get(void *data, Evas_Object *obj, const /* if there is no ap_image_path (NO AP Found situation) */ DEBUG_LOG(UG_NAME_ERR, "Fatal: Image path is NULL"); - } else if (!g_strcmp0(part, "elm.icon.1")) { + } else if (!strcmp("elm.swallow.icon", part)) { ic = elm_layout_add(obj); elm_layout_theme_set(ic, "layout", "list/B/type.3", "default"); @@ -149,7 +149,7 @@ static Evas_Object *_gl_listview_content_get(void *data, Evas_Object *obj, const evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_layout_content_set(ic, "elm.swallow.content", icon); - } else if (!g_strcmp0(part, "elm.icon.2")) { + } else if (!strcmp("elm.swallow.end", part)) { if (VIEWER_ITEM_RADIO_MODE_CONNECTING == gdata->radio_mode || VIEWER_ITEM_RADIO_MODE_CONFIGURATION == gdata->radio_mode) { ic = elm_layout_add(obj); @@ -200,7 +200,7 @@ static void _gl_listview_del(void *data, Evas_Object *obj) static char *_gl_text_available_networks_get(void *data, Evas_Object *obj, const char *part) { - if (g_strcmp0(part, "elm.text.main") == 0) + if (!strcmp("elm.text", part)) return g_strdup(sc(PACKAGE, I18N_TYPE_Available_networks)); return NULL; @@ -948,13 +948,13 @@ Evas_Object* viewer_list_create(Evas_Object *win) evas_object_size_hint_weight_set(viewer_list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(viewer_list, EVAS_HINT_FILL, EVAS_HINT_FILL); - itc.item_style = "2line.top"; + itc.item_style = WIFI_GENLIST_2LINE_TOP_TEXT_ICON_STYLE; itc.func.text_get = _gl_listview_text_get; itc.func.content_get = _gl_listview_content_get; itc.func.state_get = NULL; itc.func.del = _gl_listview_del; - no_wifi_device_itc.item_style = "1line"; + no_wifi_device_itc.item_style = WIFI_GENLIST_1LINE_TEXT_STYLE; no_wifi_device_itc.func.text_get = _gl_listview_text_get; no_wifi_device_itc.func.content_get = NULL; no_wifi_device_itc.func.state_get = NULL; @@ -996,7 +996,7 @@ void viewer_list_title_item_set(Elm_Object_Item *item_header) } memset(&grouptitle_itc, 0, sizeof(grouptitle_itc)); - grouptitle_itc.item_style = "groupindex"; + grouptitle_itc.item_style = WIFI_GENLIST_GROUP_INDEX_STYLE; grouptitle_itc.func.text_get = _gl_text_available_networks_get; grouptitle_itc.func.content_get = _gl_content_scanning_icon_get; diff --git a/sources/wifi-syspopup/viewer-popups/view-main.c b/sources/wifi-syspopup/viewer-popups/view-main.c index d0cb318..ea25541 100755 --- a/sources/wifi-syspopup/viewer-popups/view-main.c +++ b/sources/wifi-syspopup/viewer-popups/view-main.c @@ -614,14 +614,14 @@ static char *_gl_text_get(void *data, Evas_Object *obj, const char *part) devpkr_gl_data_t *gdata = (devpkr_gl_data_t *) data; retvm_if(NULL == gdata, NULL); - if (!strncmp(part, "elm.text.main.left.top", strlen(part))) { + if (!strcmp("elm.text", part)) { txt = evas_textblock_text_utf8_to_markup(NULL, gdata->dev_info->ssid); ret = g_strdup(txt); if (ret == NULL) { ERROR_LOG(SP_NAME_NORMAL, "ssid name is NULL!!"); } g_free(txt); - } else if (!strncmp(part, "elm.text.sub.left.bottom", strlen(part))) { + } else if (!strcmp("elm.text.sub", part)) { if (ITEM_CONNECTION_MODE_CONNECTING == gdata->connection_mode) { ret = g_strdup(sc(PACKAGE, I18N_TYPE_Connecting)); } else if (ITEM_CONNECTION_MODE_CONFIGURATION == gdata->connection_mode) { @@ -649,7 +649,7 @@ static Evas_Object *_gl_content_get(void *data, Evas_Object *obj, const char *pa Evas_Object* icon = NULL; Evas_Object *ic = NULL; - if (!strncmp(part, "elm.icon.1", strlen(part))) { + if (!strcmp("elm.swallow.icon", part)) { char *temp_str = NULL; ic = elm_layout_add(obj); @@ -667,7 +667,7 @@ static Evas_Object *_gl_content_get(void *data, Evas_Object *obj, const char *pa evas_object_size_hint_align_set(icon, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_layout_content_set(ic, "elm.swallow.content", icon); - } else if (!strncmp(part, "elm.icon.2", strlen(part))) { + } else if (!strcmp("elm.swallow.end", part)) { if (gdata->connection_mode == ITEM_CONNECTION_MODE_CONNECTING || gdata->connection_mode == ITEM_CONNECTION_MODE_CONFIGURATION) { ic = elm_layout_add(obj); @@ -721,7 +721,7 @@ static Evas_Object *_create_genlist(Evas_Object* parent) evas_object_size_hint_weight_set(list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(list, EVAS_HINT_FILL, EVAS_HINT_FILL); - itc.item_style = "2line.top"; + itc.item_style = WIFI_GENLIST_2LINE_TOP_TEXT_ICON_STYLE; itc.func.text_get = _gl_text_get; itc.func.content_get = _gl_content_get; itc.func.state_get = NULL; @@ -937,7 +937,7 @@ static Evas_Object *_gl_content_title_get(void *data, Evas_Object *obj, const ch static char* _gl_text_title_get(void *data, Evas_Object *obj,const char *part) { - if (g_strcmp0(part, "elm.text.main") == 0) { + if (!strcmp("elm.text", part)) { return (char*) g_strdup(sc(PACKAGE, I18N_TYPE_Available_networks)); } @@ -946,7 +946,7 @@ static char* _gl_text_title_get(void *data, Evas_Object *obj,const char *part) static void view_main_add_group_title(void) { - grouptitle_itc.item_style = "groupindex"; + grouptitle_itc.item_style = WIFI_GENLIST_GROUP_INDEX_STYLE; grouptitle_itc.func.text_get = _gl_text_title_get; grouptitle_itc.func.content_get = _gl_content_title_get; @@ -985,6 +985,7 @@ void view_main_update_group_title(gboolean is_bg_scan) main_list = _create_genlist(box); view_main_add_group_title(); + elm_box_pack_start(box, main_list); evas_object_show(main_list); -- 2.7.4