Merge branch 'main' into feat/plugin-pages

This commit is contained in:
Ian Chua
2026-07-29 19:40:40 +08:00
169 changed files with 54682 additions and 28088 deletions
+1 -1
View File
@@ -736,7 +736,7 @@ wxBoxSizer* AMSDryCtrWin::create_guide_right_section(wxPanel* parent)
m_back_button = create_button(
parent,
wxString::FromUTF8(_CTX_utf8(L_CONTEXT("Back", "amsdrying"), "amsdrying")),
wxString::FromUTF8(_u8L_CONTEXT(L_CONTEXT("Back", "amsdrying"), "amsdrying")),
wxColour("#F8F8F8"), // Background color - light gray
wxColour("#D0D0D0"), // Border color - gray
*wxBLACK // Text color - black
+1 -1
View File
@@ -2100,7 +2100,7 @@ void AmsReplaceMaterialDialog::create()
m_top_line->SetBackgroundColour(wxColour(166, 169, 170));
m_main_sizer->Add(m_top_line, 0, wxEXPAND, 0);
m_nozzle_btn_panel = new SwitchBoard(this, _L("Left"), _L("Right"), wxSize(FromDIP(126), FromDIP(26)));
m_nozzle_btn_panel = new SwitchBoard(this, _L_CONTEXT("Left", "Nozzle position"), _L_CONTEXT("Right", "Nozzle position"), wxSize(FromDIP(126), FromDIP(26)));
m_nozzle_btn_panel->Hide();
m_nozzle_btn_panel->Connect(wxCUSTOMEVT_SWITCH_POS, wxCommandEventHandler(AmsReplaceMaterialDialog::on_nozzle_selected), NULL, this);
+3 -3
View File
@@ -192,7 +192,7 @@ PingCodeBindDialog::PingCodeBindDialog(Plater* plater /*= nullptr*/)
SetSizer(sizer_main);
SetSizerAndFit(sizer_main);
Layout();
Fit();
@@ -670,7 +670,7 @@ PingCodeBindDialog::~PingCodeBindDialog() {
m_sizer_main->Add(m_sw_bind_failed_info, 0, wxALIGN_CENTER, 0);
m_sizer_main->Add(m_simplebook, 0, wxALIGN_RIGHT | wxRIGHT | wxBOTTOM, ButtonProps::ChoiceButtonGap());
SetSizer(m_sizer_main);
SetSizerAndFit(m_sizer_main);
Layout();
Fit();
Centre(wxBOTH);
@@ -992,7 +992,7 @@ UnBindMachineDialog::UnBindMachineDialog(Plater *plater /*= nullptr*/)
m_sizer_main->Add(m_sizer_button, 0, wxALIGN_RIGHT | wxRIGHT, ButtonProps::ChoiceButtonGap());
m_sizer_main->Add(0, 0, 0, wxTOP, FromDIP(20));
SetSizer(m_sizer_main);
SetSizerAndFit(m_sizer_main);
Layout();
Fit();
Centre(wxBOTH);
+2 -4
View File
@@ -632,9 +632,8 @@ EditCalibrationHistoryDialog::EditCalibrationHistoryDialog(wxWindow
main_sizer->Add(top_panel, 1, wxEXPAND | wxALL, FromDIP(20));
SetSizer(main_sizer);
SetSizerAndFit(main_sizer);
Layout();
Fit();
CenterOnParent();
wxGetApp().UpdateDlgDarkUI(this);
@@ -910,9 +909,8 @@ NewCalibrationHistoryDialog::NewCalibrationHistoryDialog(wxWindow *parent, const
main_sizer->Add(top_panel, 1, wxEXPAND | wxALL, FromDIP(20));
SetSizer(main_sizer);
SetSizerAndFit(main_sizer);
Layout();
Fit();
CenterOnParent();
wxGetApp().UpdateDlgDarkUI(this);
+1 -1
View File
@@ -162,7 +162,7 @@ CalibrationDialog::CalibrationDialog(Plater *plater)
body_panel->Layout();
m_sizer_main->Add(body_panel, 0, wxEXPAND | wxALL, FromDIP(25));
SetSizer(m_sizer_main);
SetSizerAndFit(m_sizer_main);
Layout();
Fit();
+1 -2
View File
@@ -112,9 +112,8 @@ CloneDialog::CloneDialog(wxWindow *parent)
v_sizer->Add(bottom_sizer, 0, wxEXPAND);
this->SetSizer(v_sizer);
this->SetSizerAndFit(v_sizer);
this->Layout();
v_sizer->Fit(this);
wxGetApp().UpdateDlgDarkUI(this);
+1 -2
View File
@@ -80,9 +80,8 @@ ConnectPrinterDialog::ConnectPrinterDialog(wxWindow *parent, wxWindowID id, cons
main_sizer->Add(sizer_top);
this->SetSizer(main_sizer);
this->SetSizerAndFit(main_sizer);
this->Layout();
this->Fit();
CentreOnParent();
m_textCtrl_code->Bind(wxEVT_TEXT, &ConnectPrinterDialog::on_input_enter, this);
+1
View File
@@ -13,6 +13,7 @@
#include <boost/log/trivial.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/format.hpp>
#include "nlohmann/json.hpp"
@@ -637,7 +637,7 @@ ReselectMachineDialog::ReselectMachineDialog(wxWindow* parent)
wxBoxSizer* okGroupSizer = new wxBoxSizer(wxHORIZONTAL);
UiAMSSlot* amsSlotOK= new UiAMSSlot(statusBar, colourOK, wxString("Ax\nPLA"), DataStatusType::OK, wxID_ANY, wxDefaultPosition, wxSize(FromDIP(58), FromDIP(90)), 1.0, 1.0);
wxStaticText* okLabel = new wxStaticText(statusBar, wxID_ANY, _CTX(L_CONTEXT("OK", "FilamentTrack"), "FilamentTrack"));
wxStaticText* okLabel = new wxStaticText(statusBar, wxID_ANY, _L_CONTEXT(L_CONTEXT("OK", "FilamentTrack"), "FilamentTrack"));
okLabel->SetFont(wxGetApp().normal_font());
okLabel->SetForegroundColour(wxColour("#6B6B6B"));
+1 -2
View File
@@ -112,9 +112,8 @@ DownloadProgressDialog::DownloadProgressDialog(wxString title)
m_simplebook_status->AddPage(m_panel_download_failed, wxEmptyString, false);
m_simplebook_status->AddPage(m_panel_install_failed, wxEmptyString, false);
SetSizer(m_sizer_main);
SetSizerAndFit(m_sizer_main);
Layout();
Fit();
CentreOnParent();
Bind(wxEVT_CLOSE_WINDOW, &DownloadProgressDialog::on_close, this);
+2 -3
View File
@@ -239,7 +239,7 @@ void ExtrusionCalibration::create()
m_button_save_result->SetStyle(ButtonStyle::Confirm, ButtonType::Choice);
m_button_save_result->Bind(wxEVT_BUTTON, &ExtrusionCalibration::on_click_save, this);
m_button_last_step = new Button(m_step_2_panel, _CTX("Back", "Navigation")); // Back for english
m_button_last_step = new Button(m_step_2_panel, _L_CONTEXT("Back", "Navigation")); // Back for english
m_button_last_step->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
m_button_last_step->Bind(wxEVT_BUTTON, &ExtrusionCalibration::on_click_last, this);
@@ -261,7 +261,7 @@ void ExtrusionCalibration::create()
top_sizer->Add(FromDIP(24), 0);
top_sizer->Add(sizer_main, 1, wxEXPAND);
top_sizer->Add(FromDIP(24), 0);
SetSizer(top_sizer);
SetSizerAndFit(top_sizer);
// set default nozzle
m_comboBox_nozzle_dia->SetSelection(1);
@@ -271,7 +271,6 @@ void ExtrusionCalibration::create()
set_step(1);
Layout();
Fit();
m_k_val->GetTextCtrl()->Bind(wxEVT_TEXT_ENTER, [this](wxCommandEvent& e) {
input_value_finish();
+1 -1
View File
@@ -105,7 +105,7 @@ void FilamentMapManualPanel::OnTimer(wxTimerEvent &)
m_suggestion_panel->Hide();
} else {
m_errors->SetLabel(wxString::Format(_L("Error: %s extruder has no available %s nozzle, current group result is invalid."),
invalid_eid == 0 ? _L("Left") : _L("Right"),
invalid_eid == 0 ? _L_CONTEXT("Left", "Nozzle position") : _L_CONTEXT("Right", "Nozzle position"),
invalid_nozzle == NozzleVolumeType::nvtStandard ? _L("Standard") : _L("High Flow")));
// Re-wrap: wrapping only applies to the label text present when Wrap is called,
// and the label was empty at construction time.
+1 -2
View File
@@ -105,9 +105,8 @@ FilamentPickerDialog::FilamentPickerDialog(wxWindow *parent, const wxString& fil
container_sizer->Add(main_sizer, 1, wxEXPAND | wxALL, FromDIP(10));
container_sizer->Add(dlg_btns, 0, wxEXPAND);
SetSizer(container_sizer);
SetSizerAndFit(container_sizer);
Layout();
container_sizer->Fit(this);
// Position the dialog relative to the parent window
if (GetParent()) {
+2 -2
View File
@@ -4268,7 +4268,7 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
};
auto append_print = [&imgui, imperial_units](const ColorRGBA& color, const std::array<float, 4>& offsets, const Times& times, std::pair<double, double> used_filament) {
imgui.text(_CTX_utf8("Print", "Noun"));
imgui.text(_u8L_CONTEXT("Print", "Noun"));
ImGui::SameLine();
float icon_size = ImGui::GetTextLineHeight();
@@ -4302,7 +4302,7 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
for (const PartialTime& item : partial_times) {
switch (item.type)
{
case PartialTime::EType::Print: { labels.push_back(_CTX_utf8("Print", "Noun")); break; }
case PartialTime::EType::Print: { labels.push_back(_u8L_CONTEXT("Print", "Noun")); break; }
case PartialTime::EType::Pause: { labels.push_back(_u8L("Pause")); break; }
case PartialTime::EType::ColorChange: { labels.push_back(_u8L("Color change")); break; }
}
+7 -7
View File
@@ -282,7 +282,7 @@ void GLCanvas3D::LayersEditing::render_variable_layer_height_dialog(GLCanvas3D&
ImGui::SetCursorPosX(input_align);
ImGui::BBLDragFloat("##adaptive_input", &m_adaptive_quality, 0.05f, 0.0f, 0.0f, "%.2f");
if (imgui.button(_L("Smooth")))
if (imgui.button(_L_CONTEXT("Smooth", "Mesh action")))
wxPostEvent((wxEvtHandler*)canvas.get_wxglcanvas(), HeightProfileSmoothEvent(EVT_GLCANVAS_SMOOTH_LAYER_HEIGHT_PROFILE, m_smooth_params));
ImGui::SameLine();
text_align = std::max(text_align, ImGui::GetCursorPosX());
@@ -6047,12 +6047,12 @@ void GLCanvas3D::_render_3d_navigator()
strcpy(style.AxisLabels[ImGuizmo::Axis::Axis_X], "Y"); // ORCA use uppercase to match text on tranform widgets
strcpy(style.AxisLabels[ImGuizmo::Axis::Axis_Y], "Z"); // ORCA use uppercase to match text on tranform widgets
strcpy(style.AxisLabels[ImGuizmo::Axis::Axis_Z], "X"); // ORCA use uppercase to match text on tranform widgets
strcpy(style.FaceLabels[ImGuizmo::FACES::FACE_FRONT], _utf8("Front").c_str());
strcpy(style.FaceLabels[ImGuizmo::FACES::FACE_BACK], _CTX_utf8("Back", "Camera View").c_str());
strcpy(style.FaceLabels[ImGuizmo::FACES::FACE_TOP], _utf8("Top").c_str());
strcpy(style.FaceLabels[ImGuizmo::FACES::FACE_BOTTOM], _utf8("Bottom").c_str());
strcpy(style.FaceLabels[ImGuizmo::FACES::FACE_LEFT], _CTX_utf8("Left", "Camera View").c_str());
strcpy(style.FaceLabels[ImGuizmo::FACES::FACE_RIGHT], _CTX_utf8("Right", "Camera View").c_str());
strcpy(style.FaceLabels[ImGuizmo::FACES::FACE_FRONT], _u8L_CONTEXT("Front", "Camera View").c_str());
strcpy(style.FaceLabels[ImGuizmo::FACES::FACE_BACK], _u8L_CONTEXT("Back", "Camera View").c_str());
strcpy(style.FaceLabels[ImGuizmo::FACES::FACE_TOP], _u8L_CONTEXT("Top", "Camera View").c_str());
strcpy(style.FaceLabels[ImGuizmo::FACES::FACE_BOTTOM], _u8L_CONTEXT("Bottom", "Camera View").c_str());
strcpy(style.FaceLabels[ImGuizmo::FACES::FACE_LEFT], _u8L_CONTEXT("Left", "Camera View").c_str());
strcpy(style.FaceLabels[ImGuizmo::FACES::FACE_RIGHT], _u8L_CONTEXT("Right", "Camera View").c_str());
float sc = get_scale();
#ifdef WIN32
+18 -7
View File
@@ -96,6 +96,7 @@
#include "../Utils/PresetUpdater.hpp"
#include "../Utils/PrintHost.hpp"
#include "../Utils/Process.hpp"
#include "../Utils/wxInspectorPlugins/Registration.hpp"
#include "../Utils/MacDarkMode.hpp"
#include "../Utils/Http.hpp"
#include "../Utils/InstanceID.hpp"
@@ -2849,6 +2850,9 @@ bool GUI_App::on_init_inner()
::Label::initSysFont();
// Register wxInspector plugins for Orca custom controls
RegisterOrcaInspectorPlugins();
// Set initialization of image handlers before any UI actions - See GH issue #7469
wxInitAllImageHandlers();
#ifdef NDEBUG
@@ -3718,13 +3722,13 @@ bool GUI_App::on_init_network(bool try_backup)
}
} else {
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ": on_init_network, load dll failed";
// A failed install can leave the config naming a build that never made it to
// disk (download_plugin() adopts the downloaded version up front so that
// install_plugin() can name the library after it). If the whitelisted latest
// is still installed, fall back to it instead of dropping the user into the
// re-download flow without networking.
// A failed install can leave the config naming a build that never made it to disk;
// fall back to the installed latest instead of dropping the user into the re-download
// flow. Only when the configured library is genuinely absent, though - a pinned series
// that is on disk but failed to load once must keep its pin, not be rewritten for good.
std::string latest = get_latest_network_version();
if (config_version != latest && BBLNetworkPlugin::versioned_library_exists(latest)) {
if (config_version != latest && !BBLNetworkPlugin::versioned_library_exists(config_version)
&& BBLNetworkPlugin::versioned_library_exists(latest)) {
BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << ": falling back to installed " << latest;
config_version = latest;
app_config->set_network_plugin_version(latest);
@@ -3828,7 +3832,14 @@ bool GUI_App::on_init_network(bool try_backup)
m_user_manager = new Slic3r::UserManager();
}
if (should_load_networking_plugin && m_networking_compatible && !use_legacy_network_plugin()) {
// A version pinned to something other than the latest series is a deliberate choice, so it
// is exempt from the upgrade prompt the same way the legacy pin already is - otherwise the
// dialog reappears on every launch for as long as the pin is held.
const std::string pinned_version = app_config->get_network_plugin_version();
const bool pinned_to_older_series = !pinned_version.empty() &&
network_plugin_series(pinned_version) != network_plugin_series(get_latest_network_version());
if (should_load_networking_plugin && m_networking_compatible && !pinned_to_older_series) {
app_config->clear_remind_network_update_later();
if (has_network_update_available()) {
+2 -2
View File
@@ -533,11 +533,11 @@ void MenuFactory::append_menu_item_set_visible(wxMenu* menu)
void MenuFactory::append_menu_item_delete(wxMenu* menu)
{
#ifdef __WINDOWS__
append_menu_item(menu, wxID_ANY, _L("Delete") + "\t" + _L("Del"), _L("Delete the selected object"),
append_menu_item(menu, wxID_ANY, _L("Delete") + "\t" + _L_CONTEXT("Del", "Keyboard Shortcut"), _L("Delete the selected object"),
[](wxCommandEvent&) { plater()->remove_selected(); }, "menu_delete", nullptr,
[]() { return plater()->can_delete(); }, m_parent);
#else
append_menu_item(menu, wxID_ANY, _L("Delete") + "\t" + _L("Backspace"), _L("Delete the selected object"),
append_menu_item(menu, wxID_ANY, _L("Delete") + "\t" + _L_CONTEXT("Backspace", "Keyboard Shortcut"), _L("Delete the selected object"),
[](wxCommandEvent&) { plater()->remove_selected(); }, "", nullptr,
[]() { return plater()->can_delete(); }, m_parent);
#endif
+8 -1
View File
@@ -20,6 +20,7 @@
#include <wx/settings.h>
#include <wx/dataview.h>
#include <wx/statbox.h>
#include <wx/inspector/inspector.h>
#include <chrono>
#include "Event.hpp"
@@ -88,7 +89,7 @@ void update_dark_ui(wxWindow* window);
extern std::deque<wxDialog*> dialogStack;
template<class P> class DPIAware : public P
template<class P> class DPIAware : public P, public wxInspector::wxInspectable
{
public:
DPIAware(wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &pos=wxDefaultPosition,
@@ -107,6 +108,7 @@ public:
this->SetFont(m_normal_font);
#endif
this->CenterOnParent();
SetupInspectorAccelerator(this);
#ifdef _WIN32
update_dark_ui(this);
#endif
@@ -182,6 +184,11 @@ public:
float scale_factor() const { return m_scale_factor; }
float prev_scale_factor() const { return m_prev_scale_factor; }
// Only meant to be used by inspector, not public API
void set_scale_factor(float v) { m_scale_factor = v; }
void set_prev_scale_factor(float v) { m_prev_scale_factor = v; }
void set_em_unit(int v) { m_em_unit = v; }
bool force_rescale() const { return m_force_rescale; }
int em_unit() const { return m_em_unit; }
// int font_size() const { return m_font_size; }
+2 -2
View File
@@ -372,7 +372,7 @@ bool GLGizmoAdvancedCut::on_init()
std::string GLGizmoAdvancedCut::on_get_name() const
{
return (_(L("Cut"))).ToUTF8().data();
return (_L_CONTEXT("Cut", "Cut tool")).ToUTF8().data();
}
void GLGizmoAdvancedCut::on_load(cereal::BinaryInputArchive &ar)
@@ -1905,7 +1905,7 @@ bool GLGizmoAdvancedCut::render_slider_double_input(const std::string &label, fl
mean_size *= float(units_mm_to_in);
min_size *= float(units_mm_to_in);
}
std::string format = value_in < 0.f ? " " : m_imperial_units ? "%.4f " + _CTX_utf8("in", "inches") : "%.2f " + _u8L("mm");
std::string format = value_in < 0.f ? " " : m_imperial_units ? "%.4f " + _u8L_CONTEXT("in", "inches") : "%.2f " + _u8L("mm");
m_imgui->bbl_slider_float_style(("##" + label).c_str(), &value, min_size, mean_size, format.c_str());
+3 -3
View File
@@ -32,13 +32,13 @@ std::string GLGizmoAssembly::on_get_name() const
{
if (!on_is_activable() && m_state == EState::Off) {
if (wxGetApp().plater()->canvas3D()->get_canvas_type() == GLCanvas3D::ECanvasType::CanvasAssembleView) {
return _u8L("Assemble") + ":\n" + _u8L("Please confirm explosion ratio = 1 and select at least two volumes.");
return _u8L_CONTEXT("Assemble", "Assembly tool") + ":\n" + _u8L("Please confirm explosion ratio = 1 and select at least two volumes.");
}
else {
return _u8L("Assemble") + ":\n" + _u8L("Please select at least two volumes.");
return _u8L_CONTEXT("Assemble", "Assembly tool") + ":\n" + _u8L("Please select at least two volumes.");
}
} else {
return _u8L("Assemble");
return _u8L_CONTEXT("Assemble", "Assembly tool");
}
}
+7 -7
View File
@@ -241,7 +241,7 @@ std::string GLGizmoCut3D::get_tooltip() const
std::string tooltip;
if (m_hover_id == Z || (m_dragging && m_hover_id == CutPlane)) {
double koef = m_imperial_units ? GizmoObjectManipulation::mm_to_in : 1.0;
std::string unit_str = " " + (m_imperial_units ? _CTX_utf8("in", "inches") : _u8L("mm"));
std::string unit_str = " " + (m_imperial_units ? _u8L_CONTEXT("in", "inches") : _u8L("mm"));
const BoundingBoxf3& tbb = m_transformed_bounding_box;
const std::string name = m_keep_as_parts ? _u8L("Part") : _u8L("Object");
@@ -541,7 +541,7 @@ bool GLGizmoCut3D::render_double_input(const std::string& label, double& value_i
ImGui::InputDouble(("##" + label).c_str(), &value, 0.0f, 0.0f, "%.2f", ImGuiInputTextFlags_CharsDecimal);
ImGui::SameLine();
m_imgui->text(m_imperial_units ? _CTX("in", "inches") : _L("mm"));
m_imgui->text(m_imperial_units ? _L_CONTEXT("in", "inches") : _L("mm"));
value_in = value * (m_imperial_units ? GizmoObjectManipulation::in_to_mm : 1.0);
return !is_approx(old_val, value);
@@ -582,7 +582,7 @@ bool GLGizmoCut3D::render_slider_two_input(const std::string& label, float& valu
if (m_imperial_units) {
min_size *= f_mm_to_in;
}
std::string format = value_in < 0.f ? " " : m_imperial_units ? "%.4f " + _CTX_utf8("in", "inches") : "%.2f " + _u8L("mm");
std::string format = value_in < 0.f ? " " : m_imperial_units ? "%.4f " + _u8L_CONTEXT("in", "inches") : "%.2f " + _u8L("mm");
m_imgui->bbl_slider_float_style(("##" + label).c_str(), &value, min_size, mean_size, format.c_str());
@@ -653,7 +653,7 @@ bool GLGizmoCut3D::render_slider_input(const std::string& label, float& value_in
if (m_imperial_units) {
min_size *= f_mm_to_in;
}
std::string format = value_in < 0.f ? " " : m_imperial_units ? "%.4f " + _CTX_utf8("in", "inches") : "%.2f " + _u8L("mm");
std::string format = value_in < 0.f ? " " : m_imperial_units ? "%.4f " + _u8L_CONTEXT("in", "inches") : "%.2f " + _u8L("mm");
m_imgui->bbl_slider_float_style(("##" + label).c_str(), &value, min_size, max_value, format.c_str());
@@ -1386,7 +1386,7 @@ void GLGizmoCut3D::on_save(cereal::BinaryOutputArchive& ar) const
std::string GLGizmoCut3D::on_get_name() const
{
return _u8L("Cut");
return _u8L_CONTEXT("Cut", "Cut tool");
}
void GLGizmoCut3D::apply_color_clip_plane_colors()
@@ -2472,7 +2472,7 @@ void GLGizmoCut3D::render_connectors_input_window(CutConnectors &connectors, flo
void GLGizmoCut3D::render_build_size()
{
double koef = m_imperial_units ? GizmoObjectManipulation::mm_to_in : 1.0;
wxString unit_str = m_imperial_units ? _CTX("in", "inches") : _L("mm");
wxString unit_str = m_imperial_units ? _L_CONTEXT("in", "inches") : _L("mm");
Vec3d tbb_sz = m_transformed_bounding_box.size() * koef; // ORCA
ImGui::AlignTextToFramePadding();
@@ -3502,7 +3502,7 @@ static void check_objects_after_cut(const ModelObjectPtrs& objects)
names += ", " + from_u8(err_objects_names[i]);
WarningDialog(wxGetApp().plater(), format_wxstr(_L("Objects(%1%) have duplicated connectors. "
"Some connectors may be missing in slicing result.\n"
"Please report to PrusaSlicer team in which scenario this issue happened.\n"
"Please report to the OrcaSlicer team in which scenario this issue happened.\n"
"Thank you."), names)).ShowModal();
}
+7 -7
View File
@@ -1961,7 +1961,7 @@ void GLGizmoEmboss::draw_model_type()
ImGui::SameLine();
std::string last_solid_part_hint = _u8L("You can't change a type of the last solid part of the object.");
if (ImGui::RadioButton(_CTX_utf8(L_CONTEXT("Cut", "EmbossOperation"), "EmbossOperation").c_str(), type == negative))
if (ImGui::RadioButton(_u8L_CONTEXT(L_CONTEXT("Cut", "EmbossOperation"), "EmbossOperation").c_str(), type == negative))
new_type = negative;
else if (ImGui::IsItemHovered()) {
if (is_last_solid_part)
@@ -2811,29 +2811,29 @@ void GLGizmoEmboss::draw_advanced()
ImGui::SameLine(input_offset);
if (align.first==FontProp::HorizontalAlign::left) draw(get_icon(icons, IconType::align_horizontal_left, IconState::hovered));
else if (draw_button(icons, IconType::align_horizontal_left)) { align.first=FontProp::HorizontalAlign::left; is_change = true; }
else if (ImGui::IsItemHovered()) m_imgui->tooltip(_CTX_utf8(L_CONTEXT("Left", "Alignment"), "Alignment"), m_gui_cfg->max_tooltip_width);
else if (ImGui::IsItemHovered()) m_imgui->tooltip(_u8L_CONTEXT(L_CONTEXT("Left", "Alignment"), "Alignment"), m_gui_cfg->max_tooltip_width);
ImGui::SameLine();
if (align.first==FontProp::HorizontalAlign::center) draw(get_icon(icons, IconType::align_horizontal_center, IconState::hovered));
else if (draw_button(icons, IconType::align_horizontal_center)) { align.first=FontProp::HorizontalAlign::center; is_change = true; }
else if (ImGui::IsItemHovered()) m_imgui->tooltip(_CTX_utf8(L_CONTEXT("Center", "Alignment"), "Alignment"), m_gui_cfg->max_tooltip_width);
else if (ImGui::IsItemHovered()) m_imgui->tooltip(_u8L_CONTEXT(L_CONTEXT("Center", "Alignment"), "Alignment"), m_gui_cfg->max_tooltip_width);
ImGui::SameLine();
if (align.first==FontProp::HorizontalAlign::right) draw(get_icon(icons, IconType::align_horizontal_right, IconState::hovered));
else if (draw_button(icons, IconType::align_horizontal_right)) { align.first=FontProp::HorizontalAlign::right; is_change = true; }
else if (ImGui::IsItemHovered()) m_imgui->tooltip(_CTX_utf8(L_CONTEXT("Right", "Alignment"), "Alignment"), m_gui_cfg->max_tooltip_width);
else if (ImGui::IsItemHovered()) m_imgui->tooltip(_u8L_CONTEXT(L_CONTEXT("Right", "Alignment"), "Alignment"), m_gui_cfg->max_tooltip_width);
ImGui::SameLine(0, ImGui::GetStyle().ItemSpacing.x * 2.f); // ORCA use wider spacing for separation between horizontal / vertical alignment
if (align.second==FontProp::VerticalAlign::top) draw(get_icon(icons, IconType::align_vertical_top, IconState::hovered));
else if (draw_button(icons, IconType::align_vertical_top)) { align.second=FontProp::VerticalAlign::top; is_change = true; }
else if (ImGui::IsItemHovered()) m_imgui->tooltip(_CTX_utf8(L_CONTEXT("Top", "Alignment"), "Alignment"), m_gui_cfg->max_tooltip_width);
else if (ImGui::IsItemHovered()) m_imgui->tooltip(_u8L_CONTEXT(L_CONTEXT("Top", "Alignment"), "Alignment"), m_gui_cfg->max_tooltip_width);
ImGui::SameLine();
if (align.second==FontProp::VerticalAlign::center) draw(get_icon(icons, IconType::align_vertical_center, IconState::hovered));
else if (draw_button(icons, IconType::align_vertical_center)) { align.second=FontProp::VerticalAlign::center; is_change = true; }
else if (ImGui::IsItemHovered()) m_imgui->tooltip(_CTX_utf8(L_CONTEXT("Middle", "Alignment"), "Alignment"), m_gui_cfg->max_tooltip_width);
else if (ImGui::IsItemHovered()) m_imgui->tooltip(_u8L_CONTEXT(L_CONTEXT("Middle", "Alignment"), "Alignment"), m_gui_cfg->max_tooltip_width);
ImGui::SameLine();
if (align.second==FontProp::VerticalAlign::bottom) draw(get_icon(icons, IconType::align_vertical_bottom, IconState::hovered));
else if (draw_button(icons, IconType::align_vertical_bottom)) { align.second=FontProp::VerticalAlign::bottom; is_change = true; }
else if (ImGui::IsItemHovered()) m_imgui->tooltip(_CTX_utf8(L_CONTEXT("Bottom", "Alignment"), "Alignment"), m_gui_cfg->max_tooltip_width);
else if (ImGui::IsItemHovered()) m_imgui->tooltip(_u8L_CONTEXT(L_CONTEXT("Bottom", "Alignment"), "Alignment"), m_gui_cfg->max_tooltip_width);
return is_change;
};
const FontProp::Align * def_align = stored_style ? &stored_style->prop.align : nullptr;
+7 -7
View File
@@ -455,8 +455,8 @@ bool GLGizmoMeasure::on_init()
m_shortcuts = {
{_L("Left mouse button"), _L("Select")},
{shift + _L("Left mouse button"), _L("Select point")},
{_L("Delete"), _L("Restart selection")},
{_L("Esc"), _L("Cancel a feature until exit")},
{_L_CONTEXT("Delete", "Keyboard Shortcut"), _L("Restart selection")},
{_L_CONTEXT("Esc", "Keyboard Shortcut"), _L("Cancel a feature until exit")},
};
return true;
@@ -1252,7 +1252,7 @@ void GLGizmoMeasure::render_dimensioning()
const bool use_inches = wxGetApp().app_config->get_bool("use_inches");
const double curr_value = use_inches ? GizmoObjectManipulation::mm_to_in * distance : distance;
const std::string curr_value_str = format_double(curr_value);
const std::string units = use_inches ? _CTX_utf8("in", "inches") : _u8L("mm");
const std::string units = use_inches ? _u8L_CONTEXT("in", "inches") : _u8L("mm");
const float value_str_width = 20.0f + ImGui::CalcTextSize(curr_value_str.c_str()).x;
static double edit_value = 0.0;
@@ -1303,7 +1303,7 @@ void GLGizmoMeasure::render_dimensioning()
return;
const double ratio = new_value / old_value;
wxGetApp().plater()->take_snapshot(_CTX_utf8("Scale", "Verb"), UndoRedo::SnapshotType::GizmoAction);
wxGetApp().plater()->take_snapshot(_u8L_CONTEXT("Scale", "Verb"), UndoRedo::SnapshotType::GizmoAction);
// apply scale
TransformationType type;
type.set_world();
@@ -1359,10 +1359,10 @@ void GLGizmoMeasure::render_dimensioning()
ImGui::SameLine();
ImGuiWrapper::push_confirm_button_style();
//if (m_imgui->button(_CTX(L_CONTEXT("Scale part", "Verb"), "Verb")))
//if (m_imgui->button(_L_CONTEXT(L_CONTEXT("Scale part", "Verb"), "Verb")))
//action_scale(edit_value, curr_value, true);
//ImGui::SameLine();
if (m_imgui->button(_CTX(L_CONTEXT("Scale all", "Verb"), "Verb")))
if (m_imgui->button(_L_CONTEXT(L_CONTEXT("Scale all", "Verb"), "Verb")))
action_scale(edit_value, curr_value, false);
ImGuiWrapper::pop_confirm_button_style();
ImGui::SameLine();
@@ -2130,7 +2130,7 @@ void GLGizmoMeasure::show_face_face_assembly_senior()
void GLGizmoMeasure::init_render_input_window()
{
m_use_inches = wxGetApp().app_config->get_bool("use_inches");
m_units = " " + (m_use_inches ? _CTX_utf8("in", "inches") : _u8L("mm"));
m_units = " " + (m_use_inches ? _u8L_CONTEXT("in", "inches") : _u8L("mm"));
m_space_size = ImGui::CalcTextSize(" ").x * 2;
m_input_size_max = ImGui::CalcTextSize("-100.00").x * 1.2;
m_same_model_object = is_two_volume_in_same_model_object();
@@ -122,7 +122,7 @@ bool GLGizmoMmuSegmentation::on_init()
std::pair<wxString, wxString> paint_shortcut = {_L("Left mouse button"), m_desc["paint"]};
std::pair<wxString, wxString> erase_shortcut = {shift + _L("Left mouse button"), m_desc["erase"]};
std::pair<wxString, wxString> clipping_shortcut = {alt + _L("Mouse wheel"), m_desc["clipping_of_view"]};
std::pair<wxString, wxString> toggle_wireframe_shortcut = {alt + shift + _L("Enter"), m_desc["toggle_wireframe"]};
std::pair<wxString, wxString> toggle_wireframe_shortcut = {alt + shift + _L_CONTEXT("Enter", "Keyboard Shortcut"), m_desc["toggle_wireframe"]};
m_shortcuts_brush = {
paint_shortcut,
+2 -2
View File
@@ -1704,7 +1704,7 @@ void GLGizmoSVG::draw_size()
if (m_keep_ratio) {
std::stringstream ss;
ss << std::setprecision(2) << std::fixed << width << " x " << height << " " << (use_inch ? _CTX("in", "inches") : _L("mm"));
ss << std::setprecision(2) << std::fixed << width << " x " << height << " " << (use_inch ? _L_CONTEXT("in", "inches") : _L("mm"));
ImGui::SameLine(m_gui_cfg->input_offset);
ImGui::SetNextItemWidth(m_gui_cfg->input_width);
@@ -2016,7 +2016,7 @@ void GLGizmoSVG::draw_model_type()
ImGui::SameLine();
std::string last_solid_part_hint = _u8L("You can't change a type of the last solid part of the object.");
if (ImGui::RadioButton(_CTX_utf8(L_CONTEXT("Cut", "EmbossOperation"), "EmbossOperation").c_str(), type == negative))
if (ImGui::RadioButton(_u8L_CONTEXT(L_CONTEXT("Cut", "EmbossOperation"), "EmbossOperation").c_str(), type == negative))
new_type = negative;
else if (ImGui::IsItemHovered()) {
if (is_last_solid_part)
+2 -2
View File
@@ -143,9 +143,9 @@ bool GLGizmoScale3D::on_init()
std::string GLGizmoScale3D::on_get_name() const
{
if (!on_is_activable() && m_state == EState::Off) {
return _CTX_utf8("Scale", "Verb") + ":\n" + _u8L("Please select at least one object.");
return _u8L_CONTEXT("Scale", "Verb") + ":\n" + _u8L("Please select at least one object.");
} else {
return _CTX_utf8("Scale", "Verb");
return _u8L_CONTEXT("Scale", "Verb");
}
}
+2 -2
View File
@@ -1213,8 +1213,8 @@ SlaGizmoHelpDialog::SlaGizmoHelpDialog()
shortcuts.push_back(std::make_pair(_L"Del", _L("Remove selected points")));
shortcuts.push_back(std::make_pair(ctrl+_L("Mouse wheel"), _L("Move clipping plane")));
shortcuts.push_back(std::make_pair("R", _L("Reset clipping plane")));
shortcuts.push_back(std::make_pair(_L("Enter"), _L("Apply changes")));
shortcuts.push_back(std::make_pair(_L("Esc"), _L("Discard changes")));
shortcuts.push_back(std::make_pair(_L_CONTEXT("Enter", "Keyboard Shortcut"), _L("Apply changes")));
shortcuts.push_back(std::make_pair(_L_CONTEXT("Esc", "Keyboard Shortcut"), _L("Discard changes")));
shortcuts.push_back(std::make_pair("M", _L("Switch to editing mode")));
shortcuts.push_back(std::make_pair("A", _L("Auto-generate points")));
@@ -1161,7 +1161,7 @@ void GizmoObjectManipulation::do_render_scale_input_window(ImGuiWrapper* imgui_w
imgui_wrapper->calc_text_size(_L("Part")).x
}) + imgui_wrapper->calc_text_size("xxx"sv).x + imgui_wrapper->scaled(3.5f);
float label_max = std::max({
imgui_wrapper->calc_text_size(_CTX("Scale", "Noun")).x,
imgui_wrapper->calc_text_size(_L_CONTEXT("Scale", "Noun")).x,
imgui_wrapper->calc_text_size(_L("Size")).x
});
float caption_max = std::max(label_max, coord_combo_width - 3 * space_size);
@@ -1218,7 +1218,7 @@ void GizmoObjectManipulation::do_render_scale_input_window(ImGuiWrapper* imgui_w
//ImGui::PushItemWidth(unit_size * 2);
ImGui::AlignTextToFramePadding();
imgui_wrapper->text(_CTX("Scale", "Noun"));
imgui_wrapper->text(_L_CONTEXT("Scale", "Noun"));
ImGui::SameLine(caption_max + space_size);
ImGui::PushItemWidth(unit_size);
ImGui::BBLInputDouble(label_scale_values[0][0], &scale[0], 0.0f, 0.0f, "%.2f");
+3 -3
View File
@@ -7,9 +7,9 @@
#define _u8L(s) Slic3r::GUI::I18N::translate_utf8((s))
#endif /* _ */
#ifndef _CTX
#define _CTX(s, ctx) Slic3r::GUI::I18N::translate((s), (ctx))
#define _CTX_utf8(s, ctx) Slic3r::GUI::I18N::translate_utf8((s), (ctx))
#ifndef _L_CONTEXT
#define _L_CONTEXT(s, ctx) Slic3r::GUI::I18N::translate((s), (ctx))
#define _u8L_CONTEXT(s, ctx) Slic3r::GUI::I18N::translate_utf8((s), (ctx))
#endif /* _ */
#ifndef L
+1 -1
View File
@@ -644,7 +644,7 @@ void Slic3r::GUI::ImageGrid::renderContent1(wxDC &dc, wxPoint const &pt, int ind
if (m_file_sys->GetFileType() == PrinterFileSystem::F_MODEL) {
if (secondAction != _L("Play"))
thirdAction = secondAction;
secondAction = _CTX("Print", "Verb");
secondAction = _L_CONTEXT("Print", "Verb");
}
// Draw buttons on hovered item
wxRect rect{pt.x, pt.y + m_content_rect.GetBottom() - m_buttons_background.GetHeight(), m_content_rect.GetWidth(), m_buttons_background.GetHeight()};
+23 -20
View File
@@ -201,7 +201,7 @@ void KBShortcutsDialog::fill_shortcuts()
#ifdef __APPLE__
{"fn+⌫", L("Delete Selected")},
#else
{L("Del"), L("Delete Selected")},
{L_CONTEXT("Del", "Keyboard Shortcut"), L("Delete Selected")},
#endif
// Help
{ "?", L("Show keyboard shortcuts list") }
@@ -231,12 +231,12 @@ void KBShortcutsDialog::fill_shortcuts()
{alt + L("Left mouse button"), L("Select a part")},
{ctrl + L("Left mouse button"), L("Select multiple objects")},
{shift + L("Left mouse button"), L("Select objects by rectangle")},
{L("Arrow Up"), L("Move selection 10mm in positive Y direction")},
{L("Arrow Down"), L("Move selection 10mm in negative Y direction")},
{L("Arrow Left"), L("Move selection 10mm in negative X direction")},
{L("Arrow Right"), L("Move selection 10mm in positive X direction")},
{L_CONTEXT("Arrow Up", "Keyboard Shortcut"), L("Move selection 10mm in positive Y direction")},
{L_CONTEXT("Arrow Down", "Keyboard Shortcut"), L("Move selection 10mm in negative Y direction")},
{L_CONTEXT("Arrow Left", "Keyboard Shortcut"), L("Move selection 10mm in negative X direction")},
{L_CONTEXT("Arrow Right", "Keyboard Shortcut"), L("Move selection 10mm in positive X direction")},
{shift + L("Any arrow"), L("Movement step set to 1mm")},
{L("Esc"), L("Deselect All")},
{L_CONTEXT("Esc", "Keyboard Shortcut"), L("Deselect All")},
{"1-9", L("Keyboard 1-9: set filament for object/part")},
{ctrl + "0", L("Camera view - Default")},
{ctrl + "1", L("Camera view - Top")},
@@ -266,14 +266,14 @@ void KBShortcutsDialog::fill_shortcuts()
{ "I", L("Zoom in") },
{ "O", L("Zoom out") },
{ "V", L("Toggle printable for object/part") },
{ L("Tab"), L("Switch between Prepare/Preview") },
{ L("Space"), L("Open actions speed dial") },
{ L_CONTEXT("Tab", "Keyboard Shortcut"), L("Switch between Prepare/Preview") },
{ L_CONTEXT("Space", "Keyboard Shortcut"), L("Open actions speed dial") },
};
m_full_shortcuts.push_back({ { _L("Plater"), "" }, plater_shortcuts });
Shortcuts gizmos_shortcuts = {
{L("Esc"), L("Deselect All")},
{L_CONTEXT("Esc", "Keyboard Shortcut"), L("Deselect All")},
{shift, L("Move: press to snap by 1mm")},
{ctrl + L("Mouse wheel"), L("Support/Color Painting: adjust pen radius")},
{alt + L("Mouse wheel"), L("Support/Color Painting: adjust section position")},
@@ -282,8 +282,8 @@ void KBShortcutsDialog::fill_shortcuts()
Shortcuts object_list_shortcuts = {
{"1-9", L("Set extruder number for the objects and parts") },
{L("Del"), L("Delete objects, parts, modifiers")},
{L("Esc"), L("Deselect All")},
{L_CONTEXT("Del", "Keyboard Shortcut"), L("Delete objects, parts, modifiers")},
{L_CONTEXT("Esc", "Keyboard Shortcut"), L("Deselect All")},
{ctrl + "C", L("Copy to clipboard")},
{ctrl + "V", L("Paste from clipboard")},
{ctrl + "X", L("Cut")},
@@ -291,26 +291,26 @@ void KBShortcutsDialog::fill_shortcuts()
{ctrl + "K", L("Clone Selected")},
{ctrl + "Z", L("Undo")},
{ctrl + "Y", L("Redo")},
{L("Space"), L("Select the object/part and press space to change the name")},
{L_CONTEXT("Space", "Keyboard Shortcut"), L("Select the object/part and press space to change the name")},
{L("Mouse click"), L("Select the object/part and mouse click to change the name")},
};
m_full_shortcuts.push_back({ { _L("Objects List"), "" }, object_list_shortcuts });
}
Shortcuts preview_shortcuts = {
{ L("Arrow Up"), L("Vertical slider - Move active thumb Up")},
{ L("Arrow Down"), L("Vertical slider - Move active thumb Down")},
{ L("Arrow Left"), L("Horizontal slider - Move active thumb Left")},
{ L("Arrow Right"), L("Horizontal slider - Move active thumb Right")},
{ L_CONTEXT("Arrow Up", "Keyboard Shortcut"), L("Vertical slider - Move active thumb Up")},
{ L_CONTEXT("Arrow Down", "Keyboard Shortcut"), L("Vertical slider - Move active thumb Down")},
{ L_CONTEXT("Arrow Left", "Keyboard Shortcut"), L("Horizontal slider - Move active thumb Left")},
{ L_CONTEXT("Arrow Right", "Keyboard Shortcut"), L("Horizontal slider - Move active thumb Right")},
{ "L", L("On/Off one layer mode of the vertical slider")},
{ "C", L("On/Off G-code window")},
{ L("Tab"), L("Switch between Prepare/Preview")},
{ L_CONTEXT("Tab", "Keyboard Shortcut"), L("Switch between Prepare/Preview")},
{shift + L("Any arrow"), L("Move slider 5x faster")},
{shift + L("Mouse wheel"), L("Move slider 5x faster")},
{ctrl + L("Any arrow"), L("Move slider 5x faster")},
{ctrl + L("Mouse wheel"), L("Move slider 5x faster")},
{ L("Home"), L("Horizontal slider - Move to start position")},
{ L("End"), L("Horizontal slider - Move to last position")},
{ L_CONTEXT("Home", "Keyboard Shortcut"), L("Horizontal slider - Move to start position")},
{ L_CONTEXT("End", "Keyboard Shortcut"), L("Horizontal slider - Move to last position")},
};
m_full_shortcuts.push_back({ { _L("Preview"), "" }, preview_shortcuts });
}
@@ -341,7 +341,10 @@ wxPanel* KBShortcutsDialog::create_page(wxWindow* parent, const ShortcutsItem& s
for (int i = 0; i < items_count; ++i) {
const auto &[shortcut, description] = shortcuts.second[i];
auto key = new wxStaticText(scrollable_panel, wxID_ANY, _(shortcut));
// Keyboard keys carry a "Keyboard Shortcut" context so translators keep them in English;
// mouse-input labels are ordinary phrases and use the plain lookup.
const bool is_mouse = shortcut.find("Mouse") != std::string::npos || shortcut.find("mouse") != std::string::npos;
auto key = new wxStaticText(scrollable_panel, wxID_ANY, is_mouse ? _(shortcut) : _L_CONTEXT(shortcut, "Keyboard Shortcut"));
key->SetForegroundColour(wxColour(50, 58, 61));
key->SetFont(bold_font);
grid_sizer->Add(key, 0, wxALIGN_CENTRE_VERTICAL);
+15 -15
View File
@@ -738,7 +738,7 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, BORDERLESS_FRAME_
return;
}
if (evt.CmdDown() && evt.GetKeyCode() == 'I') {
if (evt.CmdDown() && evt.GetKeyCode() == 'I' && !evt.ShiftDown()) {
if (!can_add_models()) return;
if (m_plater) { m_plater->add_file(); }
return;
@@ -2031,10 +2031,10 @@ wxBoxSizer* MainFrame::create_side_tools()
});
// upload and print
SideButton* send_gcode_btn = new SideButton(p, _CTX("Print", "Verb"), "");
SideButton* send_gcode_btn = new SideButton(p, _L_CONTEXT("Print", "Verb"), "");
send_gcode_btn->SetCornerRadius(0);
send_gcode_btn->Bind(wxEVT_BUTTON, [this, p](wxCommandEvent&) {
m_print_btn->SetLabel(_CTX("Print", "Verb"));
m_print_btn->SetLabel(_L_CONTEXT("Print", "Verb"));
m_print_select = eSendGcode;
m_print_enable = get_enable_print_status();
m_print_btn->Enable(m_print_enable);
@@ -2671,18 +2671,18 @@ static void add_common_view_menu_items(wxMenu* view_menu, MainFrame* mainFrame,
"", nullptr, [can_change_view]() { return can_change_view(); }, mainFrame);
//view_menu->AppendSeparator();
//TRN To be shown in the main menu View->Top
append_menu_item(view_menu, wxID_ANY, _L("Top") + "\t" + ctrl + "1", _L("Top View"), [mainFrame](wxCommandEvent&) { mainFrame->select_view("top"); },
append_menu_item(view_menu, wxID_ANY, _L_CONTEXT("Top", "Camera View") + "\t" + ctrl + "1", _L("Top View"), [mainFrame](wxCommandEvent&) { mainFrame->select_view("top"); },
"", nullptr, [can_change_view]() { return can_change_view(); }, mainFrame);
//TRN To be shown in the main menu View->Bottom
append_menu_item(view_menu, wxID_ANY, _L("Bottom") + "\t" + ctrl + "2", _L("Bottom View"), [mainFrame](wxCommandEvent&) { mainFrame->select_view("bottom"); },
append_menu_item(view_menu, wxID_ANY, _L_CONTEXT("Bottom", "Camera View") + "\t" + ctrl + "2", _L("Bottom View"), [mainFrame](wxCommandEvent&) { mainFrame->select_view("bottom"); },
"", nullptr, [can_change_view]() { return can_change_view(); }, mainFrame);
append_menu_item(view_menu, wxID_ANY, _L("Front") + "\t" + ctrl + "3", _L("Front View"), [mainFrame](wxCommandEvent&) { mainFrame->select_view("front"); },
append_menu_item(view_menu, wxID_ANY, _L_CONTEXT("Front", "Camera View") + "\t" + ctrl + "3", _L("Front View"), [mainFrame](wxCommandEvent&) { mainFrame->select_view("front"); },
"", nullptr, [can_change_view]() { return can_change_view(); }, mainFrame);
append_menu_item(view_menu, wxID_ANY, _L("Rear") + "\t" + ctrl + "4", _L("Rear View"), [mainFrame](wxCommandEvent&) { mainFrame->select_view("rear"); },
append_menu_item(view_menu, wxID_ANY, _L_CONTEXT("Rear", "Camera View") + "\t" + ctrl + "4", _L("Rear View"), [mainFrame](wxCommandEvent&) { mainFrame->select_view("rear"); },
"", nullptr, [can_change_view]() { return can_change_view(); }, mainFrame);
append_menu_item(view_menu, wxID_ANY, _CTX("Left", "Camera View") + "\t" + ctrl + "5", _L("Left View"),[mainFrame](wxCommandEvent &) {mainFrame->select_view("left"); },
append_menu_item(view_menu, wxID_ANY, _L_CONTEXT("Left", "Camera View") + "\t" + ctrl + "5", _L("Left View"),[mainFrame](wxCommandEvent &) {mainFrame->select_view("left"); },
"", nullptr, [can_change_view]() { return can_change_view(); }, mainFrame);
append_menu_item(view_menu, wxID_ANY, _CTX("Right", "Camera View") + "\t" + ctrl + "6", _L("Right View"),[mainFrame](wxCommandEvent &) { mainFrame->select_view("right"); },
append_menu_item(view_menu, wxID_ANY, _L_CONTEXT("Right", "Camera View") + "\t" + ctrl + "6", _L("Right View"),[mainFrame](wxCommandEvent &) { mainFrame->select_view("right"); },
"", nullptr, [can_change_view]() { return can_change_view(); }, mainFrame);
}
@@ -2873,7 +2873,7 @@ void MainFrame::init_menubar_as_editor()
_L("Paste clipboard"), [this](wxCommandEvent&) { m_plater->paste_from_clipboard(); },
"menu_paste", nullptr, [this](){return m_plater->can_paste_from_clipboard(); }, this);
// BBS Delete selected
append_menu_item(editMenu, wxID_ANY, _L("Delete Selected") + "\t" + _L("Del"),
append_menu_item(editMenu, wxID_ANY, _L("Delete Selected") + "\t" + _L_CONTEXT("Del", "Keyboard Shortcut"),
_L("Deletes the current selection"),[this](wxCommandEvent&) { m_plater->remove_selected(); },
"menu_remove", nullptr, [this](){return can_delete(); }, this);
//BBS: delete all
@@ -2958,7 +2958,7 @@ void MainFrame::init_menubar_as_editor()
"", nullptr, [this](){return m_plater->can_paste_from_clipboard(); }, this);
#if 0
// BBS Delete selected
append_menu_item(editMenu, wxID_ANY, _L("Delete Selected") + "\t" + _L("Backspace"),
append_menu_item(editMenu, wxID_ANY, _L("Delete Selected") + "\t" + _L_CONTEXT("Backspace", "Keyboard Shortcut"),
_L("Deletes the current selection"),[this](wxCommandEvent&) {
m_plater->remove_selected();
},
@@ -3013,7 +3013,7 @@ void MainFrame::init_menubar_as_editor()
m_plater->select_all(); },
"", nullptr, [this](){return can_select(); }, this);
// BBS Deslect All
append_menu_item(editMenu, wxID_ANY, _L("Deselect All") + sep + _L("Esc"),
append_menu_item(editMenu, wxID_ANY, _L("Deselect All") + sep + _L_CONTEXT("Esc", "Keyboard Shortcut"),
_L("Deselects all objects"), [this, handle_key_event](wxCommandEvent&) {
wxKeyEvent e;
e.SetEventType(wxEVT_KEY_DOWN);
@@ -3279,7 +3279,7 @@ void MainFrame::init_menubar_as_editor()
#ifndef __APPLE__
m_topbar->SetFileMenu(fileMenu);
if (editMenu)
m_topbar->AddDropDownSubMenu(editMenu, _L("Edit"));
m_topbar->AddDropDownSubMenu(editMenu, _L_CONTEXT("Edit", "Menu"));
if (viewMenu)
m_topbar->AddDropDownSubMenu(viewMenu, _L("View"));
//BBS add Preference
@@ -3468,7 +3468,7 @@ void MainFrame::init_menubar_as_editor()
m_menubar->Append(fileMenu, wxString::Format("&%s", _L("File")));
if (editMenu)
m_menubar->Append(editMenu, wxString::Format("&%s", _L("Edit")));
m_menubar->Append(editMenu, wxString::Format("&%s", _L_CONTEXT("Edit", "Menu")));
if (viewMenu)
m_menubar->Append(viewMenu, wxString::Format("&%s", _L("View")));
/*if (publishMenu)
@@ -4090,7 +4090,7 @@ void MainFrame::set_print_button_to_default(PrintSelectType select_type)
m_print_btn->Enable(m_print_enable);
this->Layout();
} else if (select_type == PrintSelectType::eSendGcode) {
m_print_btn->SetLabel(_CTX("Print", "Verb"));
m_print_btn->SetLabel(_L_CONTEXT("Print", "Verb"));
m_print_select = eSendGcode;
if (m_print_enable)
m_print_enable = get_enable_print_status() && can_send_gcode();
+3 -3
View File
@@ -556,7 +556,7 @@ void MediaFilePanel::doAction(size_t index, int action)
} else if (action == 1) {
if (fs->GetFileType() == PrinterFileSystem::F_MODEL) {
if (index != -1) {
auto dlg = new MediaProgressDialog(_CTX("Print", "Verb"), this, [fs] { fs->FetchModelCancel(); });
auto dlg = new MediaProgressDialog(_L_CONTEXT("Print", "Verb"), this, [fs] { fs->FetchModelCancel(); });
dlg->Update(0, _L("Fetching model information..."));
fs->FetchModel(index, [this, fs, dlg, index](int result, std::string const &data) {
dlg->Destroy();
@@ -566,7 +566,7 @@ void MediaFilePanel::doAction(size_t index, int action)
wxString msg = data.empty() ? _L("Failed to fetch model information from printer.") :
from_u8(data);
CallAfter([this, msg] {
MessageDialog(this, msg, _CTX("Print", "Verb"), wxOK).ShowModal();
MessageDialog(this, msg, _L_CONTEXT("Print", "Verb"), wxOK).ShowModal();
});
return;
}
@@ -579,7 +579,7 @@ void MediaFilePanel::doAction(size_t index, int action)
|| plate_data_list.empty()) {
MessageDialog(this,
_L("Failed to parse model information."),
_CTX("Print", "Verb"), wxOK).ShowModal();
_L_CONTEXT("Print", "Verb"), wxOK).ShowModal();
return;
}
+1 -1
View File
@@ -193,7 +193,7 @@ void MonitorPanel::init_tabpanel()
//m_tabpanel->AddPage(m_media_file_panel, _L("Internal Storage"), false);
m_upgrade_panel = new UpgradePanel(m_tabpanel);
m_tabpanel->AddPage(m_upgrade_panel, _CTX(L_CONTEXT("Update", "Firmware"), "Firmware"), false);
m_tabpanel->AddPage(m_upgrade_panel, _L_CONTEXT(L_CONTEXT("Update", "Firmware"), "Firmware"), "", false);
m_hms_panel = new HMSPanel(m_tabpanel);
m_tabpanel->AddPage(m_hms_panel, _L("Assistant(HMS)"), false);
+6 -6
View File
@@ -65,7 +65,7 @@ MsgDialog::MsgDialog(wxWindow *parent, const wxString &title, const wxString &he
main_sizer->Add(btn_sizer, 0, wxBOTTOM | wxRIGHT | wxEXPAND | wxTOP, FromDIP(10));
apply_style(style);
SetSizerAndFit(main_sizer);
SetSizer(main_sizer);
wxGetApp().UpdateDlgDarkUI(this);
}
@@ -221,6 +221,7 @@ void MsgDialog::apply_style(long style)
void MsgDialog::finalize()
{
GetSizer()->SetSizeHints(this);
Layout();
Fit();
CenterOnParent();
@@ -547,7 +548,7 @@ DeleteConfirmDialog::DeleteConfirmDialog(wxWindow *parent, const wxString &title
m_del_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent &e) { EndModal(wxID_OK); });
m_cancel_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent &e) { EndModal(wxID_CANCEL); });
SetSizer(m_main_sizer);
SetSizerAndFit(m_main_sizer);
Layout();
Fit();
wxGetApp().UpdateDlgDarkUI(this);
@@ -582,7 +583,7 @@ Newer3mfVersionDialog::Newer3mfVersionDialog(wxWindow *parent, const Semver *fil
main_sizer->Add(content_sizer, 0, wxEXPAND | wxALL, FromDIP(5));
main_sizer->Add(get_btn_sizer(), 0, wxEXPAND | wxALL, FromDIP(5));
this->SetSizer(main_sizer);
this->SetSizerAndFit(main_sizer);
Layout();
Fit();
wxGetApp().UpdateDlgDarkUI(this);
@@ -632,7 +633,7 @@ wxBoxSizer *Newer3mfVersionDialog::get_btn_sizer()
bool file_version_newer = (*m_file_version) > (*m_cloud_version);
if (!file_version_newer) {
m_update_btn = new Button(this, _CTX(L_CONTEXT("Update", "Software"), "Software"));
m_update_btn = new Button(this, _L_CONTEXT(L_CONTEXT("Update", "Software"), "Software"));
m_update_btn->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
horizontal_sizer->Add(m_update_btn, 0, wxRIGHT, FromDIP(ButtonProps::ChoiceButtonGap()));
@@ -745,9 +746,8 @@ NetworkErrorDialog::NetworkErrorDialog(wxWindow* parent)
sizer_main->Add(sizer_button, 1, wxEXPAND | wxLEFT | wxRIGHT, 15);
sizer_main->Add(0, 0, 0, wxTOP, 18);
SetSizer(sizer_main);
SetSizerAndFit(sizer_main);
Layout();
sizer_main->Fit(this);
Centre(wxBOTH);
}
+1
View File
@@ -47,6 +47,7 @@ NetworkPluginDownloadDialog::NetworkPluginDownloadDialog(wxWindow* parent, Mode
} else {
create_missing_plugin_ui();
}
main_sizer->SetSizeHints(this);
Layout();
Fit();
CentreOnParent();
+1 -1
View File
@@ -47,7 +47,7 @@ NetworkTestDialog::NetworkTestDialog(wxWindow* parent, wxWindowID id, const wxSt
init_bind();
this->SetSizer(main_sizer);
this->SetSizerAndFit(main_sizer);
this->Layout();
this->Centre(wxBOTH);
+2 -2
View File
@@ -230,7 +230,7 @@ wxPoint OG_CustomCtrl::get_pos(const Line& line, Field* field_in/* = nullptr*/)
// add label if any
if (is_multioption_line && !option.label.empty()) {
//! To correct translation by context have to use wxGETTEXT_IN_CONTEXT macro from wxWidget 3.1.1
auto label = (option.label == L_CONTEXT("Top", "Layers") || option.label == L_CONTEXT("Bottom", "Layers")) ? _CTX(option.label, "Layers") :
auto label = (option.label == L_CONTEXT("Top", "Layers") || option.label == L_CONTEXT("Bottom", "Layers")) ? _L_CONTEXT(option.label, "Layers") :
_(option.label);
// BBS
// label += ":";
@@ -882,7 +882,7 @@ void OG_CustomCtrl::CtrlLine::render(wxDC& dc, wxCoord h_pos, wxCoord v_pos)
if (is_multioption_line && !option.label.empty()) {
//! To correct translation by context have to use wxGETTEXT_IN_CONTEXT macro from wxWidget 3.1.1
label = (option.label == L_CONTEXT("Top", "Layers") || option.label == L_CONTEXT("Bottom", "Layers")) ?
_CTX(option.label, "Layers") : _(option.label);
_L_CONTEXT(option.label, "Layers") : _(option.label);
//if (!ctrl->opt_group->option_label_at_right) // BBS
//label += ":";
+1 -1
View File
@@ -432,7 +432,7 @@ void OptionsGroup::activate_line(Line& line)
if ((is_multioption_line || line.label.IsEmpty()) && !option.label.empty() && !custom_ctrl) {
//! To correct translation by context have to use wxGETTEXT_IN_CONTEXT macro from wxWidget 3.1.1
wxString str_label = (option.label == L_CONTEXT("Top", "Layers") || option.label == L_CONTEXT("Bottom", "Layers")) ?
_CTX(option.label, "Layers") :
_L_CONTEXT(option.label, "Layers") :
_(option.label);
label = new wxStaticText(this->ctrl_parent(), wxID_ANY, str_label + ": ", wxDefaultPosition, // wxDefaultSize);
wxSize(sublabel_width != -1 ? sublabel_width * wxGetApp().em_unit() : -1, -1), wxALIGN_RIGHT);
+6
View File
@@ -4552,6 +4552,9 @@ int PartPlateList::create_plate(bool adjust_position)
return -1;
int cols = compute_colum_count(new_index + 1);
int old_cols = compute_colum_count(new_index);
// Orca: Rebuild plate membership before moving instances during a grid reflow.
if (adjust_position && old_cols != cols)
reload_all_objects();
origin = compute_origin(new_index, cols);
plate = new PartPlate(this, origin, m_plate_width, m_plate_depth, m_plate_height, m_plater, m_model, true, printer_technology);
@@ -5041,6 +5044,9 @@ int PartPlateList::move_plate_to_index(int old_index, int new_index)
return -1;
}
// Orca: Rebuild plate membership before moving the plates.
reload_all_objects();
if (old_index < new_index)
{
delta = 1;
+1 -2
View File
@@ -270,7 +270,7 @@ PartSkipDialog::PartSkipDialog(wxWindow *parent) : DPIDialog(parent, wxID_ANY, _
m_simplebook->AddPage(m_book_third_panel, _("dialog page"), false);
m_sizer->Add(m_simplebook, 1, wxEXPAND | wxALL, 5);
SetSizer(m_sizer);
SetSizerAndFit(m_sizer);
m_zoom_in_btn->Bind(wxEVT_BUTTON, &PartSkipDialog::OnZoomIn, this);
m_zoom_out_btn->Bind(wxEVT_BUTTON, &PartSkipDialog::OnZoomOut, this);
m_switch_drag_btn->Bind(wxEVT_BUTTON, &PartSkipDialog::OnSwitchDrag, this);
@@ -281,7 +281,6 @@ PartSkipDialog::PartSkipDialog(wxWindow *parent) : DPIDialog(parent, wxID_ANY, _
m_all_checkbox->Bind(wxEVT_TOGGLEBUTTON, &PartSkipDialog::OnAllCheckbox, this);
Layout();
Fit();
CentreOnParent();
}
+1 -1
View File
@@ -62,7 +62,7 @@ PhysicalPrinterDialog::PhysicalPrinterDialog(wxWindow* parent) :
Tab *tab = wxGetApp().get_tab(Preset::TYPE_PRINTER);
m_presets = tab->get_presets();
const Preset &sel_preset = m_presets->get_selected_preset();
std::string suffix = _CTX_utf8(L_CONTEXT("Copy", "PresetName"), "PresetName");
std::string suffix = _u8L_CONTEXT(L_CONTEXT("Copy", "PresetName"), "PresetName");
std::string preset_name = sel_preset.is_default ? "Untitled" : sel_preset.is_system ? (boost::format(("%1% - %2%")) % sel_preset.name % suffix).str() : sel_preset.name;
auto input_sizer = new wxBoxSizer(wxVERTICAL);
+2 -2
View File
@@ -33,7 +33,7 @@ LayerNumberTextInput::LayerNumberTextInput(wxWindow* parent, int layer_number, w
{
GetTextCtrl()->SetValidator(wxTextValidator(wxFILTER_DIGITS));
GetTextCtrl()->SetFont(::Label::Body_14);
Append(_L("End"));
Append(_L_CONTEXT("End", "Layer range"));
Append(_L("Customize"));
if (m_value_type == ValueType::End)
SetSelection(0);
@@ -45,7 +45,7 @@ LayerNumberTextInput::LayerNumberTextInput(wxWindow* parent, int layer_number, w
Bind(wxEVT_TEXT, [this](auto& evt) {
if (m_value_type == ValueType::End) {
// TextCtrl->SetValue() will generate a wxEVT_TEXT event
GetTextCtrl()->ChangeValue(_L("End"));
GetTextCtrl()->ChangeValue(_L_CONTEXT("End", "Layer range"));
return;
}
evt.Skip();
+52 -12
View File
@@ -14190,7 +14190,7 @@ void Plater::calib_temp(const Calib_Params& params) {
}
}
if (std::abs(nozzle_scale - 1.0) > EPSILON)
if (params.nozzle_based_resize && std::abs(nozzle_scale - 1.0) > EPSILON)
model().objects[0]->scale(nozzle_scale, nozzle_scale, nozzle_scale);
model().objects[0]->ensure_on_bed();
@@ -14198,7 +14198,9 @@ void Plater::calib_temp(const Calib_Params& params) {
printer_config->set_key_value("resonance_avoidance", new ConfigOptionBool{false});
set_config_values<int, ConfigOptionInts>(filament_config, "nozzle_temperature_initial_layer", (int) start_temp);
set_config_values<int, ConfigOptionInts>(filament_config, "nozzle_temperature", (int) start_temp);
model().objects[0]->config.set_key_value("layer_height", new ConfigOptionFloat(nozzle_diameter/2));
// When resizing is disabled the 0.4 mm / 0.2 mm reference model is printed as-is (preset layer height kept).
if (params.nozzle_based_resize)
model().objects[0]->config.set_key_value("layer_height", new ConfigOptionFloat(nozzle_diameter/2));
model().objects[0]->config.set_key_value("brim_type", new ConfigOptionEnum<BrimType>(btOuterOnly));
model().objects[0]->config.set_key_value("brim_width", new ConfigOptionFloat(5.0));
model().objects[0]->config.set_key_value("brim_object_gap", new ConfigOptionFloat(0.0));
@@ -14209,7 +14211,8 @@ void Plater::calib_temp(const Calib_Params& params) {
auto print_config = &wxGetApp().preset_bundle->prints.get_edited_preset().config;
print_config->set_key_value("enable_wrapping_detection", new ConfigOptionBool(false));
print_config->set_key_value("initial_layer_print_height", new ConfigOptionFloat(nozzle_diameter/2));
if (params.nozzle_based_resize)
print_config->set_key_value("initial_layer_print_height", new ConfigOptionFloat(nozzle_diameter/2));
changed_objects({ 0 });
@@ -14373,6 +14376,42 @@ void Plater::calib_VFA(const Calib_Params& params)
auto print_config = &wxGetApp().preset_bundle->prints.get_edited_preset().config;
auto filament_config = &wxGetApp().preset_bundle->filaments.get_edited_preset().config;
auto printer_config = &wxGetApp().preset_bundle->printers.get_edited_preset().config;
const ConfigOptionFloats* nozzle_diameter_config = printer_config->option<ConfigOptionFloats>("nozzle_diameter");
size_t nozzle_id = static_cast<size_t>(std::max(params.extruder_id, 0));
double nozzle_diameter = vfa_base_nozzle_diameter;
if (nozzle_diameter_config && !nozzle_diameter_config->values.empty()) {
nozzle_id = std::min(nozzle_id, nozzle_diameter_config->values.size() - 1);
nozzle_diameter = nozzle_diameter_config->values[nozzle_id];
}
if (nozzle_diameter <= 0.0)
nozzle_diameter = vfa_base_nozzle_diameter;
// Resolved layer height: use the (possibly auto-adjusted) value from the dialog, else default to nozzle/2.
double layer_height = params.vfa_layer_height > 0.0 ? params.vfa_layer_height : nozzle_diameter / 2.0;
// cut upper (on the unscaled model, using the base block height); the scaling below keeps the physical
// block height (vfa_layers_per_block * layer_height) in sync with the speed stepping in GCode::process_layer.
// Subtract EPSILON (as the temperature tower does) so the cut lands just below the flat block surface instead
// of exactly on it, which would otherwise add a degenerate extra layer.
auto obj_bb = model().objects[0]->bounding_box_exact();
auto height = vfa_base_block_height * ((params.end - params.start) / params.step + 1) - EPSILON;
if (height < obj_bb.size().z()) {
cut_horizontal(0, 0, height, ModelObjectCutAttribute::KeepLower);
}
// When resizing is enabled, XY scales with the nozzle (footprint / line width) and Z scales so each base
// block becomes vfa_layers_per_block layers of the resolved layer height. When disabled the 0.4 mm / 0.2 mm
// reference model is printed as-is (preset layer height kept).
if (params.nozzle_based_resize) {
const double xy_scale = nozzle_diameter / vfa_base_nozzle_diameter;
const double z_scale = (vfa_layers_per_block * layer_height) / vfa_base_block_height;
if (std::abs(xy_scale - 1.0) > EPSILON || std::abs(z_scale - 1.0) > EPSILON)
model().objects[0]->scale(xy_scale, xy_scale, z_scale);
}
model().objects[0]->ensure_on_bed();
printer_config->set_key_value("resonance_avoidance", new ConfigOptionBool{false});
filament_config->set_key_value("slow_down_layer_time", new ConfigOptionFloats { 0.0 });
set_config_values<bool, ConfigOptionBoolsNullable>(print_config, "enable_overhang_speed", false);
@@ -14386,6 +14425,10 @@ void Plater::calib_VFA(const Calib_Params& params)
print_config->set_key_value("spiral_mode", new ConfigOptionBool(true));
print_config->set_key_value("enable_wrapping_detection", new ConfigOptionBool(false));
print_config->set_key_value("precise_z_height", new ConfigOptionBool(false));
if (params.nozzle_based_resize) {
print_config->set_key_value("initial_layer_print_height", new ConfigOptionFloat(layer_height));
model().objects[0]->config.set_key_value("layer_height", new ConfigOptionFloat(layer_height));
}
model().objects[0]->config.set_key_value("brim_type", new ConfigOptionEnum<BrimType>(btOuterOnly));
model().objects[0]->config.set_key_value("brim_width", new ConfigOptionFloat(3.0));
model().objects[0]->config.set_key_value("brim_object_gap", new ConfigOptionFloat(0.0));
@@ -14396,14 +14439,11 @@ void Plater::calib_VFA(const Calib_Params& params)
wxGetApp().get_tab(Preset::TYPE_PRINT)->update_ui_from_settings();
wxGetApp().get_tab(Preset::TYPE_FILAMENT)->update_ui_from_settings();
// cut upper
auto obj_bb = model().objects[0]->bounding_box_exact();
auto height = 5 * ((params.end - params.start) / params.step + 1);
if (height < obj_bb.size().z()) {
cut_horizontal(0, 0, height, ModelObjectCutAttribute::KeepLower);
}
p->background_process.fff_print()->set_calib_params(params);
// Pass the resolved layer height on (only meaningful when resized). GCode's VFA stepping is layer-based, so
// it does not require it, but keep it consistent with the geometry.
Calib_Params calib_params = params;
calib_params.vfa_layer_height = params.nozzle_based_resize ? layer_height : 0.0;
p->background_process.fff_print()->set_calib_params(calib_params);
}
void Plater::calib_input_shaping_freq(const Calib_Params& params)
@@ -15101,7 +15141,7 @@ ProjectDropDialog::ProjectDropDialog(const std::string &filename)
m_sizer_main->Add(dlg_btns, 0, wxEXPAND);
SetSizer(m_sizer_main);
SetSizerAndFit(m_sizer_main);
Layout();
Fit();
Centre(wxBOTH);
+18 -36
View File
@@ -138,6 +138,9 @@ PluginDescriptor as_cloud_only_descriptor(PluginDescriptor descriptor)
descriptor.plugin_root.clear();
descriptor.entry_path.clear();
descriptor.installed_version.clear();
// No local package is left behind, so the package verdict and any load error it produced go with it.
descriptor.metadata_valid = false;
descriptor.clear_error();
if (descriptor.cloud.has_value()) {
descriptor.cloud->installed = false;
descriptor.cloud->update_available = false;
@@ -289,11 +292,10 @@ PluginAvailableActions evaluate_action_policy(const PluginDialogItem& item)
available_actions.context_actions.push_back(PluginContextAction{id, label, enabled, danger});
};
if (is_cloud) {
if (is_mine)
add_action("delete_mine_plugin", "Delete", true, true);
else
add_action("unsubscribe_plugin", "Unsubscribe", true, true);
// Owned cloud plugins fall through to the local delete: it removes the installed package only.
// Deleting a plugin from the cloud is a plugin hub operation and is never offered here.
if (is_cloud && !is_mine) {
add_action("unsubscribe_plugin", "Unsubscribe", true, true);
} else if (has_local) {
add_action("delete_plugin", "Delete", true, true);
}
@@ -742,8 +744,6 @@ void PluginsDialog::handle_plugin_menu_action(const std::string& plugin_key, con
delete_local_plugin(row_data);
} else if (action == "unsubscribe_plugin") {
unsubscribe_cloud_plugin(row_data);
} else if (action == "delete_mine_plugin") {
delete_mine_local_and_cloud_plugin(plugin_key);
} else if (action == "reload_plugin") {
reload_local_plugin(plugin_key, /*clear_cache=*/false);
} else if (action == "clear_cache_reload_plugin") {
@@ -1071,19 +1071,25 @@ void PluginsDialog::open_plugin_hub()
void PluginsDialog::delete_local_plugin(const PluginDescriptor& plugin)
{
const wxString plugin_name = from_u8(plugin.name);
const int rc = wxMessageBox(wxString::Format(_L("Delete plugin \"%s\"?\n\nThis permanently removes the plugin folder."), plugin_name),
kDeletePluginTitle, wxYES_NO | wxNO_DEFAULT | wxICON_WARNING, this);
const int rc = wxMessageBox(
wxString::Format(plugin.is_cloud_plugin() ?
_L("Delete plugin \"%s\"?\n\nThis removes the local plugin files. The plugin stays in the cloud "
"and can be reinstalled.") :
_L("Delete plugin \"%s\"?\n\nThis permanently removes the plugin folder."),
plugin_name),
kDeletePluginTitle, wxYES_NO | wxNO_DEFAULT | wxICON_WARNING, this);
restore_z_order();
if (rc != wxYES)
return;
auto state = std::make_shared<PluginOperationState>();
run_with_dialog(
[plugin_key = plugin.plugin_key, should_refresh = plugin.is_cloud_plugin(), state]() {
[plugin_key = plugin.plugin_key, cloud_row = as_cloud_only_descriptor(plugin), state]() {
std::string error;
const bool succeeded = PluginManager::instance().delete_plugin(plugin_key, error);
if (succeeded && should_refresh)
refresh_plugin_metadata_blocking(kFetchCloudMeta);
// Keep the cloud row listed so the plugin stays reinstallable without waiting on a cloud fetch.
if (succeeded && cloud_row.is_cloud_plugin())
PluginManager::instance().update_cloud_metadata(std::vector<PluginDescriptor>{cloud_row});
store_plugin_operation_result(state, succeeded, std::move(error));
},
[this, state, plugin_name]() {
@@ -1249,28 +1255,4 @@ void PluginsDialog::reinstall_cloud_plugin(const PluginDescriptor& plugin)
show_status(wxString::Format(_L("Reloaded \"%s\"."), plugin_display_name(plugin_key)), "success");
}
void PluginsDialog::delete_mine_local_and_cloud_plugin(const std::string& plugin_key)
{
PluginDescriptor descriptor;
const std::string display = get_descriptor(plugin_key, descriptor) ? descriptor.name : std::string{};
const wxString plugin_name = from_u8(display.empty() ? plugin_key : display);
const int rc = wxMessageBox(
wxString::Format(_L("Delete plugin \"%s\" from local and cloud?\n\nThis permanently removes the local plugin files and "
"deletes the plugin from the cloud. This action cannot be undone."),
plugin_name),
kDeletePluginTitle, wxYES_NO | wxNO_DEFAULT | wxICON_WARNING, this);
restore_z_order();
if (rc != wxYES)
return;
std::string error;
if (!PluginManager::instance().delete_mine_local_and_cloud_plugin(plugin_key, error)) {
show_status(error.empty() ? _L("Failed to delete plugin from local and cloud.") : from_u8(error), "error");
return;
}
send_plugins();
show_status(wxString::Format(_L("Deleted \"%s\"."), plugin_name), "success");
}
}} // namespace Slic3r::GUI
-1
View File
@@ -98,7 +98,6 @@ private:
void unsubscribe_cloud_plugin(const Slic3r::PluginDescriptor& plugin);
void reload_local_plugin(const std::string& plugin_key, bool clear_cache);
void reinstall_cloud_plugin(const Slic3r::PluginDescriptor& plugin);
void delete_mine_local_and_cloud_plugin(const std::string& plugin_key);
// In the future, we can allow users to choose which plugin version they want to install.
template<typename Run, typename OnFinish>
+1 -1
View File
@@ -1234,7 +1234,7 @@ PrintHostQueueDialog::PrintHostQueueDialog(wxWindow *parent)
job_list->AppendProgressColumn(_L("Progress"), wxDATAVIEW_CELL_INERT, widths[1], wxALIGN_LEFT, wxDATAVIEW_COL_RESIZABLE | wxDATAVIEW_COL_SORTABLE);
append_text_column(_L("Status"),widths[2]);
append_text_column(_L("Host"), widths[3]);
append_text_column(_CTX(L_CONTEXT("Size", "OfFile"), "OfFile"), widths[4]);
append_text_column(_L_CONTEXT(L_CONTEXT("Size", "OfFile"), "OfFile"), widths[4]);
append_text_column(_L("Filename"), widths[5]);
append_text_column(_L("Message"), widths[6]);
//append_text_column(_L("Error Message"), -1, wxALIGN_CENTER, wxDATAVIEW_COL_HIDDEN);
+15 -16
View File
@@ -28,7 +28,7 @@ PrintOptionsDialog::PrintOptionsDialog(wxWindow* parent)
{
this->SetDoubleBuffered(true);
SetBackgroundColour(*wxWHITE);
SetSize(FromDIP(480),FromDIP(520));
// SetMinSize(FromDIP(wxSize{wxDefaultCoord,520}));
m_scrollwindow = new wxScrolledWindow(this, wxID_ANY);
@@ -50,7 +50,8 @@ PrintOptionsDialog::PrintOptionsDialog(wxWindow* parent)
m_scrollwindow->FitInside();
this->Layout();
// mainSizer->Fit(this);
mainSizer->SetMinSize(wxDefaultCoord, FromDIP(520));
mainSizer->Fit(this);
//this->Fit();
m_cb_ai_monitoring->Bind(wxEVT_TOGGLEBUTTON, [this](wxCommandEvent &evt) {
@@ -1469,7 +1470,7 @@ PrinterPartsDialog::PrinterPartsDialog(wxWindow* parent)
//nozzle type
wxBoxSizer* line_sizer_nozzle_type = new wxBoxSizer(wxHORIZONTAL);
auto nozzle_type = new Label(single_panel, _CTX(L_CONTEXT("Type", "Nozzle Type"), "Nozzle Type"));
auto nozzle_type = new Label(single_panel, _L_CONTEXT(L_CONTEXT("Type", "Nozzle Type"), "Nozzle Type"));
nozzle_type->SetFont(Label::Body_14);
nozzle_type->SetMinSize(wxSize(FromDIP(180), -1));
nozzle_type->SetMaxSize(wxSize(FromDIP(180), -1));
@@ -1485,7 +1486,7 @@ PrinterPartsDialog::PrinterPartsDialog(wxWindow* parent)
//nozzle diameter
wxBoxSizer* line_sizer_nozzle_diameter = new wxBoxSizer(wxHORIZONTAL);
auto nozzle_diameter = new Label(single_panel, _CTX(L_CONTEXT("Diameter", "Nozzle Diameter"), "Nozzle Diameter"));
auto nozzle_diameter = new Label(single_panel, _L_CONTEXT(L_CONTEXT("Diameter", "Nozzle Diameter"), "Nozzle Diameter"));
nozzle_diameter->SetFont(Label::Body_14);
nozzle_diameter->SetMinSize(wxSize(FromDIP(180), -1));
nozzle_diameter->SetMaxSize(wxSize(FromDIP(180), -1));
@@ -1500,7 +1501,7 @@ PrinterPartsDialog::PrinterPartsDialog(wxWindow* parent)
//nozzle flow type
wxBoxSizer* line_sizer_nozzle_flowtype = new wxBoxSizer(wxHORIZONTAL);
nozzle_flow_type_label = new Label(single_panel, _CTX(L_CONTEXT("Flow", "Nozzle Flow"), "Nozzle Flow"));
nozzle_flow_type_label = new Label(single_panel, _L_CONTEXT(L_CONTEXT("Flow", "Nozzle Flow"), "Nozzle Flow"));
nozzle_flow_type_label->SetFont(Label::Body_14);
nozzle_flow_type_label->SetMinSize(wxSize(FromDIP(180), -1));
nozzle_flow_type_label->SetMaxSize(wxSize(FromDIP(180), -1));
@@ -1563,18 +1564,18 @@ PrinterPartsDialog::PrinterPartsDialog(wxWindow* parent)
leftTitle->SetForegroundColour(StateColor::darkModeColorFor(wxColour("#2C2C2E")));
wxBoxSizer *multiple_left_line_sizer = new wxBoxSizer(wxHORIZONTAL);
auto multiple_left_nozzle_type = new Label(multiple_panel, _CTX(L_CONTEXT("Type", "Nozzle Type"), "Nozzle Type"));
auto multiple_left_nozzle_type = new Label(multiple_panel, _L_CONTEXT(L_CONTEXT("Type", "Nozzle Type"), "Nozzle Type"));
multiple_left_nozzle_type->SetFont(Label::Body_14);
multiple_left_nozzle_type->SetForegroundColour(STATIC_TEXT_CAPTION_COL);
multiple_left_nozzle_type_checkbox = new ComboBox(multiple_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(FromDIP(180), -1), 0, NULL, wxCB_READONLY);
auto multiple_left_nozzle_diameter = new Label(multiple_panel, _CTX(L_CONTEXT("Diameter", "Nozzle Diameter"), "Nozzle Diameter"));
auto multiple_left_nozzle_diameter = new Label(multiple_panel, _L_CONTEXT(L_CONTEXT("Diameter", "Nozzle Diameter"), "Nozzle Diameter"));
multiple_left_nozzle_diameter->SetFont(Label::Body_14);
multiple_left_nozzle_diameter->SetForegroundColour(STATIC_TEXT_CAPTION_COL);
multiple_left_nozzle_diameter_checkbox = new ComboBox(multiple_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(FromDIP(140), -1), 0, NULL, wxCB_READONLY);
auto multiple_left_nozzle_flow = new Label(multiple_panel, _CTX(L_CONTEXT("Flow", "Nozzle Flow"), "Nozzle Flow"));
auto multiple_left_nozzle_flow = new Label(multiple_panel, _L_CONTEXT(L_CONTEXT("Flow", "Nozzle Flow"), "Nozzle Flow"));
multiple_left_nozzle_flow->SetFont(Label::Body_14);
multiple_left_nozzle_flow->SetForegroundColour(STATIC_TEXT_CAPTION_COL);
multiple_left_nozzle_flow_checkbox = new ComboBox(multiple_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(FromDIP(140), -1), 0, NULL, wxCB_READONLY);
@@ -1597,18 +1598,18 @@ PrinterPartsDialog::PrinterPartsDialog(wxWindow* parent)
rightTitle->SetForegroundColour(StateColor::darkModeColorFor(wxColour("#2C2C2E")));
wxBoxSizer *multiple_right_line_sizer = new wxBoxSizer(wxHORIZONTAL);
auto multiple_right_nozzle_type = new Label(multiple_panel, _CTX(L_CONTEXT("Type", "Nozzle Type"), "Nozzle Type"));
auto multiple_right_nozzle_type = new Label(multiple_panel, _L_CONTEXT(L_CONTEXT("Type", "Nozzle Type"), "Nozzle Type"));
multiple_right_nozzle_type->SetFont(Label::Body_14);
multiple_right_nozzle_type->SetForegroundColour(STATIC_TEXT_CAPTION_COL);
multiple_right_nozzle_type_checkbox = new ComboBox(multiple_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(FromDIP(180), -1), 0, NULL, wxCB_READONLY);
auto multiple_right_nozzle_diameter = new Label(multiple_panel, _CTX(L_CONTEXT("Diameter", "Nozzle Diameter"), "Nozzle Diameter"));
auto multiple_right_nozzle_diameter = new Label(multiple_panel, _L_CONTEXT(L_CONTEXT("Diameter", "Nozzle Diameter"), "Nozzle Diameter"));
multiple_right_nozzle_diameter->SetFont(Label::Body_14);
multiple_right_nozzle_diameter->SetForegroundColour(STATIC_TEXT_CAPTION_COL);
multiple_right_nozzle_diameter_checkbox = new ComboBox(multiple_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(FromDIP(140), -1), 0, NULL, wxCB_READONLY);
auto multiple_right_nozzle_flow = new Label(multiple_panel, _CTX(L_CONTEXT("Flow", "Nozzle Flow"), "Nozzle Flow"));
auto multiple_right_nozzle_flow = new Label(multiple_panel, _L_CONTEXT(L_CONTEXT("Flow", "Nozzle Flow"), "Nozzle Flow"));
multiple_right_nozzle_flow->SetFont(Label::Body_14);
multiple_right_nozzle_flow->SetForegroundColour(STATIC_TEXT_CAPTION_COL);
multiple_right_nozzle_flow_checkbox = new ComboBox(multiple_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(FromDIP(140), -1), 0, NULL, wxCB_READONLY);
@@ -1670,12 +1671,9 @@ PrinterPartsDialog::PrinterPartsDialog(wxWindow* parent)
/*inset data*/
sizer->Add(single_panel, 0, wxEXPAND, 0);
sizer->Add(multiple_panel, 0, wxEXPAND, 0);
SetSizer(sizer);
Layout();
Fit();
single_panel->Hide();
SetSizerAndFit(sizer);
Layout();
wxGetApp().UpdateDlgDarkUI(this);
}
@@ -1752,6 +1750,7 @@ bool PrinterPartsDialog::Show(bool show)
}
}
GetSizer()->SetSizeHints(this);
Layout();
Fit();
}
+1 -1
View File
@@ -119,7 +119,7 @@ PublishDialog::PublishDialog(Plater *plater)
top_sizer->Add(m_main_sizer, 1, wxALL | wxEXPAND, 0);
top_sizer->Add(FromDIP(30), 0, 0, wxEXPAND, 0);
this->SetSizer(top_sizer);
this->SetSizerAndFit(top_sizer);
this->Layout();
this->Centre(wxBOTH);
+1 -1
View File
@@ -274,7 +274,7 @@ void SavePresetDialog::build(std::vector<Preset::Type> types, std::string suffix
SetBackgroundColour(SAVE_PRESET_DIALOG_DEF_COLOUR);
SetFont(wxGetApp().normal_font());
if (suffix.empty()) suffix = _CTX_utf8(L_CONTEXT("Copy", "PresetName"), "PresetName");
if (suffix.empty()) suffix = _u8L_CONTEXT(L_CONTEXT("Copy", "PresetName"), "PresetName");
wxBoxSizer *m_Sizer_main = new wxBoxSizer(wxVERTICAL);
+1 -1
View File
@@ -157,7 +157,7 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater)
/*mode switch*/
/*auto m_sizer_mode_switch = new wxBoxSizer(wxHORIZONTAL);
m_mode_print = new SendModeSwitchButton(scroll_area, _CTX("Print", "Verb"), true);
m_mode_print = new SendModeSwitchButton(scroll_area, _L_CONTEXT("Print", "Verb"), true);
m_mode_send = new SendModeSwitchButton(scroll_area,_L("Save to printer"), false);
m_sizer_mode_switch->Add(m_mode_print, 0, wxALIGN_CENTER, 0);
m_sizer_mode_switch->Add(0, 0, 0, wxLEFT, FromDIP(8));
+2 -2
View File
@@ -358,7 +358,7 @@ ExtruderSwithingStatus::ExtruderSwithingStatus(wxWindow *parent)
{ m_switching_status_label->SetBackgroundColour(parent->GetBackgroundColour());
}
m_button_quit = new Button(this, _CTX(L_CONTEXT("Quit", "Quit_Switching"), "Quit_Switching"), "", 0, FromDIP(22));
m_button_quit = new Button(this, _L_CONTEXT(L_CONTEXT("Quit", "Quit_Switching"), "Quit_Switching"), "", 0, FromDIP(22));
m_button_quit->SetStyle(ButtonStyle::Regular, ButtonType::Window);
m_button_quit->Bind(wxEVT_BUTTON, &ExtruderSwithingStatus::on_quit, this);
@@ -1986,7 +1986,7 @@ wxBoxSizer *StatusBasePanel::create_extruder_control(wxWindow *parent)
StateColor e_ctrl_bg(std::pair<wxColour, int>(BUTTON_PRESS_COL, StateColor::Pressed), std::pair<wxColour, int>(BUTTON_NORMAL1_COL, StateColor::Normal));
StateColor e_ctrl_bd(std::pair<wxColour, int>(BUTTON_HOVER_COL, StateColor::Hovered), std::pair<wxColour, int>(BUTTON_NORMAL1_COL, StateColor::Normal));
m_nozzle_btn_panel = new SwitchBoard(panel, _L("Left"), _L("Right"), wxSize(FromDIP(126), FromDIP(26)));
m_nozzle_btn_panel = new SwitchBoard(panel, _L_CONTEXT("Left", "Nozzle position"), _L_CONTEXT("Right", "Nozzle position"), wxSize(FromDIP(126), FromDIP(26)));
m_nozzle_btn_panel->SetAutoDisableWhenSwitch();
m_bpButton_e_10 = new Button(panel, "", "monitor_extruder_up", 0, 22); // Orca Dont scale icon size
+1 -2
View File
@@ -310,10 +310,9 @@ StepMeshDialog::StepMeshDialog(wxWindow* parent, Slic3r::Step& file, double line
bSizer->Add(bSizer_button, 1, wxEXPAND);
this->SetSizer(bSizer);
this->SetSizerAndFit(bSizer);
update_mesh_number_text();
this->Layout();
bSizer->Fit(this);
this->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {
SetFocusIgnoringChildren();
+6 -6
View File
@@ -283,7 +283,7 @@ wxBoxSizer *SyncAmsInfoDialog::create_sizer_thumbnail(wxButton *image_button, bo
auto sizer_thumbnail = new wxBoxSizer(wxVERTICAL);
if (left) {
wxBoxSizer *text_sizer = new wxBoxSizer(wxHORIZONTAL);
auto sync_text = new Label(image_button->GetParent(), _CTX(L_CONTEXT("Original", "Sync_AMS"), "Sync_AMS"));
auto sync_text = new Label(image_button->GetParent(), _L_CONTEXT(L_CONTEXT("Original", "Sync_AMS"), "Sync_AMS"));
sync_text->SetForegroundColour(StateColor::darkModeColorFor(wxColour("#363636"))); // ORCA match label colors
text_sizer->Add(sync_text, 0, wxALIGN_CENTER | wxALL, 0);
sizer_thumbnail->Add(sync_text, FromDIP(0), wxALIGN_CENTER | wxALL, FromDIP(4));
@@ -550,7 +550,7 @@ void SyncAmsInfoDialog::add_two_image_control()
m_choose_plate_sizer = new wxBoxSizer(wxHORIZONTAL);
m_choose_plate_sizer->AddStretchSpacer();
wxStaticText *chose_combox_title = new wxStaticText(m_two_thumbnail_panel, wxID_ANY, _CTX(L_CONTEXT("Plate", "Sync_AMS"), "Sync_AMS"));
wxStaticText *chose_combox_title = new wxStaticText(m_two_thumbnail_panel, wxID_ANY, _L_CONTEXT(L_CONTEXT("Plate", "Sync_AMS"), "Sync_AMS"));
m_choose_plate_sizer->Add(chose_combox_title, 0, wxEXPAND | wxTOP, FromDIP(6));
m_choose_plate_sizer->AddSpacer(FromDIP(10));
@@ -2598,7 +2598,7 @@ void SyncAmsInfoDialog::reset_and_sync_ams_list()
if (is_first_row) {
is_first_row = false;
if (!m_original_in_colormap) {
m_original_in_colormap = new wxStaticText(m_filament_panel, wxID_ANY, _CTX(L_CONTEXT("Original", "Sync_AMS"), "Sync_AMS") + ":");
m_original_in_colormap = new wxStaticText(m_filament_panel, wxID_ANY, _L_CONTEXT(L_CONTEXT("Original", "Sync_AMS"), "Sync_AMS") + ":");
m_original_in_colormap->SetForegroundColour(StateColor::darkModeColorFor(wxColour("#363636"))); // ORCA match label colors
m_original_in_colormap->SetFont(::Label::Head_12);
}
@@ -2816,7 +2816,7 @@ void SyncAmsInfoDialog::generate_override_fix_ams_list()
if (is_first_row) {
is_first_row = false;
if (!m_original_in_override) {
m_original_in_override = new wxStaticText(m_fix_filament_panel, wxID_ANY, _CTX(L_CONTEXT("Original", "Sync_AMS"), "Sync_AMS") + ":");
m_original_in_override = new wxStaticText(m_fix_filament_panel, wxID_ANY, _L_CONTEXT(L_CONTEXT("Original", "Sync_AMS"), "Sync_AMS") + ":");
m_original_in_override->SetForegroundColour(StateColor::darkModeColorFor(wxColour("#363636"))); // ORCA match label colors
m_original_in_override->SetFont(::Label::Head_12);
}
@@ -3218,7 +3218,7 @@ SyncNozzleAndAmsDialog::SyncNozzleAndAmsDialog(InputInfo &input_info)
_L("Successfully synchronized nozzle and AMS number information.")
) + "\n\n" + _L("Do you want to continue to sync filaments?"),
_L("Yes"), // ORCA use shorter text for buttons
_CTX(L_CONTEXT(_L("No"), "Sync_Nozzle_AMS"), "Sync_Nozzle_AMS"),
_L_CONTEXT(L_CONTEXT(_L("No"), "Sync_Nozzle_AMS"), "Sync_Nozzle_AMS"),
DisappearanceMode::TimedDisappearance)
, m_input_info(input_info)
{
@@ -3266,7 +3266,7 @@ FinishSyncAmsDialog::FinishSyncAmsDialog(InputInfo &input_info)
wxGetApp().app_config->get("sync_ams_filament_mode") == "1" ?
_L("Successfully synchronized filament color from printer.") :
_L("Successfully synchronized color and type of filament from printer."),
_CTX(L_CONTEXT("OK", "FinishSyncAms"), "FinishSyncAms"),
_L_CONTEXT(L_CONTEXT("OK", "FinishSyncAms"), "FinishSyncAms"),
"",
DisappearanceMode::TimedDisappearance)
, m_input_info(input_info)
+12 -9
View File
@@ -1796,7 +1796,7 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value)
// Keep this preset's "plugins" manifest in sync when a plugin picker changes, so full_config() and
// save_to_json() always find resolved "name;uuid;capability" references and rebuild it nowhere else.
// Also drop any plugin_config_overrides entries for a capability the change just stopped
// Also drop any plugin config override entries for a capability the change just stopped
// referencing (e.g. a plugin removed from slicing_pipeline_plugin), so a saved preset never
// carries configuration for a capability it no longer names. The Configure button is a separate
// field holding its own cached copy of that value, so it needs to be told explicitly, or it
@@ -1804,9 +1804,10 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value)
if (const ConfigOptionDef* opt_def = m_config->def()->get(opt_key);
opt_def && opt_def->is_plugin_backed()) {
m_config->update_plugin_manifest();
if (prune_stale_plugin_overrides(*m_config)) {
if (Field* overrides_field = get_field(PLUGIN_OVERRIDES_OPTION_KEY))
overrides_field->set_value(boost::any(m_config->opt_string(PLUGIN_OVERRIDES_OPTION_KEY)), false);
const std::string overrides_key = Preset::plugin_overrides_key(m_type);
if (prune_stale_plugin_overrides(*m_config, overrides_key)) {
if (Field* overrides_field = get_field(overrides_key))
overrides_field->set_value(boost::any(m_config->opt_string(overrides_key)), false);
}
}
@@ -3136,7 +3137,7 @@ void TabPrint::build()
// Its own group: the one above hides its labels, and this row needs its label — and the revert
// arrow beside it — to show. No label-width override either, as a 0 there means "no label column".
optgroup = page->new_optgroup(L("Plugin Configuration"), L"param_gcode");
optgroup->append_single_option_line("plugin_config_overrides");
optgroup->append_single_option_line("print_plugin_config_overrides");
optgroup = page->new_optgroup(L("Notes"), "note", 0);
option = optgroup->get_option("notes");
@@ -4552,7 +4553,7 @@ void TabFilament::build()
optgroup->append_single_option_line(option);
optgroup = page->new_optgroup(L("Plugin Configuration"), L"param_gcode");
optgroup->append_single_option_line("plugin_config_overrides");
optgroup->append_single_option_line("filament_plugin_config_overrides");
page = add_options_page(L("Multimaterial"), "custom-gcode_multi_material"); // ORCA: icon only visible on placeholders
optgroup = page->new_optgroup(L("Wipe tower parameters"), "param_tower");
@@ -5061,7 +5062,7 @@ void TabPrinter::build_fff()
optgroup->append_single_option_line("time_cost", "printer_basic_information_advanced#time-cost");
optgroup = page->new_optgroup(L("Plugin Configuration"), L"param_gcode");
optgroup->append_single_option_line("plugin_config_overrides");
optgroup->append_single_option_line("printer_plugin_config_overrides");
optgroup = page->new_optgroup(L("Cooling Fan"), "param_cooling_fan");
Line line = Line{ L("Fan speed-up time"), optgroup->get_option("fan_speedup_time").opt.tooltip };
@@ -7958,7 +7959,7 @@ bool Tab::validate_filament_temperature_pairs()
RichMessageDialog dialog(parent(), msg_text, _L("Temperature Safety Check"), wxYES | wxNO | wxICON_WARNING);
dialog.SetButtonLabel(wxID_YES, _L("Continue"), true);
dialog.SetButtonLabel(wxID_NO, _CTX("Back", "Navigation"));
dialog.SetButtonLabel(wxID_NO, _L_CONTEXT("Back", "Navigation"));
dialog.ShowCheckBox(_L("Don't warn again for this preset"));
const int answer = dialog.ShowModal();
// Session-only suppression (does not modify/save filament preset data).
@@ -7999,7 +8000,9 @@ void Tab::update_extruder_variants(int extruder_id, bool reload)
m_actual_nozzle_volumes.resize(extruder_nums, NozzleVolumeType::nvtStandard);
for (int i = 0; i < extruder_nums; i++) m_actual_nozzle_volumes[i] = (NozzleVolumeType)nozzle_volumes->values[i];
if (extruder_nums == 2) {
// Orca: a non-Bambu dual-nozzle printer has two extruders but a single variant column, so
// the nozzle switch and sync button have nothing to act on. Only enable with real variants.
if (extruder_nums == 2 && m_preset_bundle->support_different_extruders()) {
auto options = generate_extruder_options();
m_extruder_switch->SetOptions(options);
+1 -1
View File
@@ -354,7 +354,7 @@ TroubleshootDialog::TroubleshootDialog()
m_sizer->AddSpacer(FromDIP(20));
m_sizer->Add(right_sizer, 0, wxEXPAND | wxTOP | wxBOTTOM | wxRIGHT, FromDIP(15));
SetSizer(m_sizer);
SetSizerAndFit(m_sizer);
Layout();
Fit();
CenterOnParent();
+3
View File
@@ -168,6 +168,9 @@ private:
}
wxClientDC dc(this);
int cWidth = GetClientSize().GetWidth();
// Don't compute/commit a size based on a not-yet-laid-out width
// Mirrors the guard in OnPaint() so both use the same wrap results
if (cWidth < 50) return;
int y = 0;
for (size_t i = 0; i < m_lines.size(); ++i) {
+7 -6
View File
@@ -773,7 +773,7 @@ std::vector<std::string> DiffViewCtrl::selected_options()
static std::string none{"none"};
#define UNSAVE_CHANGE_DIALOG_SCROLL_WINDOW_SIZE wxSize(FromDIP(490), FromDIP(374))
#define UNSAVE_CHANGE_DIALOG_ACTION_LINE_SIZE wxSize(FromDIP(490), FromDIP(60))
#define UNSAVE_CHANGE_DIALOG_ACTION_LINE_SIZE wxSize(FromDIP(490), -1)
#define UNSAVE_CHANGE_DIALOG_FIRST_VALUE_WIDTH FromDIP(190)
#define UNSAVE_CHANGE_DIALOG_VALUE_WIDTH FromDIP(150)
#define UNSAVE_CHANGE_DIALOG_ITEM_HEIGHT FromDIP(24)
@@ -1075,11 +1075,6 @@ void UnsavedChangesDialog::build(Preset::Type type, PresetCollection *dependent_
m_sizer_main->Add(m_sizer_button, 0, wxEXPAND | wxTOP, 6);
m_sizer_main->Add(0, 0, 1, wxTOP, 18);
SetSizer(m_sizer_main);
Layout();
Fit();
Centre(wxBOTH);
if (params) {
if (params->left_to_right)
update_tree(type, params->config, params->from, params->to);
@@ -1095,6 +1090,11 @@ void UnsavedChangesDialog::build(Preset::Type type, PresetCollection *dependent_
//topSizer->SetSizeHints(this);
show_info_line(Action::Undef);
SetSizerAndFit(m_sizer_main);
Layout();
Fit();
// Centre(wxBOTH);
}
void UnsavedChangesDialog::show_info_line(Action action, std::string preset_name)
@@ -1499,6 +1499,7 @@ void UnsavedChangesDialog::update(Preset::Type type, PresetCollection* dependent
}
m_action_line->SetLabel(action_msg);
m_action_line->Wrap(UNSAVE_CHANGE_DIALOG_SCROLL_WINDOW_SIZE.x);
update_tree(type, presets);
update_list();
+1 -2
View File
@@ -213,9 +213,8 @@ MsgUpdateConfig::MsgUpdateConfig(const std::vector<Update> &updates, bool force_
m_scrollwindw_release_note->Layout();
SetSizer(m_sizer_main);
SetSizerAndFit(m_sizer_main);
Layout();
m_sizer_main->Fit(this);
Centre(wxBOTH);
wxGetApp().UpdateDlgDarkUI(this);
+1 -1
View File
@@ -47,7 +47,7 @@ WebViewPanel::WebViewPanel(wxWindow *parent)
// Create the button
bSizer_toolbar = new wxBoxSizer(wxHORIZONTAL);
m_button_back = new wxButton(this, wxID_ANY, _CTX("Back", "Navigation"), wxDefaultPosition, wxDefaultSize, 0);
m_button_back = new wxButton(this, wxID_ANY, _L_CONTEXT("Back", "Navigation"), wxDefaultPosition, wxDefaultSize, 0);
m_button_back->Enable(false);
bSizer_toolbar->Add(m_button_back, 0, wxALL, 5);
+7
View File
@@ -72,6 +72,13 @@ public:
void SetTextColorNormal(wxColor const &color);
void SetSelected(bool selected = true) { m_selected = selected; }
// Only meant to be used by inspector, not public API
ButtonStyle GetStyle() const { return m_style; }
ButtonType GetType() const { return m_type; }
bool IsSelected() const { return m_selected; }
bool Enable(bool enable = true) override;
void EnableTooltipEvenDisabled();// The tip will be shown even if the button is disabled
+3
View File
@@ -15,6 +15,9 @@ public:
void SetHalfChecked(bool value = true);
// Only meant to be used by inspector, not public API
bool IsHalfChecked() const { return m_half_checked; }
void Rescale();
#ifdef __WXOSX__
+2 -2
View File
@@ -1031,13 +1031,13 @@ wxString FanControlPopupNew::get_fan_func_name(int mode, int submode, AIR_FUN fu
L_CONTEXT("Right(Aux)", "air_duct");
L_CONTEXT("Right(Filter)", "air_duct");
L_CONTEXT("Left(Aux)", "air_duct");
return _CTX(func_text, "air_duct");
return _L_CONTEXT(func_text, "air_duct");
}
}
static std::map<AIR_FUN, wxString> s_fan_func_name
{
{ AIR_FUN::FAN_HEAT_BREAK_0_IDX, _L("Hotend") },
{ AIR_FUN::FAN_HEAT_BREAK_0_IDX, _L_CONTEXT("Hotend", "Hotend Heat Breaker Fan") },
{ AIR_FUN::FAN_COOLING_0_AIRDOOR, _L("Parts") },
{ AIR_FUN::FAN_REMOTE_COOLING_0_IDX, _L("Aux") },
{ AIR_FUN::FAN_CHAMBER_0_IDX, _L("Exhaust") },
@@ -46,6 +46,12 @@ public:
bool Enable(bool enable) override;
// Only meant to be used by inspector, not public API
int GetCornerRadius() const { return m_radius; }
int GetBorderWidth() const { return m_border_width; }
StateColor GetBorderColor() const { return border_color; }
float GetScale() const { return m_scale; }
private:
void PickDC(wxDC& dc);
+3
View File
@@ -43,6 +43,9 @@ public:
void SetCornerRadius(double radius);
// Only meant to be used by inspector, not public API
int GetCornerRadius() const { return static_cast<int>(radius); }
void SetLabel(const wxString& label);
void SetStaticTips(const wxString& tips, const wxBitmap& bitmap);
+169
View File
@@ -8,7 +8,9 @@
#include "Widgets/HyperLink.hpp"
#include <string>
#include <vector>
#include <cmath>
#include "libslic3r/PrintConfig.hpp"
#include "libslic3r/Flow.hpp"
#include "libslic3r/Utils.hpp"
namespace Slic3r { namespace GUI {
@@ -34,6 +36,23 @@ int GetTextMax(wxWindow* parent, const std::vector<wxString>& labels)
return text_size.x + parent->FromDIP(10);
}
CheckBox* add_scale_checkbox(wxWindow* parent, wxSizer* settings_sizer)
{
auto row = new wxBoxSizer(wxHORIZONTAL);
auto cb = new CheckBox(parent);
cb->SetValue(true);
auto text = new wxStaticText(parent, wxID_ANY, _L("Auto-scale for nozzle"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
cb->SetToolTip(_L("This model is designed around a 0.4 mm nozzle with a 0.2 mm layer height. \n"
"When the scaling option is enabled (recommended), it dynamically resizes to match your current nozzle diameter"
" and an appropriate layer height, making the test both accurate and easy to read.\n"
"Turn scaling off only if you wish to print the reference model exactly as-is."));
text->SetToolTip(cb->GetToolTipText());
row->Add(cb , 0, wxALL | wxALIGN_CENTER_VERTICAL, parent->FromDIP(2));
row->Add(text, 0, wxALL | wxALIGN_CENTER_VERTICAL, parent->FromDIP(2));
settings_sizer->Add(row, 0, wxLEFT | wxTOP, parent->FromDIP(3));
return cb;
}
std::vector<std::string> get_shaper_type_values()
{
if (auto* preset_bundle = wxGetApp().preset_bundle) {
@@ -402,6 +421,9 @@ Temp_Calibration_Dlg::Temp_Calibration_Dlg(wxWindow* parent, wxWindowID id, Plat
temp_step_sizer->Add(m_tiStep , 0, wxALL | wxALIGN_CENTER_VERTICAL, FromDIP(2));
settings_sizer->Add(temp_step_sizer, 0, wxLEFT, FromDIP(3));
// Resize the model to the nozzle diameter (recommended)
m_cbResize = add_scale_checkbox(this, settings_sizer);
settings_sizer->AddSpacer(FromDIP(5));
v_sizer->Add(settings_sizer, 0, wxTOP | wxRIGHT | wxLEFT | wxEXPAND, FromDIP(10));
@@ -475,6 +497,7 @@ void Temp_Calibration_Dlg::on_start(wxCommandEvent& event) {
}
m_params.start = start;
m_params.end = end;
m_params.nozzle_based_resize = m_cbResize->GetValue();
m_params.mode = CalibMode::Calib_Temp_Tower;
m_plater->calib_temp(m_params);
EndModal(wxID_OK);
@@ -691,6 +714,22 @@ VFA_Test_Dlg::VFA_Test_Dlg(wxWindow* parent, wxWindowID id, Plater* plater)
vol_step_sizer->Add(m_tiStep , 0, wxALL | wxALIGN_CENTER_VERTICAL, FromDIP(2));
settings_sizer->Add(vol_step_sizer, 0, wxLEFT, FromDIP(3));
// Resize the model to the nozzle diameter (recommended)
m_cbResize = add_scale_checkbox(this, settings_sizer);
// Auto-adjust parameters to the filament's max volumetric speed
auto auto_adjust_sizer = new wxBoxSizer(wxHORIZONTAL);
m_cbAutoAdjust = new CheckBox(this);
m_cbAutoAdjust->SetValue(true);
auto auto_adjust_text = new wxStaticText(this, wxID_ANY, _L("Auto-adjust to max volumetric speed"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
m_cbAutoAdjust->SetToolTip(_L("If the end speed would exceed the filament's maximum volumetric speed, automatically lower the layer "
"height (keeping standard values and staying within the machine's limits) to reach it. If even the "
"minimum layer height is not enough, lower the end speed instead."));
auto_adjust_text->SetToolTip(m_cbAutoAdjust->GetToolTipText());
auto_adjust_sizer->Add(m_cbAutoAdjust , 0, wxALL | wxALIGN_CENTER_VERTICAL, FromDIP(2));
auto_adjust_sizer->Add(auto_adjust_text, 0, wxALL | wxALIGN_CENTER_VERTICAL, FromDIP(2));
settings_sizer->Add(auto_adjust_sizer, 0, wxLEFT | wxTOP, FromDIP(3));
settings_sizer->AddSpacer(FromDIP(5));
v_sizer->Add(settings_sizer, 0, wxTOP | wxRIGHT | wxLEFT | wxEXPAND, FromDIP(10));
@@ -732,6 +771,136 @@ void VFA_Test_Dlg::on_start(wxCommandEvent& event)
return;
}
// If the requested end speed would exceed the filament's maximum volumetric speed, the slicer clamps the
// outer wall speed, so the upper blocks of the tower would all print at the same (clamped) speed instead of
// the requested one. Depending on the "Auto-adjust" option, either fix it automatically or just warn.
m_params.vfa_layer_height = 0.0; // 0 = auto (nozzle/2); overridden below when auto-adjusting
m_params.nozzle_based_resize = m_cbResize->GetValue();
if (const auto* preset_bundle = wxGetApp().preset_bundle) {
const auto& printer_config = preset_bundle->printers.get_edited_preset().config;
const auto& print_config = preset_bundle->prints.get_edited_preset().config;
const auto& filament_config = preset_bundle->filaments.get_edited_preset().config;
const int extruder_id = std::max(m_params.extruder_id, 0);
auto get_at = [extruder_id](const ConfigOptionFloats* opt, double fallback) {
if (opt == nullptr || opt->values.empty())
return fallback;
return opt->values[std::min(static_cast<size_t>(extruder_id), opt->values.size() - 1)];
};
const double nozzle_diameter = get_at(printer_config.option<ConfigOptionFloats>("nozzle_diameter"), vfa_base_nozzle_diameter);
double preset_lh = nozzle_diameter / 2.0;
if (const auto* lh_opt = print_config.option<ConfigOptionFloat>("layer_height"))
if (lh_opt->value > 0.0)
preset_lh = lh_opt->value;
// Layer height the tower will actually print at: nozzle/2 when resizing, else the preset value.
const double default_lh = m_params.nozzle_based_resize ? nozzle_diameter / 2.0 : preset_lh;
const double max_vol_speed = get_at(filament_config.option<ConfigOptionFloats>("filament_max_volumetric_speed"), 0.0);
const double machine_min_lh = get_at(printer_config.option<ConfigOptionFloats>("min_layer_height"), 0.0);
const double machine_max_lh = get_at(printer_config.option<ConfigOptionFloats>("max_layer_height"), 0.0);
double line_width = print_config.get_abs_value("outer_wall_line_width", nozzle_diameter);
if (line_width <= 0.0)
line_width = print_config.get_abs_value("line_width", nozzle_diameter);
if (line_width <= 0.0)
line_width = nozzle_diameter;
// Max outer-wall speed printable at a given layer height without exceeding the volumetric limit.
auto speed_limit_for_lh = [&](double lh) -> double {
const double mm3_per_mm = Flow(line_width, lh, nozzle_diameter).mm3_per_mm();
return mm3_per_mm > 0.0 ? max_vol_speed / mm3_per_mm : 1e9;
};
auto confirm_clamp = [&](const wxString& question) -> bool {
MessageDialog msg_dlg(nullptr,
wxString::Format(_L("The end speed (%.0f mm/s) exceeds the filament's maximum volumetric speed "
"(%.1f mm³/s), which limits the outer wall to about %.0f mm/s at this line width and "
"layer height.\n Speeds above this will be clamped, so the upper blocks of the tower "
"will not print at the requested speed.\n\n%s"),
m_params.end, max_vol_speed, speed_limit_for_lh(default_lh), question),
_L("VFA test"), wxICON_WARNING | wxYES_NO | wxNO_DEFAULT);
return msg_dlg.ShowModal() == wxID_YES;
};
if (max_vol_speed > 0.0 && nozzle_diameter > 0.0 && m_params.end > speed_limit_for_lh(default_lh)) {
// The layer-height auto-adjust only applies when resizing is enabled (it changes the layer height).
if (m_cbAutoAdjust->GetValue() && m_params.nozzle_based_resize) {
// Candidate layer heights are the ones actually used by the process profiles compatible with the
// current printer (clamped to the machine's layer-height limits, when set). A smaller layer height
// means a smaller cross-section, hence a higher printable speed under the volumetric limit; pick the
// largest candidate that still reaches the end speed to keep the change from the default minimal.
std::vector<double> candidates;
for (const auto& preset : preset_bundle->prints.get_presets()) {
if (!preset.is_compatible || preset.is_default)
continue;
const auto* lh_opt = preset.config.option<ConfigOptionFloat>("layer_height");
if (lh_opt == nullptr || lh_opt->value <= 0.0)
continue;
const double lh = lh_opt->value;
if ((machine_min_lh > 0.0 && lh < machine_min_lh - 1e-6) ||
(machine_max_lh > 0.0 && lh > machine_max_lh + 1e-6))
continue;
candidates.push_back(lh);
}
std::sort(candidates.begin(), candidates.end());
candidates.erase(std::unique(candidates.begin(), candidates.end(),
[](double a, double b) { return std::abs(a - b) < 1e-6; }),
candidates.end());
// Largest candidate <= the default layer height that still reaches the end speed (smallest change).
double chosen_lh = 0.0;
for (auto it = candidates.rbegin(); it != candidates.rend(); ++it) {
if (*it > default_lh + 1e-6)
continue; // never increase the layer height above the default
if (speed_limit_for_lh(*it) >= m_params.end) { chosen_lh = *it; break; }
}
if (chosen_lh > 0.0) {
// Reducing the layer height is enough to reach the requested end speed.
m_params.vfa_layer_height = chosen_lh;
MessageDialog msg_dlg(nullptr,
wxString::Format(_L("The end speed (%.0f mm/s) exceeds the filament's maximum volumetric speed "
"(%.1f mm³/s) at the default layer height (%.2f mm).\n\n"
"The layer height has been reduced to %.2f mm (a value used by this printer's "
"profiles) so the tower can reach the requested speed."),
m_params.end, max_vol_speed, default_lh, chosen_lh),
_L("VFA test"), wxICON_INFORMATION | wxOK);
msg_dlg.ShowModal();
} else if (!candidates.empty()) {
// Even the smallest available layer height cannot reach the end speed; propose a lower end speed
// based on that layer height, the line width and the maximum volumetric speed.
const double min_lh = candidates.front();
const double reachable = speed_limit_for_lh(min_lh);
double new_end = std::floor(reachable / m_params.step) * m_params.step; // snap down to a step multiple
if (new_end < m_params.start + m_params.step)
new_end = m_params.start + m_params.step;
MessageDialog msg_dlg(nullptr,
wxString::Format(_L("Even at the smallest layer height used by this printer's profiles (%.2f mm) the "
"end speed (%.0f mm/s) exceeds the filament's maximum volumetric speed "
"(%.1f mm³/s).\n\n"
"The layer height will be set to %.2f mm and the end speed lowered to %.0f mm/s.\n\n"
"Continue?"),
min_lh, m_params.end, max_vol_speed, min_lh, new_end),
_L("VFA test"), wxICON_WARNING | wxYES_NO | wxNO_DEFAULT);
if (msg_dlg.ShowModal() != wxID_YES)
return;
m_params.end = new_end;
m_params.vfa_layer_height = min_lh;
} else {
// No compatible process profiles to draw layer heights from: warn and let the user decide.
if (!confirm_clamp(_L("Continue anyway?")))
return;
}
} else {
// Auto-adjust off, or resizing disabled (which forbids changing the layer height): just warn.
if (!confirm_clamp(m_params.nozzle_based_resize
? _L("Enable \"Auto-adjust\" to fix this automatically, or continue anyway?")
: _L("Enable \"Auto-scale for nozzle\" and \"Auto-adjust\" to fix this automatically, or continue anyway?")))
return;
}
}
}
m_params.mode = CalibMode::Calib_VFA_Tower;
m_plater->calib_VFA(m_params);
EndModal(wxID_OK);
+3
View File
@@ -65,6 +65,7 @@ protected:
TextInput* m_tiStart;
TextInput* m_tiEnd;
TextInput* m_tiStep;
CheckBox* m_cbResize;
Plater* m_plater;
};
@@ -99,6 +100,8 @@ protected:
TextInput* m_tiStart;
TextInput* m_tiEnd;
TextInput* m_tiStep;
CheckBox* m_cbAutoAdjust;
CheckBox* m_cbResize;
Plater* m_plater;
};
+6 -1
View File
@@ -602,6 +602,12 @@ WXLRESULT wxMediaCtrl2::MSWWindowProc(WXUINT nMsg,
WXWPARAM wParam,
WXLPARAM lParam)
{
// The stream source sends WM_USER+1000 with a synchronous SendMessage from its own threads,
// so this runs re-entrantly on the UI thread at whatever message-retrieval point the player
// happens to be in - often nested inside an Orca log statement. Never BOOST_LOG_TRIVIAL here:
// boost::log is not re-entrant on one thread, and doing so corrupted its per-thread record
// state, crashing later in unrelated places (the player, the log filter, a plug-in heap free).
// Post the string out (as the stat branch does) and log it on a clean stack instead.
if (nMsg == WM_USER + 1000) {
wxString msg((wchar_t const *) lParam);
if (wParam == 1) {
@@ -619,7 +625,6 @@ WXLRESULT wxMediaCtrl2::MSWWindowProc(WXUINT nMsg,
wxPostEvent(this, evt);
}
}
BOOST_LOG_TRIVIAL(trace) << msg.ToUTF8().data();
return 0;
}
return wxMediaCtrl::MSWWindowProc(nMsg, wParam, lParam);