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;
}
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;
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) {
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);