mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-16 18:12:10 +00:00
init
This commit is contained in:
@@ -2099,6 +2099,11 @@ void Tab::on_presets_changed()
|
||||
// Instead of PostEvent (EVT_TAB_PRESETS_CHANGED) just call update_presets
|
||||
wxGetApp().plater()->sidebar().update_presets(m_type);
|
||||
|
||||
// Check if printer agent needs switching
|
||||
if (m_type == Preset::TYPE_PRINTER) {
|
||||
update_printer_agent_if_needed();
|
||||
}
|
||||
|
||||
bool is_bbl_vendor_preset = m_preset_bundle->is_bbl_vendor();
|
||||
if (is_bbl_vendor_preset) {
|
||||
wxGetApp().plater()->get_partplate_list().set_render_option(true, true);
|
||||
@@ -2129,6 +2134,28 @@ void Tab::on_presets_changed()
|
||||
wxGetApp().plater()->update_project_dirty_from_presets();
|
||||
}
|
||||
|
||||
void Tab::update_printer_agent_if_needed()
|
||||
{
|
||||
std::string agent_id = "orca";
|
||||
if (m_preset_bundle) {
|
||||
if (wxGetApp().preset_bundle->is_bbl_vendor()) {
|
||||
agent_id = "bbl";
|
||||
} else if (wxGetApp().preset_bundle->is_qidi_vendor()) {
|
||||
agent_id = "qidi";
|
||||
}
|
||||
}
|
||||
|
||||
const DynamicPrintConfig& config = m_preset_bundle->printers.get_edited_preset().config;
|
||||
if (config.has("printer_agent")) {
|
||||
std::string value = config.option<ConfigOptionString>("printer_agent")->value;
|
||||
if (!value.empty()) {
|
||||
agent_id = value;
|
||||
}
|
||||
}
|
||||
// Switch agent in GUI_App
|
||||
wxGetApp().switch_printer_agent(agent_id);
|
||||
}
|
||||
|
||||
void Tab::build_preset_description_line(ConfigOptionsGroup* optgroup)
|
||||
{
|
||||
auto description_line = [this](wxWindow* parent) {
|
||||
|
||||
Reference in New Issue
Block a user