TizenRefApp-7711 [Email] Fix issue with processing popup blinking in Setting while... 38/99638/1
authorIgor Nazarov <i.nazarov@samsung.com>
Wed, 23 Nov 2016 12:06:08 +0000 (14:06 +0200)
committerIgor Nazarov <i.nazarov@samsung.com>
Wed, 23 Nov 2016 12:06:08 +0000 (14:06 +0200)
Change-Id: I746edaa8ff38754993fb783072ddf3ca1b12bec9

modules/setting/src/email-setting-utils.c
modules/setting/src/email-view-account-setup.c
modules/setting/src/email-view-manual-setup.c

index d9b9ce5..980d1af 100644 (file)
@@ -1431,9 +1431,10 @@ void setting_create_account_validation_popup(email_view_t *view, int *handle)
 #endif
 
        debug_log("Start Account Validation");
-       module->popup = setting_get_pb_process_notify(view,
-                       &(EMAIL_SETTING_STRING_VALIDATING_ACCOUNT_ING), 0, NULL, NULL, NULL, NULL,
-                       POPUP_BACK_TYPE_DESTROY_WITH_CANCEL_OP, handle);
+       if (!module->popup)
+               module->popup = setting_get_pb_process_notify(view,
+                               &(EMAIL_SETTING_STRING_VALIDATING_ACCOUNT_ING), 0, NULL, NULL, NULL, NULL,
+                               POPUP_BACK_TYPE_DESTROY_WITH_CANCEL_OP, handle);
 }
 
 Evas_Object *setting_gl_item_get_editfield_entry(Elm_Object_Item *item)
index 4cedf93..ccc354c 100644 (file)
@@ -231,12 +231,10 @@ static void _activate(email_view_t *self, email_view_state prev_state)
        EmailSettingView *view = (EmailSettingView *)self;
        EmailSettingModule *module = (EmailSettingModule *)view->base.module;
 
-       if (prev_state != EV_STATE_CREATED) {
-               return;
+       if (prev_state == EV_STATE_CREATED) {
+               setting_load_provider_list(&(module->default_provider_list), NULL, EMAIL_SETTING_DEFAULT_PROVIDER_XML_FILENAME);
        }
 
-       setting_load_provider_list(&(module->default_provider_list), NULL, EMAIL_SETTING_DEFAULT_PROVIDER_XML_FILENAME);
-
        Evas_Object *email_address_entry = setting_gl_item_get_editfield_entry(view->item_email_address);
        if (email_address_entry) {
                elm_object_focus_set(email_address_entry, EINA_TRUE);
@@ -447,6 +445,7 @@ static void _validate_account(EmailSettingView *view)
                debug_log("Validate account");
                setting_create_account_validation_popup(&view->base, &(view->handle));
        } else {
+               DELETE_EVAS_OBJECT(module->popup);
                if (error_code == EMAIL_ERROR_ALREADY_EXISTS) {
                        module->popup = setting_get_notify(&view->base,
                                        &(EMAIL_SETTING_STRING_WARNING),
@@ -671,6 +670,8 @@ static Eina_Bool _after_validation_cb(void *data)
        EmailSettingView *view = data;
        EmailSettingModule *module = (EmailSettingModule *)view->base.module;
 
+       elm_object_focus_set(view->next_btn, EINA_TRUE);
+
        DELETE_TIMER_OBJECT(view->preset_vc_timer);
        DELETE_EVAS_OBJECT(module->popup);
 
@@ -764,7 +765,6 @@ static void _account_validate_cb(int account_id, email_setting_response_data *re
 
        /* initialize handle */
        view->handle = EMAIL_OP_HANDLE_INITIALIZER;
-       DELETE_EVAS_OBJECT(module->popup);
        if (response->err == EMAIL_ERROR_NONE || response->err == EMAIL_ERROR_VALIDATE_ACCOUNT_OF_SMTP) {
                view->is_retry_validate_with_username = 0;
                DELETE_TIMER_OBJECT(view->preset_vc_timer);
@@ -776,12 +776,14 @@ static void _account_validate_cb(int account_id, email_setting_response_data *re
                _update_account_smtp_mail_limit_size(view, (const char *)(response->data));
                view->preset_vc_timer = ecore_timer_add(0.5, _after_validation_cb, view);
        } else if (response->err == EMAIL_ERROR_DPM_RESTRICTED_MODE) {
-                       common_util_show_dpm_error_popup("IDS_EMAIL_OPT_ADD_ACCOUNT");
+               DELETE_EVAS_OBJECT(module->popup);
+               common_util_show_dpm_error_popup("IDS_EMAIL_OPT_ADD_ACCOUNT");
        } else if (!(view->is_retry_validate_with_username) && (response->err != EMAIL_ERROR_CANCELLED)) {
                view->is_retry_validate_with_username = 1;
                _set_username_before_at(view);
                _validate_account(view);
        } else {
+               DELETE_EVAS_OBJECT(module->popup);
                view->is_retry_validate_with_username = 0;
                if (response->err != EMAIL_ERROR_CANCELLED) {
                        const email_string_t *type = setting_get_service_fail_type(response->err);
index e855a1a..d2948f9 100644 (file)
@@ -473,6 +473,7 @@ static void _validate_account(EmailSettingView *view)
                debug_log("Validate account");
                setting_create_account_validation_popup(&view->base, &(view->handle));
        } else {
+               DELETE_EVAS_OBJECT(module->popup);
                if (error_code == EMAIL_ERROR_ALREADY_EXISTS) {
                        module->popup = setting_get_notify(&view->base,
                                        &(EMAIL_SETTING_STRING_WARNING),
@@ -644,6 +645,8 @@ static Eina_Bool _after_validation_cb(void *data)
 
        EmailSettingModule *module = (EmailSettingModule *)view->base.module;
 
+       elm_object_focus_set(view->next_btn, EINA_TRUE);
+
        DELETE_TIMER_OBJECT(view->other_vc_timer);
        DELETE_EVAS_OBJECT(module->popup);
 
@@ -1246,7 +1249,6 @@ static void _account_validate_cb(int account_id, email_setting_response_data *re
 
        /* initialize handle */
        view->handle = EMAIL_OP_HANDLE_INITIALIZER;
-       DELETE_EVAS_OBJECT(module->popup);
        if (response->err == EMAIL_ERROR_NONE ||
                        response->err == EMAIL_ERROR_VALIDATE_ACCOUNT_OF_SMTP) {
                view->is_retry_validate_with_username = 0;
@@ -1257,6 +1259,7 @@ static void _account_validate_cb(int account_id, email_setting_response_data *re
                _update_account_smtp_mail_limit_size(view, (const char *)(response->data));
                view->other_vc_timer = ecore_timer_add(0.5, _after_validation_cb, view);
        } else if (response->err == EMAIL_ERROR_DPM_RESTRICTED_MODE) {
+               DELETE_EVAS_OBJECT(module->popup);
                common_util_show_dpm_error_popup("IDS_EMAIL_OPT_ADD_ACCOUNT");
        } else if ((view->is_retry_validate_with_username <= 2) &&
                        (response->err != EMAIL_ERROR_CANCELLED)) {
@@ -1269,6 +1272,7 @@ static void _account_validate_cb(int account_id, email_setting_response_data *re
                        _set_username_with_email_address(view);
                _validate_account(view);
        } else {
+               DELETE_EVAS_OBJECT(module->popup);
                view->is_retry_validate_with_username = 0;
                if (response->err != EMAIL_ERROR_CANCELLED) {
                        const email_string_t *err_msg = setting_get_service_fail_type(response->err);