}
evas_object_del(cycle_start_data->popup);
+ free(cycle_start_data);
}
static void _timer_popup_cancel_cb(void *data, Evas_Object *obj, void *event_info)
{
Cycle_Start_Popup_Data_T *cycle_start_data = (Cycle_Start_Popup_Data_T *)data;
evas_object_del(cycle_start_data->popup);
+ free(cycle_start_data);
}
-static void _create_timer_popup(SmartMgrData *smd, char *title, int start_day)
+static void _create_monthly_start_date_popup(SmartMgrData *smd, char *title, int start_day)
{
Evas_Object *date_time = NULL;
+ Evas_Object *box = NULL;
Cycle_Start_Popup_Data_T *cycle_start_data = calloc(1, sizeof(Limit_Popup_Data_T));
-
if (!cycle_start_data)
return;
- cycle_start_data->popup = setting_create_popup2(cycle_start_data, smd->md.naviframe, title, NULL, _timer_popup_done_cb, _timer_popup_cancel_cb, 0, EINA_TRUE, EINA_FALSE, 2, "Done", "Cancel");
- if (!cycle_start_data->popup) {
- SETTING_TRACE_ERROR("cycle_start_data->popup == NULL");
- free(cycle_start_data);
- return;
- }
-
- date_time = elm_spinner_add(cycle_start_data->popup);
- if (!date_time) {
- SETTING_TRACE_ERROR("date_time == NULL");
- evas_object_del(cycle_start_data->popup);
- free(cycle_start_data);
- return;
- }
-
+ cycle_start_data->popup = _create_popup(smd, title);
+ box = _create_box(cycle_start_data->popup);
+ date_time = elm_spinner_add(box);
elm_object_style_set(date_time, "vertical");
+ elm_spinner_value_set(date_time, start_day);
+ elm_spinner_min_max_set(date_time, 1, 31);
+ elm_spinner_interval_set(date_time, 1.0);
+ elm_object_content_set(box, date_time);
+ evas_object_show(date_time);
cycle_start_data->smd = smd;
cycle_start_data->content = date_time;
+ elm_box_pack_end(box, date_time);
- elm_spinner_value_set(date_time, start_day);
- elm_spinner_min_max_set(date_time, 1, 31);
- elm_spinner_interval_set(date_time, 1.0);
+ _create_popup_button(cycle_start_data->popup, "button1", "Cancel", EVAS_HINT_EXPAND, EVAS_HINT_EXPAND, _timer_popup_cancel_cb, cycle_start_data);
+ _create_popup_button(cycle_start_data->popup, "button2", "Done", EVAS_HINT_EXPAND, EVAS_HINT_EXPAND, _timer_popup_done_cb, cycle_start_data);
- elm_object_content_set(cycle_start_data->popup, date_time);
+ evas_object_show(cycle_start_data->popup);
}
static char *_genlist_radio_text_get(void *data, Evas_Object *obj, const char *part)
{
switch (smd->selected_sim_limits->cycle_mode) {
case CYCLE_MODE_MONTHLY:
- _create_timer_popup(smd, "Select start date", smd->selected_sim_limits->cycle_start);
+ _create_monthly_start_date_popup(smd, "Select start date", smd->selected_sim_limits->cycle_start);
break;
case CYCLE_MODE_WEEKLY:
_create_list_popup(smd, "Select start day", ELEMENT_TYPE_START_DATE);