diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 74093e234c..3e4056db1f 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -4565,7 +4565,7 @@ bool GUI_App::show_ip_address_enter_dialog() if (!dev) return false; if (!dev->get_selected_machine()) return false; auto obj = dev->get_selected_machine(); - InputIpAddressDialog dlg(nullptr, from_u8(dev->get_selected_machine()->dev_name)); + InputIpAddressDialog dlg(nullptr, from_u8(dev->get_selected_machine()->dev_name), dev->get_selected_machine()->dev_ip, dev->get_selected_machine()->access_code); dlg.Bind(EVT_ENTER_IP_ADDRESS, [this, obj](wxCommandEvent& e) { auto selection_data_arr = wxSplit(e.GetString().ToStdString(), '|'); diff --git a/src/slic3r/GUI/MsgDialog.cpp b/src/slic3r/GUI/MsgDialog.cpp index 63eea6dace..8e2525747f 100644 --- a/src/slic3r/GUI/MsgDialog.cpp +++ b/src/slic3r/GUI/MsgDialog.cpp @@ -422,7 +422,7 @@ void DownloadDialog::SetExtendedMessage(const wxString &extendedMessage) Fit(); } -InputIpAddressDialog::InputIpAddressDialog(wxWindow* parent, wxString name) +InputIpAddressDialog::InputIpAddressDialog(wxWindow* parent, wxString name, wxString ip, wxString access_code) :DPIDialog(static_cast(wxGetApp().mainframe), wxID_ANY, _L("Unable to connect printer"), wxDefaultPosition, wxDefaultSize, wxCAPTION | wxCLOSE_BOX) { std::string icon_path = (boost::format("%1%/images/BambuStudioTitle.ico") % resources_dir()).str(); @@ -448,13 +448,13 @@ InputIpAddressDialog::InputIpAddressDialog(wxWindow* parent, wxString name) tip->Wrap(FromDIP(420)); m_tips_ip = new Label(this, _L("IP")); - m_input_ip = new TextInput(this, wxEmptyString, wxEmptyString); + m_input_ip = new TextInput(this, ip, wxEmptyString); m_input_ip->Bind(wxEVT_TEXT, &InputIpAddressDialog::on_text, this); m_input_ip->SetMinSize(wxSize(FromDIP(420), FromDIP(28))); m_input_ip->SetMaxSize(wxSize(FromDIP(420), FromDIP(28))); m_tips_access_code = new Label(this, _L("Access Code")); - m_input_access_code = new TextInput(this, wxEmptyString, wxEmptyString); + m_input_access_code = new TextInput(this, access_code, wxEmptyString); m_input_access_code->Bind(wxEVT_TEXT, &InputIpAddressDialog::on_text, this); m_input_access_code->SetMinSize(wxSize(FromDIP(420), FromDIP(28))); m_input_access_code->SetMaxSize(wxSize(FromDIP(420), FromDIP(28))); diff --git a/src/slic3r/GUI/MsgDialog.hpp b/src/slic3r/GUI/MsgDialog.hpp index ffe8383ef7..90674d6547 100644 --- a/src/slic3r/GUI/MsgDialog.hpp +++ b/src/slic3r/GUI/MsgDialog.hpp @@ -378,7 +378,7 @@ public: wxString comfirm_after_enter_text; std::string m_ip; Label* tip{nullptr}; - InputIpAddressDialog(wxWindow* parent = nullptr, wxString name = wxEmptyString); + InputIpAddressDialog(wxWindow* parent = nullptr, wxString name = wxEmptyString, wxString id = wxEmptyString, wxString access_code = wxEmptyString); ~InputIpAddressDialog(); Button* m_button_ok{nullptr};