};
static char *elements_cycle_day_of_week[] = {
+ "Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
- "Saturday",
- "Sunday"
+ "Saturday"
};
static Evas_Smart_Cb create_start_popup_functions[] = {
.func.del = _genlist_radio_del
};
-static Elm_Entry_Filter_Accept_Set accept_set = {
- .accepted = "0123456789.",
- .rejected = NULL
-};
-
static Elm_Entry_Filter_Limit_Size limit_size = {
.max_char_count = 9
};
return btn;
}
-static Evas_Object *create_editfield_clear_popup_button(Evas_Object *parent, char *part,
- char *title, float weight_x, float weight_y, Evas_Smart_Cb cb,
+static Evas_Object *create_editfield_clear_popup_button(Evas_Object *parent,
+ char *part, char *title, float weight_x, float weight_y, Evas_Smart_Cb cb,
void *callback_data)
{
return _create_generic_popup_button(parent, part, title,
static void _clean_entry_cb(void *data, Evas_Object *obj, void *event_info)
{
Evas_Object *entry = (Evas_Object *)data;
- ret_if(!entry);
elm_object_text_set(entry, "");
+ elm_object_focus_set(entry, EINA_TRUE);
}
static Evas_Object *_create_entry(Evas_Object *parent)
{
Evas_Object *entry = elm_entry_add(parent);
- retv_if(!entry, NULL);
+ elm_entry_single_line_set(entry, EINA_TRUE);
- elm_entry_markup_filter_append(entry, elm_entry_filter_accept_set,
- &accept_set);
elm_entry_markup_filter_append(entry, elm_entry_filter_limit_size,
&limit_size);
-
- elm_entry_input_panel_layout_set(entry, ELM_INPUT_PANEL_LAYOUT_NUMBER);
+ elm_entry_input_panel_layout_set(entry, ELM_INPUT_PANEL_LAYOUT_NUMBERONLY);
+ elm_entry_input_panel_show(entry);
evas_object_size_hint_weight_set(entry, 0.73, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_object_text_set(popup_info.content, "90");
}
if (value >= 1 && value <= 90) {
+ smd->selected_sim_limits->cycle_mode = CYCLE_MODE_CUSTOM;
+ smd->selected_sim_limits->cycle_start = 1;
smd->selected_sim_limits->custom_mode_interval = value;
+ elm_radio_value_set(cycle_mode_radio_group,
+ smd->selected_sim_limits->cycle_mode);
write_cycle_info(smd);
+ generate_list(mobile_genlist, smd);
evas_object_del(popup_info.popup);
elm_genlist_realized_items_update(mobile_genlist);
}
evas_object_del(popup_info.popup);
} else {
create_toast_popup(popup_info.popup,
- _("Maximum value allowed is 100GB. Value changed to 100GB"));
+ _("Maximum value allowed is 100GB.\
+ Value changed to 100GB"));
smd->selected_sim_limits->warning = MAX_LIMIT_IN_BYTES;
_entry_set_displayed_value(popup_info.content,
popup_info.unit_btn, smd->selected_sim_limits->warning);
free(item_data);
}
-static void _radio_cycle_list_item_selected_cb(void *data, Evas_Object *obj,
- void *event_info)
+static void _handle_radio_cycle_item(Radio_List_Item_T *item_data)
{
- Radio_List_Item_T *item_data = (Radio_List_Item_T *)data;
-
- if (item_data->smd->selected_sim_limits->cycle_mode !=
- item_data->radio_value) {
- item_data->smd->selected_sim_limits->cycle_mode =
- item_data->radio_value;
- item_data->smd->selected_sim_limits->cycle_start = 1;
- elm_radio_value_set(cycle_mode_radio_group,
- item_data->smd->selected_sim_limits->cycle_mode);
- generate_list(mobile_genlist, item_data->smd);
- }
-
- if (item_data->smd->selected_sim_limits->cycle_mode == CYCLE_MODE_CUSTOM)
+ if (item_data->radio_value != CYCLE_MODE_CUSTOM) {
+ if (item_data->smd->selected_sim_limits->cycle_mode !=
+ item_data->radio_value) {
+ item_data->smd->selected_sim_limits->cycle_mode =
+ item_data->radio_value;
+ item_data->smd->selected_sim_limits->cycle_start = 1;
+ item_data->smd->selected_sim_limits->custom_mode_interval = 1;
+ elm_radio_value_set(cycle_mode_radio_group,
+ item_data->smd->selected_sim_limits->cycle_mode);
+ generate_list(mobile_genlist, item_data->smd);
+ write_cycle_info(item_data->smd);
+ }
+ } else {
_create_custom_cycle_popup(item_data->smd, _("Set data usage cycle"),
- item_data->smd->selected_sim_limits->custom_mode_interval);
+ item_data->smd->selected_sim_limits->custom_mode_interval);
+ }
- write_cycle_info(item_data->smd);
evas_object_del(item_data->popup);
elm_genlist_realized_items_update(mobile_genlist);
}
+static void _radio_cycle_list_item_selected_cb(void *data, Evas_Object *obj,
+ void *event_info)
+{
+ _handle_radio_cycle_item((Radio_List_Item_T *)data);
+}
+
static Elm_Widget_Item *_append_item_to_radio_list(SmartMgrData *smd,
Evas_Object *popup, Evas_Object *genlist, Elm_Gen_Item_Class *itc,
const char *text, int radio_value, bool is_first,
static void _radio_cycle_selected_cb(void *data, Evas_Object *obj,
void *event_info)
{
- Radio_List_Item_T *item_data = (Radio_List_Item_T *)data;
-
- if (item_data->smd->selected_sim_limits->cycle_mode !=
- item_data->radio_value) {
- item_data->smd->selected_sim_limits->cycle_mode =
- item_data->radio_value;
- item_data->smd->selected_sim_limits->cycle_start = 1;
- elm_radio_value_set(cycle_mode_radio_group,
- item_data->smd->selected_sim_limits->cycle_mode);
- generate_list(mobile_genlist, item_data->smd);
- }
-
- if (item_data->smd->selected_sim_limits->cycle_mode == CYCLE_MODE_CUSTOM)
- _create_custom_cycle_popup(item_data->smd, _("Set data usage cycle"),
- item_data->smd->selected_sim_limits->custom_mode_interval);
-
-
-
- write_cycle_info(item_data->smd);
- evas_object_del(item_data->popup);
- elm_genlist_realized_items_update(mobile_genlist);
+ _handle_radio_cycle_item((Radio_List_Item_T *)data);
}
static Evas_Object *_genlist_cycle_radio_content_get(void *data,
mobile_genlist = elm_genlist_add(smd->md.naviframe);
generate_list(mobile_genlist, smd);
- nf_it = elm_naviframe_item_push(smd->md.naviframe, _("Data usage settings"),
- back_btn, NULL, mobile_genlist, NULL);
+ nf_it = elm_naviframe_item_push(smd->md.naviframe,
+ _("Data usage settings"), back_btn, NULL, mobile_genlist, NULL);
elm_naviframe_item_style_set(nf_it, "tabbar");
elm_naviframe_item_pop_cb_set(nf_it, _pop_view_cb, smd);
return now_tm.tm_mday;
}
-void get_data_amount_str(const char *prefix, int64_t num_bytes, char *txt_out, int len_max)
+void get_data_amount_str(const char *prefix, int64_t num_bytes, char *txt_out,
+ int len_max)
{
float amount = 0.0;
if (temp < 4) {
snprintf(output, max_len, "%d%s", number, number_postfixes[temp]);
} else {
- snprintf(output, max_len, "%d%s", number, number_postfixes[TH_POSTFIX_IDX]);
+ snprintf(output, max_len, "%d%s", number,
+ number_postfixes[TH_POSTFIX_IDX]);
}
}
return true;
}
- SETTING_TRACE_DEBUG("\033[1;33mObtaining per app data usage for ifce: %d", iface);
+ SETTING_TRACE_DEBUG("\033[1;33mObtaining per app data usage for ifce: %d",
+ iface);
ret = stc_foreach_stats(stc, rule, stats_cb, cb_data);
if (ret != STC_ERROR_NONE) {
SETTING_TRACE_ERROR("stc_get_stats() error: %s",
return true;
}
- SETTING_TRACE_DEBUG("\033[1;34mObtaining total stats for ifce: %d", iface_type);
+ SETTING_TRACE_DEBUG("\033[1;34mObtaining total stats for ifce: %d",
+ iface_type);
ret = stc_get_total_stats(stc, rule, stats_cb, cb_data);
if (ret != STC_ERROR_NONE) {
SETTING_TRACE_ERROR("stc_get_total_stats() error: %s",
return true;
}
- SETTING_TRACE_DEBUG("\033[1;35mObtaining restrictions for ifce: %d", iface_type);
+ SETTING_TRACE_DEBUG("\033[1;35mObtaining restrictions for ifce: %d",
+ iface_type);
ret = stc_foreach_restriction(stc, rule, restrictions_cb,
restriction_info_cb_data);
if (STC_ERROR_NONE != ret) {
ret = stc_restriction_rule_set_warning_limit(rule, warning_limit);
if (STC_ERROR_NONE != ret) {
(void)stc_restriction_rule_destroy(rule);
- SETTING_TRACE_ERROR("stc_restriction_rule_set_warning_limit() error: %s",
- get_error_message(ret));
+ SETTING_TRACE_ERROR(
+ "stc_restriction_rule_set_warning_limit() error: %s",
+ get_error_message(ret));
return RESTRICTIONS_ERROR;
}
return RESTRICTIONS_OK;
}
-bool unset_mobile_limit_restrictions(stc_h stc_handle, stc_restriction_info_cb _get_and_unset_limit_restrictions_cb, void *data)
+bool unset_mobile_limit_restrictions(stc_h stc_handle,
+ stc_restriction_info_cb _get_and_unset_limit_restrictions_cb, void *data)
{
SETTING_TRACE_BEGIN;
- return _get_restrictions(stc_handle, STC_IFACE_DATACALL, _get_and_unset_limit_restrictions_cb, data);
+ return _get_restrictions(stc_handle, STC_IFACE_DATACALL,
+ _get_and_unset_limit_restrictions_cb, data);
SETTING_TRACE_END;
}