From 3685a9cef227512f3c449d7916240118ef7e406a Mon Sep 17 00:00:00 2001 From: Shuhrat Dehkanov Date: Thu, 28 May 2015 22:03:58 +0900 Subject: [PATCH 01/16] Replace utils_get_vconf_value() with is_24_hour() utils_get_vconf_value() is exclusively used for getting 24-hour format enabled/disabled state from vconf. is_24_hour() achieves the same result, albeit with more simplicity. Change-Id: I1ed582f39114fd0f729fb81475cfc88261fe96b6 --- ug/system/clock/include/ug_clock_utils.h | 2 +- ug/system/clock/src/ug_clock.c | 41 ++-------------- ug/system/clock/src/ug_clock_sublist.c | 18 ++----- ug/system/clock/src/ug_clock_time_spin_control.c | 25 ++-------- ug/system/clock/src/ug_clock_utils.c | 61 ++++++------------------ 5 files changed, 26 insertions(+), 121 deletions(-) diff --git a/ug/system/clock/include/ug_clock_utils.h b/ug/system/clock/include/ug_clock_utils.h index bfd87d5..ac77873 100644 --- a/ug/system/clock/include/ug_clock_utils.h +++ b/ug/system/clock/include/ug_clock_utils.h @@ -60,6 +60,6 @@ void utils_get_time_value(int *time); void utils_set_time_value(int *time); int utils_set_vconf_value(const char *key, int value); -int utils_get_vconf_value(const char *key, int *value); +void utils_is_24_hour(int *enabled); #endif /* __UG_CLOCK_UTILS_H__ */ diff --git a/ug/system/clock/src/ug_clock.c b/ug/system/clock/src/ug_clock.c index 53bffdf..72ef6fb 100644 --- a/ug/system/clock/src/ug_clock.c +++ b/ug/system/clock/src/ug_clock.c @@ -358,7 +358,6 @@ static Evas_Object *_add_clock_sublist_switch_btn( { Evas_Object *switch_btn; const char *display; - int ret; if (!data) { _ERR("data is null."); @@ -377,17 +376,8 @@ static Evas_Object *_add_clock_sublist_switch_btn( elm_box_pack_end(data->sublist_box, switch_btn); /* Set ON/OFF for switch button. */ - ret = utils_get_vconf_value(VCONF_KEY_24HOUR_MODE, &data->mode); - if (ret != 0) { - _ERR("vconf get value failed."); - return NULL; - } - - if (!data->mode) - display = OFF; - else - display = ON; - + utils_is_24_hour(&data->mode); + display = data->mode ? ON : OFF; elm_object_part_text_set(switch_btn, BTN_PART_VALUE, display); evas_object_event_callback_add(switch_btn, @@ -569,18 +559,11 @@ static void _refresh_time_btn_text(Evas_Object *btn, int *time) { int mode; char buf[BUF_SIZE]; - int ret; if (!btn || !time) return; - mode = 0; - ret = utils_get_vconf_value(VCONF_KEY_24HOUR_MODE, &mode); - if (ret != 0) { - _ERR("vconf get value failed."); - return; - } - + utils_is_24_hour(&mode); if (mode) { snprintf(buf, sizeof(buf), "%02d : %02d", time[TIME_HOUR], time[TIME_MINUTE]); @@ -1038,19 +1021,12 @@ static void _refresh_switch_btn_text(Evas_Object *btn, int mode) static void _refresh_time_btn_as_mode(Evas_Object *btn, int *time) { int mode; - int ret; char buf[BUF_SIZE]; if (!btn || !time) return; - mode = 0; - ret = utils_get_vconf_value(VCONF_KEY_24HOUR_MODE, &mode); - if (ret != 0) { - _ERR("vconf get value failed."); - return; - } - + utils_is_24_hour(&mode); if (mode) snprintf(buf, sizeof(buf), "%02d : %02d", time[TIME_HOUR], time[TIME_MINUTE]); @@ -1071,20 +1047,13 @@ static void _refresh_time_btn_as_mode(Evas_Object *btn, int *time) */ static void _refresh_btn_text(struct _ug_data *data) { - int ret; - if (!data || !data->cur_btn) return; if (data->date_btn == data->cur_btn) { _refresh_date_btn_text(data->cur_btn, data->date); } else if (data->switch_btn == data->cur_btn) { - ret = utils_get_vconf_value(VCONF_KEY_24HOUR_MODE, &data->mode); - if (ret != 0) { - _ERR("vconf get value failed."); - return; - } - + utils_is_24_hour(&data->mode); _refresh_switch_btn_text(data->cur_btn, data->mode); utils_get_time_value(data->time); diff --git a/ug/system/clock/src/ug_clock_sublist.c b/ug/system/clock/src/ug_clock_sublist.c index 47e93be..bff06ec 100644 --- a/ug/system/clock/src/ug_clock_sublist.c +++ b/ug/system/clock/src/ug_clock_sublist.c @@ -108,7 +108,7 @@ static void _sublist_btn_clicked_cb(void *priv, Evas_Object *obj, void *ei) ret = utils_set_vconf_value(VCONF_KEY_24HOUR_MODE, data->mode); if (ret != 0) { - _ERR("set 24hour mode failed."); + _ERR("Setting 24-hour mode failed"); return; } @@ -136,7 +136,6 @@ static void _key_down_on_sublist_btn_cb(void *priv, Evas *e, struct _sublist_data *data; const char *keyname; int mode; - int ret; if (!priv || !ei || !obj) return; @@ -162,11 +161,7 @@ static void _key_down_on_sublist_btn_cb(void *priv, Evas *e, return; } - ret = utils_get_vconf_value(VCONF_KEY_24HOUR_MODE, &mode); - if (ret != 0) { - _ERR("vconf get value failed."); - return; - } + utils_is_24_hour(&mode); if (!strncmp(keyname, KEY_DOWN, strlen(keyname))) { if (obj != on_btn) @@ -311,18 +306,10 @@ static void _set_sublist_init_value(Eina_Array *array) { Evas_Object *on_btn, *off_btn; int mode; - int ret; if (!array) return; - mode = 0; - ret = utils_get_vconf_value(VCONF_KEY_24HOUR_MODE, &mode); - if (ret != 0) { - _ERR("vconf get value failed."); - return; - } - on_btn = eina_array_data_get(array, 0); off_btn = eina_array_data_get(array, 1); if (!on_btn || !off_btn) { @@ -335,6 +322,7 @@ static void _set_sublist_init_value(Eina_Array *array) elm_object_text_set(on_btn, ON); elm_object_text_set(off_btn, OFF); + utils_is_24_hour(&mode); if (mode) { elm_object_signal_emit(on_btn, SIG_SRC_FOC_SHOW_ICON, SIG_NAME_SUBLIST); diff --git a/ug/system/clock/src/ug_clock_time_spin_control.c b/ug/system/clock/src/ug_clock_time_spin_control.c index 1f956af..2627164 100644 --- a/ug/system/clock/src/ug_clock_time_spin_control.c +++ b/ug/system/clock/src/ug_clock_time_spin_control.c @@ -81,21 +81,14 @@ static void _update_time_value(Evas_Object *btn, int *time, int btn_idx) { int mode; char buf[BUF_SIZE]; - int ret; if (!btn || !time) return; if (btn_idx < TIME_HOUR || btn_idx >= TIME_MAX) return; - mode = 0; - ret = utils_get_vconf_value(VCONF_KEY_24HOUR_MODE, &mode); - if (ret != 0) { - _ERR("vconf get value failed."); - return; - } - if (btn_idx == TIME_HOUR) { + utils_is_24_hour(&mode); if (mode) { if (time[btn_idx] > 23) time[btn_idx] = 0; @@ -612,13 +605,7 @@ static int _add_time_spin_btns(struct _time_spin_data *data) utils_get_time_value(data->time); - mode = 0; - ret = utils_get_vconf_value(VCONF_KEY_24HOUR_MODE, &mode); - if (ret != 0) { - _ERR("vconf get value failed."); - return -1; - } - + utils_is_24_hour(&mode); if (mode) { ret = _add_time_spin_without_ampm(data); if (ret != 0) { @@ -756,13 +743,7 @@ static Evas_Object *_create(struct _time_spin_data *data) data->base = base; elm_layout_file_set(base, UG_CLOCK_EDJFILE, TIME_SPIN_CTRL_GRP); - onoff = 0; - ret = utils_get_vconf_value(VCONF_KEY_24HOUR_MODE, &onoff); - if (ret != 0) { - _ERR("vconf get value failed."); - return NULL; - } - + utils_is_24_hour(&onoff); if (onoff) elm_object_signal_emit(base, SIGNAL_NAME_TIME_SPIN_2, SIGNAL_SOURCE_TIME_SPIN); diff --git a/ug/system/clock/src/ug_clock_utils.c b/ug/system/clock/src/ug_clock_utils.c index a164582..ae6574a 100644 --- a/ug/system/clock/src/ug_clock_utils.c +++ b/ug/system/clock/src/ug_clock_utils.c @@ -180,8 +180,7 @@ void utils_set_date_value(unsigned int *date) void utils_get_time_value(int *time) { struct tm *t; - int v; - int ret; + int mode; if (!time) return; @@ -192,15 +191,8 @@ void utils_get_time_value(int *time) time[TIME_MINUTE] = t->tm_min; time[TIME_AMPM] = time[TIME_HOUR] >= 12 ? 1 : 0; - v = 0; - ret = utils_get_vconf_value(VCONF_KEY_24HOUR_MODE, &v); - if (ret != 0) { - _ERR("get vconf key failed."); - return; - } - - if (!v) - if (time[TIME_HOUR] >= 12) + utils_is_24_hour(&mode); + if (!mode && time[TIME_HOUR] >= 12) time[TIME_HOUR] -= 12; } @@ -214,20 +206,13 @@ void utils_get_time_value(int *time) */ void utils_set_time_value(int *time) { - int ret; struct tm *t; int mode; if (!time) return; - mode = 0; - ret = utils_get_vconf_value(VCONF_KEY_24HOUR_MODE, &mode); - if (ret != 0) { - _ERR("vconf get key failed."); - return; - } - + utils_is_24_hour(&mode); if (!mode && time[TIME_AMPM] == 1) time[TIME_HOUR] += 12; @@ -249,46 +234,28 @@ void utils_set_time_value(int *time) */ int utils_set_vconf_value(const char *key, int value) { - int ret; - if (!key) { - _ERR("the key of vconf is null."); + _ERR("Can not set vconf value for null key"); return -1; } - ret = vconf_set_int(key, value); - if (ret != 0) { - _ERR("vconf set int failed."); - return -1; - } - - return 0; + return vconf_set_int(key, value); } /** -* Get the value of vconf key. +* Get 24-hour format enabled/disabled value from vconf. * -* @param[in]: key : the vconf key which to get value from. -* @param[out]: value : the pointer of value of key. +* @param[out]: enabled : 0 - disabled; 1 - enabled. * -* @return: 0 - Success, -1 - Fail. +* @return: void. */ -int utils_get_vconf_value(const char *key, int *value) -{ - int ret; - if (!key || !value) { - _ERR("invalid argument."); - return -1; - } - - ret = vconf_get_int(key, value); - if (ret != 0) { - _ERR("vconf get int failed."); - return -1; +void utils_is_24_hour(int *enabled) +{ + if (vconf_get_int(VCONF_KEY_24HOUR_MODE, enabled) != 0) { + /* failed to get value from vconf, assume it disabled */ + *enabled = 0; } - - return 0; } /** -- 2.7.4 From 16e3eac24aa71aec221edf5d630bdae58d0581fe Mon Sep 17 00:00:00 2001 From: Shuhrat Dehkanov Date: Thu, 28 May 2015 22:36:25 +0900 Subject: [PATCH 02/16] Fix various build warnings Change-Id: I4fa8f552fe803ba6ac3738c5918c8f62145f5e03 --- src/settings_provider.c | 13 ++++++++----- ug/channel/src/tv_scan.c | 27 ++++++++++++++------------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/src/settings_provider.c b/src/settings_provider.c index 8e9ad3c..e28a064 100644 --- a/src/settings_provider.c +++ b/src/settings_provider.c @@ -167,6 +167,7 @@ struct sleeptimer_data { //tvtimer_h timer; }; +#if 0 static unsigned int sleeptimer_value[] = { 0, 30, @@ -176,7 +177,9 @@ static unsigned int sleeptimer_value[] = { 150, 180 }; +#endif +#if 0 /** * An timer foreach iteration callback for tvtimer_foreach_item. * @@ -186,7 +189,6 @@ static unsigned int sleeptimer_value[] = { * @param data [in] The function specific data passed by tvtimer_foreach_item. * @return void */ -#if 0 static void _timer_callback(tvtimer_h timer, void *data) { int id; @@ -201,20 +203,18 @@ static void _timer_callback(tvtimer_h timer, void *data) tvtimer_get_id(timer, &id); -#if 0 if (priv->id == id) priv->timer = timer; -#endif } #endif +#if 0 /** * Set a sleep timer. * * @param val [in] The index value for sleeptimer_value array. * @return 0 if success, -1 if fail. */ -#if 0 static int _set_sleeptimer(int val) { int size, r, id; @@ -301,6 +301,7 @@ static enum item_type _find_type(const char *key) return result; } +#if 0 /** * Find array index according to given array value and size. * @@ -326,6 +327,7 @@ static int _find_index(unsigned int *array, int size, int val, int *index) return -1; } +#endif /** * Set data with integer value. @@ -400,7 +402,8 @@ static int _set_int(const char *key, int val) static int _get_int(const char *key, int *val) { enum item_type type; - int status, size, index; + int status; + /*int size, index;*/ if (!key || !val) { _ERR("Invalid argument"); diff --git a/ug/channel/src/tv_scan.c b/ug/channel/src/tv_scan.c index 7d105b2..0e1af47 100644 --- a/ug/channel/src/tv_scan.c +++ b/ug/channel/src/tv_scan.c @@ -55,6 +55,7 @@ struct _signal_info { #endif }; +#if 0 /** * Get the scan type according to the setting of scanning mode in the beginning * @@ -65,7 +66,6 @@ struct _signal_info { * @param[out] type: The corresponding scan type provided by tv service * @return 0 on success otherwise -1 */ -#if 0 static int _get_scan_mode(enum antenna_mode mode, TvServiceScanType *type) { switch (mode) { @@ -87,6 +87,7 @@ static int _get_scan_mode(enum antenna_mode mode, TvServiceScanType *type) } #endif +#if 0 /** * Handling the beginning signal. * @@ -103,7 +104,6 @@ static int _get_scan_mode(enum antenna_mode mode, TvServiceScanType *type) static void _handle_begin_signal(struct tv_scan *tvs, struct _signal_info *sinfo) { -#if 0 if (!tvs || !sinfo) { _ERR("Invalid argument"); return; @@ -124,9 +124,10 @@ static void _handle_begin_signal(struct tv_scan *tvs, _ERR("Invalid scan type"); break; } -#endif } +#endif +#if 0 /** * Handle the receiving channel signal. * @@ -136,7 +137,6 @@ static void _handle_begin_signal(struct tv_scan *tvs, static void _handle_progress_signal(struct tv_scan *tvs, struct _signal_info *sinfo) { -#if 0 if (!tvs || !sinfo) { _ERR("Invalid argument"); return; @@ -148,9 +148,10 @@ static void _handle_progress_signal(struct tv_scan *tvs, if (tvs->cbs.progress_cb) tvs->cbs.progress_cb(tvs, tvs->set_mode, tvs->ch_count, tvs->ch_num, tvs->cbs.data); -#endif } +#endif +#if 0 /** * Calculating the number of ATV channle signal or DTV channel signal. * @@ -161,7 +162,6 @@ static void _handle_progress_signal(struct tv_scan *tvs, static void _channel_count(unsigned int *atv, unsigned int *dtv, struct _signal_info *sinfo) { -#if 0 if (!sinfo || !atv || !dtv) { _ERR("Invalid argument"); return; @@ -178,9 +178,10 @@ static void _channel_count(unsigned int *atv, unsigned int *dtv, _ERR("Invalid TVS_CHANNEL_TYPE"); break; } -#endif } +#endif +#if 0 /** * Handle the found channel signal when tune lock success. * @@ -190,7 +191,6 @@ static void _channel_count(unsigned int *atv, unsigned int *dtv, static void _handle_found_signal(struct tv_scan *tvs, struct _signal_info *sinfo) { -#if 0 if (!tvs || !sinfo) { _ERR("Invalid argument"); return; @@ -215,9 +215,10 @@ static void _handle_found_signal(struct tv_scan *tvs, sinfo->signal_data.data.s[3] > 0) && tvs->cbs.found_cb) tvs->cbs.found_cb(tvs, tvs->ch_count, tvs->ch_num, &tvs->res, tvs->cbs.data); -#endif } +#endif +#if 0 /** * Handle the result when scanning is finished. * @@ -227,7 +228,6 @@ static void _handle_found_signal(struct tv_scan *tvs, static void _handle_done_signal(struct tv_scan *tvs, struct _signal_info *sinfo) { -#if 0 if (!tvs || !sinfo) { _ERR("Invalid argument"); return; @@ -239,9 +239,10 @@ static void _handle_done_signal(struct tv_scan *tvs, if (tvs->cbs.done_cb) tvs->cbs.done_cb(tvs, &tvs->res, tvs->cbs.data); } -#endif } +#endif +#if 0 /** * Handle the receiving signal saved in tvs->signal_queue. * @@ -249,7 +250,6 @@ static void _handle_done_signal(struct tv_scan *tvs, */ static Eina_Bool _handle_signal(void *data) { -#if 0 struct tv_scan *tvs; struct _signal_info *sinfo; @@ -296,8 +296,8 @@ static Eina_Bool _handle_signal(void *data) stop: tvs->signal_timer = NULL; return ECORE_CALLBACK_CANCEL; -#endif } +#endif /** * Handle the receiving signal from tv service. @@ -538,6 +538,7 @@ int tv_scan_pause(struct tv_scan *tvs) return 0; #endif + return -1; } -- 2.7.4 From 589806e80055f29891b56aaae57ae51d2f1cabb1 Mon Sep 17 00:00:00 2001 From: Shuhrat Dehkanov Date: Fri, 29 May 2015 00:46:42 +0900 Subject: [PATCH 03/16] Disable channel lock menu if passcode has not been setup yet Change-Id: Iaea5a3dbddeddc5cbb697df44731345503fe641d --- src/settings_provider.c | 2 ++ src/view_maincatalog.c | 15 +++++++++++++-- src/view_need_pwd.c | 5 ++++- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/settings_provider.c b/src/settings_provider.c index e28a064..b61d070 100644 --- a/src/settings_provider.c +++ b/src/settings_provider.c @@ -578,6 +578,8 @@ static int _get_string(const char *key, char **val) break; case SYSTEM_PASSCODE: *val = vconf_get_str(KEY_CHANGE_PASSCODE); + if (*val == NULL) + r = -1; break; default: break; diff --git a/src/view_maincatalog.c b/src/view_maincatalog.c index b2cfe58..4112ba6 100644 --- a/src/view_maincatalog.c +++ b/src/view_maincatalog.c @@ -45,6 +45,9 @@ #define ENABLED "enabled" #define SIG_CLICKED "clicked" +#define KEY_PASSCODE "settings/system/change_passcode" +#define ITEM_CHANNEL_LOCK_ID "channel-lock" + enum focused_state { FOCUS_MAIN_ITEM = 1, FOCUS_SUB_ITEM @@ -1096,7 +1099,7 @@ static int _draw_subitems(struct _view_data *data, const char *name) int cnt; Eina_Array_Iterator a; unsigned int i; - const char *style, *status; + const char *id, *passcode, *style, *status; Eina_Array *enabled; if (!data || !name || !data->base) { @@ -1173,7 +1176,15 @@ static int _draw_subitems(struct _view_data *data, const char *name) evas_object_data_set(btn, SUBITEM_DATA_ID, item); - status = settingitem_get_status(item); + id = settingitem_get_id(item); + if (id && !strncmp(id, ITEM_CHANNEL_LOCK_ID, strlen(id)) + && (provider_get_passcode(KEY_PASSCODE, &passcode) == -1)) { + /*Disable channel lock menu if passcode has not been setup yet*/ + status = DISABLED; + } else { + status = settingitem_get_status(item); + } + if (status && !strncmp(status, DISABLED, strlen(status))) { elm_object_disabled_set(btn, EINA_TRUE); evas_object_freeze_events_set(btn, EINA_TRUE); diff --git a/src/view_need_pwd.c b/src/view_need_pwd.c index b1357ac..633bf61 100644 --- a/src/view_need_pwd.c +++ b/src/view_need_pwd.c @@ -221,7 +221,10 @@ static int _check_passcode(struct _chnllock_data *data) return 0; passcode = NULL; - provider_get_passcode(KEY_PASSCODE, &passcode); + if (provider_get_passcode(KEY_PASSCODE, &passcode) == -1) { + _DBG("Passcode has not been setup yet"); + return 1; + } if (strncmp(data->passcode, passcode, strlen(passcode))) { free(passcode); -- 2.7.4 From 7be3519c3d6805a49f046e2b1290389b83362cf7 Mon Sep 17 00:00:00 2001 From: Shuhrat Dehkanov Date: Fri, 29 May 2015 00:50:28 +0900 Subject: [PATCH 04/16] Remove "Auto program" menu Auto program depends on tv-service which is currently missing Change-Id: I1eb80616a11fddbcecdfc55b3516e48fca38cc79 --- CMakeLists.txt | 5 +---- json/channel.json | 10 +--------- json/helper.json | 1 - 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bc5f3ff..01a6284 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,9 +24,6 @@ pkg_check_modules(HOMEPANEL_PKGS REQUIRED capi-system-info capi-media-sound-manager ) - #capi-system-tvtimer - #tv-service - #tv-player-core SET(PREFIX ${CMAKE_INSTALL_PREFIX}) @@ -123,7 +120,7 @@ INSTALL(FILES ${CMAKE_SOURCE_DIR}/${DESKTOP_ICON_4X2} DESTINATION ${DESKTOP_ICON INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/json DESTINATION ${RESDIR}) ADD_SUBDIRECTORY(data) #ADD_SUBDIRECTORY(po) -ADD_SUBDIRECTORY(ug/channel) +#ADD_SUBDIRECTORY(ug/channel) ADD_SUBDIRECTORY(ug/network) ADD_SUBDIRECTORY(ug/proxy) ADD_SUBDIRECTORY(ug/wifi-direct) diff --git a/json/channel.json b/json/channel.json index 0d2d070..7df2cf8 100644 --- a/json/channel.json +++ b/json/channel.json @@ -1,12 +1,5 @@ { "settingitems": { - "auto-program": { - "display-name": "Auto program", - "setting-ui": { - "style": "ui-gadget", - "name": "auto-program" - } - }, "channel-lock": { "display-name": "Channel lock", "style": "title.value", @@ -32,10 +25,9 @@ "settingtree": { "channel": { "subsettingitems": [ - "auto-program", "channel-lock" ], "parentitem": "maincatalog" } } -} \ No newline at end of file +} diff --git a/json/helper.json b/json/helper.json index ef99f50..a9f4b1e 100644 --- a/json/helper.json +++ b/json/helper.json @@ -9,7 +9,6 @@ "picturemode": "picture", "soundmode": "sound", "speakersettings": "sound", - "auto-program": "channel", "channel-lock": "channel", "lock-sublist": "channel-lock", "network-settings": "network", -- 2.7.4 From 0f0b16192489eda4ece753d60a6d2f55fa8719f7 Mon Sep 17 00:00:00 2001 From: Shuhrat Dehkanov Date: Tue, 2 Jun 2015 23:11:17 +0900 Subject: [PATCH 05/16] Fix incompatible pointer type warning [ 54s] /home/abuild/rpmbuild/BUILD/org.tizen.settings-tv-ref-0.1/src /view_maincatalog.c: In function '_draw_subitems': [ 54s] /home/abuild/rpmbuild/BUILD/org.tizen.settings-tv-ref-0.1/src /view_maincatalog.c:1181:45: warning: passing argument 2 of 'provider_get_passcode' from incompatible pointer type [ 54s] && (provider_get_passcode(KEY_PASSCODE, &passcode) == -1)) { [ 54s] ^ [ 54s] In file included from /home/abuild/rpmbuild/BUILD/ org.tizen.settings-tv-ref-0.1/src/view_maincatalog.c:28:0: [ 54s] /home/abuild/rpmbuild/BUILD/org.tizen.settings-tv-ref-0.1/ include/settings_provider.h:28:5: note: expected 'char **' but argument is of type 'const char **' [ 54s] int provider_get_passcode(const char *key, char **val); [ 54s] ^ Change-Id: I4926ee81a6f19504ea8b6b5721fbf5d827bcaf0a --- src/view_maincatalog.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/view_maincatalog.c b/src/view_maincatalog.c index 4112ba6..d6e5ea2 100644 --- a/src/view_maincatalog.c +++ b/src/view_maincatalog.c @@ -1099,7 +1099,8 @@ static int _draw_subitems(struct _view_data *data, const char *name) int cnt; Eina_Array_Iterator a; unsigned int i; - const char *id, *passcode, *style, *status; + const char *id, *style, *status; + char *passcode; Eina_Array *enabled; if (!data || !name || !data->base) { -- 2.7.4 From fd484e011c47d611bee8effc8491df3ece42a927 Mon Sep 17 00:00:00 2001 From: Shuhrat Dehkanov Date: Tue, 2 Jun 2015 23:19:42 +0900 Subject: [PATCH 06/16] Add text.ellipsis This fixes edje_cc: Warning. Part 'elm.text' in group 'elm/progressbar/horizontal/update_progressbar' contains description 'default:0' which has text.min: 1 X; but not text.ellipsis: -1; edje_cc: Warning. This is almost certainly not what you want. warning. Change-Id: I328f3dee7a12e67ec01b9b478e5b5e32d16bc8b3 --- data/widget/progressbar.edc | 46 ++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/data/widget/progressbar.edc b/data/widget/progressbar.edc index 75109b9..35df42c 100644 --- a/data/widget/progressbar.edc +++ b/data/widget/progressbar.edc @@ -15,7 +15,7 @@ */ group { - name: "elm/progressbar/horizontal/subitembtnprogress"; + name: "elm/progressbar/horizontal/subitembtnprogress"; parts { part { name: "elm.background.progressbar"; @@ -155,29 +155,29 @@ group { } } } - } - programs { - program { - name: "focused"; - signal: SIG_UNCTRL_PB_FOCUSED; - source: SRC_PB_PROG; - action: STATE_SET "focused" 0.0; - target: "background"; - target: "elm.progress.progressbar"; - } - program { - name: "unfocused"; - signal: SIG_UNCTRL_PB_UNFOCUSED; - source: SRC_PB_PROG; - action: STATE_SET "default" 0.0; - target: "background"; - target: "elm.progress.progressbar"; - } - } + } + programs { + program { + name: "focused"; + signal: SIG_UNCTRL_PB_FOCUSED; + source: SRC_PB_PROG; + action: STATE_SET "focused" 0.0; + target: "background"; + target: "elm.progress.progressbar"; + } + program { + name: "unfocused"; + signal: SIG_UNCTRL_PB_UNFOCUSED; + source: SRC_PB_PROG; + action: STATE_SET "default" 0.0; + target: "background"; + target: "elm.progress.progressbar"; + } + } } group { - name: "elm/progressbar/horizontal/update_progressbar"; + name: "elm/progressbar/horizontal/update_progressbar"; parts { part { name: "elm.background.progressbar"; @@ -347,11 +347,11 @@ group { font: APP_TEXT_FONT; size: 18*2; min: 1 0; + ellipsis: -1; text_class: "tizen"; } fixed: 1 1; } } - } + } } - -- 2.7.4 From 773cb7a220332e7455cb8469cc33aad55b03215f Mon Sep 17 00:00:00 2001 From: Shuhrat Dehkanov Date: Wed, 3 Jun 2015 16:13:44 +0900 Subject: [PATCH 07/16] Add index normalizer Index returned by elm_genlist_item_index_get() starts from 1, but eina_list_nth() index starts from 0 consequently causing mismatch in user selected AP and the actual AP being connected to. This adds a normalizer to correct that. Change-Id: Ia04044ea49d5bacc28606216d4985c8d0655bc00 --- ug/network/src/main_view.c | 48 ++++++++++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/ug/network/src/main_view.c b/ug/network/src/main_view.c index 0f78e08..b20e2f8 100644 --- a/ug/network/src/main_view.c +++ b/ug/network/src/main_view.c @@ -39,6 +39,12 @@ #define TYPE_POPUP_X_OFFSET 190 +/* + * Index returned by elm_genlist_item_index_get() starts from 1, + * while eina_list_nth() index starts from 0 + */ +#define ELM_GENLIST_ITEM_INDEX_GET_NORMALIZER 1 + enum action_btn_enum { CONNECT, REFRESH, @@ -94,7 +100,7 @@ struct _priv { enum network_type_enum network_type; enum view_type cur_view; - int wifi_init; + Eina_Bool is_wifi_initialized; Eina_Bool wifi_conn; Eina_Bool wired_conn; @@ -942,7 +948,7 @@ static void _item_select_cb(void *data, Evas_Object *obj, void *ei) int index; if (!data || !ei) { - _ERR("Parameter error!"); + _ERR("Invalid parameter"); return; } @@ -950,6 +956,7 @@ static void _item_select_cb(void *data, Evas_Object *obj, void *ei) gen_item = ei; if (priv->last_item == gen_item) { + _DBG("The same item is selected again"); elm_object_item_signal_emit(gen_item, SIG_STATE_UNSELECTED, ELM); _disable_connect_btn(priv); @@ -969,15 +976,16 @@ static void _item_select_cb(void *data, Evas_Object *obj, void *ei) _enable_connect_btn(priv); _enable_other_btn(priv); - index = elm_genlist_item_index_get(priv->last_item); + index = elm_genlist_item_index_get(priv->last_item) + - ELM_GENLIST_ITEM_INDEX_GET_NORMALIZER; if (index < 0) { - _ERR("the index of item is invalid."); + _ERR("Invalid index"); return; } ap_info = eina_list_nth(priv->ap_list, index); if (!ap_info) { - _ERR("ap info is NULL."); + _ERR("Failed to get AP info"); return; } @@ -988,9 +996,10 @@ static void _item_select_cb(void *data, Evas_Object *obj, void *ei) priv->ap_name = strdup(ap_info->essid); if (!priv->ap_name) { - _ERR("ap name gets failed."); + _ERR("Failed to get AP name"); return; } + _DBG("Selected AP name: %s", priv->ap_name); if (priv->ap) { wifi_mgr_ap_destroy(priv->ap); @@ -999,7 +1008,7 @@ static void _item_select_cb(void *data, Evas_Object *obj, void *ei) wifi_mgr_ap_clone(&priv->ap, ap_info->ap); if (!priv->ap) { - _ERR("ap clone failed."); + _ERR("AP clone failed"); return; } @@ -1178,7 +1187,7 @@ static void _wifi_activated_cb(wifi_error_e result, void *data) /** * Clear the genlist item list. * -* Called when need clear the ap list,eg.refrsh button is clicked +* Called when need clear the AP list, e.g., when the refresh button is clicked * * @param[in] priv _priv object bypassed */ @@ -1187,7 +1196,7 @@ static void _clear_genlist_item_list(struct _priv *priv) void *temp; if (!priv || !priv->genlist) { - _ERR("Parameter error!"); + _ERR("Invalid parameter"); return; } @@ -1213,26 +1222,26 @@ static int _display_wireless_setting(struct _priv *priv) int ret; if (!priv) { - _ERR("the param is invalid."); + _ERR("Invalid parameter"); return RET_FAILED; } _create_wireless_disconnect_part(priv); - if (!priv->wifi_init) { + if (!priv->is_wifi_initialized) { obj = _create_genlist_view(priv); if (!obj) { - _ERR("fail to create genlist"); + _ERR("Failed to create genlist"); return RET_FAILED; } ret = wifi_mgr_init(); if (ret != RET_SUCCESS) { - _ERR("fail to init wifi network"); + _ERR("Failed to initialize Wi-Fi network"); return RET_FAILED; } - priv->wifi_init = 1; + priv->is_wifi_initialized = EINA_TRUE; } _clear_genlist_item_list(priv); @@ -1240,7 +1249,7 @@ static int _display_wireless_setting(struct _priv *priv) activated = EINA_FALSE; ret = wifi_mgr_is_activated(&activated); if (ret != RET_SUCCESS) { - _ERR("the wifi is not activated."); + _ERR("Wi-Fi is still not activated"); return RET_FAILED; } @@ -1855,17 +1864,18 @@ static void _connect_network(struct _priv *priv) int ret; if (!priv) { - _ERR("the param is NULL."); + _ERR("Invalid parameter"); return; } if (priv->network_type == TYPE_WIRELESS) { if (priv->last_item) { - index = elm_genlist_item_index_get(priv->last_item); + index = elm_genlist_item_index_get(priv->last_item) + - ELM_GENLIST_ITEM_INDEX_GET_NORMALIZER; ret = _wifi_connect_ap(priv, index); if (ret != RET_SUCCESS) { - _ERR("connect ap"); + _DBG("Failed to connect to selected AP"); _show_confirm_popup(priv); return; } @@ -1873,7 +1883,7 @@ static void _connect_network(struct _priv *priv) } else { ret = _wired_connect_proc(priv); if (ret != RET_SUCCESS) { - _ERR("connect ap"); + _DBG("Failed to connect to selected network"); _show_confirm_popup(priv); return; } -- 2.7.4 From 343c5ba1f919e2b0bb32bc4abc1867365dc617bd Mon Sep 17 00:00:00 2001 From: Shuhrat Dehkanov Date: Wed, 3 Jun 2015 19:24:51 +0900 Subject: [PATCH 08/16] Replace "Select" key with "Return" "Select" key is missing both from keyboard and remote controller. That's, use KEY_ENTER_REMOTE or KEY_ENTER to proceed with connection. This change also removes markup from password entry text. Change-Id: I3dbc7dc3a31b1b31984f41cc92d521e92feade97 --- ug/network/edje/ug-network-settings.edc | 4 +++ ug/network/src/wifi_passcode_view.c | 43 +++++++++++++++++++++------------ 2 files changed, 31 insertions(+), 16 deletions(-) diff --git a/ug/network/edje/ug-network-settings.edc b/ug/network/edje/ug-network-settings.edc index 99ef21f..b354222 100644 --- a/ug/network/edje/ug-network-settings.edc +++ b/ug/network/edje/ug-network-settings.edc @@ -1442,6 +1442,7 @@ collections { scale: 1; description { state: "default" 0.0; + fixed: 1 1; rel1.to: "bg"; rel2 { to: "bg"; @@ -1459,6 +1460,7 @@ collections { description { state: "default" 0.0; align: 0.0 0.0; + fixed: 1 1; rel1 { to: "progress_padding"; relative: 1.0 1.0; @@ -1479,6 +1481,7 @@ collections { scale: 1; description { state: "default" 0.0; + fixed: 1 1; rel1 { to: "progress_wheel"; relative: 1.0 0.0; @@ -1521,6 +1524,7 @@ collections { scale: 1; description { state: "default" 0.0; + fixed: 1 1; rel1.to: "bg"; rel2 { to: "bg"; diff --git a/ug/network/src/wifi_passcode_view.c b/ug/network/src/wifi_passcode_view.c index e8a03b1..42bda01 100644 --- a/ug/network/src/wifi_passcode_view.c +++ b/ug/network/src/wifi_passcode_view.c @@ -31,9 +31,16 @@ #include "wifi_mgr.h" #define KEY_PRIV "priv" -#define KEY_NETWORK_ENTER "Select" -#define AP_NAME_LENTH 256 +#define AP_NAME_LENGTH 256 + +/* + * TODO: should MIN_PWD_LENGTH be changed to 8? + * + * http://standards.ieee.org/getieee802/download/802.11i-2004.pdf, H.4.1: + * _A pass-phrase is a sequence of between 8 and 63 ASCII-encoded characters._ + */ +#define MIN_PWD_LENGTH 1 #define TXT_PASSCODE "Network passcode" #define TXT_ENTER_PASSCODE "Enter the network password" @@ -49,7 +56,7 @@ struct _priv { Evas_Object *entry; Evas_Object *dim_ly; Evas_Object *ctxpopup; - char ap_name[AP_NAME_LENTH + 1]; + char ap_name[AP_NAME_LENGTH + 1]; char *ap_pwd; }; @@ -675,7 +682,7 @@ static bool _wifi_found_ap_cb(wifi_ap_h ap, void *data) wifi_mgr_get_ap_info(ap, &ap_info); - if (!strncmp(priv->ap_name, ap_info.essid, AP_NAME_LENTH)) { + if (!strncmp(priv->ap_name, ap_info.essid, AP_NAME_LENGTH)) { ret = wifi_mgr_set_passphrase(ap, priv->ap_pwd); if (ret != RET_SUCCESS) { _ERR("wifi_mgr_set_passphrase() failed."); @@ -769,9 +776,10 @@ static void _entry_key_press_cb(void *data, Evas *e, Evas_Event_Key_Down *ev; struct _priv *priv; int ret; + char *pwd; if (!ei || !data) { - _ERR("ei or data is NULL"); + _ERR("Invalid parameter"); return; } @@ -783,24 +791,27 @@ static void _entry_key_press_cb(void *data, Evas *e, return; } - if (!strcmp(ev->keyname, KEY_NETWORK_ENTER)) { + if (!strcmp(ev->keyname, KEY_ENTER_REMOTE) + || !strcmp(ev->keyname, KEY_ENTER)) { + pwd = elm_entry_markup_to_utf8(elm_entry_entry_get(obj)); + if (!pwd || strlen(pwd) < MIN_PWD_LENGTH) { + _DBG("Invalid passcode is provided"); + free(pwd); + _show_invalid_pwd_popup(priv); + return; + } + if (priv->ap_pwd) { free(priv->ap_pwd); priv->ap_pwd = NULL; } - - priv->ap_pwd = strdup(elm_entry_entry_get(obj)); - if (!priv->ap_pwd) { - _ERR("the passcode in entry is NULL."); - _show_invalid_pwd_popup(priv); - return; - } + priv->ap_pwd = strdup(pwd); + free(pwd); ret = _wifi_connect_ap(priv); if (ret != RET_SUCCESS) { - _ERR("connect ap"); + _DBG("Connection failed"); _show_confirm_popup(priv); - return; } } } @@ -877,7 +888,7 @@ static Evas_Object *_create(struct viewmgr *vmgr, void *data) priv->vmgr = vmgr; ap_info = data; - strncpy(priv->ap_name, ap_info->essid, AP_NAME_LENTH); + strncpy(priv->ap_name, ap_info->essid, AP_NAME_LENGTH); base = util_add_layout(priv->win, UG_NETWORK_EDJ_FILE, GRP_WIFI_PASSCODE_BASE); -- 2.7.4 From 3c6278a023e39c33a30c1b57cb5015e0be2c7023 Mon Sep 17 00:00:00 2001 From: Shuhrat Dehkanov Date: Mon, 8 Jun 2015 16:38:42 +0900 Subject: [PATCH 09/16] Exit app and sub-catalog on remote back key press Change-Id: I92a284b9e89a4035972e1f0940c2b8f8751f9988 --- src/view_maincatalog.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/view_maincatalog.c b/src/view_maincatalog.c index d6e5ea2..9847b8a 100644 --- a/src/view_maincatalog.c +++ b/src/view_maincatalog.c @@ -121,8 +121,9 @@ static void _subitem_key_pressed_cb(void *data, Evas *e, priv = data; - if (!strcmp(ev->keyname, KEY_LEFT) || - !strcmp(ev->keyname, KEY_BACK)) { + if (!strcmp(ev->keyname, KEY_LEFT) + || !strcmp(ev->keyname, KEY_BACK) + || !strcmp(ev->keyname, KEY_BACK_REMOTE)) { pb = evas_object_data_get(obj, PROGRESS_BAR_DATA); if (pb) elm_object_signal_emit(pb, @@ -1356,8 +1357,9 @@ static void _main_setting_key_pressed_cb(void *data, Evas *e, _draw_subitems(priv, name); } else if (!strcmp(ev->keyname, KEY_RIGHT)) { _move_from_main_item_to_subitem(priv, obj); - } else if (!strcmp(ev->keyname, KEY_EXIT) || - !strcmp(ev->keyname, KEY_BACK)) { + } else if (!strcmp(ev->keyname, KEY_EXIT) + || !strcmp(ev->keyname, KEY_BACK) + || !strcmp(ev->keyname, KEY_BACK_REMOTE)) { app_efl_exit(); } } -- 2.7.4 From f862f3e401c1e4854f34a5b5a598416e92daf4cf Mon Sep 17 00:00:00 2001 From: Shuhrat Dehkanov Date: Tue, 9 Jun 2015 08:19:16 +0900 Subject: [PATCH 10/16] Exit Wi-Fi passcode view on remote back key press Change-Id: I9fc5fcc0540624337f046973463370a82e0e7bbb --- ug/network/src/wifi_passcode_view.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ug/network/src/wifi_passcode_view.c b/ug/network/src/wifi_passcode_view.c index 42bda01..93e8c54 100644 --- a/ug/network/src/wifi_passcode_view.c +++ b/ug/network/src/wifi_passcode_view.c @@ -168,7 +168,7 @@ static int _create_dim_layout(struct _priv *priv) /** * Callback for key pressed event. * - * If the key is KEY_BACK, delete this view. + * If the key is KEY_BACK or KEY_BACK_REMOTE, delete this view. * * @param[in] data User data * @param[in] e Evas handler @@ -194,7 +194,8 @@ static void _base_key_press_cb(void *data, Evas *e, return; } - if (!strcmp(ev->keyname, KEY_BACK)) + if (!strcmp(ev->keyname, KEY_BACK) + || !strcmp(ev->keyname, KEY_BACK_REMOTE)) viewmgr_pop(priv->vmgr); } @@ -280,7 +281,7 @@ static void _ctxpopup_unfocused_cb(void *data, /** * @Evas_Object_Event_Cb type callback for handling pressed event. * -* When KEY_BACK is pressed in the ctxpopup, delete the ctxpopup. +* When KEY_BACK or KEY_BACK_REMOTE is pressed in the ctxpopup, delete it. * * @param[in] data User data * @param[in] e Evas handler @@ -306,7 +307,8 @@ static void _ctxpopup_pressed_cb(void *data, Evas *e, return; } - if (!strcmp(ev->keyname, KEY_BACK)) { + if (!strcmp(ev->keyname, KEY_BACK) + || !strcmp(ev->keyname, KEY_BACK_REMOTE)) { _unset_layout_dim(priv); evas_object_del(obj); -- 2.7.4 From 048feed01306053db5dde27a8176077e9ce5b974 Mon Sep 17 00:00:00 2001 From: Shuhrat Dehkanov Date: Wed, 10 Jun 2015 16:29:57 +0900 Subject: [PATCH 11/16] Remove key definitions These are provided by app-common Change-Id: If61ad40967aa285b37c540f1e6920a6cdeadb38d --- include/def.h | 19 ------------------- ug/network/include/defs.h | 19 ------------------- ug/proxy/include/defs.h | 19 ------------------- ug/proxy/src/main_view.c | 4 ++-- ug/system/clock/include/ug_clock_define.h | 17 ----------------- ug/wifi-direct/include/defs.h | 18 ------------------ 6 files changed, 2 insertions(+), 94 deletions(-) diff --git a/include/def.h b/include/def.h index fed4bd5..e90d53e 100644 --- a/include/def.h +++ b/include/def.h @@ -266,23 +266,4 @@ #define TEXT_STYLE_MEDIUM "Tizen Sans:style=Medium" #define TEXT_STYLE_BOLD "Tizen Sans:style=Bold" -/* Key defines */ -#define KEY_UP "Up" -#define KEY_DOWN "Down" -#define KEY_LEFT "Left" -#define KEY_RIGHT "Right" -#define KEY_ENTER "Return" -#define KEY_EXIT "XF86Close" - -#define KEY_0 "0" -#define KEY_1 "1" -#define KEY_2 "2" -#define KEY_3 "3" -#define KEY_4 "4" -#define KEY_5 "5" -#define KEY_6 "6" -#define KEY_7 "7" -#define KEY_8 "8" -#define KEY_9 "9" - #endif /* __DEF_H__ */ diff --git a/ug/network/include/defs.h b/ug/network/include/defs.h index dc58d0f..cc9048f 100644 --- a/ug/network/include/defs.h +++ b/ug/network/include/defs.h @@ -137,25 +137,6 @@ #define POPUP_WIDTH 688 #define POPUP_HEIGHT 411 -/* Key defines */ -#define KEY_UP "Up" -#define KEY_DOWN "Down" -#define KEY_LEFT "Left" -#define KEY_RIGHT "Right" -#define KEY_ENTER "Return" -#define KEY_EXIT "XF86Close" - -#define KEY_0 "0" -#define KEY_1 "1" -#define KEY_2 "2" -#define KEY_3 "3" -#define KEY_4 "4" -#define KEY_5 "5" -#define KEY_6 "6" -#define KEY_7 "7" -#define KEY_8 "8" -#define KEY_9 "9" - /* FIXME: do not pre-define */ #define DEFAULT_WIN_WIDTH 1920 #define DEFAULT_WIN_HEIGHT 1080 diff --git a/ug/proxy/include/defs.h b/ug/proxy/include/defs.h index 4163f4f..7ed946a 100644 --- a/ug/proxy/include/defs.h +++ b/ug/proxy/include/defs.h @@ -94,25 +94,6 @@ #define PART_TEXT_CONTENT "content.txt" #define PART_ENTRY "part.entry" -/* Key defines */ -#define KEY_UP "Up" -#define KEY_DOWN "Down" -#define KEY_LEFT "Left" -#define KEY_RIGHT "Right" -#define KEY_ENTER "Return" -#define KEY_EXIT "XF86Close" - -#define KEY_0 "0" -#define KEY_1 "1" -#define KEY_2 "2" -#define KEY_3 "3" -#define KEY_4 "4" -#define KEY_5 "5" -#define KEY_6 "6" -#define KEY_7 "7" -#define KEY_8 "8" -#define KEY_9 "9" - /* FIXME: do not pre-define */ #define DEFAULT_WIN_WIDTH 1920 #define DEFAULT_WIN_HEIGHT 1080 diff --git a/ug/proxy/src/main_view.c b/ug/proxy/src/main_view.c index 2096d8b..156f23c 100644 --- a/ug/proxy/src/main_view.c +++ b/ug/proxy/src/main_view.c @@ -30,7 +30,6 @@ #include "common.h" #define KEY_PRIV "priv" -#define KEY_PROXY_ENTER "Select" #define IP_VALUE1 "value1" #define IP_VALUE2 "value2" #define IP_VALUE3 "value3" @@ -1226,7 +1225,8 @@ static void _entry_key_pressed_cb(void *data, Evas *e, } _unset_layout_dim(priv); - } else if (!strcmp(ev->keyname, KEY_PROXY_ENTER)) { + } else if (!strcmp(ev->keyname, KEY_ENTER_REMOTE) + || !strcmp(ev->keyname, KEY_ENTER)) { value = elm_entry_entry_get(obj); elm_object_part_text_set(priv->url_btn, PART_VALUE, value); memset(priv->url, 0, MOTHED_URL_LEN + 1); diff --git a/ug/system/clock/include/ug_clock_define.h b/ug/system/clock/include/ug_clock_define.h index 6b0527f..6830756 100644 --- a/ug/system/clock/include/ug_clock_define.h +++ b/ug/system/clock/include/ug_clock_define.h @@ -81,21 +81,4 @@ #define SIG_SRC_FOC_HIDE_ICON "focus_hide_icon" #define SIG_NAME_SUBLIST "sublist" -/* Key defines */ -#define KEY_UP "Up" -#define KEY_DOWN "Down" -#define KEY_LEFT "Left" -#define KEY_RIGHT "Right" - -#define KEY_0 "0" -#define KEY_1 "1" -#define KEY_2 "2" -#define KEY_3 "3" -#define KEY_4 "4" -#define KEY_5 "5" -#define KEY_6 "6" -#define KEY_7 "7" -#define KEY_8 "8" -#define KEY_9 "9" - #endif /* __UG_CLOCK_DEFINE_H__ */ diff --git a/ug/wifi-direct/include/defs.h b/ug/wifi-direct/include/defs.h index a40c295..ebbd145 100644 --- a/ug/wifi-direct/include/defs.h +++ b/ug/wifi-direct/include/defs.h @@ -91,22 +91,4 @@ #define SIG_CLICKED "clicked" #define SIG_BTN_SELECTED "btn,selected" -/* Key defines */ -#define KEY_UP "Up" -#define KEY_DOWN "Down" -#define KEY_LEFT "Left" -#define KEY_RIGHT "Right" -#define KEY_EXIT "XF86Close" - -#define KEY_0 "0" -#define KEY_1 "1" -#define KEY_2 "2" -#define KEY_3 "3" -#define KEY_4 "4" -#define KEY_5 "5" -#define KEY_6 "6" -#define KEY_7 "7" -#define KEY_8 "8" -#define KEY_9 "9" - #endif /* __DEFS_H__ */ -- 2.7.4 From 7be8032a66d283f24b095422993d08701009d024 Mon Sep 17 00:00:00 2001 From: Shuhrat Dehkanov Date: Thu, 11 Jun 2015 16:11:30 +0900 Subject: [PATCH 12/16] Show date in full length instead of ellipses Currently, the date is shown as ".../.../..." instead of "12/31/2000" in date setting pop-up dialog. This fixes that and shows the date in full length. Change-Id: Ie2da0a75b6a190f85ef0f72b1e8c9203687d291d --- ug/system/clock/edje/ug_clock.edc | 7 ++++++- ug/system/clock/edje/widgets/button.edc | 10 +++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ug/system/clock/edje/ug_clock.edc b/ug/system/clock/edje/ug_clock.edc index f4bc252..d561401 100644 --- a/ug/system/clock/edje/ug_clock.edc +++ b/ug/system/clock/edje/ug_clock.edc @@ -335,6 +335,11 @@ collections { fixed: 1 1; color: 128 128 128 38; } + description { + state: "hide" 0.0; + inherit: "default" 0.0; + visible: 0; + } } part { name: "spin_ctrl_2_swallow_padding"; @@ -434,7 +439,7 @@ collections { scale: 1; description { state: "default" 0.0; - min: 138 122; + min: 140 122; rel1 { to: "spin_ctrl_3_swallow_padding"; relative: 0.0 0.0; diff --git a/ug/system/clock/edje/widgets/button.edc b/ug/system/clock/edje/widgets/button.edc index 4d346e3..059a674 100644 --- a/ug/system/clock/edje/widgets/button.edc +++ b/ug/system/clock/edje/widgets/button.edc @@ -567,7 +567,7 @@ group { to: "elm_text_padding"; } text { - size: 30; + size: 26; align: 0.5 0.5; } color: 69 143 255 255; @@ -727,7 +727,7 @@ group { scale: 1; description { state: "default" 0.0; - min: 138 122; + min: 140 122; align: 0 0; fixed: 1 1; } @@ -836,7 +836,7 @@ group { to: "elm_text_padding"; } text { - size: 30; + size: 26; align: 0.5 0.5; } color: 69 143 255 255; @@ -1040,7 +1040,7 @@ group { to: "elm_text_padding"; } text { - size: 30; + size: 26; align: 0.0 0.5; } color: 69 143 255 255; @@ -1547,4 +1547,4 @@ group { target: "bg"; } } -} \ No newline at end of file +} -- 2.7.4 From 81de5cb011cb41b20bf4560d964ba2493730e2be Mon Sep 17 00:00:00 2001 From: Shuhrat Dehkanov Date: Thu, 11 Jun 2015 17:10:06 +0900 Subject: [PATCH 13/16] Do not fail if proxy method has never been setup Currently, the UI fails if no proxy method was setup previously i.e., if vconf_get_int(VCONF_PROXY_METHOD, value) returns non-zero value. However, we think, that should not be the case as user has to be able to get to the proxy settings UI in order to setup proxy in the first place. This fix that issue and enables the UI even if vconf_get_int() fails. Change-Id: Ie7308f75d75ec252ebab931550c48482476a94ab Signed-off-by: Shuhrat Dehkanov --- ug/proxy/include/vconf_mgr.h | 4 ++-- ug/proxy/src/main_view.c | 30 +++++++++--------------------- ug/proxy/src/vconf_mgr.c | 44 +++++++++++++------------------------------- 3 files changed, 24 insertions(+), 54 deletions(-) diff --git a/ug/proxy/include/vconf_mgr.h b/ug/proxy/include/vconf_mgr.h index 363a73a..cd354aa 100644 --- a/ug/proxy/include/vconf_mgr.h +++ b/ug/proxy/include/vconf_mgr.h @@ -22,7 +22,7 @@ char *vconf_mgr_get_string_value(const char *key); int vconf_mgr_set_string_value(const char *key, const char *value); -int vconf_mgr_get_int_value(const char *key, int *value); -int vconf_mgr_set_int_value(const char *key, const int value); +void vconf_mgr_get_proxy_method(int *value); +int vconf_mgr_set_proxy_method(const int value); #endif /* __VCONF_MGR_H__ */ diff --git a/ug/proxy/src/main_view.c b/ug/proxy/src/main_view.c index 156f23c..2135982 100644 --- a/ug/proxy/src/main_view.c +++ b/ug/proxy/src/main_view.c @@ -36,7 +36,6 @@ #define IP_VALUE4 "value4" static const char *VCONF_NETWORK_TYPE = "db/menu/network/network_type"; -static const char *VCONF_PROXY_METHOD = "db/menu/proxy/method"; static const char *VCONF_PROXY_IP = "db/menu/proxy/ip"; static const char *VCONF_PROXY_URL = "db/menu/proxy/url"; @@ -426,7 +425,6 @@ static void _get_man_saved_value(char *des_ip, static int _get_proxy_method(struct _priv *priv) { int value; - int ret; char *str; if (!priv) { @@ -440,26 +438,12 @@ static int _get_proxy_method(struct _priv *priv) else priv->net_type = TYPE_WIRELESS; - value = 0; - ret = vconf_mgr_get_int_value(VCONF_PROXY_METHOD, &value); - if (ret != RET_SUCCESS) { - _ERR("vconf_mgr_get_int_value() failed."); - return RET_FAILED; - } - - switch (value) { - case 0: - priv->method = METHOD_NONE; - break; - case 1: - priv->method = METHOD_MAN; - break; - case 2: - priv->method = METHOD_AUTO; - break; - default: + vconf_mgr_get_proxy_method(&value); + if (value < METHOD_NONE || value > METHOD_AUTO) { + _ERR("Unsupported method is returned from vconf"); return RET_FAILED; } + priv->method = value; _get_man_saved_value(priv->ip, VCONF_PROXY_IP); @@ -1697,12 +1681,16 @@ static void _show_invalid_info_ctxpopup(struct _priv *priv, int ret) */ static int _save_to_vconf(struct _priv *priv) { + int ret; + if (!priv) { _ERR("The param is invalid.\n"); return RET_SUCCESS; } - vconf_mgr_set_int_value(VCONF_PROXY_METHOD, priv->method); + ret = vconf_mgr_set_proxy_method(priv->method); + if (ret != RET_SUCCESS) + return RET_FAILED; switch (priv->method) { case METHOD_NONE: diff --git a/ug/proxy/src/vconf_mgr.c b/ug/proxy/src/vconf_mgr.c index d018549..27ac3f3 100644 --- a/ug/proxy/src/vconf_mgr.c +++ b/ug/proxy/src/vconf_mgr.c @@ -19,6 +19,8 @@ #include "vconf_mgr.h" #include "i18n.h" +static const char *VCONF_PROXY_METHOD = "db/menu/proxy/method"; + /** * Gets the string value from vconf. * @@ -61,49 +63,29 @@ int vconf_mgr_set_string_value(const char *key, const char *value) } /** - * Gets the integer value from vconf. + * Gets the current proxy method value from vconf. * - * @param[in] key Vconf key - * @param[out] value The value - * @return RET_SUCCESS if the operation is successful; RET_FAILED if failed; + * @param[out]: value : 0 - none; 1 - manual; 2 - auto. + * @return void. */ -int vconf_mgr_get_int_value(const char *key, int *value) +void vconf_mgr_get_proxy_method(int *value) { - int ret; - - if (!key || !value) { - _ERR("the param is invalid."); - return RET_FAILED; - } - - ret = vconf_get_int(key, value); - if (ret != 0) { - _ERR("vconf get int failed"); - return RET_FAILED; + if (vconf_get_int(VCONF_PROXY_METHOD, value) != 0) { + /* failed to get value from vconf, assume none set */ + *value = METHOD_NONE; } - - return RET_SUCCESS; } /** - * Sets the integer value to vconf. + * Sets the user selected proxy method value to vconf. * - * @param[in] key Vconf key * @param[in] value The value * @return RET_SUCCESS if the operation is successful; RET_FAILED if failed; */ -int vconf_mgr_set_int_value(const char *key, const int value) +int vconf_mgr_set_proxy_method(const int value) { - int ret; - - if (!key) { - _ERR("the param is invalid."); - return RET_FAILED; - } - - ret = vconf_set_int(key, value); - if (ret != 0) { - _ERR("vconf set int failed."); + if (vconf_set_int(VCONF_PROXY_METHOD, value) != 0) { + _ERR("Failed to set user selected proxy method to vconf"); return RET_FAILED; } -- 2.7.4 From e0e4c7ca0d4372cbbad23098344ae17fc3768def Mon Sep 17 00:00:00 2001 From: Minkyu Kang Date: Fri, 12 Jun 2015 13:19:37 +0900 Subject: [PATCH 14/16] add focus_highlight on at widgets Change-Id: I26cd77402f1afcf5549d85fd829185858a5d618f Signed-off-by: Minkyu Kang --- data/widget/button.edc | 9 ++++++++- data/widget/ctxpopup.edc | 6 +++++- data/widget/progressbar.edc | 2 ++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/data/widget/button.edc b/data/widget/button.edc index 00056b3..c52af91 100644 --- a/data/widget/button.edc +++ b/data/widget/button.edc @@ -16,6 +16,7 @@ group{ name: MAINICONBTN; + data.item: "focus_highlight" "on"; images { image: "allbrowser_menu_bg.png" COMP; } @@ -244,6 +245,7 @@ group{ group { name: SUBITEMBTN; + data.item: "focus_highlight" "on"; parts { part { name: "bg"; @@ -535,6 +537,7 @@ group { group { name: "elm/button/base/subbtn_item_title_icon"; + data.item: "focus_highlight" "on"; images { image: "ico_hyperlink_arrow.png" COMP; } @@ -826,6 +829,7 @@ group { group { name: "elm/button/base/subbtn_item_title_slider_value"; + data.item: "focus_highlight" "on"; parts { part { name: "bg"; @@ -1210,6 +1214,7 @@ group { group{ name: CTXPOPUPBTN; + data.item: "focus_highlight" "on"; images { image: "ico_spincontrol_check.png" COMP; } @@ -1487,6 +1492,7 @@ group{ group { name: "elm/button/base/basic_btn"; + data.item: "focus_highlight" "on"; images { image: "round_rectangle_4X4.png" COMP; } @@ -1640,6 +1646,7 @@ group { group { name: "elm/button/base/input_passcode_btn"; + data.item: "focus_highlight" "on"; images { image: "search_searchbar_small_bg_foc.png" COMP; image: "search_searchbar_small_bg_nor.png" COMP; @@ -1715,4 +1722,4 @@ group { target: "elm.text"; } } -} \ No newline at end of file +} diff --git a/data/widget/ctxpopup.edc b/data/widget/ctxpopup.edc index ce0907a..f3f25d0 100644 --- a/data/widget/ctxpopup.edc +++ b/data/widget/ctxpopup.edc @@ -16,6 +16,7 @@ group { name: SUBLIST_CTXPOPUP1; + data.item: "focus_highlight" "on"; parts { part { name: SUBLIST_CTXPOPUP1_CLIPPER; @@ -51,6 +52,7 @@ group { group { name: SUBLIST_CTXPOPUP2; + data.item: "focus_highlight" "on"; images { image: "btn_down.png" COMP; image: "btn_up.png" COMP; @@ -246,7 +248,9 @@ group { } } -group { name: "elm/ctxpopup/base/change_passcode_ctxpopup"; +group { + name: "elm/ctxpopup/base/change_passcode_ctxpopup"; + data.item: "focus_highlight" "on"; parts { part { name: "elm.swallow.content"; diff --git a/data/widget/progressbar.edc b/data/widget/progressbar.edc index 35df42c..d987002 100644 --- a/data/widget/progressbar.edc +++ b/data/widget/progressbar.edc @@ -16,6 +16,7 @@ group { name: "elm/progressbar/horizontal/subitembtnprogress"; + data.item: "focus_highlight" "on"; parts { part { name: "elm.background.progressbar"; @@ -178,6 +179,7 @@ group { group { name: "elm/progressbar/horizontal/update_progressbar"; + data.item: "focus_highlight" "on"; parts { part { name: "elm.background.progressbar"; -- 2.7.4 From 41378c1bf08c5a5b1059ded33211299e448b577f Mon Sep 17 00:00:00 2001 From: Minkyu Kang Date: Fri, 12 Jun 2015 13:31:16 +0900 Subject: [PATCH 15/16] disable unsupported menus Change-Id: I869a89ab61ed1205fe70aab094ea9dbffa33b7d6 Signed-off-by: Minkyu Kang --- json/sound.json | 1 + json/system.json | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/json/sound.json b/json/sound.json index db64a70..35ca9f4 100644 --- a/json/sound.json +++ b/json/sound.json @@ -29,6 +29,7 @@ "speakersettings": { "display-name": "Speaker settings", "style": "title.icon", + "status": "disabled", "setting-ui": { "style": "ctxpopup" }, diff --git a/json/system.json b/json/system.json index 4b2ad50..c51eacb 100644 --- a/json/system.json +++ b/json/system.json @@ -3,6 +3,7 @@ "clock": { "display-name": "Clock", "style": "title.value", + "status": "disabled", "setting-ui": { "style": "clock-ctxpopup", "name": "clock" @@ -25,6 +26,7 @@ "sleep-timer": { "display-name": "Sleep Timer", "style": "title.value", + "status": "disabled", "setting-ui": { "style": "ctxpopup" }, @@ -79,6 +81,7 @@ "change-passcode": { "display-name": "Change Passcode", "style": "title.value", + "status": "disabled", "setting-ui": { "style": "passcode-popup" }, @@ -90,6 +93,7 @@ "subtitle": { "display-name": "Subtitle", "style": "title.value", + "status": "disabled", "setting-ui": { "style": "ctxpopup" }, @@ -123,7 +127,7 @@ "type": "string", "list": [ { - "display-value": "Korean", + "display-value": "Korea", "value": "ko_KR.utf8" }, { @@ -136,6 +140,7 @@ "language": { "display-name": "Language", "style": "title.value", + "status": "disabled", "setting-ui": { "style": "ctxpopup" }, @@ -186,4 +191,4 @@ "parentitem": "maincatalog" } } -} \ No newline at end of file +} -- 2.7.4 From 93921891730dd84f3381da898b403adbb28f0bb7 Mon Sep 17 00:00:00 2001 From: Yu Jiung Date: Sat, 20 Jun 2015 18:07:18 +0900 Subject: [PATCH 16/16] Replace libwifi-direct with capi-network-wifi-direct Change-Id: I3adcaf456eaf3aacb8c7e3b733e92809462e5a34 Signed-off-by: Yu jiung --- packaging/org.tizen.settings-tv-ref.spec | 4 ++-- ug/wifi-direct/CMakeLists.txt | 4 ++-- ug/wifi-direct/include/wifi_direct_mgr.h | 4 ++-- ug/wifi-direct/src/wifi_direct_mgr.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packaging/org.tizen.settings-tv-ref.spec b/packaging/org.tizen.settings-tv-ref.spec index 2139bd2..f82326c 100644 --- a/packaging/org.tizen.settings-tv-ref.spec +++ b/packaging/org.tizen.settings-tv-ref.spec @@ -3,7 +3,7 @@ Name: org.tizen.settings-tv-ref Summary: Setting Reference Application -Version: 0.1 +Version: 0.2 Release: 1 Group: Applications/Native Applications License: Apache-2.0 @@ -26,7 +26,7 @@ BuildRequires: pkgconfig(capi-system-info) BuildRequires: pkgconfig(capi-network-wifi) BuildRequires: pkgconfig(capi-network-connection) BuildRequires: pkgconfig(capi-media-sound-manager) -BuildRequires: pkgconfig(wifi-direct) +BuildRequires: pkgconfig(capi-network-wifi-direct) BuildRequires: gettext-devel BuildRequires: vconf #BuildRequires: pkgconfig(capi-appfw-tvcontext) diff --git a/ug/wifi-direct/CMakeLists.txt b/ug/wifi-direct/CMakeLists.txt index 6e427e9..45aa3e1 100644 --- a/ug/wifi-direct/CMakeLists.txt +++ b/ug/wifi-direct/CMakeLists.txt @@ -37,7 +37,7 @@ pkg_check_modules(UG_WIFI_DIRECT_PKGS REQUIRED capi-appfw-application capi-network-wifi capi-network-connection - wifi-direct + capi-network-wifi-direct ) #ecore-x @@ -46,7 +46,7 @@ SET(PKGS_LDFLAGS "${PKGS_LDFLAGS} ${UG_WIFI_DIRECT_PKGS_LDFLAGS}") FOREACH(FLAG ${UG_WIFI_DIRECT_PKGS_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${FLAG}") ENDFOREACH(FLAG) -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fvisibility=hidden -Wall -Werror") +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall -fvisibility=hidden") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS}") SET(SRCS diff --git a/ug/wifi-direct/include/wifi_direct_mgr.h b/ug/wifi-direct/include/wifi_direct_mgr.h index d448ed4..fdde801 100644 --- a/ug/wifi-direct/include/wifi_direct_mgr.h +++ b/ug/wifi-direct/include/wifi_direct_mgr.h @@ -71,8 +71,8 @@ int wifi_direct_mgr_foreach_connected_peers( wifi_direct_connected_peer_cb cb, void *data); int wifi_direct_mgr_start_discovery(void); int wifi_direct_mgr_cancel_discovery(void); -int wifi_direct_mgr_connect(const char *mac_addr); -int wifi_direct_mgr_disconnect(const char *mac_addr); +int wifi_direct_mgr_connect(char *mac_addr); +int wifi_direct_mgr_disconnect(char *mac_addr); int wifi_direct_mgr_reject_connection(const char *mac_addr); int wifi_direct_mgr_accept_connection(char *mac_addr); int wifi_direct_mgr_get_wps_type(Eina_Bool *is_pbc); diff --git a/ug/wifi-direct/src/wifi_direct_mgr.c b/ug/wifi-direct/src/wifi_direct_mgr.c index 02cf4a3..2d18739 100644 --- a/ug/wifi-direct/src/wifi_direct_mgr.c +++ b/ug/wifi-direct/src/wifi_direct_mgr.c @@ -475,7 +475,7 @@ int wifi_direct_mgr_cancel_discovery(void) * @param[in] mac_adrr the MAC address * @return 0 on success, otherwise -1 */ -int wifi_direct_mgr_connect(const char *mac_addr) +int wifi_direct_mgr_connect(char *mac_addr) { int ret; @@ -500,7 +500,7 @@ int wifi_direct_mgr_connect(const char *mac_addr) * @param[in] mac_adrr the MAC address * @return 0 on success, otherwise -1 */ -int wifi_direct_mgr_disconnect(const char *mac_addr) +int wifi_direct_mgr_disconnect(char *mac_addr) { int ret; -- 2.7.4