From 4419703f41430128f1ee671281578bb71f0e1b0f Mon Sep 17 00:00:00 2001 From: Arthur Date: Thu, 1 Dec 2022 10:35:06 +0800 Subject: [PATCH] ENH: do not add L prefix to empty string Change-Id: I0fc7f57baf256452645be497020d75ffaf9c20f4 --- src/libslic3r/PrintConfig.cpp | 16 ++++++++-------- src/slic3r/GUI/Auxiliary.cpp | 2 +- src/slic3r/GUI/BBLStatusBarBind.cpp | 4 ++-- src/slic3r/GUI/BBLStatusBarSend.cpp | 4 ++-- src/slic3r/GUI/CameraPopup.cpp | 2 +- src/slic3r/GUI/GCodeViewer.cpp | 4 ++-- src/slic3r/GUI/GUI_ObjectList.cpp | 2 +- src/slic3r/GUI/MainFrame.cpp | 6 +++--- src/slic3r/GUI/ParamsDialog.cpp | 2 +- src/slic3r/GUI/PrintOptionsDialog.cpp | 2 +- src/slic3r/GUI/PublishDialog.cpp | 2 +- src/slic3r/GUI/SelectMachine.cpp | 2 +- src/slic3r/GUI/SendToPrinter.cpp | 2 +- src/slic3r/GUI/Tab.cpp | 4 ++-- src/slic3r/GUI/UnsavedChangesDialog.cpp | 2 +- src/slic3r/GUI/WebGuideDialog.cpp | 4 ++-- src/slic3r/GUI/Widgets/AMSControl.cpp | 16 ++++++++-------- 17 files changed, 38 insertions(+), 38 deletions(-) diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 5396cc737..2262191ed 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -411,14 +411,14 @@ void PrintConfigDef::init_common_params() def = this->add("printhost_user", coString); def->label = L("User"); - // def->tooltip = L(""); + // def->tooltip = ""; def->mode = comAdvanced; def->cli = ConfigOptionDef::nocli; def->set_default_value(new ConfigOptionString("")); def = this->add("printhost_password", coString); def->label = L("Password"); - // def->tooltip = L(""); + // def->tooltip = ""; def->mode = comAdvanced; def->cli = ConfigOptionDef::nocli; def->set_default_value(new ConfigOptionString("")); @@ -440,7 +440,7 @@ void PrintConfigDef::init_common_params() def = this->add("printhost_authorization_type", coEnum); def->label = L("Authorization Type"); - // def->tooltip = L(""); + // def->tooltip = ""; def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); def->enum_values.push_back("key"); def->enum_values.push_back("user"); @@ -630,7 +630,7 @@ void PrintConfigDef::init_fff_params() def->tooltip = L("Force cooling fan to be specific speed when overhang degree of printed part exceeds this value. " "Expressed as percentage which indicides how much width of the line without support from lower layer. " "0% means forcing cooling for all outer wall no matter how much overhang degree"); - def->sidetext = L(""); + def->sidetext = ""; def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); def->mode = comAdvanced; def->enum_values.emplace_back("0%"); @@ -2692,7 +2692,7 @@ void PrintConfigDef::init_fff_params() def = this->add("nozzle_temperature_range_low", coInts); def->label = L("Min"); - //def->tooltip = L(""); + //def->tooltip = ""; def->sidetext = L("°C"); def->min = 0; def->max = max_temp; @@ -2700,7 +2700,7 @@ void PrintConfigDef::init_fff_params() def = this->add("nozzle_temperature_range_high", coInts); def->label = L("Max"); - //def->tooltip = L(""); + //def->tooltip = ""; def->sidetext = L("°C"); def->min = 0; def->max = max_temp; @@ -2833,8 +2833,8 @@ void PrintConfigDef::init_fff_params() def = this->add("flush_multiplier", coFloat); def->label = L("Flush multiplier"); - def->tooltip = L(""); - def->sidetext = L(""); + def->tooltip = ""; + def->sidetext = ""; def->mode = comDevelop; def->min = 0; def->set_default_value(new ConfigOptionFloat(1.0)); diff --git a/src/slic3r/GUI/Auxiliary.cpp b/src/slic3r/GUI/Auxiliary.cpp index 7b2380ae5..e3d9f5560 100644 --- a/src/slic3r/GUI/Auxiliary.cpp +++ b/src/slic3r/GUI/Auxiliary.cpp @@ -379,7 +379,7 @@ void AuFile::on_input_enter(wxCommandEvent &evt) fs::path newPath(new_dir_path); fs::rename(oldPath, newPath); } else { - /*MessageDialog msg_wingow(nullptr, info_line, _L(""), + /*MessageDialog msg_wingow(nullptr, info_line, "", wxICON_WARNING | wxOK); if (msg_wingow.ShowModal() == wxID_CANCEL) { m_input_name->GetTextCtrl()->SetValue(wxEmptyString); diff --git a/src/slic3r/GUI/BBLStatusBarBind.cpp b/src/slic3r/GUI/BBLStatusBarBind.cpp index 878cfb25e..727ceb8d6 100644 --- a/src/slic3r/GUI/BBLStatusBarBind.cpp +++ b/src/slic3r/GUI/BBLStatusBarBind.cpp @@ -27,7 +27,7 @@ BBLStatusBarBind::BBLStatusBarBind(wxWindow *parent, int id) //wxBoxSizer *m_sizer_bottom = new wxBoxSizer(wxHORIZONTAL); - /* m_status_text = new wxStaticText(m_self, wxID_ANY, L(""), wxDefaultPosition, wxDefaultSize, 0); + /* m_status_text = new wxStaticText(m_self, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, 0); m_status_text->SetForegroundColour(wxColour(107, 107, 107)); m_status_text->SetFont(::Label::Body_13); m_status_text->Wrap(-1); @@ -37,7 +37,7 @@ BBLStatusBarBind::BBLStatusBarBind(wxWindow *parent, int id) m_prog->SetValue(0); - m_stext_percent = new wxStaticText(m_self, wxID_ANY, _L(""), wxDefaultPosition, wxDefaultSize, 0); + m_stext_percent = new wxStaticText(m_self, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, 0); m_stext_percent->SetForegroundColour(wxColour(107, 107, 107)); m_stext_percent->SetFont(::Label::Body_13); m_stext_percent->Wrap(-1); diff --git a/src/slic3r/GUI/BBLStatusBarSend.cpp b/src/slic3r/GUI/BBLStatusBarSend.cpp index 480addb60..242cc11e1 100644 --- a/src/slic3r/GUI/BBLStatusBarSend.cpp +++ b/src/slic3r/GUI/BBLStatusBarSend.cpp @@ -26,7 +26,7 @@ BBLStatusBarSend::BBLStatusBarSend(wxWindow *parent, int id) wxBoxSizer *m_sizer_body = new wxBoxSizer(wxVERTICAL); wxBoxSizer *m_sizer_bottom = new wxBoxSizer(wxHORIZONTAL); - m_status_text = new wxStaticText(m_self, wxID_ANY, L(""), wxDefaultPosition, wxSize(m_self->FromDIP(280), -1), 0); + m_status_text = new wxStaticText(m_self, wxID_ANY, "", wxDefaultPosition, wxSize(m_self->FromDIP(280), -1), 0); m_status_text->SetForegroundColour(wxColour(107, 107, 107)); m_status_text->SetFont(::Label::Body_13); m_status_text->Wrap(m_self->FromDIP(280)); @@ -60,7 +60,7 @@ BBLStatusBarSend::BBLStatusBarSend(wxWindow *parent, int id) m_cancel_cb_fina(); }); - m_stext_percent = new wxStaticText(m_self, wxID_ANY, L(""), wxDefaultPosition, wxDefaultSize, 0); + m_stext_percent = new wxStaticText(m_self, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, 0); m_stext_percent->SetForegroundColour(wxColour(107, 107, 107)); m_stext_percent->SetFont(::Label::Body_13); m_stext_percent->Wrap(-1); diff --git a/src/slic3r/GUI/CameraPopup.cpp b/src/slic3r/GUI/CameraPopup.cpp index 793f84ff7..d56f7832e 100644 --- a/src/slic3r/GUI/CameraPopup.cpp +++ b/src/slic3r/GUI/CameraPopup.cpp @@ -315,7 +315,7 @@ wxString CameraPopup::to_resolution_label_string(CameraResolution resolution) { case RESOLUTION_1080P: return _L("1080p"); default: - return _L(""); + return ""; } return ""; } diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index 2bea4c234..13f13d248 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -4482,7 +4482,7 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv if (m_extruder_ids.size() <= 1 || !show_flushed_filaments) append_headers({ {_u8L("Filament"), offsets[0]}, {_u8L("Model"), offsets[2]}}); else - append_headers({ {_u8L("Filament"), offsets[0]}, {_u8L("Model"), offsets[1]}, {_u8L("Flushed"), offsets[2]}, {_u8L(""), offsets[3]}, {_u8L("Total"), offsets[4]}});// to add Tower + append_headers({ {_u8L("Filament"), offsets[0]}, {_u8L("Model"), offsets[1]}, {_u8L("Flushed"), offsets[2]}, {"", offsets[3]}, {_u8L("Total"), offsets[4]}});// to add Tower break; } default: { break; } @@ -5185,7 +5185,7 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv ImGui::Spacing(); ImGui::Dummy({ window_padding, window_padding }); ImGui::SameLine(); - offsets = calculate_offsets({ { _u8L("Options"), { _u8L("")}}, { _u8L("Display"), {""}} }, icon_size); + offsets = calculate_offsets({ { _u8L("Options"), { ""}}, { _u8L("Display"), {""}} }, icon_size); append_headers({ {_u8L("Options"), offsets[0] }, { _u8L("Display"), offsets[1]} }); for (auto item : options_items) append_option_item(item, offsets); diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp index d6e84e7ca..673b40bf3 100644 --- a/src/slic3r/GUI/GUI_ObjectList.cpp +++ b/src/slic3r/GUI/GUI_ObjectList.cpp @@ -2320,7 +2320,7 @@ bool ObjectList::del_subobject_from_object(const int obj_idx, const int idx, con else if (type == itInstance) { if (object->instances.size() == 1) { // BBS: remove snapshot name "Last instance of an object cannot be deleted." - Slic3r::GUI::show_error(nullptr, _L("")); + Slic3r::GUI::show_error(nullptr, ""); return false; } diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index 5b0c3293c..612657cca 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -2350,11 +2350,11 @@ void MainFrame::init_menubar_as_editor() //}); //parent_menu->Insert(0, about_item); append_menu_item( - parent_menu, wxID_ANY, _L(about_title), _L(""), + parent_menu, wxID_ANY, _L(about_title), "", [this](wxCommandEvent &) { Slic3r::GUI::about();}, "", nullptr, []() { return true; }, this, 0); append_menu_item( - parent_menu, wxID_ANY, _L("Preferences") + "\tCtrl+,", _L(""), + parent_menu, wxID_ANY, _L("Preferences") + "\tCtrl+,", "", [this](wxCommandEvent &) { PreferencesDialog dlg(this); dlg.ShowModal(); @@ -2381,7 +2381,7 @@ void MainFrame::init_menubar_as_editor() //BBS add Preference append_menu_item( - m_topbar->GetTopMenu(), wxID_ANY, _L("Preferences") + "\tCtrl+P", _L(""), + m_topbar->GetTopMenu(), wxID_ANY, _L("Preferences") + "\tCtrl+P", "", [this](wxCommandEvent &) { PreferencesDialog dlg(this); dlg.ShowModal(); diff --git a/src/slic3r/GUI/ParamsDialog.cpp b/src/slic3r/GUI/ParamsDialog.cpp index 54acab776..6bf1fd16b 100644 --- a/src/slic3r/GUI/ParamsDialog.cpp +++ b/src/slic3r/GUI/ParamsDialog.cpp @@ -15,7 +15,7 @@ namespace GUI { ParamsDialog::ParamsDialog(wxWindow * parent) - : DPIDialog(parent, wxID_ANY, _L(""), wxDefaultPosition, + : DPIDialog(parent, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxCAPTION | wxCLOSE_BOX | wxRESIZE_BORDER) { m_panel = new ParamsPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBK_LEFT | wxTAB_TRAVERSAL); diff --git a/src/slic3r/GUI/PrintOptionsDialog.cpp b/src/slic3r/GUI/PrintOptionsDialog.cpp index b89e0818b..ee08b2e53 100644 --- a/src/slic3r/GUI/PrintOptionsDialog.cpp +++ b/src/slic3r/GUI/PrintOptionsDialog.cpp @@ -268,7 +268,7 @@ wxString PrintOptionsDialog::sensitivity_level_to_label_string(enum AiMonitorSen case HIGH: return _L("High"); default: - return _L(""); + return ""; } return ""; } diff --git a/src/slic3r/GUI/PublishDialog.cpp b/src/slic3r/GUI/PublishDialog.cpp index 9d3614e85..79f6aa5c9 100644 --- a/src/slic3r/GUI/PublishDialog.cpp +++ b/src/slic3r/GUI/PublishDialog.cpp @@ -65,7 +65,7 @@ PublishDialog::PublishDialog(Plater *plater) m_main_sizer->Add(0, FromDIP(10), 0, wxEXPAND, 0); wxBoxSizer *m_progress_text_sizer = new wxBoxSizer(wxHORIZONTAL); - m_text_progress = new wxStaticText(this, wxID_ANY, _L(""), wxDefaultPosition, wxDefaultSize, 0); + m_text_progress = new wxStaticText(this, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, 0); m_text_progress->Wrap(-1); m_text_progress->SetFont(Label::Body_12); m_text_progress->SetForegroundColour(TEXT_LIGHT_GRAY); diff --git a/src/slic3r/GUI/SelectMachine.cpp b/src/slic3r/GUI/SelectMachine.cpp index e4e074dc6..9e24e7cba 100644 --- a/src/slic3r/GUI/SelectMachine.cpp +++ b/src/slic3r/GUI/SelectMachine.cpp @@ -1099,7 +1099,7 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater) m_sizer_printer->Add(m_stext_printer_title, 0, wxALL | wxLEFT, FromDIP(5)); m_sizer_printer->Add(0, 0, 0, wxEXPAND | wxLEFT, FromDIP(12)); - m_comboBox_printer = new ::ComboBox(this, wxID_ANY, L(""), wxDefaultPosition, wxSize(FromDIP(250), -1), 0, nullptr, wxCB_READONLY); + m_comboBox_printer = new ::ComboBox(this, wxID_ANY, "", wxDefaultPosition, wxSize(FromDIP(250), -1), 0, nullptr, wxCB_READONLY); m_comboBox_printer->Bind(wxEVT_COMBOBOX, &SelectMachineDialog::on_selection_changed, this); m_sizer_printer->Add(m_comboBox_printer, 1, wxEXPAND | wxRIGHT, FromDIP(5)); diff --git a/src/slic3r/GUI/SendToPrinter.cpp b/src/slic3r/GUI/SendToPrinter.cpp index 831580df7..08eb38df0 100644 --- a/src/slic3r/GUI/SendToPrinter.cpp +++ b/src/slic3r/GUI/SendToPrinter.cpp @@ -230,7 +230,7 @@ SendToPrinterDialog::SendToPrinterDialog(Plater *plater) m_sizer_printer->Add(m_stext_printer_title, 0, wxALL | wxLEFT, FromDIP(5)); m_sizer_printer->Add(0, 0, 0, wxEXPAND | wxLEFT, FromDIP(12)); - m_comboBox_printer = new ::ComboBox(this, wxID_ANY, L(""), wxDefaultPosition, wxSize(FromDIP(250), -1), 0, nullptr, wxCB_READONLY); + m_comboBox_printer = new ::ComboBox(this, wxID_ANY, "", wxDefaultPosition, wxSize(FromDIP(250), -1), 0, nullptr, wxCB_READONLY); m_comboBox_printer->Bind(wxEVT_COMBOBOX, &SendToPrinterDialog::on_selection_changed, this); m_sizer_printer->Add(m_comboBox_printer, 1, wxEXPAND | wxRIGHT, FromDIP(5)); diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index eb1a0752c..b543ecd5b 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1604,7 +1604,7 @@ void Tab::build_preset_description_line(ConfigOptionsGroup* optgroup) }; auto detach_preset_btn = [this](wxWindow* parent) { - m_detach_preset_btn = new ScalableButton(parent, wxID_ANY, "lock_normal_sys", _L(""), + m_detach_preset_btn = new ScalableButton(parent, wxID_ANY, "lock_normal_sys", "", wxDefaultSize, wxDefaultPosition, wxBU_LEFT | wxBU_EXACTFIT, true); ScalableButton* btn = m_detach_preset_btn; btn->SetFont(Slic3r::GUI::wxGetApp().normal_font()); @@ -2081,7 +2081,7 @@ void TabPrintModel::build() init_options_list(); auto page = add_options_page(L("Frequent"), "empty"); - auto optgroup = page->new_optgroup(L("")); + auto optgroup = page->new_optgroup(""); optgroup->append_single_option_line("layer_height"); optgroup->append_single_option_line("sparse_infill_density"); optgroup->append_single_option_line("wall_loops"); diff --git a/src/slic3r/GUI/UnsavedChangesDialog.cpp b/src/slic3r/GUI/UnsavedChangesDialog.cpp index 0804253de..1001fb917 100644 --- a/src/slic3r/GUI/UnsavedChangesDialog.cpp +++ b/src/slic3r/GUI/UnsavedChangesDialog.cpp @@ -1668,7 +1668,7 @@ bool UnsavedChangesDialog::check_option_valid() Preset * new_preset = preset_bundle->printers.find_preset(m_new_selected_preset_name); std::string str_print_type = new_preset->get_current_printer_type(preset_bundle); if (str_print_type == "C11" && itor->new_value.ToStdString() == "Smooth") { - MessageDialog dlg(wxGetApp().plater(), _L("The P1P printer is not support smooth timelapse, it will not transform the timelapse changes."), + MessageDialog dlg(wxGetApp().plater(), _L("The P1P printer does not support smooth timelapse, use traditional timelapse instead."), _L("Warning"), wxICON_WARNING | wxOK); dlg.ShowModal(); m_presetitems.erase(itor); diff --git a/src/slic3r/GUI/WebGuideDialog.cpp b/src/slic3r/GUI/WebGuideDialog.cpp index dfb5165ce..8cfc9919a 100644 --- a/src/slic3r/GUI/WebGuideDialog.cpp +++ b/src/slic3r/GUI/WebGuideDialog.cpp @@ -158,10 +158,10 @@ wxString GuideFrame::SetStartPage(GuidePage startpage, bool load) else TargetUrl = from_u8((boost::filesystem::path(resources_dir()) / "web/guide/21/index.html").make_preferred().string()); } else if (startpage == BBL_FILAMENT_ONLY) { - SetTitle(_L("")); + SetTitle(""); TargetUrl = from_u8((boost::filesystem::path(resources_dir()) / "web/guide/23/index.html").make_preferred().string()); } else if (startpage == BBL_MODELS_ONLY) { - SetTitle(_L("")); + SetTitle(""); TargetUrl = from_u8((boost::filesystem::path(resources_dir()) / "web/guide/24/index.html").make_preferred().string()); } else { diff --git a/src/slic3r/GUI/Widgets/AMSControl.cpp b/src/slic3r/GUI/Widgets/AMSControl.cpp index df01e55f1..b2a0ff54a 100644 --- a/src/slic3r/GUI/Widgets/AMSControl.cpp +++ b/src/slic3r/GUI/Widgets/AMSControl.cpp @@ -1876,10 +1876,10 @@ void AMSControl::UpdateStepCtrl() void AMSControl::CreateAms() { - auto caninfo0_0 = Caninfo{"def_can_0", L(""), *wxWHITE, AMSCanType::AMS_CAN_TYPE_NONE}; - auto caninfo0_1 = Caninfo{"def_can_1", L(""), *wxWHITE, AMSCanType::AMS_CAN_TYPE_NONE}; - auto caninfo0_2 = Caninfo{"def_can_2", L(""), *wxWHITE, AMSCanType::AMS_CAN_TYPE_NONE}; - auto caninfo0_3 = Caninfo{"def_can_3", L(""), *wxWHITE, AMSCanType::AMS_CAN_TYPE_NONE}; + auto caninfo0_0 = Caninfo{"def_can_0", (""), *wxWHITE, AMSCanType::AMS_CAN_TYPE_NONE}; + auto caninfo0_1 = Caninfo{"def_can_1", (""), *wxWHITE, AMSCanType::AMS_CAN_TYPE_NONE}; + auto caninfo0_2 = Caninfo{"def_can_2", (""), *wxWHITE, AMSCanType::AMS_CAN_TYPE_NONE}; + auto caninfo0_3 = Caninfo{"def_can_3", (""), *wxWHITE, AMSCanType::AMS_CAN_TYPE_NONE}; AMSinfo ams1 = AMSinfo{"def_ams_0", std::vector{caninfo0_0, caninfo0_1, caninfo0_2, caninfo0_3}}; AMSinfo ams2 = AMSinfo{"def_ams_1", std::vector{caninfo0_0, caninfo0_1, caninfo0_2, caninfo0_3}}; @@ -1895,10 +1895,10 @@ void AMSControl::CreateAms() void AMSControl::Reset() { - auto caninfo0_0 = Caninfo{"def_can_0", L(""), *wxWHITE, AMSCanType::AMS_CAN_TYPE_NONE}; - auto caninfo0_1 = Caninfo{"def_can_1", L(""), *wxWHITE, AMSCanType::AMS_CAN_TYPE_NONE}; - auto caninfo0_2 = Caninfo{"def_can_2", L(""), *wxWHITE, AMSCanType::AMS_CAN_TYPE_NONE}; - auto caninfo0_3 = Caninfo{"def_can_3", L(""), *wxWHITE, AMSCanType::AMS_CAN_TYPE_NONE}; + auto caninfo0_0 = Caninfo{"def_can_0", "", *wxWHITE, AMSCanType::AMS_CAN_TYPE_NONE}; + auto caninfo0_1 = Caninfo{"def_can_1", "", *wxWHITE, AMSCanType::AMS_CAN_TYPE_NONE}; + auto caninfo0_2 = Caninfo{"def_can_2", "", *wxWHITE, AMSCanType::AMS_CAN_TYPE_NONE}; + auto caninfo0_3 = Caninfo{"def_can_3", "", *wxWHITE, AMSCanType::AMS_CAN_TYPE_NONE}; AMSinfo ams1 = AMSinfo{"def_ams_0", std::vector{caninfo0_0, caninfo0_1, caninfo0_2, caninfo0_3}}; AMSinfo ams2 = AMSinfo{"def_ams_1", std::vector{caninfo0_0, caninfo0_1, caninfo0_2, caninfo0_3}};