diff --git a/src/slic3r/GUI/SelectMachine.cpp b/src/slic3r/GUI/SelectMachine.cpp index 85692df461..a02ea6c5e4 100644 --- a/src/slic3r/GUI/SelectMachine.cpp +++ b/src/slic3r/GUI/SelectMachine.cpp @@ -4070,24 +4070,9 @@ void SelectMachineDialog::sys_color_changed() bool SelectMachineDialog::Show(bool show) { - if (show) { - m_refresh_timer->Start(LIST_REFRESH_INTERVAL); - } else { - m_refresh_timer->Stop(); - - DeviceManager *dev = Slic3r::GUI::wxGetApp().getDeviceManager(); - if (dev) { - MachineObject *obj_ = dev->get_selected_machine(); - if (obj_ && obj_->connection_type() == "cloud" /*&& m_print_type == FROM_SDCARD_VIEW*/) { - if (obj_->is_connected()) { obj_->disconnect(); } - } - } - - return DPIDialog::Show(false); - } - show_status(PrintDialogStatus::PrintStatusInit); + PresetBundle& preset_bundle = *wxGetApp().preset_bundle; const auto& project_config = preset_bundle.project_config; @@ -4109,14 +4094,31 @@ bool SelectMachineDialog::Show(bool show) } // set default value when show this dialog - wxGetApp().UpdateDlgDarkUI(this); - wxGetApp().reset_to_active(); - set_default(); - update_user_machine_list(); + if (show) { + m_refresh_timer->Start(LIST_REFRESH_INTERVAL); + show_status(PrintDialogStatus::PrintStatusInit); + wxGetApp().UpdateDlgDarkUI(this); + wxGetApp().reset_to_active(); + set_default(); + update_user_machine_list(); - Layout(); - Fit(); - CenterOnParent(); + Layout(); + Fit(); + CenterOnParent(); + } + else { + m_refresh_timer->Stop(); + DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager(); + if (dev) { + MachineObject* obj_ = dev->get_selected_machine(); + if (obj_ && obj_->connection_type() == "cloud" /*&& m_print_type == FROM_SDCARD_VIEW*/) { + if (obj_->is_connected()) { + obj_->disconnect(); + } + + } + } + } return DPIDialog::Show(show); }