diff --git a/src/libslic3r/Config.hpp b/src/libslic3r/Config.hpp index 44d081771e..f02caf226c 100644 --- a/src/libslic3r/Config.hpp +++ b/src/libslic3r/Config.hpp @@ -16,8 +16,8 @@ #include "Point.hpp" #include -#include -#include +#include +#include #include #include diff --git a/src/libslic3r/Extruder.cpp b/src/libslic3r/Extruder.cpp index 74d900825d..f7a5c50071 100644 --- a/src/libslic3r/Extruder.cpp +++ b/src/libslic3r/Extruder.cpp @@ -1,4 +1,5 @@ #include "Extruder.hpp" +#include "PrintConfig.hpp" namespace Slic3r { diff --git a/src/libslic3r/Extruder.hpp b/src/libslic3r/Extruder.hpp index 066a5f56d2..e9c6927f85 100644 --- a/src/libslic3r/Extruder.hpp +++ b/src/libslic3r/Extruder.hpp @@ -3,10 +3,11 @@ #include "libslic3r.h" #include "Point.hpp" -#include "PrintConfig.hpp" namespace Slic3r { +class GCodeConfig; + class Extruder { public: diff --git a/src/slic3r/GUI/AboutDialog.cpp b/src/slic3r/GUI/AboutDialog.cpp index 30892d9c9b..bd95630a0b 100644 --- a/src/slic3r/GUI/AboutDialog.cpp +++ b/src/slic3r/GUI/AboutDialog.cpp @@ -36,7 +36,7 @@ void AboutDialogLogo::onRepaint(wxEvent &event) // CopyrightsDialog // ----------------------------------------- CopyrightsDialog::CopyrightsDialog() - : DPIDialog(NULL, wxID_ANY, wxString::FromUTF8((boost::format("%1% - %2%") + : DPIDialog(NULL, wxID_ANY, from_u8((boost::format("%1% - %2%") % SLIC3R_APP_NAME % _utf8(L("Portions copyright"))).str()), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) @@ -198,7 +198,7 @@ void CopyrightsDialog::onCloseDialog(wxEvent &) } AboutDialog::AboutDialog() - : DPIDialog(NULL, wxID_ANY, wxString::FromUTF8((boost::format(_utf8(L("About %s"))) % SLIC3R_APP_NAME).str()), wxDefaultPosition, + : DPIDialog(NULL, wxID_ANY, from_u8((boost::format(_utf8(L("About %s"))) % SLIC3R_APP_NAME).str()), wxDefaultPosition, wxDefaultSize, /*wxCAPTION*/wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) { SetFont(wxGetApp().normal_font()); @@ -261,7 +261,7 @@ AboutDialog::AboutDialog() const std::string license_str = _utf8(L("GNU Affero General Public License, version 3")); const std::string based_on_str = _utf8(L("PrusaSlicer is based on Slic3r by Alessandro Ranellucci and the RepRap community.")); const std::string contributors_str = _utf8(L("Contributions by Henrik Brix Andersen, Nicolas Dandrimont, Mark Hindess, Petr Ledvina, Joseph Lenox, Y. Sapir, Mike Sheldrake, Vojtech Bubnik and numerous others.")); - const auto text = wxString::FromUTF8( + const auto text = from_u8( (boost::format( "" "" diff --git a/src/slic3r/GUI/BackgroundSlicingProcess.cpp b/src/slic3r/GUI/BackgroundSlicingProcess.cpp index f22d54e2bc..536d6d6344 100644 --- a/src/slic3r/GUI/BackgroundSlicingProcess.cpp +++ b/src/slic3r/GUI/BackgroundSlicingProcess.cpp @@ -1,5 +1,6 @@ #include "BackgroundSlicingProcess.hpp" #include "GUI_App.hpp" +#include "GUI.hpp" #include #include @@ -219,7 +220,7 @@ void BackgroundSlicingProcess::thread_proc() // Canceled, this is all right. assert(m_print->canceled()); } catch (const std::bad_alloc& ex) { - wxString errmsg = wxString::FromUTF8((boost::format(_utf8(L("%s has encountered an error. It was likely caused by running out of memory. " + wxString errmsg = GUI::from_u8((boost::format(_utf8(L("%s has encountered an error. It was likely caused by running out of memory. " "If you are sure you have enough RAM on your system, this may also be a bug and we would " "be glad if you reported it."))) % SLIC3R_APP_NAME).str()); error = std::string(errmsg.ToUTF8()) + "\n\n" + std::string(ex.what()); diff --git a/src/slic3r/GUI/BonjourDialog.cpp b/src/slic3r/GUI/BonjourDialog.cpp index 42750885cd..8ee01c9493 100644 --- a/src/slic3r/GUI/BonjourDialog.cpp +++ b/src/slic3r/GUI/BonjourDialog.cpp @@ -219,10 +219,10 @@ void BonjourDialog::on_timer(wxTimerEvent &) if (timer_state > 0) { const std::string dots(timer_state, '.'); - label->SetLabel(wxString::FromUTF8((boost::format("%1% %2%") % search_str % dots).str())); + label->SetLabel(GUI::from_u8((boost::format("%1% %2%") % search_str % dots).str())); timer_state = (timer_state) % 3 + 1; } else { - label->SetLabel(wxString::FromUTF8((boost::format("%1%: %2%") % search_str % (_utf8(L("Finished"))+".")).str())); + label->SetLabel(GUI::from_u8((boost::format("%1%: %2%") % search_str % (_utf8(L("Finished"))+".")).str())); timer->Stop(); } } diff --git a/src/slic3r/GUI/ConfigSnapshotDialog.cpp b/src/slic3r/GUI/ConfigSnapshotDialog.cpp index b49e994a9c..6a44b96dc6 100644 --- a/src/slic3r/GUI/ConfigSnapshotDialog.cpp +++ b/src/slic3r/GUI/ConfigSnapshotDialog.cpp @@ -72,7 +72,7 @@ static wxString generate_html_row(const Config::Snapshot &snapshot, bool row_eve } if (! compatible) { - text += "

