diff --git a/src/slic3r/GUI/PhysicalPrinterDialog.cpp b/src/slic3r/GUI/PhysicalPrinterDialog.cpp index 04c6d4d804..b9096ce108 100644 --- a/src/slic3r/GUI/PhysicalPrinterDialog.cpp +++ b/src/slic3r/GUI/PhysicalPrinterDialog.cpp @@ -269,6 +269,8 @@ void PhysicalPrinterDialog::build_printhost_settings(ConfigOptionsGroup* m_optgr m_optgroup->m_on_change = [this](t_config_option_key opt_key, boost::any value) { if (opt_key == "host_type" || opt_key == "printhost_authorization_type") this->update(); + if (opt_key == "print_host") + this->update_printhost_buttons(); }; m_optgroup->append_single_option_line("host_type"); @@ -413,6 +415,23 @@ void PhysicalPrinterDialog::build_printhost_settings(ConfigOptionsGroup* m_optgr m_optgroup->activate(); + Field* printhost_field = m_optgroup->get_field("print_host"); + if (printhost_field) + { + wxTextCtrl* temp = dynamic_cast(printhost_field->getWindow()); + if (temp) + temp->Bind(wxEVT_TEXT, ([this, printhost_field, temp](wxEvent& e) + { +#ifndef __WXGTK__ + e.Skip(); + temp->GetToolTip()->Enable(true); +#endif // __WXGTK__ + TextCtrl* field = dynamic_cast(printhost_field); + if (field) + field->propagate_value(); + }), temp->GetId()); + } + // Always fill in the "printhost_port" combo box from the config and select it. { Choice* choice = dynamic_cast(m_optgroup->get_field("printhost_port")); @@ -423,6 +442,13 @@ void PhysicalPrinterDialog::build_printhost_settings(ConfigOptionsGroup* m_optgr update(); } +void PhysicalPrinterDialog::update_printhost_buttons() +{ + 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()); +} + void PhysicalPrinterDialog::update() { m_optgroup->reload_config(); @@ -455,9 +481,7 @@ void PhysicalPrinterDialog::update() m_optgroup->show_field("printhost_port", 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()); + update_printhost_buttons(); this->SetSize(this->GetBestSize()); this->Layout(); diff --git a/src/slic3r/GUI/PhysicalPrinterDialog.hpp b/src/slic3r/GUI/PhysicalPrinterDialog.hpp index 925939492c..7ee1f7d927 100644 --- a/src/slic3r/GUI/PhysicalPrinterDialog.hpp +++ b/src/slic3r/GUI/PhysicalPrinterDialog.hpp @@ -86,6 +86,7 @@ public: ~PhysicalPrinterDialog(); void update(); + void update_printhost_buttons(); void update_printers(); wxString get_printer_name(); void update_full_printer_names();