[SM][Mob]Few minor fixes 08/159408/2
authorPawel Aksiutowicz <p.aksiutowic@partner.samsung.com>
Wed, 8 Nov 2017 16:28:27 +0000 (17:28 +0100)
committerPawel Aksiutowicz <p.aksiutowic@partner.samsung.com>
Wed, 8 Nov 2017 17:37:26 +0000 (18:37 +0100)
*When limit is set to 0 warning is also set to 0
*When warning/limit was set to 0 entry is empty after call popup
*When value set in entry cursor is moved to the end of text
*When value set in entry it get focus
*Handling hardware back button action for popups

Change-Id: I2c277d48551db23dc37d3f0b557370f3b58dc2e3
Signed-off-by: Pawel Aksiutowicz <p.aksiutowic@partner.samsung.com>
setting-smartmanager/smartmanager-data/src/smartmanager-data-usage-mobile-settings.c

index 615338144ab412928af5f954a43573264368c8a9..950c4387db5aac3ef4867f482c47dca9d8f927f3 100755 (executable)
@@ -225,8 +225,13 @@ static void _entry_set_displayed_value(Evas_Object *entry, Evas_Object *button,
 {
        char int_amount_buf[256] = {0};
        char unit_buf[256] = {0};
-       get_data_int_amount_str(value, int_amount_buf, sizeof(int_amount_buf));
-       elm_object_text_set(entry, int_amount_buf);
+       if (value > 0) {
+               get_data_int_amount_str(value, int_amount_buf, sizeof(int_amount_buf));
+               elm_object_text_set(entry, int_amount_buf);
+               elm_entry_cursor_end_set(entry);
+       }
+
+       elm_object_focus_set(entry, EINA_TRUE);
        get_data_unit_str(value, unit_buf, sizeof(unit_buf));
        elm_object_text_set(button, unit_buf);
 }
@@ -373,6 +378,7 @@ static Evas_Object *_create_entry(Evas_Object *parent)
 
        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);
+
        evas_object_show(entry);
 
        return entry;
@@ -415,13 +421,19 @@ static Evas_Object *_create_datetime(Evas_Object *parent, time_t start_date)
        return datetime;
 }
 
+static void _popup_back_cb(void *data, Evas_Object *popup, void *event_info)
+{
+       evas_object_del(popup);
+}
+
 static Evas_Object *_create_popup(SmartMgrData *smd, char *title)
 {
        Evas_Object *popup = elm_popup_add(smd->md.window);
        retv_if(!popup, NULL);
        elm_object_part_text_set(popup, "title,text", title);
        elm_popup_align_set(popup, 0.5, 0.5);
-
+       eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, _popup_back_cb,
+               NULL);
        return popup;
 }
 
@@ -692,6 +704,7 @@ static void _limit_popup_done_cb(void *data, Evas_Object *obj,
                unset_mobile_limit_restrictions(smd->stc,
                        _get_and_unset_limit_restrictions_cb, smd);
                smd->selected_sim_limits->limit = 0;
+               smd->selected_sim_limits->warning = 0;
                evas_object_del(popup_info.popup);
        }