Update downloading progress bar 16/80416/2 accepted/tizen_ivi accepted/tizen_tv accepted/tizen/common/20160718.155837 accepted/tizen/ivi/20160718.104737 accepted/tizen/mobile/20160718.104739 accepted/tizen/tv/20160718.104606 accepted/tizen/wearable/20160718.104726 submit/tizen/20160718.052307
authorWonnam Jang <wn.jang@samsung.com>
Mon, 18 Jul 2016 04:41:25 +0000 (13:41 +0900)
committerWonnam Jang <wn.jang@samsung.com>
Mon, 18 Jul 2016 04:42:48 +0000 (13:42 +0900)
Change-Id: I9b0d743f4811a016038dfdb292819a7635b81eda
Signed-off-by: Wonnam Jang <wn.jang@samsung.com>
setting-app/src/ttssmt_setting_main.c

index b450300..426e795 100644 (file)
@@ -372,16 +372,10 @@ static void __hide_progress_popup()
 static void __progress_popup_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
 {
        Ecore_Timer* timer = data;
-       if (NULL != g_ad->progress_popup) {
-               evas_object_del(g_ad->progress_popup);
-               g_ad->progress_popup = NULL;
-       }
        if (NULL != timer) {
                ecore_timer_del(timer);
                timer = NULL;
        }
-       g_received_bytes = 0;
-       g_total_content_bytes = 0;
        return;
 }
 
@@ -401,13 +395,13 @@ static void __progress_popup_back_cb(void *data, Evas_Object *obj, void *event_i
 static Eina_Bool __progress_popup_timer_cb(void* data)
 {
        double value = 0.0;
-       char percentage[7] = {'\0',};
+       char percentage[8] = {'\0',};
        Evas_Object *progressbar = data;
        value = (double)((long double)g_received_bytes / (long double)g_total_content_bytes);
-       dlog_print(DLOG_ERROR, LOG_TAG, "recevied(%llu), tatal(%llu), value(%lf)", g_received_bytes, g_total_content_bytes, value);
+       dlog_print(DLOG_ERROR, LOG_TAG, "popup timer : recevied(%llu), tatal(%llu), value(%lf)", g_received_bytes, g_total_content_bytes, value);
 
        elm_progressbar_value_set(progressbar, value);
-       snprintf(percentage, 7, "%d/100", (int)(value*100));
+       snprintf(percentage, 8, "%d/100", (int)(value*100));
        elm_object_part_text_set(progressbar, "elm.text.top.right", (const char*)percentage);
 
        return ECORE_CALLBACK_RENEW;
@@ -457,6 +451,20 @@ static void __show_progress_popup(bool failed, const char* msg)
        evas_object_show(popup);
 }
 
+static void __show_complete_popup(void)
+{
+       usleep(1000000);
+       dlog_print(DLOG_ERROR, LOG_TAG, "progress bar is completed!!");
+
+       if (NULL != g_ad->progress_popup) {
+               evas_object_del(g_ad->progress_popup);
+               g_ad->progress_popup = NULL;
+       }
+       g_received_bytes = 0;
+       g_total_content_bytes = 0;
+       return;
+}
+
 static void __delete_popup_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
 {
        if (NULL != g_ad->delete_popup) {
@@ -573,6 +581,7 @@ static void __download_state_changed_cb(int download_id, download_state_e state,
        dlog_print(DLOG_INFO, LOG_TAG, "State (%d)", state);
        if (DOWNLOAD_STATE_COMPLETED == state) {
                dlog_print(DLOG_INFO, LOG_TAG, "===== Download Completed");
+               __show_complete_popup();
                ecore_main_loop_thread_safe_call_sync(__download_completed_cb, user_data);
                download_unset_state_changed_cb(download_id);
                download_unset_progress_cb(download_id);