mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-07-26 16:12:02 +08:00
Merge remote-tracking branch 'origin/master' into ys_unsaved_changes
This commit is contained in:
commit
e709c49e17
@ -1878,10 +1878,11 @@ namespace Slic3r {
|
|||||||
volume->calculate_convex_hull();
|
volume->calculate_convex_hull();
|
||||||
|
|
||||||
// recreate custom supports from previously loaded attribute
|
// recreate custom supports from previously loaded attribute
|
||||||
assert(geometry.custom_supports.size() == triangles_count);
|
|
||||||
for (unsigned i=0; i<triangles_count; ++i) {
|
for (unsigned i=0; i<triangles_count; ++i) {
|
||||||
if (! geometry.custom_supports[i].empty())
|
size_t index = src_start_id/3 + i;
|
||||||
volume->m_supported_facets.set_triangle_from_string(i, geometry.custom_supports[i]);
|
assert(index < geometry.custom_supports.size());
|
||||||
|
if (! geometry.custom_supports[index].empty())
|
||||||
|
volume->m_supported_facets.set_triangle_from_string(i, geometry.custom_supports[index]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// apply the remaining volume's metadata
|
// apply the remaining volume's metadata
|
||||||
|
@ -161,13 +161,15 @@ PhysicalPrinterDialog::PhysicalPrinterDialog(wxString printer_name)
|
|||||||
SetFont(wxGetApp().normal_font());
|
SetFont(wxGetApp().normal_font());
|
||||||
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
|
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
|
||||||
|
|
||||||
m_default_name = _L("My Printer Device");
|
m_default_name = _L("Type here the name of your printer device");
|
||||||
|
bool new_printer = true;
|
||||||
|
|
||||||
if (printer_name.IsEmpty())
|
if (printer_name.IsEmpty())
|
||||||
printer_name = m_default_name;
|
printer_name = m_default_name;
|
||||||
else {
|
else {
|
||||||
std::string full_name = into_u8(printer_name);
|
std::string full_name = into_u8(printer_name);
|
||||||
printer_name = from_u8(PhysicalPrinter::get_short_name(full_name));
|
printer_name = from_u8(PhysicalPrinter::get_short_name(full_name));
|
||||||
|
new_printer = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxStaticText* label_top = new wxStaticText(this, wxID_ANY, _L("Descriptive name for the printer device") + ":");
|
wxStaticText* label_top = new wxStaticText(this, wxID_ANY, _L("Descriptive name for the printer device") + ":");
|
||||||
@ -206,7 +208,6 @@ PhysicalPrinterDialog::PhysicalPrinterDialog(wxString printer_name)
|
|||||||
|
|
||||||
m_optgroup = new ConfigOptionsGroup(this, _L("Print Host upload"), m_config);
|
m_optgroup = new ConfigOptionsGroup(this, _L("Print Host upload"), m_config);
|
||||||
build_printhost_settings(m_optgroup);
|
build_printhost_settings(m_optgroup);
|
||||||
//m_optgroup->reload_config();
|
|
||||||
|
|
||||||
wxStdDialogButtonSizer* btns = this->CreateStdDialogButtonSizer(wxOK | wxCANCEL);
|
wxStdDialogButtonSizer* btns = this->CreateStdDialogButtonSizer(wxOK | wxCANCEL);
|
||||||
wxButton* btnOK = static_cast<wxButton*>(this->FindWindowById(wxID_OK, this));
|
wxButton* btnOK = static_cast<wxButton*>(this->FindWindowById(wxID_OK, this));
|
||||||
@ -230,6 +231,11 @@ PhysicalPrinterDialog::PhysicalPrinterDialog(wxString printer_name)
|
|||||||
|
|
||||||
SetSizer(topSizer);
|
SetSizer(topSizer);
|
||||||
topSizer->SetSizeHints(this);
|
topSizer->SetSizeHints(this);
|
||||||
|
|
||||||
|
if (new_printer) {
|
||||||
|
m_printer_name->SetFocus();
|
||||||
|
m_printer_name->SelectAll();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PhysicalPrinterDialog::~PhysicalPrinterDialog()
|
PhysicalPrinterDialog::~PhysicalPrinterDialog()
|
||||||
@ -494,7 +500,7 @@ void PhysicalPrinterDialog::OnOK(wxEvent& event)
|
|||||||
|
|
||||||
std::string renamed_from;
|
std::string renamed_from;
|
||||||
// temporary save previous printer name if it was edited
|
// temporary save previous printer name if it was edited
|
||||||
if (m_printer.name != _u8L("My Printer Device") &&
|
if (m_printer.name != into_u8(m_default_name) &&
|
||||||
m_printer.name != into_u8(printer_name))
|
m_printer.name != into_u8(printer_name))
|
||||||
renamed_from = m_printer.name;
|
renamed_from = m_printer.name;
|
||||||
|
|
||||||
|
@ -179,7 +179,9 @@ void PresetComboBox::update(std::string select_preset_name)
|
|||||||
|
|
||||||
const std::deque<Preset>& presets = m_collection->get_presets();
|
const std::deque<Preset>& presets = m_collection->get_presets();
|
||||||
|
|
||||||
std::map<wxString, std::pair<wxBitmap*, bool>> nonsys_presets;
|
std::map<wxString, std::pair<wxBitmap*, bool>> nonsys_presets;
|
||||||
|
std::map<wxString, wxBitmap*> incomp_presets;
|
||||||
|
|
||||||
wxString selected = "";
|
wxString selected = "";
|
||||||
if (!presets.front().is_visible)
|
if (!presets.front().is_visible)
|
||||||
set_label_marker(Append(separator(L("System presets")), wxNullBitmap));
|
set_label_marker(Append(separator(L("System presets")), wxNullBitmap));
|
||||||
@ -206,15 +208,15 @@ void PresetComboBox::update(std::string select_preset_name)
|
|||||||
wxBitmap* bmp = get_bmp(bitmap_key, main_icon_name, "lock_closed", is_enabled, preset.is_compatible, preset.is_system || preset.is_default);
|
wxBitmap* bmp = get_bmp(bitmap_key, main_icon_name, "lock_closed", is_enabled, preset.is_compatible, preset.is_system || preset.is_default);
|
||||||
assert(bmp);
|
assert(bmp);
|
||||||
|
|
||||||
if (preset.is_default || preset.is_system) {
|
if (!is_enabled)
|
||||||
int item_id = Append(wxString::FromUTF8((preset.name + (preset.is_dirty ? Preset::suffix_modified() : "")).c_str()), *bmp);
|
incomp_presets.emplace(wxString::FromUTF8((preset.name + (preset.is_dirty ? Preset::suffix_modified() : "")).c_str()), bmp);
|
||||||
if (!is_enabled)
|
else if (preset.is_default || preset.is_system)
|
||||||
set_label_marker(item_id, LABEL_ITEM_DISABLED);
|
{
|
||||||
|
Append(wxString::FromUTF8((preset.name + (preset.is_dirty ? Preset::suffix_modified() : "")).c_str()), *bmp);
|
||||||
validate_selection(preset.name == select_preset_name);
|
validate_selection(preset.name == select_preset_name);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::pair<wxBitmap*, bool> pair(bmp, is_enabled);
|
|
||||||
nonsys_presets.emplace(wxString::FromUTF8((preset.name + (preset.is_dirty ? Preset::suffix_modified() : "")).c_str()), std::pair<wxBitmap*, bool>(bmp, is_enabled));
|
nonsys_presets.emplace(wxString::FromUTF8((preset.name + (preset.is_dirty ? Preset::suffix_modified() : "")).c_str()), std::pair<wxBitmap*, bool>(bmp, is_enabled));
|
||||||
if (preset.name == select_preset_name || (select_preset_name.empty() && is_enabled))
|
if (preset.name == select_preset_name || (select_preset_name.empty() && is_enabled))
|
||||||
selected = wxString::FromUTF8((preset.name + (preset.is_dirty ? Preset::suffix_modified() : "")).c_str());
|
selected = wxString::FromUTF8((preset.name + (preset.is_dirty ? Preset::suffix_modified() : "")).c_str());
|
||||||
@ -233,6 +235,13 @@ void PresetComboBox::update(std::string select_preset_name)
|
|||||||
validate_selection(it->first == selected);
|
validate_selection(it->first == selected);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!incomp_presets.empty())
|
||||||
|
{
|
||||||
|
set_label_marker(Append(separator(L("Incompatible presets")), wxNullBitmap));
|
||||||
|
for (std::map<wxString, wxBitmap*>::iterator it = incomp_presets.begin(); it != incomp_presets.end(); ++it) {
|
||||||
|
set_label_marker(Append(it->first, *it->second), LABEL_ITEM_DISABLED);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
update_selection();
|
update_selection();
|
||||||
Thaw();
|
Thaw();
|
||||||
@ -1054,6 +1063,11 @@ SavePresetDialog::Item::Item(Preset::Type type, const std::string& suffix, wxBox
|
|||||||
m_combo->Append(from_u8(value));
|
m_combo->Append(from_u8(value));
|
||||||
|
|
||||||
m_combo->Bind(wxEVT_TEXT, [this](wxCommandEvent&) { update(); });
|
m_combo->Bind(wxEVT_TEXT, [this](wxCommandEvent&) { update(); });
|
||||||
|
#ifdef __WXOSX__
|
||||||
|
// Under OSX wxEVT_TEXT wasn't invoked after change selection in combobox,
|
||||||
|
// So process wxEVT_COMBOBOX too
|
||||||
|
m_combo->Bind(wxEVT_COMBOBOX, [this](wxCommandEvent&) { update(); });
|
||||||
|
#endif //__WXOSX__
|
||||||
|
|
||||||
m_valid_label = new wxStaticText(m_parent, wxID_ANY, "");
|
m_valid_label = new wxStaticText(m_parent, wxID_ANY, "");
|
||||||
m_valid_label->SetFont(wxGetApp().bold_font());
|
m_valid_label->SetFont(wxGetApp().bold_font());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user