Merge branch 'master' of https://github.com/prusa3d/Slic3r into et_copy_and_paste

This commit is contained in:
Enrico Turri 2019-05-13 08:30:30 +02:00
commit 9a16af5251
15 changed files with 528 additions and 526 deletions

File diff suppressed because it is too large Load Diff

View File

@ -223,7 +223,7 @@ void PrintConfigDef::init_fff_params()
def = this->add("colorprint_heights", coFloats);
def->label = L("Colorprint height");
def->tooltip = L("Heights at which a filament change is to occur. ");
def->tooltip = L("Heights at which a filament change is to occur.");
def->set_default_value(new ConfigOptionFloats { });
def = this->add("compatible_printers", coStrings);
@ -282,7 +282,7 @@ void PrintConfigDef::init_fff_params()
def = this->add("cooling_tube_retraction", coFloat);
def->label = L("Cooling tube position");
def->tooltip = L("Distance of the center-point of the cooling tube from the extruder tip ");
def->tooltip = L("Distance of the center-point of the cooling tube from the extruder tip.");
def->sidetext = L("mm");
def->min = 0;
def->mode = comAdvanced;
@ -290,7 +290,7 @@ void PrintConfigDef::init_fff_params()
def = this->add("cooling_tube_length", coFloat);
def->label = L("Cooling tube length");
def->tooltip = L("Length of the cooling tube to limit space for cooling moves inside it ");
def->tooltip = L("Length of the cooling tube to limit space for cooling moves inside it.");
def->sidetext = L("mm");
def->min = 0;
def->mode = comAdvanced;
@ -574,7 +574,7 @@ void PrintConfigDef::init_fff_params()
def = this->add("filament_loading_speed", coFloats);
def->label = L("Loading speed");
def->tooltip = L("Speed used for loading the filament on the wipe tower. ");
def->tooltip = L("Speed used for loading the filament on the wipe tower.");
def->sidetext = L("mm/s");
def->min = 0;
def->mode = comExpert;
@ -582,7 +582,7 @@ void PrintConfigDef::init_fff_params()
def = this->add("filament_loading_speed_start", coFloats);
def->label = L("Loading speed at the start");
def->tooltip = L("Speed used at the very beginning of loading phase. ");
def->tooltip = L("Speed used at the very beginning of loading phase.");
def->sidetext = L("mm/s");
def->min = 0;
def->mode = comExpert;
@ -591,7 +591,7 @@ void PrintConfigDef::init_fff_params()
def = this->add("filament_unloading_speed", coFloats);
def->label = L("Unloading speed");
def->tooltip = L("Speed used for unloading the filament on the wipe tower (does not affect "
" initial part of unloading just after ramming). ");
" initial part of unloading just after ramming).");
def->sidetext = L("mm/s");
def->min = 0;
def->mode = comExpert;
@ -599,7 +599,7 @@ void PrintConfigDef::init_fff_params()
def = this->add("filament_unloading_speed_start", coFloats);
def->label = L("Unloading speed at the start");
def->tooltip = L("Speed used for unloading the tip of the filament immediately after ramming. ");
def->tooltip = L("Speed used for unloading the tip of the filament immediately after ramming.");
def->sidetext = L("mm/s");
def->min = 0;
def->mode = comExpert;
@ -609,7 +609,7 @@ void PrintConfigDef::init_fff_params()
def->label = L("Delay after unloading");
def->tooltip = L("Time to wait after the filament is unloaded. "
"May help to get reliable toolchanges with flexible materials "
"that may need more time to shrink to original dimensions. ");
"that may need more time to shrink to original dimensions.");
def->sidetext = L("s");
def->min = 0;
def->mode = comExpert;
@ -618,7 +618,7 @@ void PrintConfigDef::init_fff_params()
def = this->add("filament_cooling_moves", coInts);
def->label = L("Number of cooling moves");
def->tooltip = L("Filament is cooled by being moved back and forth in the "
"cooling tubes. Specify desired number of these moves ");
"cooling tubes. Specify desired number of these moves.");
def->max = 0;
def->max = 20;
def->mode = comExpert;
@ -626,7 +626,7 @@ void PrintConfigDef::init_fff_params()
def = this->add("filament_cooling_initial_speed", coFloats);
def->label = L("Speed of the first cooling move");
def->tooltip = L("Cooling moves are gradually accelerating beginning at this speed. ");
def->tooltip = L("Cooling moves are gradually accelerating beginning at this speed.");
def->sidetext = L("mm/s");
def->min = 0;
def->mode = comExpert;
@ -645,7 +645,7 @@ void PrintConfigDef::init_fff_params()
def = this->add("filament_cooling_final_speed", coFloats);
def->label = L("Speed of the last cooling move");
def->tooltip = L("Cooling moves are gradually accelerating towards this speed. ");
def->tooltip = L("Cooling moves are gradually accelerating towards this speed.");
def->sidetext = L("mm/s");
def->min = 0;
def->mode = comExpert;
@ -661,7 +661,7 @@ void PrintConfigDef::init_fff_params()
def = this->add("filament_ramming_parameters", coStrings);
def->label = L("Ramming parameters");
def->tooltip = L("This string is edited by RammingDialog and contains ramming specific parameters ");
def->tooltip = L("This string is edited by RammingDialog and contains ramming specific parameters.");
def->mode = comExpert;
def->set_default_value(new ConfigOptionStrings { "120 100 6.6 6.8 7.2 7.6 7.9 8.2 8.7 9.4 9.9 10.0|"
" 0.05 6.6 0.45 6.8 0.95 7.8 1.45 8.3 1.95 9.7 2.45 10 2.95 7.6 3.45 7.6 3.95 7.6 4.45 7.6 4.95 7.6" });
@ -1336,7 +1336,7 @@ void PrintConfigDef::init_fff_params()
def = this->add("parking_pos_retraction", coFloat);
def->label = L("Filament parking position");
def->tooltip = L("Distance of the extruder tip from the position where the filament is parked "
"when unloaded. This should match the value in printer firmware. ");
"when unloaded. This should match the value in printer firmware.");
def->sidetext = L("mm");
def->min = 0;
def->mode = comAdvanced;
@ -1346,7 +1346,7 @@ void PrintConfigDef::init_fff_params()
def->label = L("Extra loading distance");
def->tooltip = L("When set to zero, the distance the filament is moved from parking position during load "
"is exactly the same as it was moved back during unload. When positive, it is loaded further, "
" if negative, the loading move is shorter than unloading. ");
" if negative, the loading move is shorter than unloading.");
def->sidetext = L("mm");
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(-2.f));
@ -2131,13 +2131,13 @@ void PrintConfigDef::init_fff_params()
def->label = L("Purging volumes - load/unload volumes");
def->tooltip = L("This vector saves required volumes to change from/to each tool used on the "
"wipe tower. These values are used to simplify creation of the full purging "
"volumes below. ");
"volumes below.");
def->set_default_value(new ConfigOptionFloats { 70.f, 70.f, 70.f, 70.f, 70.f, 70.f, 70.f, 70.f, 70.f, 70.f });
def = this->add("wiping_volumes_matrix", coFloats);
def->label = L("Purging volumes - matrix");
def->tooltip = L("This matrix describes volumes (in cubic milimetres) required to purge the"
" new filament on the wipe tower for any given pair of tools. ");
" new filament on the wipe tower for any given pair of tools.");
def->set_default_value(new ConfigOptionFloats { 0.f, 140.f, 140.f, 140.f, 140.f,
140.f, 0.f, 140.f, 140.f, 140.f,
140.f, 140.f, 0.f, 140.f, 140.f,
@ -2167,7 +2167,7 @@ void PrintConfigDef::init_fff_params()
def = this->add("wipe_tower_rotation_angle", coFloat);
def->label = L("Wipe tower rotation angle");
def->tooltip = L("Wipe tower rotation angle with respect to x-axis ");
def->tooltip = L("Wipe tower rotation angle with respect to x-axis.");
def->sidetext = L("°");
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(0.));
@ -2190,7 +2190,7 @@ void PrintConfigDef::init_fff_params()
def = this->add("wipe_tower_bridging", coFloat);
def->label = L("Maximal bridging distance");
def->tooltip = L("Maximal distance between supports on sparse infill sections. ");
def->tooltip = L("Maximal distance between supports on sparse infill sections.");
def->sidetext = L("mm");
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(10.));

