L10n improvements

This commit is contained in:
YuSanka 2019-01-21 12:34:28 +01:00
parent d6a203613d
commit 1a474ea282
36 changed files with 67009 additions and 38373 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,32 +1,37 @@
xs/src/slic3r/GUI/AboutDialog.cpp src/slic3r/GUI/AboutDialog.cpp
xs/src/slic3r/GUI/BedShapeDialog.cpp src/slic3r/GUI/BedShapeDialog.cpp
xs/src/slic3r/GUI/BedShapeDialog.hpp src/slic3r/GUI/BedShapeDialog.hpp
xs/src/slic3r/GUI/BonjourDialog.cpp src/slic3r/GUI/BonjourDialog.cpp
xs/src/slic3r/GUI/ButtonsDescription.cpp src/slic3r/GUI/ButtonsDescription.cpp
xs/src/slic3r/GUI/ConfigSnapshotDialog.cpp src/slic3r/GUI/ConfigSnapshotDialog.cpp
xs/src/slic3r/GUI/ConfigWizard.cpp src/slic3r/GUI/ConfigWizard.cpp
xs/src/slic3r/GUI/FirmwareDialog.cpp src/slic3r/GUI/Field.cpp
xs/src/slic3r/GUI/GLCanvas3D.cpp src/slic3r/GUI/FirmwareDialog.cpp
xs/src/slic3r/GUI/GUI.cpp src/slic3r/GUI/GLCanvas3D.cpp
xs/src/slic3r/GUI/MsgDialog.cpp src/slic3r/GUI/GLGizmo.cpp
xs/src/slic3r/GUI/Tab.cpp src/slic3r/GUI/GUI.cpp
xs/src/slic3r/GUI/Tab.hpp src/slic3r/GUI/GUI_App.cpp
xs/src/slic3r/GUI/Field.cpp src/slic3r/GUI/GUI_ObjectList.cpp
xs/src/slic3r/GUI/OptionsGroup.cpp src/slic3r/GUI/GUI_ObjectManipulation.cpp
xs/src/slic3r/GUI/Preset.cpp src/slic3r/GUI/GUI_Preview.cpp
xs/src/slic3r/GUI/PresetBundle.cpp src/slic3r/GUI/KBShortcutsDialog.cpp
xs/src/slic3r/GUI/PresetHints.cpp src/slic3r/GUI/MainFrame.cpp
xs/src/slic3r/GUI/Preferences.cpp src/slic3r/GUI/MsgDialog.cpp
xs/src/slic3r/GUI/RammingChart.cpp src/slic3r/GUI/Plater.cpp
xs/src/slic3r/GUI/UpdateDialogs.cpp src/slic3r/GUI/Preferences.cpp
xs/src/slic3r/GUI/WipeTowerDialog.cpp src/slic3r/GUI/Preset.cpp
xs/src/slic3r/Utils/OctoPrint.cpp src/slic3r/GUI/PresetBundle.cpp
xs/src/slic3r/Utils/PresetUpdater.cpp src/slic3r/GUI/PresetHints.cpp
xs/src/libslic3r/Print.cpp src/slic3r/GUI/PrintHostDialogs.cpp
xs/src/libslic3r/PrintConfig.cpp src/slic3r/GUI/RammingChart.cpp
xs/src/libslic3r/GCode/PreviewData.cpp src/slic3r/GUI/SysInfoDialog.cpp
lib/Slic3r/GUI.pm src/slic3r/GUI/Tab.cpp
lib/Slic3r/GUI/MainFrame.pm src/slic3r/GUI/Tab.hpp
lib/Slic3r/GUI/Plater.pm src/slic3r/GUI/UpdateDialogs.cpp
lib/Slic3r/GUI/Plater/2D.pm src/slic3r/GUI/WipeTowerDialog.cpp
lib/Slic3r/GUI/Plater/3DPreview.pm src/slic3r/Utils/OctoPrint.cpp
src/slic3r/Utils/PresetUpdater.cpp
src/slic3r/Utils/FixModelByWin10.cpp
src/libslic3r/Print.cpp
src/libslic3r/PrintConfig.cpp
src/libslic3r/GCode/PreviewData.cpp

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -2487,7 +2487,6 @@ void PrintConfigDef::init_sla_params()
def->label = L("Generate supports"); def->label = L("Generate supports");
def->category = L("Supports"); def->category = L("Supports");
def->tooltip = L("Generate supports for the models"); def->tooltip = L("Generate supports for the models");
def->sidetext = L("");
def->cli = ""; def->cli = "";
def->default_value = new ConfigOptionBool(true); def->default_value = new ConfigOptionBool(true);
@ -2549,7 +2548,6 @@ void PrintConfigDef::init_sla_params()
def->tooltip = L("Merging bridges or pillars into another pillars can " def->tooltip = L("Merging bridges or pillars into another pillars can "
"increase the radius. Zero means no increase, one means " "increase the radius. Zero means no increase, one means "
"full increase."); "full increase.");
def->sidetext = L("");
def->cli = ""; def->cli = "";
def->min = 0; def->min = 0;
def->max = 1; def->max = 1;
@ -2631,14 +2629,13 @@ void PrintConfigDef::init_sla_params()
def->label = L("Use pad"); def->label = L("Use pad");
def->category = L("Pad"); def->category = L("Pad");
def->tooltip = L("Add a pad underneath the supported model"); def->tooltip = L("Add a pad underneath the supported model");
def->sidetext = L("");
def->cli = ""; def->cli = "";
def->default_value = new ConfigOptionBool(true); def->default_value = new ConfigOptionBool(true);
def = this->add("pad_wall_thickness", coFloat); def = this->add("pad_wall_thickness", coFloat);
def->label = L("Pad wall thickness"); def->label = L("Pad wall thickness");
def->category = L("Pad"); def->category = L("Pad");
def->tooltip = L(""); // def->tooltip = L("");
def->sidetext = L("mm"); def->sidetext = L("mm");
def->cli = ""; def->cli = "";
def->min = 0; def->min = 0;
@ -2647,7 +2644,7 @@ void PrintConfigDef::init_sla_params()
def = this->add("pad_wall_height", coFloat); def = this->add("pad_wall_height", coFloat);
def->label = L("Pad wall height"); def->label = L("Pad wall height");
def->category = L("Pad"); def->category = L("Pad");
def->tooltip = L(""); // def->tooltip = L("");
def->sidetext = L("mm"); def->sidetext = L("mm");
def->cli = ""; def->cli = "";
def->min = 0; def->min = 0;
@ -2656,7 +2653,7 @@ void PrintConfigDef::init_sla_params()
def = this->add("pad_max_merge_distance", coFloat); def = this->add("pad_max_merge_distance", coFloat);
def->label = L("Max merge distance"); def->label = L("Max merge distance");
def->category = L("Pad"); def->category = L("Pad");
def->tooltip = L(""); // def->tooltip = L("");
def->sidetext = L("mm"); def->sidetext = L("mm");
def->cli = ""; def->cli = "";
def->min = 0; def->min = 0;
@ -2665,7 +2662,7 @@ void PrintConfigDef::init_sla_params()
def = this->add("pad_edge_radius", coFloat); def = this->add("pad_edge_radius", coFloat);
def->label = L("Pad edge radius"); def->label = L("Pad edge radius");
def->category = L("Pad"); def->category = L("Pad");
def->tooltip = L(""); // def->tooltip = L("");
def->sidetext = L("mm"); def->sidetext = L("mm");
def->cli = ""; def->cli = "";
def->min = 0; def->min = 0;

View file

