ENH:optimize the logic of the IP input window

jira:[STUDIO-10375 STUDIO-10534]

Change-Id: I75ff12403dbf8f59fa95c938fa97ec2497f0ed67
(cherry picked from commit b62efed65f26b1ea4390c2d1e8681169e63fff99)
This commit is contained in:
tao wang
2025-03-01 11:41:41 +08:00
committed by Noisyfox
parent b561599575
commit 3a67f1bd27
9 changed files with 277 additions and 88 deletions

View File

@@ -5512,10 +5512,11 @@ void GUI_App::show_ip_address_enter_dialog(wxString title)
{
auto evt = new wxCommandEvent(EVT_SHOW_IP_DIALOG);
evt->SetString(title);
evt->SetInt(-1);
wxQueueEvent(this, evt);
}
bool GUI_App::show_modal_ip_address_enter_dialog(wxString title)
bool GUI_App::show_modal_ip_address_enter_dialog(bool input_sn, wxString title)
{
DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager();
if (!dev) return false;
@@ -5523,6 +5524,7 @@ bool GUI_App::show_modal_ip_address_enter_dialog(wxString title)
auto obj = dev->get_selected_machine();
InputIpAddressDialog dlg(nullptr);
dlg.m_need_input_sn = input_sn;
dlg.set_machine_obj(obj);
if (!title.empty()) dlg.update_title(title);
@@ -5553,7 +5555,8 @@ bool GUI_App::show_modal_ip_address_enter_dialog(wxString title)
void GUI_App::show_ip_address_enter_dialog_handler(wxCommandEvent& evt)
{
wxString title = evt.GetString();
show_modal_ip_address_enter_dialog(title);
int mode = evt.GetInt();
show_modal_ip_address_enter_dialog(mode == -1?false:true, title);
}
//void GUI_App::add_config_menu(wxMenuBar *menu)