Fixed compilation on OSX,
improved utf8 compatibility of Tab::may_discard_current_dirty_preset(), renamed "SLA Print Profile" / "SLA Material Profile" to just "Print Profile" resp. Material Profile.
This commit is contained in:
parent
27b95584f4
commit
50e44af46c
2 changed files with 13 additions and 16 deletions
|
@ -2476,36 +2476,33 @@ bool Tab::may_discard_current_dirty_preset(PresetCollection* presets /*= nullptr
|
||||||
{
|
{
|
||||||
if (presets == nullptr) presets = m_presets;
|
if (presets == nullptr) presets = m_presets;
|
||||||
// Display a dialog showing the dirty options in a human readable form.
|
// Display a dialog showing the dirty options in a human readable form.
|
||||||
auto old_preset = presets->get_edited_preset();
|
const Preset& old_preset = presets->get_edited_preset();
|
||||||
auto type_name = presets->name();
|
std::string type_name = presets->name();
|
||||||
auto tab = " ";
|
wxString tab = " ";
|
||||||
auto name = old_preset.is_default ?
|
wxString name = old_preset.is_default ?
|
||||||
_(L("Default ")) + type_name + _(L(" preset")) :
|
_(L("Default ")) + type_name + _(L(" preset")) :
|
||||||
(type_name + _(L(" preset\n")) + tab + old_preset.name);
|
(type_name + _(L(" preset\n")) + tab + old_preset.name);
|
||||||
// Collect descriptions of the dirty options.
|
// Collect descriptions of the dirty options.
|
||||||
std::vector<std::string> option_names;
|
wxString changes;
|
||||||
for(auto opt_key: presets->current_dirty_options()) {
|
for (const std::string &opt_key : presets->current_dirty_options()) {
|
||||||
auto opt = m_config->def()->options.at(opt_key);
|
const ConfigOptionDef &opt = m_config->def()->options.at(opt_key);
|
||||||
std::string name = "";
|
std::string name = "";
|
||||||
if (!opt.category.empty())
|
if (! opt.category.empty())
|
||||||
name += opt.category + " > ";
|
name += opt.category + " > ";
|
||||||
name += !opt.full_label.empty() ?
|
name += !opt.full_label.empty() ?
|
||||||
opt.full_label :
|
opt.full_label :
|
||||||
opt.label;
|
opt.label;
|
||||||
option_names.push_back(name);
|
changes += tab + from_u8(name) + "\n";
|
||||||
}
|
}
|
||||||
// Show a confirmation dialog with the list of dirty options.
|
// Show a confirmation dialog with the list of dirty options.
|
||||||
std::string changes = "";
|
wxString message = name + "\n\n";
|
||||||
for (const std::string &changed_name : option_names)
|
|
||||||
changes += tab + changed_name + "\n";
|
|
||||||
std::string message = name + "\n\n";
|
|
||||||
if (new_printer_name.empty())
|
if (new_printer_name.empty())
|
||||||
message += _(L("has the following unsaved changes:"));
|
message += _(L("has the following unsaved changes:"));
|
||||||
else {
|
else {
|
||||||
message += (m_type == Slic3r::Preset::TYPE_PRINTER) ?
|
message += (m_type == Slic3r::Preset::TYPE_PRINTER) ?
|
||||||
_(L("is not compatible with printer")) :
|
_(L("is not compatible with printer")) :
|
||||||
_(L("is not compatible with print profile"));
|
_(L("is not compatible with print profile"));
|
||||||
message += std::string("\n") + tab + new_printer_name + "\n\n";
|
message += wxString("\n") + tab + from_utf8(new_printer_name) + "\n\n";
|
||||||
message += _(L("and it has the following unsaved changes:"));
|
message += _(L("and it has the following unsaved changes:"));
|
||||||
}
|
}
|
||||||
auto confirm = new wxMessageDialog(parent(),
|
auto confirm = new wxMessageDialog(parent(),
|
||||||
|
|
|
@ -360,7 +360,7 @@ class TabSLAMaterial : public Tab
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TabSLAMaterial(wxNotebook* parent) :
|
TabSLAMaterial(wxNotebook* parent) :
|
||||||
Tab(parent, _(L("SLA Material Settings")), "sla_material") {}
|
Tab(parent, _(L("Material Settings")), "sla_material") {}
|
||||||
~TabSLAMaterial() {}
|
~TabSLAMaterial() {}
|
||||||
|
|
||||||
void build() override;
|
void build() override;
|
||||||
|
@ -374,7 +374,7 @@ class TabSLAPrint : public Tab
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TabSLAPrint(wxNotebook* parent) :
|
TabSLAPrint(wxNotebook* parent) :
|
||||||
Tab(parent, _(L("SLA Print Settings")), "sla_print") {}
|
Tab(parent, _(L("Print Settings")), "sla_print") {}
|
||||||
~TabSLAPrint() {}
|
~TabSLAPrint() {}
|
||||||
void build() override;
|
void build() override;
|
||||||
void reload_config() override;
|
void reload_config() override;
|
||||||
|
|
Loading…
Reference in a new issue