" + wxString::FromUTF8((boost::format(_utf8(L("Incompatible with this %s"))) % SLIC3R_APP_NAME).str()) + "

"; + text += "

" + from_u8((boost::format(_utf8(L("Incompatible with this %s"))) % SLIC3R_APP_NAME).str()) + "

"; } else if (! snapshot_active) text += "

" + _(L("Activate")) + "

"; diff --git a/src/slic3r/GUI/ConfigWizard.cpp b/src/slic3r/GUI/ConfigWizard.cpp index 0e034b33b1..9d241b0daf 100644 --- a/src/slic3r/GUI/ConfigWizard.cpp +++ b/src/slic3r/GUI/ConfigWizard.cpp @@ -422,14 +422,14 @@ void ConfigWizardPage::append_spacer(int space) // Wizard pages PageWelcome::PageWelcome(ConfigWizard *parent) - : ConfigWizardPage(parent, wxString::FromUTF8((boost::format( + : ConfigWizardPage(parent, from_u8((boost::format( #ifdef __APPLE__ _utf8(L("Welcome to the %s Configuration Assistant")) #else _utf8(L("Welcome to the %s Configuration Wizard")) #endif ) % SLIC3R_APP_NAME).str()), _(L("Welcome"))) - , welcome_text(append_text(wxString::FromUTF8((boost::format( + , welcome_text(append_text(from_u8((boost::format( _utf8(L("Hello, welcome to %s! This %s helps you with the initial configuration; just a few settings and you will be ready to print."))) % SLIC3R_APP_NAME % _utf8(ConfigWizard::name())).str()) @@ -478,7 +478,7 @@ PagePrinters::PagePrinters(ConfigWizard *parent, continue; } - const auto picker_title = family.empty() ? wxString() : wxString::FromUTF8((boost::format(_utf8(L("%s Family"))) % family).str()); + const auto picker_title = family.empty() ? wxString() : from_u8((boost::format(_utf8(L("%s Family"))) % family).str()); auto *picker = new PrinterPicker(this, vendor, picker_title, MAX_COLS, *appconfig, filter); picker->Bind(EVT_PRINTER_PICK, [this, appconfig](const PrinterPickerEvent &evt) { diff --git a/src/slic3r/GUI/DoubleSlider.cpp b/src/slic3r/GUI/DoubleSlider.cpp index 911d0f532b..5795a9f643 100644 --- a/src/slic3r/GUI/DoubleSlider.cpp +++ b/src/slic3r/GUI/DoubleSlider.cpp @@ -952,7 +952,7 @@ wxString Control::get_tooltip(int tick/*=-1*/) return _(L("Discard all custom changes")); if (m_focus == fiCogIcon) return m_mode == t_mode::MultiAsSingle ? - wxString::FromUTF8((boost::format(_utf8(L("Jump to height %s or " + GUI::from_u8((boost::format(_utf8(L("Jump to height %s or " "Set extruder sequence for the entire print"))) % " (Shift + G)\n").str()) : _(L("Jump to height")) + " (Shift + G)"; if (m_focus == fiColorBand) diff --git a/src/slic3r/GUI/GUI.hpp b/src/slic3r/GUI/GUI.hpp index 2bfddf718c..a54288df45 100644 --- a/src/slic3r/GUI/GUI.hpp +++ b/src/slic3r/GUI/GUI.hpp @@ -1,7 +1,8 @@ #ifndef slic3r_GUI_hpp_ #define slic3r_GUI_hpp_ -#include +namespace boost { class any; } +namespace boost::filesystem { class path; } #include diff --git a/src/slic3r/GUI/LambdaObjectDialog.hpp b/src/slic3r/GUI/LambdaObjectDialog.hpp index 6cc99c8a74..5bc2d19a53 100644 --- a/src/slic3r/GUI/LambdaObjectDialog.hpp +++ b/src/slic3r/GUI/LambdaObjectDialog.hpp @@ -1,7 +1,8 @@ #ifndef slic3r_LambdaObjectDialog_hpp_ #define slic3r_LambdaObjectDialog_hpp_ -#include "GUI.hpp" +#include +#include #include #include diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index 18e43388a9..a4ae3e0080 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -1029,7 +1029,7 @@ void MainFrame::load_configbundle(wxString file/* = wxEmptyString, const bool re wxGetApp().load_current_presets(); const auto message = wxString::Format(_(L("%d presets successfully imported.")), presets_imported); - Slic3r::GUI::show_info(this, message, "Info"); + Slic3r::GUI::show_info(this, message, wxString("Info")); } // Load a provied DynamicConfig into the Print / Filament / Printer tabs, thus modifying the active preset. diff --git a/src/slic3r/GUI/Selection.cpp b/src/slic3r/GUI/Selection.cpp index 4707f0f069..146111f498 100644 --- a/src/slic3r/GUI/Selection.cpp +++ b/src/slic3r/GUI/Selection.cpp @@ -3,6 +3,7 @@ #include "GLCanvas3D.hpp" #include "GUI_App.hpp" +#include "GUI.hpp" #include "GUI_ObjectManipulation.hpp" #include "GUI_ObjectList.hpp" #include "Gizmos/GLGizmoBase.hpp" @@ -1470,7 +1471,7 @@ void Selection::toggle_instance_printable_state() ModelInstance* instance = model_object->instances[instance_idx]; const bool printable = !instance->printable; - wxString snapshot_text = model_object->instances.size() == 1 ? wxString::FromUTF8((boost::format("%1% %2%") + wxString snapshot_text = model_object->instances.size() == 1 ? from_u8((boost::format("%1% %2%") % (printable ? _utf8(L("Set Printable")) : _utf8(L("Set Unprintable"))) % model_object->name).str()) : (printable ? _(L("Set Printable Instance")) : _(L("Set Unprintable Instance"))); diff --git a/src/slic3r/GUI/wxExtensions.cpp b/src/slic3r/GUI/wxExtensions.cpp index 713cd187fc..c9f1de1684 100644 --- a/src/slic3r/GUI/wxExtensions.cpp +++ b/src/slic3r/GUI/wxExtensions.cpp @@ -604,7 +604,7 @@ void apply_extruder_selector(wxBitmapComboBox** ctrl, } (*ctrl)->Append(use_full_item_name - ? wxString::FromUTF8((boost::format("%1% %2%") % str % i).str()) + ? Slic3r::GUI::from_u8((boost::format("%1% %2%") % str % i).str()) : wxString::Format("%d", i), *bmp); ++i; } @@ -703,8 +703,8 @@ ModeButton::ModeButton( wxWindow* parent, void ModeButton::Init(const wxString &mode) { std::string mode_str = std::string(mode.ToUTF8()); - m_tt_focused = wxString::FromUTF8((boost::format(_utf8(L("Switch to the %s mode"))) % mode_str).str()); - m_tt_selected = wxString::FromUTF8((boost::format(_utf8(L("Current mode is %s"))) % mode_str).str()); + m_tt_focused = Slic3r::GUI::from_u8((boost::format(_utf8(L("Switch to the %s mode"))) % mode_str).str()); + m_tt_selected = Slic3r::GUI::from_u8((boost::format(_utf8(L("Current mode is %s"))) % mode_str).str()); SetBitmapMargins(3, 0); diff --git a/src/slic3r/Utils/FlashAir.cpp b/src/slic3r/Utils/FlashAir.cpp index c033bd843a..bca331e844 100644 --- a/src/slic3r/Utils/FlashAir.cpp +++ b/src/slic3r/Utils/FlashAir.cpp @@ -70,7 +70,7 @@ wxString FlashAir::get_test_ok_msg () const wxString FlashAir::get_test_failed_msg (wxString &msg) const { - return wxString::FromUTF8((boost::format("%s: %s") + return GUI::from_u8((boost::format("%s: %s") % _utf8(L("Could not connect to FlashAir")) % std::string(msg.ToUTF8()) % _utf8(L("Note: FlashAir with firmware 2.00.02 or newer and activated upload function is required."))).str());