virtual void do_update_ui() { const unsigned c_width = 60; percent_done = calc_percent(extract_completed, extract_total); unsigned __int64 extract_speed; if (time_elapsed() == 0) extract_speed = 0; else extract_speed = al_round(static_cast<double>(extract_completed) / time_elapsed() * ticks_per_sec()); if (extract_total && cache_total > extract_total) cache_total = extract_total; unsigned cache_stored_percent = calc_percent(cache_stored, cache_total); unsigned cache_written_percent = calc_percent(cache_written, cache_total); wostringstream st; st << fit_str(arc_path, c_width) << L'\n'; st << L"\x1\n"; st << fit_str(extract_file_path, c_width) << L'\n'; st << setw(7) << format_data_size(extract_completed, get_size_suffixes()) << L" / " << format_data_size(extract_total, get_size_suffixes()) << L" @ " << setw(9) << format_data_size(extract_speed, get_speed_suffixes()) << L'\n'; st << Far::get_progress_bar_str(c_width, percent_done, 100) << L'\n'; st << L"\x1\n"; st << fit_str(cache_file_path, c_width) << L'\n'; st << L"(" << format_data_size(cache_stored, get_size_suffixes()) << L" - " << format_data_size(cache_written, get_size_suffixes()) << L") / " << format_data_size(cache_total, get_size_suffixes()) << L'\n'; st << get_progress_bar_str(c_width, cache_written_percent, cache_stored_percent) << L'\n'; progress_text = st.str(); }
void error_dlg(CustomError& e) { UnicodeString msg; msg.add(far_get_msg(MSG_PLUGIN_NAME)).add('\n'); if (e.object().size() != 0) msg.add(fit_str(e.object(), get_msg_width())).add('\n'); if (e.message().size() != 0) msg.add(word_wrap(e.message(), get_msg_width())).add('\n'); msg.add_fmt(L"%S:%u v.%u.%u.%u.%u"PLUGIN_TYPE, &extract_file_name(oem_to_unicode(e.file)), e.line, g_version.major, g_version.minor, g_version.patch, g_version.revision); far_message(c_error_dialog_guid, msg, 0, FMSG_WARNING | FMSG_MB_OK); }
virtual void do_update_ui() { const unsigned c_width = 60; percent_done = calc_percent(completed, total); wostringstream st; st << fit_str(file_path, c_width) << L'\n'; st << Far::get_progress_bar_str(c_width, percent_done, 100) << L'\n'; progress_text = st.str(); }
virtual void do_update_ui() { const unsigned c_width = 60; percent_done = calc_percent(completed, total); unsigned __int64 time = time_elapsed(); unsigned __int64 speed; if (time == 0) speed = 0; else speed = al_round(static_cast<double>(completed) / time * ticks_per_sec()); unsigned __int64 total_time; if (completed) total_time = static_cast<unsigned __int64>(static_cast<double>(total) / completed * time); else total_time = 0; if (total_time < time) total_time = time; wostringstream st; st << fit_str(arc_path, c_width) << L'\n'; st << L"\x1\n"; st << fit_str(file_path, c_width) << L'\n'; st << setw(7) << format_data_size(file_completed, get_size_suffixes()) << L" / " << format_data_size(file_total, get_size_suffixes()) << L'\n'; st << Far::get_progress_bar_str(c_width, calc_percent(file_completed, file_total), 100) << L'\n'; st << L"\x1\n"; st << setw(7) << format_data_size(completed, get_size_suffixes()) << L" / " << format_data_size(total, get_size_suffixes()) << L" @ " << setw(9) << format_data_size(speed, get_speed_suffixes()) << L" -" << format_time((total_time - time) / ticks_per_sec()) << L'\n'; st << setw(7) << format_data_size(total_data_read, get_size_suffixes()) << L" \x2192 " << setw(7) << format_data_size(total_data_written, get_size_suffixes()) << L" = " << setw(2) << calc_percent(total_data_written, total_data_read) << L"%" << L'\n'; st << Far::get_progress_bar_str(c_width, percent_done, 100) << L'\n'; progress_text = st.str(); }