@ -89,8 +89,8 @@ PrinterPicker::PrinterPicker(wxWindow *parent, const VendorProfile &vendor, cons
bool default_variant = true; // Mark the first variant as default in the GUI bool default_variant = true; // Mark the first variant as default in the GUI
for (const auto &variant : model.variants) { for (const auto &variant : model.variants) {
const auto label = wxString::Format("%s %s %s %s", variant.name, _(L("mm")), _(L("nozzle")), const auto label = wxString::Format("%s %s %s %s", variant.name, _(L("mm")), _(L("nozzle")),
(default_variant ? _(L("(default)")) : wxString())); (default_variant ? "(" + _(L("default")) + ")" : wxString()));
default_variant = false; default_variant = false;
auto *cbox = new Checkbox(variants_panel, label, model_id, variant.name); auto *cbox = new Checkbox(variants_panel, label, model_id, variant.name);
const size_t idx = cboxes.size(); const size_t idx = cboxes.size();
@ -803,7 +803,7 @@ void ConfigWizard::priv::apply_config(AppConfig *app_config, PresetBundle *prese
// Public // Public
ConfigWizard::ConfigWizard(wxWindow *parent, RunReason reason) : ConfigWizard::ConfigWizard(wxWindow *parent, RunReason reason) :
wxDialog(parent, wxID_ANY, name(), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER), wxDialog(parent, wxID_ANY, _(name().ToStdString()), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER),
p(new priv(this)) p(new priv(this))
{ {
p->run_reason = reason; p->run_reason = reason;
@ -899,15 +899,17 @@ bool ConfigWizard::run(PresetBundle *preset_bundle, const PresetUpdater *updater
} }
const wxString& ConfigWizard::name() const wxString& ConfigWizard::name(const bool from_menu/* = false*/)
{ {
// A different naming convention is used for the Wizard on Windows vs. OSX & GTK. // A different naming convention is used for the Wizard on Windows vs. OSX & GTK.
#if WIN32 #if WIN32
static const wxString config_wizard_name = L("Configuration Wizard"); static const wxString config_wizard_name = L("Configuration Wizard");
static const wxString config_wizard_name_menu = L("Configuration &Wizard");
#else #else
static const wxString config_wizard_name = L("Configuration Assistant"); static const wxString config_wizard_name = L("Configuration Assistant");
static const wxString config_wizard_name_menu = L("Configuration &Assistant");
#endif #endif
return config_wizard_name; return from_menu ? config_wizard_name_menu : config_wizard_name;
} }
} }

View file

@ -34,7 +34,7 @@ public:
// Run the Wizard. Return whether it was completed. // Run the Wizard. Return whether it was completed.
bool run(PresetBundle *preset_bundle, const PresetUpdater *updater); bool run(PresetBundle *preset_bundle, const PresetUpdater *updater);
static const wxString& name(); static const wxString& name(const bool from_menu = false);
private: private:
struct priv; struct priv;
std::unique_ptr<priv> p; std::unique_ptr<priv> p;

View file

@ -602,15 +602,15 @@ void GUI_App::add_config_menu(wxMenuBar *menu)
auto local_menu = new wxMenu(); auto local_menu = new wxMenu();
wxWindowID config_id_base = wxWindow::NewControlId((int)ConfigMenuCnt); wxWindowID config_id_base = wxWindow::NewControlId((int)ConfigMenuCnt);
const auto config_wizard_name = _(ConfigWizard::name().wx_str()); const auto config_wizard_name = _(ConfigWizard::name(true).wx_str());
const auto config_wizard_tooltip = wxString::Format(_(L("Run %s")), config_wizard_name); const auto config_wizard_tooltip = wxString::Format(_(L("Run %s")), config_wizard_name);
// Cmd+, is standard on OS X - what about other operating systems? // Cmd+, is standard on OS X - what about other operating systems?
local_menu->Append(config_id_base + ConfigMenuWizard, config_wizard_name + dots, config_wizard_tooltip); local_menu->Append(config_id_base + ConfigMenuWizard, config_wizard_name + dots, config_wizard_tooltip);
local_menu->Append(config_id_base + ConfigMenuSnapshots, _(L("Configuration Snapshots")) + dots, _(L("Inspect / activate configuration snapshots"))); local_menu->Append(config_id_base + ConfigMenuSnapshots, _(L("&Configuration Snapshots")) + dots, _(L("Inspect / activate configuration snapshots")));
local_menu->Append(config_id_base + ConfigMenuTakeSnapshot, _(L("Take Configuration Snapshot")), _(L("Capture a configuration snapshot"))); local_menu->Append(config_id_base + ConfigMenuTakeSnapshot, _(L("Take Configuration &Snapshot")), _(L("Capture a configuration snapshot")));
// local_menu->Append(config_id_base + ConfigMenuUpdate, _(L("Check for updates")), _(L("Check for configuration updates"))); // local_menu->Append(config_id_base + ConfigMenuUpdate, _(L("Check for updates")), _(L("Check for configuration updates")));
local_menu->AppendSeparator(); local_menu->AppendSeparator();
local_menu->Append(config_id_base + ConfigMenuPreferences, _(L("Preferences")) + dots + "\tCtrl+P", _(L("Application preferences"))); local_menu->Append(config_id_base + ConfigMenuPreferences, _(L("&Preferences")) + dots + "\tCtrl+P", _(L("Application preferences")));
local_menu->AppendSeparator(); local_menu->AppendSeparator();
auto mode_menu = new wxMenu(); auto mode_menu = new wxMenu();
mode_menu->AppendRadioItem(config_id_base + ConfigMenuModeSimple, _(L("Simple")), _(L("Simple View Mode"))); mode_menu->AppendRadioItem(config_id_base + ConfigMenuModeSimple, _(L("Simple")), _(L("Simple View Mode")));
@ -619,9 +619,9 @@ void GUI_App::add_config_menu(wxMenuBar *menu)
mode_menu->Check(config_id_base + ConfigMenuModeSimple + get_mode(), true); mode_menu->Check(config_id_base + ConfigMenuModeSimple + get_mode(), true);
local_menu->AppendSubMenu(mode_menu, _(L("Mode")), _(L("Slic3r View Mode"))); local_menu->AppendSubMenu(mode_menu, _(L("Mode")), _(L("Slic3r View Mode")));
local_menu->AppendSeparator(); local_menu->AppendSeparator();
local_menu->Append(config_id_base + ConfigMenuLanguage, _(L("Change Application Language"))); local_menu->Append(config_id_base + ConfigMenuLanguage, _(L("Change Application &Language")));
local_menu->AppendSeparator(); local_menu->AppendSeparator();
local_menu->Append(config_id_base + ConfigMenuFlashFirmware, _(L("Flash printer firmware")), _(L("Upload a firmware image into an Arduino based printer"))); local_menu->Append(config_id_base + ConfigMenuFlashFirmware, _(L("Flash printer &firmware")), _(L("Upload a firmware image into an Arduino based printer")));
// TODO: for when we're able to flash dictionaries // TODO: for when we're able to flash dictionaries
// local_menu->Append(config_id_base + FirmwareMenuDict, _(L("Flash language file")), _(L("Upload a language dictionary file into a Prusa printer"))); // local_menu->Append(config_id_base + FirmwareMenuDict, _(L("Flash language file")), _(L("Upload a language dictionary file into a Prusa printer")));

View file

@ -249,9 +249,9 @@ void ObjectManipulation::UpdateAndShow(const bool show)
void ObjectManipulation::update_settings_value(const GLCanvas3D::Selection& selection) void ObjectManipulation::update_settings_value(const GLCanvas3D::Selection& selection)
{ {
m_new_move_label_string = L("Position:"); m_new_move_label_string = L("Position");
m_new_rotate_label_string = L("Rotation:"); m_new_rotate_label_string = L("Rotation");
m_new_scale_label_string = L("Scale factors:"); m_new_scale_label_string = L("Scale factors");
if (selection.is_single_full_instance()) if (selection.is_single_full_instance())
{ {
// all volumes in the selection belongs to the same instance, any of them contains the needed instance data, so we take the first one // all volumes in the selection belongs to the same instance, any of them contains the needed instance data, so we take the first one
@ -297,8 +297,8 @@ void ObjectManipulation::update_settings_value(const GLCanvas3D::Selection& sele
m_new_rotation = Vec3d::Zero(); m_new_rotation = Vec3d::Zero();
m_new_scale = Vec3d(1.0, 1.0, 1.0); m_new_scale = Vec3d(1.0, 1.0, 1.0);
m_new_size = box.size(); m_new_size = box.size();
m_new_rotate_label_string = L("Rotate:"); m_new_rotate_label_string = L("Rotate");
m_new_scale_label_string = L("Scale:"); m_new_scale_label_string = L("Scale");
m_new_enabled = true; m_new_enabled = true;
} }
else if (selection.is_single_modifier() || selection.is_single_volume()) else if (selection.is_single_modifier() || selection.is_single_volume())
@ -318,9 +318,9 @@ void ObjectManipulation::update_settings_value(const GLCanvas3D::Selection& sele
else if (wxGetApp().obj_list()->multiple_selection()) else if (wxGetApp().obj_list()->multiple_selection())
{ {
reset_settings_value(); reset_settings_value();
m_new_move_label_string = L("Translate:"); m_new_move_label_string = L("Translate");
m_new_rotate_label_string = L("Rotate:"); m_new_rotate_label_string = L("Rotate");
m_new_scale_label_string = L("Scale:"); m_new_scale_label_string = L("Scale");
m_new_size = selection.get_bounding_box().size(); m_new_size = selection.get_bounding_box().size();
m_new_enabled = true; m_new_enabled = true;
} }
@ -337,21 +337,21 @@ void ObjectManipulation::update_settings_value(const GLCanvas3D::Selection& sele
void ObjectManipulation::update_if_dirty() void ObjectManipulation::update_if_dirty()
{ {
#if ENABLE_IMPROVED_SIDEBAR_OBJECTS_MANIPULATION #if ENABLE_IMPROVED_SIDEBAR_OBJECTS_MANIPULATION
if (m_cache.move_label_string != _(m_new_move_label_string)) if (m_cache.move_label_string != _(m_new_move_label_string)+ ":")
{ {
m_cache.move_label_string = _(m_new_move_label_string); m_cache.move_label_string = _(m_new_move_label_string)+ ":";
m_move_Label->SetLabel(m_cache.move_label_string); m_move_Label->SetLabel(m_cache.move_label_string);
} }
if (m_cache.rotate_label_string != _(m_new_rotate_label_string)) if (m_cache.rotate_label_string != _(m_new_rotate_label_string)+ ":")
{ {
m_cache.rotate_label_string = _(m_new_rotate_label_string); m_cache.rotate_label_string = _(m_new_rotate_label_string)+ ":";
m_rotate_Label->SetLabel(m_cache.rotate_label_string); m_rotate_Label->SetLabel(m_cache.rotate_label_string);
} }
if (m_cache.scale_label_string != _(m_new_scale_label_string)) if (m_cache.scale_label_string != _(m_new_scale_label_string)+ ":")
{ {
m_cache.scale_label_string = _(m_new_scale_label_string); m_cache.scale_label_string = _(m_new_scale_label_string)+ ":";
m_scale_Label->SetLabel(m_cache.scale_label_string); m_scale_Label->SetLabel(m_cache.scale_label_string);
} }

View file

@ -101,7 +101,7 @@ void KBShortcutsDialog::fill_shortcuts()
main_shortcuts.push_back(Shortcut(ctrl+"O" ,L("Open project STL/OBJ/AMF/3MF with config, delete bed"))); main_shortcuts.push_back(Shortcut(ctrl+"O" ,L("Open project STL/OBJ/AMF/3MF with config, delete bed")));
main_shortcuts.push_back(Shortcut(ctrl+"I" ,L("Import STL/OBJ/AMF/3MF without config, keep bed"))); main_shortcuts.push_back(Shortcut(ctrl+"I" ,L("Import STL/OBJ/AMF/3MF without config, keep bed")));
main_shortcuts.push_back(Shortcut(ctrl+"L" ,L("Load Config from .ini/amf/3mf/gcode"))); main_shortcuts.push_back(Shortcut(ctrl+"L" ,L("Load Config from .ini/amf/3mf/gcode")));
main_shortcuts.push_back(Shortcut(ctrl+"G" ,L("Export Gcode"))); main_shortcuts.push_back(Shortcut(ctrl+"G" ,L("Export G-code")));
main_shortcuts.push_back(Shortcut(ctrl+"S" ,L("Save project (3MF)"))); main_shortcuts.push_back(Shortcut(ctrl+"S" ,L("Save project (3MF)")));
main_shortcuts.push_back(Shortcut(ctrl+alt+"L" ,L("Load Config from .ini/amf/3mf/gcode and merge"))); main_shortcuts.push_back(Shortcut(ctrl+alt+"L" ,L("Load Config from .ini/amf/3mf/gcode and merge")));
main_shortcuts.push_back(Shortcut(ctrl+"R" ,L("(Re)slice"))); main_shortcuts.push_back(Shortcut(ctrl+"R" ,L("(Re)slice")));
@ -110,8 +110,8 @@ void KBShortcutsDialog::fill_shortcuts()
main_shortcuts.push_back(Shortcut(ctrl+"1" ,L("Select Plater Tab"))); main_shortcuts.push_back(Shortcut(ctrl+"1" ,L("Select Plater Tab")));
main_shortcuts.push_back(Shortcut(ctrl+alt+"U" ,L("Quick slice and Save as"))); main_shortcuts.push_back(Shortcut(ctrl+alt+"U" ,L("Quick slice and Save as")));
main_shortcuts.push_back(Shortcut(ctrl+"2" ,L("Select Print Settings Tab"))); main_shortcuts.push_back(Shortcut(ctrl+"2" ,L("Select Print Settings Tab")));
main_shortcuts.push_back(Shortcut(ctrl+"3" ,L("Select Filament Setting Tab"))); main_shortcuts.push_back(Shortcut(ctrl+"3" ,L("Select Filament Settings Tab")));
main_shortcuts.push_back(Shortcut(ctrl+"4" ,L("Select Printer Setting Tab"))); main_shortcuts.push_back(Shortcut(ctrl+"4" ,L("Select Printer Settings Tab")));
main_shortcuts.push_back(Shortcut(ctrl+"5" ,L("Switch to 3D"))); main_shortcuts.push_back(Shortcut(ctrl+"5" ,L("Switch to 3D")));
main_shortcuts.push_back(Shortcut(ctrl+"6" ,L("Switch to Preview"))); main_shortcuts.push_back(Shortcut(ctrl+"6" ,L("Switch to Preview")));
main_shortcuts.push_back(Shortcut(ctrl+"P" ,L("Preferences"))); main_shortcuts.push_back(Shortcut(ctrl+"P" ,L("Preferences")));
@ -132,7 +132,7 @@ void KBShortcutsDialog::fill_shortcuts()
plater_shortcuts.push_back(Shortcut("A", L("Arrange"))); plater_shortcuts.push_back(Shortcut("A", L("Arrange")));
plater_shortcuts.push_back(Shortcut(ctrl+"A", L("Select All objects"))); plater_shortcuts.push_back(Shortcut(ctrl+"A", L("Select All objects")));
plater_shortcuts.push_back(Shortcut("Del", L("Delete selected"))); plater_shortcuts.push_back(Shortcut("Del", L("Delete selected")));
plater_shortcuts.push_back(Shortcut(ctrl+"Del", L("Delete all"))); plater_shortcuts.push_back(Shortcut(ctrl+"Del", L("Delete All")));
plater_shortcuts.push_back(Shortcut("M", L("Gizmo move"))); plater_shortcuts.push_back(Shortcut("M", L("Gizmo move")));
plater_shortcuts.push_back(Shortcut("S", L("Gizmo scale"))); plater_shortcuts.push_back(Shortcut("S", L("Gizmo scale")));
plater_shortcuts.push_back(Shortcut("R", L("Gizmo rotate"))); plater_shortcuts.push_back(Shortcut("R", L("Gizmo rotate")));

View file

@ -48,7 +48,7 @@ wxFrame(NULL, wxID_ANY, SLIC3R_BUILD, wxDefaultPosition, wxDefaultSize, wxDEFAUL
// initialize status bar // initialize status bar
m_statusbar = new ProgressStatusBar(this); m_statusbar = new ProgressStatusBar(this);
m_statusbar->embed(this); m_statusbar->embed(this);
m_statusbar->set_status_text(_(L("Version ")) + m_statusbar->set_status_text(_(L("Version")) + " " +
SLIC3R_VERSION + SLIC3R_VERSION +
_(L(" - Remember to check for updates at http://github.com/prusa3d/slic3r/releases"))); _(L(" - Remember to check for updates at http://github.com/prusa3d/slic3r/releases")));
@ -197,6 +197,12 @@ bool MainFrame::can_export_gcode() const
return true; return true;
} }
bool MainFrame::can_slice() const
{
bool bg_proc = wxGetApp().app_config->get("background_processing") == "1";
return (m_plater != nullptr) ? !m_plater->model().objects.empty() && !bg_proc : false;
}
bool MainFrame::can_change_view() const bool MainFrame::can_change_view() const
{ {
int page_id = m_tabpanel->GetSelection(); int page_id = m_tabpanel->GetSelection();
@ -227,60 +233,60 @@ void MainFrame::init_menubar()
// File menu // File menu
wxMenu* fileMenu = new wxMenu; wxMenu* fileMenu = new wxMenu;
{ {
wxMenuItem* item_open = append_menu_item(fileMenu, wxID_ANY, _(L("Open…\tCtrl+O")), _(L("Open a project file")), wxMenuItem* item_open = append_menu_item(fileMenu, wxID_ANY, _(L("&Open")) + dots + "\tCtrl+O", _(L("Open a project file")),
[this](wxCommandEvent&) { if (m_plater) m_plater->load_project(); }, "brick_add.png"); [this](wxCommandEvent&) { if (m_plater) m_plater->load_project(); }, "brick_add.png");
wxMenuItem* item_save = append_menu_item(fileMenu, wxID_ANY, _(L("Save\tCtrl+S")), _(L("Save current project file")), wxMenuItem* item_save = append_menu_item(fileMenu, wxID_ANY, _(L("&Save")) + "\tCtrl+S", _(L("Save current project file")),
[this](wxCommandEvent&) { if (m_plater) m_plater->export_3mf(into_path(m_plater->get_project_filename())); }, "disk.png"); [this](wxCommandEvent&) { if (m_plater) m_plater->export_3mf(into_path(m_plater->get_project_filename())); }, "disk.png");
wxMenuItem* item_save_as = append_menu_item(fileMenu, wxID_ANY, _(L("Save as…\tCtrl+Alt+S")), _(L("Save current project file as")), wxMenuItem* item_save_as = append_menu_item(fileMenu, wxID_ANY, _(L("Save &as")) + dots + "\tCtrl+Alt+S", _(L("Save current project file as")),
[this](wxCommandEvent&) { if (m_plater) m_plater->export_3mf(); }, "disk.png"); [this](wxCommandEvent&) { if (m_plater) m_plater->export_3mf(); }, "disk.png");
fileMenu->AppendSeparator(); fileMenu->AppendSeparator();
wxMenu* import_menu = new wxMenu(); wxMenu* import_menu = new wxMenu();
wxMenuItem* item_import_model = append_menu_item(import_menu, wxID_ANY, _(L("Import STL/OBJ/AMF/3MF…\tCtrl+I")), _(L("Load a model")), wxMenuItem* item_import_model = append_menu_item(import_menu, wxID_ANY, _(L("Import STL/OBJ/AM&F/3MF")) + dots + "\tCtrl+I", _(L("Load a model")),
[this](wxCommandEvent&) { if (m_plater) m_plater->add_model(); }, "brick_add.png"); [this](wxCommandEvent&) { if (m_plater) m_plater->add_model(); }, "brick_add.png");
import_menu->AppendSeparator(); import_menu->AppendSeparator();
append_menu_item(import_menu, wxID_ANY, _(L("Import Config…\tCtrl+L")), _(L("Load exported configuration file")), append_menu_item(import_menu, wxID_ANY, _(L("Import &Config")) + dots + "\tCtrl+L", _(L("Load exported configuration file")),
[this](wxCommandEvent&) { load_config_file(); }, "plugin_add.png"); [this](wxCommandEvent&) { load_config_file(); }, "plugin_add.png");
append_menu_item(import_menu, wxID_ANY, _(L("Import Config from project…\tCtrl+Alt+L")), _(L("Load configuration from project file")), append_menu_item(import_menu, wxID_ANY, _(L("Import Config from &project")) + dots +"\tCtrl+Alt+L", _(L("Load configuration from project file")),
[this](wxCommandEvent&) { if (m_plater) m_plater->extract_config_from_project(); }, "plugin_add.png"); [this](wxCommandEvent&) { if (m_plater) m_plater->extract_config_from_project(); }, "plugin_add.png");
import_menu->AppendSeparator(); import_menu->AppendSeparator();
append_menu_item(import_menu, wxID_ANY, _(L("Import Config Bundle")), _(L("Load presets from a bundle")), append_menu_item(import_menu, wxID_ANY, _(L("Import Config &Bundle")) + dots, _(L("Load presets from a bundle")),
[this](wxCommandEvent&) { load_configbundle(); }, "lorry_add.png"); [this](wxCommandEvent&) { load_configbundle(); }, "lorry_add.png");
append_submenu(fileMenu, import_menu, wxID_ANY, _(L("Import")), _(L(""))); append_submenu(fileMenu, import_menu, wxID_ANY, _(L("&Import")), "");
wxMenu* export_menu = new wxMenu(); wxMenu* export_menu = new wxMenu();
wxMenuItem* item_export_gcode = append_menu_item(export_menu, wxID_ANY, _(L("Export G-code…\tCtrl+G")), _(L("Export current plate as G-code")), wxMenuItem* item_export_gcode = append_menu_item(export_menu, wxID_ANY, _(L("Export &G-code")) + dots +"\tCtrl+G", _(L("Export current plate as G-code")),
[this](wxCommandEvent&) { if (m_plater) m_plater->export_gcode(); }, "cog_go.png"); [this](wxCommandEvent&) { if (m_plater) m_plater->export_gcode(); }, "cog_go.png");
export_menu->AppendSeparator(); export_menu->AppendSeparator();
wxMenuItem* item_export_stl = append_menu_item(export_menu, wxID_ANY, _(L("Export plate as STL")), _(L("Export current plate as STL")), wxMenuItem* item_export_stl = append_menu_item(export_menu, wxID_ANY, _(L("Export plate as &STL")) + dots, _(L("Export current plate as STL")),
[this](wxCommandEvent&) { if (m_plater) m_plater->export_stl(); }, "brick_go.png"); [this](wxCommandEvent&) { if (m_plater) m_plater->export_stl(); }, "brick_go.png");
wxMenuItem* item_export_amf = append_menu_item(export_menu, wxID_ANY, _(L("Export plate as AMF")), _(L("Export current plate as AMF")), wxMenuItem* item_export_amf = append_menu_item(export_menu, wxID_ANY, _(L("Export plate as &AMF")) + dots, _(L("Export current plate as AMF")),
[this](wxCommandEvent&) { if (m_plater) m_plater->export_amf(); }, "brick_go.png"); [this](wxCommandEvent&) { if (m_plater) m_plater->export_amf(); }, "brick_go.png");
export_menu->AppendSeparator(); export_menu->AppendSeparator();
append_menu_item(export_menu, wxID_ANY, _(L("Export Config…\tCtrl+E")), _(L("Export current configuration to file")), append_menu_item(export_menu, wxID_ANY, _(L("Export &Config")) +dots +"\tCtrl+E", _(L("Export current configuration to file")),
[this](wxCommandEvent&) { export_config(); }, "plugin_go.png"); [this](wxCommandEvent&) { export_config(); }, "plugin_go.png");
append_menu_item(export_menu, wxID_ANY, _(L("Export Config Bundle")), _(L("Export all presets to file")), append_menu_item(export_menu, wxID_ANY, _(L("Export Config &Bundle")) + dots, _(L("Export all presets to file")),
[this](wxCommandEvent&) { export_configbundle(); }, "lorry_go.png"); [this](wxCommandEvent&) { export_configbundle(); }, "lorry_go.png");
append_submenu(fileMenu, export_menu, wxID_ANY, _(L("Export")), _(L(""))); append_submenu(fileMenu, export_menu, wxID_ANY, _(L("&Export")), "");
fileMenu->AppendSeparator(); fileMenu->AppendSeparator();
#if 0 #if 0
m_menu_item_repeat = nullptr; m_menu_item_repeat = nullptr;
append_menu_item(fileMenu, wxID_ANY, _(L("Quick Slice\tCtrl+U")), _(L("Slice a file into a G-code")), append_menu_item(fileMenu, wxID_ANY, _(L("Quick Slice")) +dots+ "\tCtrl+U", _(L("Slice a file into a G-code")),
[this](wxCommandEvent&) { [this](wxCommandEvent&) {
wxTheApp->CallAfter([this]() { wxTheApp->CallAfter([this]() {
quick_slice(); quick_slice();
m_menu_item_repeat->Enable(is_last_input_file()); m_menu_item_repeat->Enable(is_last_input_file());
}); }, "cog_go.png"); }); }, "cog_go.png");
append_menu_item(fileMenu, wxID_ANY, _(L("Quick Slice and Save As\tCtrl+Alt+U")), _(L("Slice a file into a G-code, save as")), append_menu_item(fileMenu, wxID_ANY, _(L("Quick Slice and Save As")) +dots +"\tCtrl+Alt+U", _(L("Slice a file into a G-code, save as")),
[this](wxCommandEvent&) { [this](wxCommandEvent&) {
wxTheApp->CallAfter([this]() { wxTheApp->CallAfter([this]() {
quick_slice(qsSaveAs); quick_slice(qsSaveAs);
m_menu_item_repeat->Enable(is_last_input_file()); m_menu_item_repeat->Enable(is_last_input_file());
}); }, "cog_go.png"); }); }, "cog_go.png");
m_menu_item_repeat = append_menu_item(fileMenu, wxID_ANY, _(L("Repeat Last Quick Slice\tCtrl+Shift+U")), _(L("Repeat last quick slice")), m_menu_item_repeat = append_menu_item(fileMenu, wxID_ANY, _(L("Repeat Last Quick Slice")) +"\tCtrl+Shift+U", _(L("Repeat last quick slice")),
[this](wxCommandEvent&) { [this](wxCommandEvent&) {
wxTheApp->CallAfter([this]() { wxTheApp->CallAfter([this]() {
quick_slice(qsReslice); quick_slice(qsReslice);
@ -288,13 +294,13 @@ void MainFrame::init_menubar()
m_menu_item_repeat->Enable(false); m_menu_item_repeat->Enable(false);
fileMenu->AppendSeparator(); fileMenu->AppendSeparator();
#endif #endif
m_menu_item_reslice_now = append_menu_item(fileMenu, wxID_ANY, _(L("(Re)Slice Now\tCtrl+R")), _(L("Start new slicing process")), m_menu_item_reslice_now = append_menu_item(fileMenu, wxID_ANY, _(L("(Re)Slice &Now")) + "\tCtrl+R", _(L("Start new slicing process")),
[this](wxCommandEvent&) { reslice_now(); }, "shape_handles.png"); [this](wxCommandEvent&) { reslice_now(); }, "shape_handles.png");
fileMenu->AppendSeparator(); fileMenu->AppendSeparator();
append_menu_item(fileMenu, wxID_ANY, _(L("Repair STL file")), _(L("Automatically repair an STL file")), append_menu_item(fileMenu, wxID_ANY, _(L("&Repair STL file")) + dots, _(L("Automatically repair an STL file")),
[this](wxCommandEvent&) { repair_stl(); }, "wrench.png"); [this](wxCommandEvent&) { repair_stl(); }, "wrench.png");
fileMenu->AppendSeparator(); fileMenu->AppendSeparator();
append_menu_item(fileMenu, wxID_EXIT, _(L("Quit")), _(L("Quit Slic3r")), append_menu_item(fileMenu, wxID_EXIT, _(L("&Quit")), _(L("Quit Slic3r")),
[this](wxCommandEvent&) { Close(false); }); [this](wxCommandEvent&) { Close(false); });
Bind(wxEVT_UPDATE_UI, [this](wxUpdateUIEvent& evt) { evt.Enable(m_plater != nullptr); }, item_open->GetId()); Bind(wxEVT_UPDATE_UI, [this](wxUpdateUIEvent& evt) { evt.Enable(m_plater != nullptr); }, item_open->GetId());
@ -304,6 +310,7 @@ void MainFrame::init_menubar()
Bind(wxEVT_UPDATE_UI, [this](wxUpdateUIEvent& evt) { evt.Enable((m_plater != nullptr) && can_export_gcode()); }, item_export_gcode->GetId()); Bind(wxEVT_UPDATE_UI, [this](wxUpdateUIEvent& evt) { evt.Enable((m_plater != nullptr) && can_export_gcode()); }, item_export_gcode->GetId());
Bind(wxEVT_UPDATE_UI, [this](wxUpdateUIEvent& evt) { evt.Enable((m_plater != nullptr) && can_export_model()); }, item_export_stl->GetId()); Bind(wxEVT_UPDATE_UI, [this](wxUpdateUIEvent& evt) { evt.Enable((m_plater != nullptr) && can_export_model()); }, item_export_stl->GetId());
Bind(wxEVT_UPDATE_UI, [this](wxUpdateUIEvent& evt) { evt.Enable((m_plater != nullptr) && can_export_model()); }, item_export_amf->GetId()); Bind(wxEVT_UPDATE_UI, [this](wxUpdateUIEvent& evt) { evt.Enable((m_plater != nullptr) && can_export_model()); }, item_export_amf->GetId());
Bind(wxEVT_UPDATE_UI, [this](wxUpdateUIEvent& evt) { evt.Enable((m_plater != nullptr) && can_slice()); }, m_menu_item_reslice_now->GetId());
} }
// Edit menu // Edit menu
@ -311,12 +318,12 @@ void MainFrame::init_menubar()
if (m_plater != nullptr) if (m_plater != nullptr)
{ {
editMenu = new wxMenu(); editMenu = new wxMenu();
wxMenuItem* item_select_all = append_menu_item(editMenu, wxID_ANY, L("Select all\tCtrl+A"), L("Selects all objects"), wxMenuItem* item_select_all = append_menu_item(editMenu, wxID_ANY, _(L("&Select all")) + "\tCtrl+A", _(L("Selects all objects")),
[this](wxCommandEvent&) { m_plater->select_all(); }, ""); [this](wxCommandEvent&) { m_plater->select_all(); }, "");
editMenu->AppendSeparator(); editMenu->AppendSeparator();
wxMenuItem* item_delete_sel = append_menu_item(editMenu, wxID_ANY, L("Delete selected\tDel"), L("Deletes the current selection"), wxMenuItem* item_delete_sel = append_menu_item(editMenu, wxID_ANY, _(L("&Delete selected")) + "\tDel", _(L("Deletes the current selection")),
[this](wxCommandEvent&) { m_plater->remove_selected(); }, ""); [this](wxCommandEvent&) { m_plater->remove_selected(); }, "");
wxMenuItem* item_delete_all = append_menu_item(editMenu, wxID_ANY, L("Delete all\tCtrl+Del"), L("Deletes all objects"), wxMenuItem* item_delete_all = append_menu_item(editMenu, wxID_ANY, _(L("Delete &all")) + "\tCtrl+Del", _(L("Deletes all objects")),
[this](wxCommandEvent&) { m_plater->reset(); }, ""); [this](wxCommandEvent&) { m_plater->reset(); }, "");
Bind(wxEVT_UPDATE_UI, [this](wxUpdateUIEvent& evt) { evt.Enable(can_select()); }, item_select_all->GetId()); Bind(wxEVT_UPDATE_UI, [this](wxUpdateUIEvent& evt) { evt.Enable(can_select()); }, item_select_all->GetId());
@ -329,24 +336,24 @@ void MainFrame::init_menubar()
{ {
size_t tab_offset = 0; size_t tab_offset = 0;
if (m_plater) { if (m_plater) {
append_menu_item(windowMenu, wxID_HIGHEST + 1, L("Plater Tab\tCtrl+1"), L("Show the plater"), append_menu_item(windowMenu, wxID_HIGHEST + 1, _(L("&Plater Tab")) + "\tCtrl+1", _(L("Show the plater")),
[this](wxCommandEvent&) { select_tab(0); }, "application_view_tile.png"); [this](wxCommandEvent&) { select_tab(0); }, "application_view_tile.png");
tab_offset += 1; tab_offset += 1;
} }
if (tab_offset > 0) { if (tab_offset > 0) {
windowMenu->AppendSeparator(); windowMenu->AppendSeparator();
} }
append_menu_item(windowMenu, wxID_HIGHEST + 2, L("Print Settings Tab\tCtrl+2"), L("Show the print settings"), append_menu_item(windowMenu, wxID_HIGHEST + 2, _(L("P&rint Settings Tab")) + "\tCtrl+2", _(L("Show the print settings")),
[this, tab_offset](wxCommandEvent&) { select_tab(tab_offset + 0); }, "cog.png"); [this, tab_offset](wxCommandEvent&) { select_tab(tab_offset + 0); }, "cog.png");
append_menu_item(windowMenu, wxID_HIGHEST + 3, L("Filament Settings Tab\tCtrl+3"), L("Show the filament settings"), append_menu_item(windowMenu, wxID_HIGHEST + 3, _(L("&Filament Settings Tab")) + "\tCtrl+3", _(L("Show the filament settings")),
[this, tab_offset](wxCommandEvent&) { select_tab(tab_offset + 1); }, "spool.png"); [this, tab_offset](wxCommandEvent&) { select_tab(tab_offset + 1); }, "spool.png");
append_menu_item(windowMenu, wxID_HIGHEST + 4, L("Printer Settings Tab\tCtrl+4"), L("Show the printer settings"), append_menu_item(windowMenu, wxID_HIGHEST + 4, _(L("Print&er Settings Tab")) + "\tCtrl+4", _(L("Show the printer settings")),
[this, tab_offset](wxCommandEvent&) { select_tab(tab_offset + 2); }, "printer_empty.png"); [this, tab_offset](wxCommandEvent&) { select_tab(tab_offset + 2); }, "printer_empty.png");
if (m_plater) { if (m_plater) {
windowMenu->AppendSeparator(); windowMenu->AppendSeparator();
wxMenuItem* item_3d = append_menu_item(windowMenu, wxID_HIGHEST + 5, L("3D\tCtrl+5"), L("Show the 3D editing view"), wxMenuItem* item_3d = append_menu_item(windowMenu, wxID_HIGHEST + 5, _(L("3&D")) + "\tCtrl+5", _(L("Show the 3D editing view")),
[this](wxCommandEvent&) { m_plater->select_view_3D("3D"); }, ""); [this](wxCommandEvent&) { m_plater->select_view_3D("3D"); }, "");
wxMenuItem* item_preview = append_menu_item(windowMenu, wxID_HIGHEST + 6, L("Preview\tCtrl+6"), L("Show the 3D slices preview"), wxMenuItem* item_preview = append_menu_item(windowMenu, wxID_HIGHEST + 6, _(L("Pre&view")) + "\tCtrl+6", _(L("Show the 3D slices preview")),
[this](wxCommandEvent&) { m_plater->select_view_3D("Preview"); }, ""); [this](wxCommandEvent&) { m_plater->select_view_3D("Preview"); }, "");
Bind(wxEVT_UPDATE_UI, [this](wxUpdateUIEvent& evt) { evt.Enable(can_change_view()); }, item_3d->GetId()); Bind(wxEVT_UPDATE_UI, [this](wxUpdateUIEvent& evt) { evt.Enable(can_change_view()); }, item_3d->GetId());
@ -367,7 +374,7 @@ void MainFrame::init_menubar()
#endif // _WIN32 #endif // _WIN32
windowMenu->AppendSeparator(); windowMenu->AppendSeparator();
append_menu_item(windowMenu, wxID_ANY, L("Print Host Upload Queue\tCtrl+J"), L("Display the Print Host Upload Queue window"), append_menu_item(windowMenu, wxID_ANY, _(L("Print &Host Upload Queue")) + "\tCtrl+J", _(L("Display the Print Host Upload Queue window")),
[this](wxCommandEvent&) { m_printhost_queue_dlg->Show(); }, "arrow_up.png"); [this](wxCommandEvent&) { m_printhost_queue_dlg->Show(); }, "arrow_up.png");
} }
@ -378,14 +385,14 @@ void MainFrame::init_menubar()
// \xA0 is a non-breaing space. It is entered here to spoil the automatic accelerators, // \xA0 is a non-breaing space. It is entered here to spoil the automatic accelerators,
// as the simple numeric accelerators spoil all numeric data entry. // as the simple numeric accelerators spoil all numeric data entry.
// The camera control accelerators are captured by GLCanvas3D::on_char(). // The camera control accelerators are captured by GLCanvas3D::on_char().
wxMenuItem* item_iso = append_menu_item(viewMenu, wxID_ANY, _(L("Iso")) + "\t\xA0" + "0", _(L("Iso View")), [this](wxCommandEvent&) { select_view("iso"); }); wxMenuItem* item_iso = append_menu_item(viewMenu, wxID_ANY, _(L("&Iso")) + "\t\xA0" + "0", _(L("Iso View")), [this](wxCommandEvent&) { select_view("iso"); });
viewMenu->AppendSeparator(); viewMenu->AppendSeparator();
wxMenuItem* item_top = append_menu_item(viewMenu, wxID_ANY, _(L("Top")) + "\t\xA0" + "1", _(L("Top View")), [this](wxCommandEvent&) { select_view("top"); }); wxMenuItem* item_top = append_menu_item(viewMenu, wxID_ANY, _(L("&Top")) + "\t\xA0" + "1", _(L("Top View")), [this](wxCommandEvent&) { select_view("top"); });
wxMenuItem* item_bottom = append_menu_item(viewMenu, wxID_ANY, _(L("Bottom")) + "\t\xA0" + "2", _(L("Bottom View")), [this](wxCommandEvent&) { select_view("bottom"); }); wxMenuItem* item_bottom = append_menu_item(viewMenu, wxID_ANY, _(L("&Bottom")) + "\t\xA0" + "2", _(L("Bottom View")), [this](wxCommandEvent&) { select_view("bottom"); });
wxMenuItem* item_front = append_menu_item(viewMenu, wxID_ANY, _(L("Front")) + "\t\xA0" + "3", _(L("Front View")), [this](wxCommandEvent&) { select_view("front"); }); wxMenuItem* item_front = append_menu_item(viewMenu, wxID_ANY, _(L("&Front")) + "\t\xA0" + "3", _(L("Front View")), [this](wxCommandEvent&) { select_view("front"); });
wxMenuItem* item_rear = append_menu_item(viewMenu, wxID_ANY, _(L("Rear")) + "\t\xA0" + "4", _(L("Rear View")), [this](wxCommandEvent&) { select_view("rear"); }); wxMenuItem* item_rear = append_menu_item(viewMenu, wxID_ANY, _(L("R&ear")) + "\t\xA0" + "4", _(L("Rear View")), [this](wxCommandEvent&) { select_view("rear"); });
wxMenuItem* item_left = append_menu_item(viewMenu, wxID_ANY, _(L("Left")) + "\t\xA0" + "5", _(L("Left View")), [this](wxCommandEvent&) { select_view("left"); }); wxMenuItem* item_left = append_menu_item(viewMenu, wxID_ANY, _(L("&Left")) + "\t\xA0" + "5", _(L("Left View")), [this](wxCommandEvent&) { select_view("left"); });
wxMenuItem* item_right = append_menu_item(viewMenu, wxID_ANY, _(L("Right")) + "\t\xA0" + "6", _(L("Right View")), [this](wxCommandEvent&) { select_view("right"); }); wxMenuItem* item_right = append_menu_item(viewMenu, wxID_ANY, _(L("&Right")) + "\t\xA0" + "6", _(L("Right View")), [this](wxCommandEvent&) { select_view("right"); });
Bind(wxEVT_UPDATE_UI, [this](wxUpdateUIEvent& evt) { evt.Enable(can_change_view()); }, item_iso->GetId()); Bind(wxEVT_UPDATE_UI, [this](wxUpdateUIEvent& evt) { evt.Enable(can_change_view()); }, item_iso->GetId());
Bind(wxEVT_UPDATE_UI, [this](wxUpdateUIEvent& evt) { evt.Enable(can_change_view()); }, item_top->GetId()); Bind(wxEVT_UPDATE_UI, [this](wxUpdateUIEvent& evt) { evt.Enable(can_change_view()); }, item_top->GetId());
@ -399,29 +406,29 @@ void MainFrame::init_menubar()
// Help menu // Help menu
auto helpMenu = new wxMenu(); auto helpMenu = new wxMenu();
{ {
append_menu_item(helpMenu, wxID_ANY, _(L("Prusa 3D Drivers")), _(L("Open the Prusa3D drivers download page in your browser")), 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/"); }); [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("Prusa Edition &Releases")), _(L("Open the Prusa Edition releases page in your browser")),
[this](wxCommandEvent&) { wxLaunchDefaultBrowser("http://github.com/prusa3d/slic3r/releases"); }); [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{ //# my $versioncheck = $self->_append_menu_item($helpMenu, "Check for &Updates...", "Check for new Slic3r versions", sub{
//# wxTheApp->check_version(1); //# wxTheApp->check_version(1);
//# }); //# });
//# $versioncheck->Enable(wxTheApp->have_version_check); //# $versioncheck->Enable(wxTheApp->have_version_check);
append_menu_item(helpMenu, wxID_ANY, _(L("Slic3r Website")), _(L("Open the Slic3r website in your browser")), append_menu_item(helpMenu, wxID_ANY, _(L("Slic3r &Website")), _(L("Open the Slic3r website in your browser")),
[this](wxCommandEvent&) { wxLaunchDefaultBrowser("http://slic3r.org/"); }); [this](wxCommandEvent&) { wxLaunchDefaultBrowser("http://slic3r.org/"); });
append_menu_item(helpMenu, wxID_ANY, _(L("Slic3r Manual")), _(L("Open the Slic3r manual in your browser")), append_menu_item(helpMenu, wxID_ANY, _(L("Slic3r &Manual")), _(L("Open the Slic3r manual in your browser")),
[this](wxCommandEvent&) { wxLaunchDefaultBrowser("http://manual.slic3r.org/"); }); [this](wxCommandEvent&) { wxLaunchDefaultBrowser("http://manual.slic3r.org/"); });
helpMenu->AppendSeparator(); helpMenu->AppendSeparator();
append_menu_item(helpMenu, wxID_ANY, _(L("System Info")), _(L("Show system information")), append_menu_item(helpMenu, wxID_ANY, _(L("System &Info")), _(L("Show system information")),
[this](wxCommandEvent&) { wxGetApp().system_info(); }); [this](wxCommandEvent&) { wxGetApp().system_info(); });
append_menu_item(helpMenu, wxID_ANY, _(L("Show Configuration Folder")), _(L("Show user configuration folder (datadir)")), append_menu_item(helpMenu, wxID_ANY, _(L("Show &Configuration Folder")), _(L("Show user configuration folder (datadir)")),
[this](wxCommandEvent&) { Slic3r::GUI::desktop_open_datadir_folder(); }); [this](wxCommandEvent&) { Slic3r::GUI::desktop_open_datadir_folder(); });
append_menu_item(helpMenu, wxID_ANY, _(L("Report an Issue")), _(L("Report an issue on the Slic3r Prusa Edition")), append_menu_item(helpMenu, wxID_ANY, _(L("Report an I&ssue")), _(L("Report an issue on the Slic3r Prusa Edition")),
[this](wxCommandEvent&) { wxLaunchDefaultBrowser("http://github.com/prusa3d/slic3r/issues/new"); }); [this](wxCommandEvent&) { wxLaunchDefaultBrowser("http://github.com/prusa3d/slic3r/issues/new"); });
append_menu_item(helpMenu, wxID_ANY, _(L("About Slic3r")), _(L("Show about dialog")), append_menu_item(helpMenu, wxID_ANY, _(L("&About Slic3r")), _(L("Show about dialog")),
[this](wxCommandEvent&) { Slic3r::GUI::about(); }); [this](wxCommandEvent&) { Slic3r::GUI::about(); });
helpMenu->AppendSeparator(); helpMenu->AppendSeparator();
append_menu_item(helpMenu, wxID_ANY, _(L("Keyboard Shortcuts")) + "\t\xA0?", _(L("Show the list of the keyboard shortcuts")), append_menu_item(helpMenu, wxID_ANY, _(L("&Keyboard Shortcuts")) + "\t\xA0?", _(L("Show the list of the keyboard shortcuts")),
[this](wxCommandEvent&) { wxGetApp().keyboard_shortcuts(); }); [this](wxCommandEvent&) { wxGetApp().keyboard_shortcuts(); });
} }
@ -429,13 +436,13 @@ void MainFrame::init_menubar()
// assign menubar to frame after appending items, otherwise special items // assign menubar to frame after appending items, otherwise special items
// will not be handled correctly // will not be handled correctly
auto menubar = new wxMenuBar(); auto menubar = new wxMenuBar();
menubar->Append(fileMenu, L("&File")); menubar->Append(fileMenu, _(L("&File")));
if (editMenu) menubar->Append(editMenu, L("&Edit")); if (editMenu) menubar->Append(editMenu, _(L("&Edit")));
menubar->Append(windowMenu, L("&Window")); menubar->Append(windowMenu, _(L("&Window")));
if (viewMenu) menubar->Append(viewMenu, L("&View")); if (viewMenu) menubar->Append(viewMenu, _(L("&View")));
// Add additional menus from C++ // Add additional menus from C++
wxGetApp().add_config_menu(menubar); wxGetApp().add_config_menu(menubar);
menubar->Append(helpMenu, L("&Help")); menubar->Append(helpMenu, _(L("&Help")));
SetMenuBar(menubar); SetMenuBar(menubar);
#ifdef __APPLE__ #ifdef __APPLE__
@ -550,7 +557,7 @@ void MainFrame::quick_slice(const int qs)
} }
// show processbar dialog // show processbar dialog
m_progress_dialog = new wxProgressDialog(_(L("Slicing")), _(L("Processing ")) + input_file_basename + "", m_progress_dialog = new wxProgressDialog(_(L("Slicing")) + dots, _(L("Processing ")) + input_file_basename + "",
100, this, 4); 100, this, 4);
m_progress_dialog->Pulse(); m_progress_dialog->Pulse();
{ {
@ -846,7 +853,7 @@ void MainFrame::on_value_changed(wxCommandEvent& event)
void MainFrame::update_ui_from_settings() void MainFrame::update_ui_from_settings()
{ {
bool bp_on = wxGetApp().app_config->get("background_processing") == "1"; bool bp_on = wxGetApp().app_config->get("background_processing") == "1";
m_menu_item_reslice_now->Enable(!bp_on); // m_menu_item_reslice_now->Enable(!bp_on);
m_plater->sidebar().show_reslice(!bp_on); m_plater->sidebar().show_reslice(!bp_on);
m_plater->sidebar().Layout(); m_plater->sidebar().Layout();
if (m_plater) if (m_plater)

View file

@ -62,6 +62,7 @@ class MainFrame : public wxFrame
bool can_save() const; bool can_save() const;
bool can_export_model() const; bool can_export_model() const;
bool can_export_gcode() const; bool can_export_gcode() const;
bool can_slice() const;
bool can_change_view() const; bool can_change_view() const;
bool can_select() const; bool can_select() const;
bool can_delete() const; bool can_delete() const;

View file

@ -231,11 +231,11 @@ void OptionsGroup::append_line(const Line& line, wxStaticText** full_Label/* = n
wxSizer* sizer_tmp = sizer; wxSizer* sizer_tmp = sizer;
// add label if any // add label if any
if (option.label != "") { if (option.label != "") {
wxString str_label = _(option.label); // wxString str_label = _(option.label);
//! To correct translation by context have to use wxGETTEXT_IN_CONTEXT macro from wxWidget 3.1.1 //! To correct translation by context have to use wxGETTEXT_IN_CONTEXT macro from wxWidget 3.1.1
// wxString str_label = (option.label == "Top" || option.label == "Bottom") ? wxString str_label = (option.label == "Top" || option.label == "Bottom") ?
// wxGETTEXT_IN_CONTEXT("Layers", wxString(option.label.c_str()): wxGETTEXT_IN_CONTEXT("Layers", wxString(option.label)) :
// L_str(option.label); _(option.label);
label = new wxStaticText(parent(), wxID_ANY, str_label + ":", wxDefaultPosition, wxDefaultSize); label = new wxStaticText(parent(), wxID_ANY, str_label + ":", wxDefaultPosition, wxDefaultSize);
label->SetFont(label_font); label->SetFont(label_font);
sizer_tmp->Add(label, 0, /*wxALIGN_RIGHT |*/ wxALIGN_CENTER_VERTICAL, 0); sizer_tmp->Add(label, 0, /*wxALIGN_RIGHT |*/ wxALIGN_CENTER_VERTICAL, 0);

View file

@ -1,7 +1,7 @@
#ifndef slic3r_OptionsGroup_hpp_ #ifndef slic3r_OptionsGroup_hpp_
#define slic3r_OptionsGroup_hpp_ #define slic3r_OptionsGroup_hpp_
#include <wx/wx.h> //#include <wx/wx.h>
#include <wx/stattext.h> #include <wx/stattext.h>
#include <wx/settings.h> #include <wx/settings.h>
//#include <wx/window.h> //#include <wx/window.h>
@ -11,7 +11,7 @@
#include "libslic3r/Config.hpp" #include "libslic3r/Config.hpp"
#include "libslic3r/PrintConfig.hpp" #include "libslic3r/PrintConfig.hpp"
#include "libslic3r/libslic3r.h" // #include "libslic3r/libslic3r.h"
#include "Field.hpp" #include "Field.hpp"
#include "GUI_App.hpp" #include "GUI_App.hpp"

View file

@ -114,7 +114,7 @@ ObjectInfo::ObjectInfo(wxWindow *parent) :
grid_sizer->AddGrowableCol(3, 1); grid_sizer->AddGrowableCol(3, 1);
auto init_info_label = [parent, grid_sizer](wxStaticText **info_label, wxString text_label) { auto init_info_label = [parent, grid_sizer](wxStaticText **info_label, wxString text_label) {
auto *text = new wxStaticText(parent, wxID_ANY, text_label); auto *text = new wxStaticText(parent, wxID_ANY, text_label+":");
text->SetFont(wxGetApp().small_font()); text->SetFont(wxGetApp().small_font());
*info_label = new wxStaticText(parent, wxID_ANY, ""); *info_label = new wxStaticText(parent, wxID_ANY, "");
(*info_label)->SetFont(wxGetApp().small_font()); (*info_label)->SetFont(wxGetApp().small_font());
@ -122,13 +122,13 @@ ObjectInfo::ObjectInfo(wxWindow *parent) :
grid_sizer->Add(*info_label, 0); grid_sizer->Add(*info_label, 0);
}; };
init_info_label(&info_size, _(L("Size:"))); init_info_label(&info_size, _(L("Size")));
init_info_label(&info_volume, _(L("Volume:"))); init_info_label(&info_volume, _(L("Volume")));
init_info_label(&info_facets, _(L("Facets:"))); init_info_label(&info_facets, _(L("Facets")));
init_info_label(&info_materials, _(L("Materials:"))); init_info_label(&info_materials, _(L("Materials")));
Add(grid_sizer, 0, wxEXPAND); Add(grid_sizer, 0, wxEXPAND);
auto *info_manifold_text = new wxStaticText(parent, wxID_ANY, _(L("Manifold:"))); auto *info_manifold_text = new wxStaticText(parent, wxID_ANY, _(L("Manifold")));
info_manifold_text->SetFont(wxGetApp().small_font()); info_manifold_text->SetFont(wxGetApp().small_font());
info_manifold = new wxStaticText(parent, wxID_ANY, ""); info_manifold = new wxStaticText(parent, wxID_ANY, "");
info_manifold->SetFont(wxGetApp().small_font()); info_manifold->SetFont(wxGetApp().small_font());
@ -602,7 +602,7 @@ Sidebar::Sidebar(Plater *parent)
scrolled_sizer->Add(p->sliced_info, 0, wxEXPAND | wxTOP | wxLEFT, 20); scrolled_sizer->Add(p->sliced_info, 0, wxEXPAND | wxTOP | wxLEFT, 20);
// Buttons underneath the scrolled area // Buttons underneath the scrolled area
p->btn_export_gcode = new wxButton(this, wxID_ANY, _(L("Export G-code"))); p->btn_export_gcode = new wxButton(this, wxID_ANY, _(L("Export G-code")) + dots);
p->btn_export_gcode->SetFont(wxGetApp().bold_font()); p->btn_export_gcode->SetFont(wxGetApp().bold_font());
p->btn_reslice = new wxButton(this, wxID_ANY, _(L("Slice now"))); p->btn_reslice = new wxButton(this, wxID_ANY, _(L("Slice now")));
p->btn_reslice->SetFont(wxGetApp().bold_font()); p->btn_reslice->SetFont(wxGetApp().bold_font());
@ -792,7 +792,7 @@ void Sidebar::show_info_sizer()
wxString tooltip = wxString::Format(_(L("Auto-repaired (%d errors)")), errors); wxString tooltip = wxString::Format(_(L("Auto-repaired (%d errors)")), errors);
p->object_info->info_manifold->SetLabel(tooltip); p->object_info->info_manifold->SetLabel(tooltip);
tooltip += wxString::Format(_(L(":\n%d degenerate facets, %d edges fixed, %d facets removed, " tooltip += ":\n" + wxString::Format(_(L("%d degenerate facets, %d edges fixed, %d facets removed, "
"%d facets added, %d facets reversed, %d backwards edges")), "%d facets added, %d facets reversed, %d backwards edges")),
stats.degenerate_facets, stats.edges_fixed, stats.facets_removed, stats.degenerate_facets, stats.edges_fixed, stats.facets_removed,
stats.facets_added, stats.facets_reversed, stats.backwards_edges); stats.facets_added, stats.facets_reversed, stats.backwards_edges);
@ -849,7 +849,7 @@ void Sidebar::show_sliced_info_sizer(const bool show)
if (ps.estimated_normal_print_time == "N/A" && ps.estimated_silent_print_time == "N/A") if (ps.estimated_normal_print_time == "N/A" && ps.estimated_silent_print_time == "N/A")
p->sliced_info->SetTextAndShow(siEstimatedTime, "N/A"); p->sliced_info->SetTextAndShow(siEstimatedTime, "N/A");
else { else {
new_label = "Estimated printing time :"; new_label = _(L("Estimated printing time")) +" :";
info_text = ""; info_text = "";
if (ps.estimated_normal_print_time != "N/A") { if (ps.estimated_normal_print_time != "N/A") {
new_label += wxString::Format("\n - %s", _(L("normal mode"))); new_label += wxString::Format("\n - %s", _(L("normal mode")));
@ -1301,7 +1301,7 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
} }
} }
const auto loading = _(L("Loading")); const auto loading = _(L("Loading")) + dots;
wxProgressDialog dlg(loading, loading); wxProgressDialog dlg(loading, loading);
dlg.Pulse(); dlg.Pulse();
@ -1362,14 +1362,14 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
// The model should now be initialized // The model should now be initialized
if (model.looks_like_multipart_object()) { if (model.looks_like_multipart_object()) {
// wxMessageDialog dlg(q, _(L( wxMessageDialog dlg(q, _(L(
// "This file contains several objects positioned at multiple heights. " "This file contains several objects positioned at multiple heights. "
// "Instead of considering them as multiple objects, should I consider\n" "Instead of considering them as multiple objects, should I consider\n"
// "this file as a single object having multiple parts?\n" "this file as a single object having multiple parts?\n"
// )), _(L("Multi-part object detected")), wxICON_WARNING | wxYES | wxNO); )), _(L("Multi-part object detected")), wxICON_WARNING | wxYES | wxNO);
// if (dlg.ShowModal() == wxID_YES) { if (dlg.ShowModal() == wxID_YES) {
model.convert_multipart_object(nozzle_dmrs->values.size()); model.convert_multipart_object(nozzle_dmrs->values.size());
// } }
} }
if (type_3mf || type_any_amf) { if (type_3mf || type_any_amf) {
@ -2343,14 +2343,14 @@ bool Plater::priv::init_object_menu()
bool Plater::priv::init_common_menu(wxMenu* menu, const bool is_part/* = false*/) bool Plater::priv::init_common_menu(wxMenu* menu, const bool is_part/* = false*/)
{ {
wxMenuItem* item_delete = append_menu_item(menu, wxID_ANY, _(L("Delete\tDel")), _(L("Remove the selected object")), wxMenuItem* item_delete = append_menu_item(menu, wxID_ANY, _(L("Delete")) + "\tDel", _(L("Remove the selected object")),
[this](wxCommandEvent&) { q->remove_selected(); }, "brick_delete.png"); [this](wxCommandEvent&) { q->remove_selected(); }, "brick_delete.png");
if (!is_part){ if (!is_part){
wxMenuItem* item_increase = append_menu_item(menu, wxID_ANY, _(L("Increase copies\t+")), _(L("Place one more copy of the selected object")), wxMenuItem* item_increase = append_menu_item(menu, wxID_ANY, _(L("Increase copies")) + "\t+", _(L("Place one more copy of the selected object")),
[this](wxCommandEvent&) { q->increase_instances(); }, "add.png"); [this](wxCommandEvent&) { q->increase_instances(); }, "add.png");
wxMenuItem* item_decrease = append_menu_item(menu, wxID_ANY, _(L("Decrease copies\t-")), _(L("Remove one copy of the selected object")), wxMenuItem* item_decrease = append_menu_item(menu, wxID_ANY, _(L("Decrease copies")) + "\t-", _(L("Remove one copy of the selected object")),
[this](wxCommandEvent&) { q->decrease_instances(); }, "delete.png"); [this](wxCommandEvent&) { q->decrease_instances(); }, "delete.png");
wxMenuItem* item_set_number_of_copies = append_menu_item(menu, wxID_ANY, _(L("Set number of copies")), _(L("Change the number of copies of the selected object")), wxMenuItem* item_set_number_of_copies = append_menu_item(menu, wxID_ANY, _(L("Set number of copies")) + dots, _(L("Change the number of copies of the selected object")),
[this](wxCommandEvent&) { q->set_number_of_copies(); }, "textfield.png"); [this](wxCommandEvent&) { q->set_number_of_copies(); }, "textfield.png");
if (q != nullptr) if (q != nullptr)
{ {
@ -2363,7 +2363,7 @@ bool Plater::priv::init_common_menu(wxMenu* menu, const bool is_part/* = false*/
append_menu_item(menu, wxID_ANY, _(L("Reload from Disk")), _(L("Reload the selected file from Disk")), append_menu_item(menu, wxID_ANY, _(L("Reload from Disk")), _(L("Reload the selected file from Disk")),
[this](wxCommandEvent&) { reload_from_disk(); }); [this](wxCommandEvent&) { reload_from_disk(); });
append_menu_item(menu, wxID_ANY, _(L("Export object as STL")), _(L("Export this single object as STL file")), append_menu_item(menu, wxID_ANY, _(L("Export object as STL")) + dots, _(L("Export this single object as STL file")),
[this](wxCommandEvent&) { q->export_stl(true); }); [this](wxCommandEvent&) { q->export_stl(true); });
} }
menu->AppendSeparator(); menu->AppendSeparator();
@ -2407,7 +2407,7 @@ bool Plater::priv::complit_init_object_menu()
// append_menu_item(&object_menu, wxID_ANY, _(L("Reload from Disk")), _(L("Reload the selected file from Disk")), // append_menu_item(&object_menu, wxID_ANY, _(L("Reload from Disk")), _(L("Reload the selected file from Disk")),
// [this](wxCommandEvent&) { reload_from_disk(); }); // [this](wxCommandEvent&) { reload_from_disk(); });
// //
// append_menu_item(&object_menu, wxID_ANY, _(L("Export object as STL")), _(L("Export this single object as STL file")), // append_menu_item(&object_menu, wxID_ANY, _(L("Export object as STL")) + dots, _(L("Export this single object as STL file")),
// [this](wxCommandEvent&) { q->export_stl(true); }); // [this](wxCommandEvent&) { q->export_stl(true); });
// Append "Add..." popupmenu // Append "Add..." popupmenu

View file

@ -1153,11 +1153,11 @@ std::vector<std::string> PresetCollection::merge_presets(PresetCollection &&othe
std::string PresetCollection::name() const std::string PresetCollection::name() const
{ {
switch (this->type()) { switch (this->type()) {
case Preset::TYPE_PRINT: return "print"; case Preset::TYPE_PRINT: return L("print");
case Preset::TYPE_FILAMENT: return "filament"; case Preset::TYPE_FILAMENT: return L("filament");
case Preset::TYPE_SLA_PRINT: return "SLA print"; case Preset::TYPE_SLA_PRINT: return L("SLA print");
case Preset::TYPE_SLA_MATERIAL: return "SLA material"; case Preset::TYPE_SLA_MATERIAL: return L("SLA material");
case Preset::TYPE_PRINTER: return "printer"; case Preset::TYPE_PRINTER: return L("printer");
default: return "invalid"; default: return "invalid";
} }
} }

View file

@ -2012,7 +2012,7 @@ PageShp TabPrinter::build_kinematics_page()
if (m_use_silent_mode) { if (m_use_silent_mode) {
// Legend for OptionsGroups // Legend for OptionsGroups
auto optgroup = page->new_optgroup(_(L(""))); auto optgroup = page->new_optgroup("");
optgroup->set_show_modified_btns_val(false); optgroup->set_show_modified_btns_val(false);
optgroup->label_width = 230; optgroup->label_width = 230;
auto line = Line{ "", "" }; auto line = Line{ "", "" };
@ -2562,19 +2562,20 @@ bool Tab::may_discard_current_dirty_preset(PresetCollection* presets /*= nullptr
std::string type_name = presets->name(); std::string type_name = presets->name();
wxString tab = " "; wxString tab = " ";
wxString name = old_preset.is_default ? wxString name = old_preset.is_default ?
_(L("Default ")) + type_name + _(L(" preset")) : wxString::Format(_(L("Default preset (%s)")), _(type_name)) : //_(L("Default ")) + type_name + _(L(" preset")) :
(type_name + _(L(" preset\n")) + tab + old_preset.name); wxString::Format(_(L("Preset (%s)")), _(type_name)) + "\n" + tab + old_preset.name; //type_name + _(L(" preset\n")) + tab + old_preset.name;
// Collect descriptions of the dirty options. // Collect descriptions of the dirty options.
wxString changes; wxString changes;
for (const std::string &opt_key : presets->current_dirty_options()) { for (const std::string &opt_key : presets->current_dirty_options()) {
const ConfigOptionDef &opt = m_config->def()->options.at(opt_key); const ConfigOptionDef &opt = m_config->def()->options.at(opt_key);
std::string name = ""; /*std::string*/wxString name = "";
if (! opt.category.empty()) if (! opt.category.empty())
name += opt.category + " > "; name += _(opt.category) + " > ";
name += !opt.full_label.empty() ? name += !opt.full_label.empty() ?
opt.full_label : _(opt.full_label) :
opt.label; _(opt.label);
changes += tab + from_u8(name) + "\n"; changes += tab + /*from_u8*/(name) + "\n";
} }
// Show a confirmation dialog with the list of dirty options. // Show a confirmation dialog with the list of dirty options.
wxString message = name + "\n\n"; wxString message = name + "\n\n";
@ -2588,7 +2589,7 @@ bool Tab::may_discard_current_dirty_preset(PresetCollection* presets /*= nullptr
message += _(L("and it has the following unsaved changes:")); message += _(L("and it has the following unsaved changes:"));
} }
auto confirm = new wxMessageDialog(parent(), auto confirm = new wxMessageDialog(parent(),
message + "\n" + changes + _(L("\n\nDiscard changes and continue anyway?")), message + "\n" + changes + "\n\n" + _(L("Discard changes and continue anyway?")),
_(L("Unsaved Changes")), wxYES_NO | wxNO_DEFAULT | wxICON_QUESTION); _(L("Unsaved Changes")), wxYES_NO | wxNO_DEFAULT | wxICON_QUESTION);
return confirm->ShowModal() == wxID_YES; return confirm->ShowModal() == wxID_YES;
} }
@ -2600,8 +2601,8 @@ bool Tab::may_switch_to_SLA_preset()
if (wxGetApp().obj_list()->has_multi_part_objects()) if (wxGetApp().obj_list()->has_multi_part_objects())
{ {
show_info( parent(), show_info( parent(),
_(L("It's impossible to print multi-part object(s) with SLA technology.")) + _(L("It's impossible to print multi-part object(s) with SLA technology.")) + "\n\n" +
_(L("\n\nPlease check your object list before preset changing.")), _(L("Please check your object list before preset changing.")),
_(L("Attention!")) ); _(L("Attention!")) );
return false; return false;
} }