View File

@ -330,7 +330,7 @@ void BedShapePanel::load_stl()
model = Model::read_from_file(file_name);
}
catch (std::exception &e) {
auto msg = _(L("Error! ")) + file_name + " : " + e.what() + ".";
auto msg = _(L("Error!")) + " " + file_name + " : " + e.what() + ".";
show_error(this, msg);
exit(1);
}

View File

@ -36,7 +36,7 @@ static wxString generate_html_row(const Config::Snapshot &snapshot, bool row_eve
text += "\">";
text += "<td>";
// Format the row header.
text += wxString("<font size=\"5\"><b>") + (snapshot_active ? _(L("Active: ")) : "") +
text += wxString("<font size=\"5\"><b>") + (snapshot_active ? _(L("Active")) + ": " : "") +
Utils::format_local_date_time(snapshot.time_captured) + ": " + format_reason(snapshot.reason);
if (! snapshot.comment.empty())
text += " (" + wxString::FromUTF8(snapshot.comment.data()) + ")";

View File

@ -189,7 +189,7 @@ struct FirmwareDialog::priv
template<class ...Args> void queue_error(const wxString &format, Args... args) {
queue_message(format, args...);
queue_event(AE_STATUS, _(L("Flashing failed: ")) + wxString::Format(format, args...));
queue_event(AE_STATUS, _(L("Flashing failed")) +": "+ wxString::Format(format, args...));
avrdude->cancel();
}

View File

@ -1691,11 +1691,11 @@ void GLCanvas3D::render()
ImGuiWrapper& imgui = *wxGetApp().imgui();
imgui.set_next_window_bg_alpha(0.5f);
imgui.begin(std::string("Render statistics"), ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse);
imgui.text("Last frame: ");
imgui.text(_(L("Last frame")) +": ");
ImGui::SameLine();
imgui.text(std::to_string(m_render_stats.last_frame));
ImGui::SameLine();
imgui.text(" ms");
imgui.text(" "+_(L("ms")));
imgui.end();
#endif // ENABLE_RENDER_STATISTICS

View File

@ -1440,7 +1440,7 @@ void ObjectList::load_part( ModelObject* model_object,
model = Model::read_from_file(input_file);
}
catch (std::exception &e) {
auto msg = _(L("Error! ")) + input_file + " : " + e.what() + ".";
auto msg = _(L("Error!")) + " " + input_file + " : " + e.what() + ".";
show_error(parent, msg);
exit(1);
}

View File

@ -80,6 +80,7 @@ void ObjectSettings::update_settings_list()
auto opt_key = (line.get_options())[0].opt_id; //we assume that we have one option per line
auto btn = new ScalableButton(parent, wxID_ANY, m_bmp_delete);
btn->SetToolTip(_(L("Remove parameter")));
btn->Bind(wxEVT_BUTTON, [opt_key, config, this](wxEvent &event) {
config->erase(opt_key);

View File

@ -837,7 +837,7 @@ RENDER_AGAIN:
if (m_new_point_head_diameter > diameter_upper_cap)
m_new_point_head_diameter = diameter_upper_cap;
m_imgui->text(_(L("Head diameter: ")));
m_imgui->text(_(L("Head diameter")) + ": ");
ImGui::SameLine(m_imgui->scaled(6.66f));
ImGui::PushItemWidth(m_imgui->scaled(8.33f));
if (ImGui::SliderFloat("", &m_new_point_head_diameter, 0.1f, diameter_upper_cap, "%.1f")) {
@ -876,7 +876,7 @@ RENDER_AGAIN:
}
else { // not in editing mode:
ImGui::PushItemWidth(m_imgui->scaled(5.55f));
m_imgui->text(_(L("Minimal points distance: ")));
m_imgui->text(_(L("Minimal points distance")) + ": ");
ImGui::SameLine(m_imgui->scaled(9.44f));
std::vector<const ConfigOption*> opts = get_config_options({"support_points_density_relative", "support_points_minimal_distance"});
@ -887,7 +887,7 @@ RENDER_AGAIN:
if (value_changed)
m_model_object->config.opt<ConfigOptionFloat>("support_points_minimal_distance", true)->value = minimal_point_distance;
m_imgui->text(_(L("Support points density: ")));
m_imgui->text(_(L("Support points density")) + ": ");
ImGui::SameLine(m_imgui->scaled(9.44f));
if (ImGui::SliderFloat(" ", &density, 0.f, 200.f, "%.f %%")) {
value_changed = true;
@ -925,7 +925,7 @@ RENDER_AGAIN:
// Following is rendered in both editing and non-editing mode:
m_imgui->text("");
if (m_clipping_plane_distance == 0.f)
m_imgui->text(_(L("Clipping of view:"))+ " ");
m_imgui->text(_(L("Clipping of view"))+ ": ");
else {
if (m_imgui->button(_(L("Reset direction")))) {
wxGetApp().CallAfter([this](){

View File

@ -546,7 +546,7 @@ void MainFrame::init_menubar()
{
append_menu_item(helpMenu, wxID_ANY, _(L("Prusa 3D &Drivers")), _(L("Open the Prusa3D drivers download page in your browser")),
[this](wxCommandEvent&) { wxLaunchDefaultBrowser("http://www.prusa3d.com/drivers/"); });
append_menu_item(helpMenu, wxID_ANY, _(L("Prusa Edition &Releases")), _(L("Open the Prusa Edition releases page in your browser")),
append_menu_item(helpMenu, wxID_ANY, _(L("Software &Releases")), _(L("Open the software releases page in your browser")),
[this](wxCommandEvent&) { wxLaunchDefaultBrowser("http://github.com/prusa3d/slic3r/releases"); });
//# my $versioncheck = $self->_append_menu_item($helpMenu, "Check for &Updates...", "Check for new Slic3r versions", sub{
//# wxTheApp->check_version(1);
@ -683,7 +683,7 @@ void MainFrame::quick_slice(const int qs)
}
else if (qs & qsSaveAs) {
// The following line may die if the output_filename_format template substitution fails.
auto dlg = new wxFileDialog(this, _(L("Save ")) + (qs & qsExportSVG ? _(L("SVG")) : _(L("G-code"))) + _(L(" file as:")),
auto dlg = new wxFileDialog(this, wxString::Format(_(L("Save %s file as:")) , qs & qsExportSVG ? _(L("SVG")) : _(L("G-code")) ),
wxGetApp().app_config->get_last_output_dir(get_dir_name(output_file)), get_base_name(input_file),
qs & qsExportSVG ? file_wildcards(FT_SVG) : file_wildcards(FT_GCODE),
wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
@ -710,7 +710,9 @@ void MainFrame::quick_slice(const int qs)
}
// show processbar dialog
m_progress_dialog = new wxProgressDialog(_(L("Slicing")) + dots, _(L("Processing ")) + input_file_basename + "",
m_progress_dialog = new wxProgressDialog(_(L("Slicing")) + dots,
// TRN "Processing input_file_basename"
wxString::Format(_(L("Processing %s")), input_file_basename + dots),
100, this, 4);
m_progress_dialog->Pulse();
{

View File

@ -438,11 +438,14 @@ void ConfigOptionsGroup::on_kill_focus(const std::string& opt_key)
void ConfigOptionsGroup::reload_config()
{
for (auto &kvp : m_opt_map) {
// Name of the option field (name of the configuration key, possibly suffixed with '#' and the index of a scalar inside a vector.
const std::string &opt_id = kvp.first;
// option key (may be scalar or vector)
const std::string &opt_key = kvp.second.first;
// index in the vector option, zero for scalars
int opt_index = kvp.second.second;
const ConfigOptionDef &option = m_options.at(opt_id).opt;
this->set_value(opt_key, config_value(opt_key, opt_index, option.gui_flags == "serialized"));
this->set_value(opt_id, config_value(opt_key, opt_index, option.gui_flags == "serialized"));
}
}

View File

@ -3338,7 +3338,7 @@ void Plater::remove(size_t obj_idx) { p->remove(obj_idx); }
void Plater::reset() { p->reset(); }
void Plater::reset_with_confirm()
{
if (wxMessageDialog((wxWindow*)this, _(L("All objects will be removed, continue ?")), _(L("Delete all")), wxYES_NO | wxCANCEL | wxYES_DEFAULT | wxCENTRE).ShowModal() == wxID_YES)
if (wxMessageDialog((wxWindow*)this, _(L("All objects will be removed, continue ?")), wxString(SLIC3R_APP_NAME) + " - " + _(L("Delete all")), wxYES_NO | wxCANCEL | wxYES_DEFAULT | wxCENTRE).ShowModal() == wxID_YES)
reset();
}

View File

@ -6,7 +6,6 @@
#include "PresetBundle.hpp"
#include "PresetHints.hpp"
#include <boost/algorithm/string/predicate.hpp>
#include <wx/intl.h>
#include "GUI.hpp"
@ -18,38 +17,41 @@ namespace Slic3r {
std::string PresetHints::cooling_description(const Preset &preset)
{
std::string out;
char buf[MIN_BUF_LENGTH/*4096*/];
if (preset.config.opt_bool("cooling", 0)) {
int slowdown_below_layer_time = preset.config.opt_int("slowdown_below_layer_time", 0);
int min_fan_speed = preset.config.opt_int("min_fan_speed", 0);
int max_fan_speed = preset.config.opt_int("max_fan_speed", 0);
int min_print_speed = int(preset.config.opt_float("min_print_speed", 0) + 0.5);
int fan_below_layer_time = preset.config.opt_int("fan_below_layer_time", 0);
sprintf(buf, _CHB(L("If estimated layer time is below ~%ds, fan will run at %d%% and print speed will be reduced so that no less than %ds are spent on that layer (however, speed will never be reduced below %dmm/s).")),
slowdown_below_layer_time, max_fan_speed, slowdown_below_layer_time, min_print_speed);
out += buf;
out += (boost::format(_utf8(L("If estimated layer time is below ~%1%s, "
"fan will run at %2%%% and print speed will be reduced "
"so that no less than %3%s are spent on that layer "
"(however, speed will never be reduced below %4%mm/s).")))
% slowdown_below_layer_time % max_fan_speed % slowdown_below_layer_time % min_print_speed).str();
if (fan_below_layer_time > slowdown_below_layer_time) {
sprintf(buf, _CHB(L("\nIf estimated layer time is greater, but still below ~%ds, fan will run at a proportionally decreasing speed between %d%% and %d%%.")),
fan_below_layer_time, max_fan_speed, min_fan_speed);
out += buf;
out += (boost::format(_utf8(L("\nIf estimated layer time is greater, but still below ~%1%s, "
"fan will run at a proportionally decreasing speed between %2%%% and %3%%%.")))
% fan_below_layer_time % max_fan_speed % min_fan_speed).str();
}
out += _CHB(L("\nDuring the other layers, fan "));
out += _utf8(L("\nDuring the other layers, fan")) + " ";
} else {
out = _CHB(L("Fan "));
out = _utf8(L("Fan")) + " ";
}
if (preset.config.opt_bool("fan_always_on", 0)) {
int disable_fan_first_layers = preset.config.opt_int("disable_fan_first_layers", 0);
int min_fan_speed = preset.config.opt_int("min_fan_speed", 0);
sprintf(buf, _CHB(L("will always run at %d%% ")), min_fan_speed);
out += buf;
if (disable_fan_first_layers > 1) {
sprintf(buf, _CHB(L("except for the first %d layers")), disable_fan_first_layers);
out += buf;
}
out += (boost::format(_utf8(L("will always run at %1%%%"))) % min_fan_speed).str() + " ";
if (disable_fan_first_layers > 1)
out += (boost::format(_utf8(L("except for the first %1% layers."))) % disable_fan_first_layers).str();
else if (disable_fan_first_layers == 1)
out += _CHB(L("except for the first layer"));
out += _utf8(L("except for the first layer."));
} else
out += _CHB(L("will be turned off."));
out += _utf8(L("will be turned off."));
return out;
}
@ -150,7 +152,7 @@ std::string PresetHints::maximum_volumetric_flow_description(const PresetBundle
limit_by_first_layer_speed(std::max(external_perimeter_speed, small_perimeter_speed), max_print_speed));
if (max_flow < external_perimeter_rate) {
max_flow = external_perimeter_rate;
max_flow_extrusion_type = _CHB(L("external perimeters"));
max_flow_extrusion_type = _utf8(L("external perimeters"));
}
double perimeter_rate = Flow::new_from_config_width(frPerimeter,
first_positive(first_layer_extrusion_width_ptr, perimeter_extrusion_width, extrusion_width),
@ -159,7 +161,7 @@ std::string PresetHints::maximum_volumetric_flow_description(const PresetBundle
limit_by_first_layer_speed(std::max(perimeter_speed, small_perimeter_speed), max_print_speed));
if (max_flow < perimeter_rate) {
max_flow = perimeter_rate;
max_flow_extrusion_type = _CHB(L("perimeters"));
max_flow_extrusion_type = _utf8(L("perimeters"));
}
}
if (! bridging && infill_extruder_active) {
@ -168,7 +170,7 @@ std::string PresetHints::maximum_volumetric_flow_description(const PresetBundle
nozzle_diameter, lh, bfr).mm3_per_mm() * limit_by_first_layer_speed(infill_speed, max_print_speed);
if (max_flow < infill_rate) {
max_flow = infill_rate;
max_flow_extrusion_type = _CHB(L("infill"));
max_flow_extrusion_type = _utf8(L("infill"));
}
}
if (solid_infill_extruder_active) {
@ -178,7 +180,7 @@ std::string PresetHints::maximum_volumetric_flow_description(const PresetBundle
(bridging ? bridge_speed : limit_by_first_layer_speed(solid_infill_speed, max_print_speed));
if (max_flow < solid_infill_rate) {
max_flow = solid_infill_rate;
max_flow_extrusion_type = _CHB(L("solid infill"));
max_flow_extrusion_type = _utf8(L("solid infill"));
}
if (! bridging) {
double top_solid_infill_rate = Flow::new_from_config_width(frInfill,
@ -186,7 +188,7 @@ std::string PresetHints::maximum_volumetric_flow_description(const PresetBundle
nozzle_diameter, lh, bfr).mm3_per_mm() * limit_by_first_layer_speed(top_solid_infill_speed, max_print_speed);
if (max_flow < top_solid_infill_rate) {
max_flow = top_solid_infill_rate;
max_flow_extrusion_type = _CHB(L("top solid infill"));
max_flow_extrusion_type = _utf8(L("top solid infill"));
}
}
}
@ -197,7 +199,7 @@ std::string PresetHints::maximum_volumetric_flow_description(const PresetBundle
(bridging ? bridge_speed : limit_by_first_layer_speed(support_material_speed, max_print_speed));
if (max_flow < support_material_rate) {
max_flow = support_material_rate;
max_flow_extrusion_type = _CHB(L("support"));
max_flow_extrusion_type = _utf8(L("support"));
}
}
if (support_material_interface_extruder_active) {
@ -207,26 +209,23 @@ std::string PresetHints::maximum_volumetric_flow_description(const PresetBundle
(bridging ? bridge_speed : limit_by_first_layer_speed(support_material_interface_speed, max_print_speed));
if (max_flow < support_material_interface_rate) {
max_flow = support_material_interface_rate;
max_flow_extrusion_type = _CHB(L("support interface"));
max_flow_extrusion_type = _utf8(L("support interface"));
}
}
//FIXME handle gap_fill_speed
if (! out.empty())
out += "\n";
out += (first_layer ? _CHB(L("First layer volumetric")) : (bridging ? _CHB(L("Bridging volumetric")) : _CHB(L("Volumetric"))));
out += _CHB(L(" flow rate is maximized "));
out += (first_layer ? _utf8(L("First layer volumetric")) : (bridging ? _utf8(L("Bridging volumetric")) : _utf8(L("Volumetric"))));
out += " " + _utf8(L("flow rate is maximized")) + " ";
bool limited_by_max_volumetric_speed = max_volumetric_speed > 0 && max_volumetric_speed < max_flow;
out += (limited_by_max_volumetric_speed ?
_CHB(L("by the print profile maximum")) :
(_CHB(L("when printing ")) + max_flow_extrusion_type))
+ _CHB(L(" with a volumetric rate "));
_utf8(L("by the print profile maximum")) :
(_utf8(L("when printing"))+ " " + max_flow_extrusion_type))
+ " " + _utf8(L("with a volumetric rate"))+ " ";
if (limited_by_max_volumetric_speed)
max_flow = max_volumetric_speed;
char buf[MIN_BUF_LENGTH/*2048*/];
sprintf(buf, _CHB(L("%3.2f mm³/s")), max_flow);
out += buf;
sprintf(buf, _CHB(L(" at filament speed %3.2f mm/s.")), max_flow / filament_crossection);
out += buf;
out += (boost::format(_utf8(L("%3.2f mm³/s at filament speed %3.2f mm/s."))) % max_flow % (max_flow / filament_crossection)).str();
}
return out;
@ -244,7 +243,7 @@ std::string PresetHints::recommended_thin_wall_thickness(const PresetBundle &pre
std::string out;
if (layer_height <= 0.f){
out += _CHB(L("Recommended object thin wall thickness: Not available due to invalid layer height."));
out += _utf8(L("Recommended object thin wall thickness: Not available due to invalid layer height."));
return out;
}
@ -260,16 +259,13 @@ std::string PresetHints::recommended_thin_wall_thickness(const PresetBundle &pre
if (num_perimeters > 0) {
int num_lines = std::min(num_perimeters * 2, 10);
char buf[MIN_BUF_LENGTH/*256*/];
sprintf(buf, _CHB(L("Recommended object thin wall thickness for layer height %.2f and ")), layer_height);
out += buf;
out += (boost::format(_utf8(L("Recommended object thin wall thickness for layer height %.2f and"))) % layer_height).str() + " ";
// Start with the width of two closely spaced
double width = external_perimeter_flow.width + external_perimeter_flow.spacing();
for (int i = 2; i <= num_lines; thin_walls ? ++ i : i += 2) {
if (i > 2)
out += ", ";
sprintf(buf, _CHB(L("%d lines: %.2lf mm")), i, width);
out += buf;
out += (boost::format(_utf8(L("%d lines: %.2f mm"))) % i % width).str() + " ";
width += perimeter_flow.spacing() * (thin_walls ? 1.f : 2.f);
}
}

View File

@ -78,7 +78,7 @@ void Chart::draw() {
int text_height = 0;
dc.GetTextExtent(label,&text_width,&text_height);
dc.DrawText(label,wxPoint(0.5*(m_rect.GetRight()+m_rect.GetLeft())-text_width/2.f, m_rect.GetBottom()+0.5*legend_side));
label = _(L("Volumetric speed")) + " (" + _(L("mm")) + wxString("³/", wxConvUTF8) + _(L("s")) + ")";
label = _(L("Volumetric speed")) + " (" + _(L("mm³/s")) + ")";
dc.GetTextExtent(label,&text_width,&text_height);
dc.DrawRotatedText(label,wxPoint(0,0.5*(m_rect.GetBottom()+m_rect.GetTop())+text_width/2.f),90);
}

View File

@ -129,7 +129,8 @@ void Tab::create_preset_tab()
add_scaled_button(panel, &m_btn_hide_incompatible_presets, m_bmp_hide_incompatible_presets.name());
m_btn_save_preset->SetToolTip(_(L("Save current ")) + m_title);
// TRN "Save current Settings"
m_btn_save_preset->SetToolTip(wxString::Format(_(L("Save current %s")),m_title));
m_btn_delete_preset->SetToolTip(_(L("Delete this preset")));
m_btn_delete_preset->Disable();
@ -916,13 +917,13 @@ void Tab::update_preset_description_line()
wxString description_line = preset.is_default ?
_(L("It's a default preset.")) : preset.is_system ?
_(L("It's a system preset.")) :
_(L("Current preset is inherited from ")) + (parent == nullptr ?
"default preset." :
":\n\t" + parent->name);
wxString::Format(_(L("Current preset is inherited from %s")), (parent == nullptr ?
_(L("default preset"))+"." :
":\n\t" + parent->name));
if (preset.is_default || preset.is_system)
description_line += "\n\t" + _(L("It can't be deleted or modified. ")) +
"\n\t" + _(L("Any modifications should be saved as a new preset inherited from this one. ")) +
description_line += "\n\t" + _(L("It can't be deleted or modified.")) +
"\n\t" + _(L("Any modifications should be saved as a new preset inherited from this one.")) +
"\n\t" + _(L("To do that please specify a new name for the preset."));
if (parent && parent->vendor)
@ -1356,10 +1357,10 @@ void TabPrint::update()
correct_100p_fill = true;
}
// get fill_pattern name from enum_labels for using this one at dialog_msg
str_fill_pattern = m_config->def()->get("fill_pattern")->enum_labels[fill_pattern];
str_fill_pattern = _utf8(m_config->def()->get("fill_pattern")->enum_labels[fill_pattern]);
if (!correct_100p_fill) {
wxString msg_text = _(L("The ")) + str_fill_pattern + _(L(" infill pattern is not supposed to work at 100% density.\n"
"\nShall I switch to rectilinear fill pattern?"));
wxString msg_text = GUI::from_u8((boost::format(_utf8(L("The %1% infill pattern is not supposed to work at 100%% density.\n\n"
"Shall I switch to rectilinear fill pattern?"))) % str_fill_pattern).str());
auto dialog = new wxMessageDialog(parent(), msg_text, _(L("Infill")), wxICON_WARNING | wxYES | wxNO);
DynamicPrintConfig new_conf = *m_config;
if (dialog->ShowModal() == wxID_YES) {
@ -1450,6 +1451,7 @@ void TabPrint::update()
m_recommended_thin_wall_thickness_description_line->SetText(
from_u8(PresetHints::recommended_thin_wall_thickness(*m_preset_bundle)));
Layout();
// Thaw();
m_update_cnt--;
@ -1478,7 +1480,7 @@ void TabFilament::build()
optgroup->append_single_option_line("filament_density");
optgroup->append_single_option_line("filament_cost");
optgroup = page->new_optgroup(_(L("Temperature ")) + wxString("°C", wxConvUTF8));
optgroup = page->new_optgroup(_(L("Temperature")) + wxString(" °C", wxConvUTF8));
Line line = { _(L("Extruder")), "" };
line.append_option(optgroup->get_option("first_layer_temperature"));
line.append_option(optgroup->get_option("temperature"));
@ -1632,6 +1634,7 @@ void TabFilament::update()
m_cooling_description_line->SetText(text);
text = from_u8(PresetHints::maximum_volumetric_flow_description(*m_preset_bundle));
m_volumetric_speed_description_line->SetText(text);
Layout();
bool cooling = m_config->opt_bool("cooling", 0);
bool fan_always_on = cooling || m_config->opt_bool("fan_always_on", 0);
@ -1737,7 +1740,7 @@ void TabPrinter::build_printhost(ConfigOptionsGroup *optgroup)
Line cafile_line = optgroup->create_single_option_line("printhost_cafile");
auto printhost_cafile_browse = [this, optgroup] (wxWindow* parent) {
auto btn = new wxButton(parent, wxID_ANY, _(L(" Browse "))+dots, wxDefaultPosition, wxDefaultSize, wxBU_LEFT);
auto btn = new wxButton(parent, wxID_ANY, " " + _(L("Browse"))+" " +dots, wxDefaultPosition, wxDefaultSize, wxBU_LEFT);
btn->SetFont(Slic3r::GUI::wxGetApp().normal_font());
btn->SetBitmap(create_scaled_bitmap(this, "browse"));
auto sizer = new wxBoxSizer(wxHORIZONTAL);
@ -1818,7 +1821,7 @@ void TabPrinter::build_fff()
Line line = optgroup->create_single_option_line("bed_shape");//{ _(L("Bed shape")), "" };
line.widget = [this](wxWindow* parent) {
ScalableButton* btn;
add_scaled_button(parent, &btn, "printer_white", _(L(" Set ")) + dots, wxBU_LEFT | wxBU_EXACTFIT);
add_scaled_button(parent, &btn, "printer_white", " " + _(L("Set")) + " " + dots, wxBU_LEFT | wxBU_EXACTFIT);
btn->SetFont(wxGetApp().normal_font());
auto sizer = new wxBoxSizer(wxHORIZONTAL);
@ -2019,7 +2022,7 @@ void TabPrinter::build_sla()
Line line = optgroup->create_single_option_line("bed_shape");//{ _(L("Bed shape")), "" };
line.widget = [this](wxWindow* parent) {
ScalableButton* btn;
add_scaled_button(parent, &btn, "printer_white", _(L(" Set ")) + dots, wxBU_LEFT | wxBU_EXACTFIT);
add_scaled_button(parent, &btn, "printer_white", " " + _(L("Set")) + " " + dots, wxBU_LEFT | wxBU_EXACTFIT);
btn->SetFont(wxGetApp().normal_font());
@ -2343,11 +2346,12 @@ void TabPrinter::update_pages()
{
m_preset_bundle->update_multi_material_filament_presets();
on_value_change("extruders_count", m_extruders_count);
wxGetApp().sidebar().update_objects_list_extruder_column(m_extruders_count);
}
}
else
m_pages.swap(m_pages_fff);
wxGetApp().sidebar().update_objects_list_extruder_column(m_extruders_count);
}
else
m_pages_sla.empty() ? build_sla() : m_pages.swap(m_pages_sla);
@ -2770,8 +2774,8 @@ bool Tab::may_discard_current_dirty_preset(PresetCollection* presets /*= nullptr
std::string type_name = presets->name();
wxString tab = " ";
wxString name = old_preset.is_default ?
wxString::Format(_(L("Default preset (%s)")), _(type_name)) : //_(L("Default ")) + type_name + _(L(" preset")) :
wxString::Format(_(L("Preset (%s)")), _(type_name)) + "\n" + tab + old_preset.name; //type_name + _(L(" preset\n")) + tab + old_preset.name;
wxString::Format(_(L("Default preset (%s)")), _(type_name)) :
wxString::Format(_(L("Preset (%s)")), _(type_name)) + "\n" + tab + old_preset.name;
// Collect descriptions of the dirty options.
wxString changes;
@ -2888,11 +2892,10 @@ void Tab::save_preset(std::string name /*= ""*/)
if (name.empty()) {
const Preset &preset = m_presets->get_selected_preset();
auto default_name = preset.is_default ? "Untitled" : preset.name;
if (preset.is_system) {
default_name += " - ";
default_name += _(L("Copy")).ToUTF8().data();
}
auto default_name = preset.is_default ? "Untitled" :
preset.is_system ? (boost::format(_utf8(L("%1% - Copy"))) % preset.name).str() :
preset.name;
bool have_extention = boost::iends_with(default_name, ".ini");
if (have_extention) {
size_t len = default_name.length()-4;
@ -2948,10 +2951,12 @@ void Tab::delete_preset()
{
auto current_preset = m_presets->get_selected_preset();
// Don't let the user delete the ' - default - ' configuration.
wxString action = current_preset.is_external ? _(L("remove")) : _(L("delete"));
wxString msg = _(L("Are you sure you want to ")) + action + _(L(" the selected preset?"));
action = current_preset.is_external ? _(L("Remove")) : _(L("Delete"));
wxString title = action + _(L(" Preset"));
std::string action = current_preset.is_external ? _utf8(L("remove")) : _utf8(L("delete"));
// TRN remove/delete
const wxString msg = from_u8((boost::format(_utf8(L("Are you sure you want to %1% the selected preset?"))) % action).str());
action = current_preset.is_external ? _utf8(L("Remove")) : _utf8(L("Delete"));
// TRN Remove/Delete
wxString title = from_u8((boost::format(_utf8(L("%1% Preset"))) % action).str()); //action + _(L(" Preset"));
if (current_preset.is_default ||
wxID_YES != wxMessageDialog(parent(), msg, title, wxYES_NO | wxNO_DEFAULT | wxICON_QUESTION).ShowModal())
return;
@ -3001,7 +3006,7 @@ wxSizer* Tab::compatible_widget_create(wxWindow* parent, PresetDependencies &dep
{
deps.checkbox = new wxCheckBox(parent, wxID_ANY, _(L("All")));
deps.checkbox->SetFont(Slic3r::GUI::wxGetApp().normal_font());
add_scaled_button(parent, &deps.btn, "printer_white", _(L(" Set ")) + dots, wxBU_LEFT | wxBU_EXACTFIT);
add_scaled_button(parent, &deps.btn, "printer_white", wxString::Format(" %s %s", _(L("Set")), dots), wxBU_LEFT | wxBU_EXACTFIT);
deps.btn->SetFont(Slic3r::GUI::wxGetApp().normal_font());
auto sizer = new wxBoxSizer(wxHORIZONTAL);
@ -3256,7 +3261,8 @@ ConfigOptionsGroupShp Page::new_optgroup(const wxString& title, int noncommon_la
void SavePresetWindow::build(const wxString& title, const std::string& default_name, std::vector<std::string> &values)
{
auto text = new wxStaticText(this, wxID_ANY, _(L("Save ")) + title + _(L(" as:")),
// TRN Preset
auto text = new wxStaticText(this, wxID_ANY, wxString::Format(_(L("Save %s as:")), title),
wxDefaultPosition, wxDefaultSize);
m_combo = new wxComboBox(this, wxID_ANY, from_u8(default_name),
wxDefaultPosition, wxDefaultSize, 0, 0, wxTE_PROCESS_ENTER);