From 0a3109030eecfa80e3a0245906322054f0e6597b Mon Sep 17 00:00:00 2001 From: YuSanka Date: Mon, 2 Nov 2020 22:04:18 +0100 Subject: [PATCH] PhysicalPrinterDialog : fixed layout in update() --- src/slic3r/GUI/PhysicalPrinterDialog.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/PhysicalPrinterDialog.cpp b/src/slic3r/GUI/PhysicalPrinterDialog.cpp index 5a440b4f2..c970568c5 100644 --- a/src/slic3r/GUI/PhysicalPrinterDialog.cpp +++ b/src/slic3r/GUI/PhysicalPrinterDialog.cpp @@ -433,6 +433,7 @@ void PhysicalPrinterDialog::update() if (tech == ptFFF) { m_optgroup->show_field("host_type"); m_optgroup->hide_field("printhost_authorization_type"); + m_optgroup->show_field("printhost_apikey", true); for (const std::string& opt_key : std::vector{ "printhost_user", "printhost_password" }) m_optgroup->hide_field(opt_key); const auto opt = m_config->option>("host_type"); @@ -452,7 +453,13 @@ void PhysicalPrinterDialog::update() } m_optgroup->show_field("printhost_port", supports_multiple_printers); - m_printhost_port_browse_btn->Show(supports_multiple_printers); + m_printhost_port_browse_btn->Show(supports_multiple_printers); + + std::unique_ptr host(PrintHost::get_print_host(m_config)); + m_printhost_test_btn->Enable(!m_config->opt_string("print_host").empty() && host->can_test()); + m_printhost_browse_btn->Enable(host->has_auto_discovery()); + + this->SetSize(this->GetBestSize()); this->Layout(); }