Build fixes, conversion of wxString into utf-8 std::string

This commit is contained in:
Vojtech Kral 2018-09-19 10:34:21 +02:00
parent e695164451
commit 51d504c720
5 changed files with 19 additions and 6 deletions

View File

@ -81,8 +81,8 @@ template<class Backend> class Zipper {
public:
Zipper(const std::string& /*zipfile_path*/) {
static_assert(Backend>::value,
"No zipper implementation provided!");
// static_assert(Backend>::value,
// "No zipper implementation provided!");
}
void next_entry(const std::string& /*fname*/) {}

View File

@ -2618,7 +2618,10 @@ void modulate_extrusion_by_overlapping_layers(
(fragment_end.is_start ? &polyline.points.front() : &polyline.points.back());
}
private:
ExtrusionPathFragmentEndPointAccessor& operator=(const ExtrusionPathFragmentEndPointAccessor&) {}
ExtrusionPathFragmentEndPointAccessor& operator=(const ExtrusionPathFragmentEndPointAccessor&) {
return *this;
}
const std::vector<ExtrusionPathFragment> &m_path_fragments;
};
const coord_t search_radius = 7;

View File

@ -991,6 +991,12 @@ wxString from_u8(const std::string &str)
return wxString::FromUTF8(str.c_str());
}
std::string into_u8(const wxString &str)
{
auto buffer_utf8 = str.utf8_str();
return std::string(buffer_utf8.data());
}
void set_model_events_from_perl(Model &model,
int event_object_selection_changed,
int event_object_settings_changed,

View File

@ -217,6 +217,8 @@ int combochecklist_get_flags(wxComboCtrl* comboCtrl);
wxString L_str(const std::string &str);
// Return wxString from std::string in UTF8
wxString from_u8(const std::string &str);
// Return std::string in UTF8 from wxString
std::string into_u8(const wxString &str);
void set_model_events_from_perl(Model &model,
int event_object_selection_changed,

View File

@ -99,8 +99,9 @@ bool Preview::init(wxNotebook* notebook, DynamicPrintConfig* config, Print* prin
m_combochecklist_features = new wxComboCtrl();
m_combochecklist_features->Create(this, wxID_ANY, _(L("Feature types")), wxDefaultPosition, wxSize(200, -1), wxCB_READONLY);
std::string feature_text = _(L("Feature types"));
std::string feature_items = _(L("Perimeter")) + "|" +
std::string feature_text = GUI::into_u8(_(L("Feature types")));
std::string feature_items = GUI::into_u8(
_(L("Perimeter")) + "|" +
_(L("External perimeter")) + "|" +
_(L("Overhang perimeter")) + "|" +
_(L("Internal infill")) + "|" +
@ -112,7 +113,8 @@ bool Preview::init(wxNotebook* notebook, DynamicPrintConfig* config, Print* prin
_(L("Support material")) + "|" +
_(L("Support material interface")) + "|" +
_(L("Wipe tower")) + "|" +
_(L("Custom"));
_(L("Custom"))
);
Slic3r::GUI::create_combochecklist(m_combochecklist_features, feature_text, feature_items, true);
m_checkbox_travel = new wxCheckBox(this, wxID_ANY, _(L("Travel")));