ENH:close the auto refresh window when sending tasks

STUDIO-3492

Change-Id: I9f1272a5d105e8fad379ca95820447d33eb49b1a
This commit is contained in:
tao wang 2023-06-29 20:55:24 +08:00 committed by Lane.Wei
parent ffd36b8c5e
commit 1a8622b7f9
2 changed files with 16 additions and 2 deletions

View file

@ -1127,8 +1127,8 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater)
m_ams_backup_tip->Bind(wxEVT_LEAVE_WINDOW, [this](auto& e) {SetCursor(wxCURSOR_ARROW); }); m_ams_backup_tip->Bind(wxEVT_LEAVE_WINDOW, [this](auto& e) {SetCursor(wxCURSOR_ARROW); });
img_ams_backup->Bind(wxEVT_LEAVE_WINDOW, [this](auto& e) {SetCursor(wxCURSOR_ARROW); }); img_ams_backup->Bind(wxEVT_LEAVE_WINDOW, [this](auto& e) {SetCursor(wxCURSOR_ARROW); });
m_ams_backup_tip->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {popup_filament_backup(); on_rename_enter(); }); m_ams_backup_tip->Bind(wxEVT_LEFT_DOWN, [this](auto& e) { if (!m_is_in_sending_mode) {popup_filament_backup(); on_rename_enter();} });
img_ams_backup->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {popup_filament_backup(); }); img_ams_backup->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {if (!m_is_in_sending_mode) popup_filament_backup();on_rename_enter(); });
m_statictext_ams_msg = new wxStaticText(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER_HORIZONTAL); m_statictext_ams_msg = new wxStaticText(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER_HORIZONTAL);
m_statictext_ams_msg->SetFont(::Label::Body_13); m_statictext_ams_msg->SetFont(::Label::Body_13);
@ -1684,6 +1684,7 @@ void SelectMachineDialog::prepare_mode()
{ {
// disable combobox // disable combobox
m_comboBox_printer->Enable(); m_comboBox_printer->Enable();
Enable_Auto_Refill(true);
show_print_failed_info(false); show_print_failed_info(false);
m_is_in_sending_mode = false; m_is_in_sending_mode = false;
@ -1715,6 +1716,7 @@ void SelectMachineDialog::sending_mode()
{ {
// disable combobox // disable combobox
m_comboBox_printer->Disable(); m_comboBox_printer->Disable();
Enable_Auto_Refill(false);
m_is_in_sending_mode = true; m_is_in_sending_mode = true;
if (m_simplebook->GetSelection() != 1){ if (m_simplebook->GetSelection() != 1){
@ -2345,6 +2347,17 @@ void SelectMachineDialog::on_ok_btn(wxCommandEvent &event)
} }
} }
void SelectMachineDialog::Enable_Auto_Refill(bool enable)
{
if (enable) {
m_ams_backup_tip->SetForegroundColour(wxColour(0x00AE42));
}
else {
m_ams_backup_tip->SetForegroundColour(wxColour(0x90, 0x90, 0x90));
}
m_ams_backup_tip->Refresh();
}
void SelectMachineDialog::connect_printer_mqtt() void SelectMachineDialog::connect_printer_mqtt()
{ {
DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager(); DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager();

View file

@ -416,6 +416,7 @@ public:
void on_cancel(wxCloseEvent& event); void on_cancel(wxCloseEvent& event);
void show_errors(wxString& info); void show_errors(wxString& info);
void on_ok_btn(wxCommandEvent& event); void on_ok_btn(wxCommandEvent& event);
void Enable_Auto_Refill(bool enable);
void connect_printer_mqtt(); void connect_printer_mqtt();
void on_send_print(); void on_send_print();
void clear_ip_address_config(wxCommandEvent& e); void clear_ip_address_config(wxCommandEvent& e);