コード例 #1
0
ファイル: extract.cpp プロジェクト: SokolSG/farmanager
  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();
  }
コード例 #2
0
ファイル: delete.cpp プロジェクト: johnd0e/farmanager
  virtual void do_update_ui() {
    const unsigned c_width = 60;

    if (total == 0)
      percent_done = 0;
    else
      percent_done = al_round(static_cast<double>(completed) * 100 / total);
    if (percent_done > 100)
      percent_done = 100;

    unsigned __int64 speed;
    if (time_elapsed() == 0)
      speed = 0;
    else
      speed = al_round(static_cast<double>(completed) / time_elapsed() * ticks_per_sec());

    wostringstream st;
    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'\n';
    st << Far::get_progress_bar_str(c_width, percent_done, 100) << L'\n';
    progress_text = st.str();
  }
コード例 #3
0
ファイル: update.cpp プロジェクト: SokolSG/farmanager
  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();
  }
コード例 #4
0
ファイル: plugin.cpp プロジェクト: FarManagerLegacy/farplug
void WINAPI GetOpenPanelInfoW(OpenPanelInfo* info) {
  PluginInstance* plugin = (PluginInstance*) info->hPanel;

  info->StructSize = sizeof(OpenPanelInfo);

  info->Flags = OPIF_ADDDOTS | OPIF_SHORTCUT;
  info->CurDir = plugin->current_dir.data();
  info->Format = g_plugin_format.data();

  if (g_plugin_options.last_dev_type == dtPDA) plugin->panel_title = far_msg_ptr(MSG_DISK_MENU_PDA);
  else if (g_plugin_options.last_dev_type == dtSmartPhone) plugin->panel_title = far_msg_ptr(MSG_DISK_MENU_SMARTPHONE);
  else plugin->panel_title = far_msg_ptr(MSG_DISK_MENU_PDA);
  plugin->panel_title.add(L":").add(plugin->current_dir);

  if (g_plugin_options.show_free_space) plugin->panel_title.add(L":" + format_data_size(plugin->free_space, get_size_suffixes()));
  info->PanelTitle = plugin->panel_title.data();
  info->InfoLines = plugin->sys_info.data();
  info->InfoLinesNumber = plugin->sys_info.size();
}