80 if (upload->progress.current_file_size > 0) { |
80 if (upload->progress.current_file_size > 0) { |
81 cxmutstr file_label = cx_asprintf("%s (%.0f%%)", upload->current_file_name, ((float)upload->progress.current_file_transferred/(float)upload->progress.current_file_size)*100); |
81 cxmutstr file_label = cx_asprintf("%s (%.0f%%)", upload->current_file_name, ((float)upload->progress.current_file_transferred/(float)upload->progress.current_file_size)*100); |
82 ui_set(upload->label_top_right, file_label.ptr); |
82 ui_set(upload->label_top_right, file_label.ptr); |
83 free(file_label.ptr); |
83 free(file_label.ptr); |
84 } |
84 } |
|
85 |
|
86 time_t start = upload->progress.speedtest_start; |
|
87 time_t t = time(NULL); |
|
88 if(t >= upload->progress.speedtest_start + 4) { |
|
89 uint64_t bytesPerSeconds = dav_transfer_speed(&upload->progress, t); |
|
90 if(start > 0) { |
|
91 char *szps = util_size_str(FALSE, bytesPerSeconds); |
|
92 cxmutstr label3 = cx_asprintf("%s/s", szps); |
|
93 free(szps); |
|
94 ui_set(upload->label_bottom_left, label3.ptr); |
|
95 free(label3.ptr); |
|
96 } |
|
97 } |
85 } |
98 } |
86 |
99 |
87 |
100 |
88 |
101 |
89 static int uithr_update_upload_labels(void *data) { |
102 static int uithr_update_upload_labels(void *data) { |