FIX: disable editing while sending print job

jira: [STUDIO-10362]
Change-Id: Ie017db650699c64b751430a2bac2f9680626a750
(cherry picked from commit 79d626271cd1c7448e2cba5351b28d75652a710d)
This commit is contained in:
xin.zhang 2025-02-17 12:05:50 +08:00 committed by Noisyfox
parent cb909b9b56
commit 691d357606
2 changed files with 32 additions and 0 deletions

View file

@ -1066,6 +1066,7 @@ void SelectMachineDialog::sending_mode()
// disable combobox
m_comboBox_printer->Disable();
Enable_Auto_Refill(false);
EnableEditing(false);
m_is_in_sending_mode = true;
if (m_simplebook->GetSelection() != 1){
@ -1085,6 +1086,8 @@ void SelectMachineDialog::sending_mode()
void SelectMachineDialog::finish_mode()
{
EnableEditing(true);
m_print_page_mode = PrintPageModeFinish;
m_is_in_sending_mode = false;
m_simplebook->SetSelection(2);
@ -2306,6 +2309,29 @@ wxString SelectMachineDialog::format_steel_name(NozzleType type)
return _L("Unknown");
}
void SelectMachineDialog::EnableEditing(bool enable)
{
/*project*/
m_rename_button->Enable(enable);
/*printer*/
m_comboBox_printer->Enable(enable);
m_button_refresh->Enable(enable);
/*mapping*/
m_filament_panel->Enable(enable);
m_filament_left_panel->Enable(enable);
m_filament_right_panel->Enable(enable);
/*mapping link*/
m_link_edit_nozzle->Enable(enable);
/*options*/
for (auto iter : m_checkbox_list)
{
iter.second->Enable(enable);
}
}
void SelectMachineDialog::Enable_Auto_Refill(bool enable)
{
@ -2652,6 +2678,8 @@ void SelectMachineDialog::on_set_finish_mapping(wxCommandEvent &evt)
void SelectMachineDialog::on_print_job_cancel(wxCommandEvent &evt)
{
BOOST_LOG_TRIVIAL(info) << "print_job: canceled";
EnableEditing(true);
show_status(PrintDialogStatus::PrintStatusInit);
// enter prepare mode
prepare_mode();
@ -4409,6 +4437,7 @@ void SelectMachineDialog::sys_color_changed()
bool SelectMachineDialog::Show(bool show)
{
if (show) {
EnableEditing(true);
m_options_other->Hide();
m_advanced_options_icon->SetBitmap(create_scaled_bitmap("advanced_option1", this, 18));
m_refresh_timer->Start(LIST_REFRESH_INTERVAL);