mirror of
https://git.mirrors.martin98.com/https://github.com/bambulab/BambuStudio.git
synced 2025-08-05 16:20:40 +08:00
FIX:miss "Printer not connected" case
jira: STUDIO-12166 Change-Id: I962a93f1127064816fd481dc3ad7be034e3de0f3
This commit is contained in:
parent
255ada5ff2
commit
9eba9b8a2d
@ -13913,7 +13913,7 @@ Preset *get_printer_preset(MachineObject *obj)
|
||||
return printer_preset;
|
||||
}
|
||||
|
||||
bool Plater::check_printer_initialized(MachineObject *obj, bool only_warning)
|
||||
bool Plater::check_printer_initialized(MachineObject *obj, bool only_warning, bool popup_warning)
|
||||
{
|
||||
if (!obj)
|
||||
return false;
|
||||
@ -13933,22 +13933,23 @@ bool Plater::check_printer_initialized(MachineObject *obj, bool only_warning)
|
||||
}
|
||||
|
||||
if (!has_been_initialized) {
|
||||
if (!only_warning) {
|
||||
if (popup_warning) {
|
||||
if (!only_warning) {
|
||||
if (DeviceManager::get_printer_can_set_nozzle(obj->printer_type)) {
|
||||
MessageDialog dlg(wxGetApp().plater(), _L("The nozzle type is not set. Please set the nozzle and try again."), _L("Warning"), wxOK | wxICON_WARNING);
|
||||
dlg.ShowModal();
|
||||
} else {
|
||||
MessageDialog dlg(wxGetApp().plater(), _L("The nozzle type is not set. Please check."), _L("Warning"), wxOK | wxICON_WARNING);
|
||||
dlg.ShowModal();
|
||||
}
|
||||
|
||||
if (DeviceManager::get_printer_can_set_nozzle(obj->printer_type)) {
|
||||
MessageDialog dlg(wxGetApp().plater(), _L("The nozzle type is not set. Please set the nozzle and try again."), _L("Warning"), wxOK | wxICON_WARNING);
|
||||
dlg.ShowModal();
|
||||
PrinterPartsDialog *print_parts_dlg = new PrinterPartsDialog(nullptr);
|
||||
print_parts_dlg->update_machine_obj(obj);
|
||||
print_parts_dlg->ShowModal();
|
||||
} else {
|
||||
MessageDialog dlg(wxGetApp().plater(), _L("The nozzle type is not set. Please check."), _L("Warning"), wxOK | wxICON_WARNING);
|
||||
dlg.ShowModal();
|
||||
auto printer_name = get_selected_printer_name_in_combox(); // wxString(obj->get_preset_printer_model_name(machine_print_name))
|
||||
pop_warning_and_go_to_device_page(printer_name, Plater::PrinterWarningType::NOT_CONNECTED, _L("Sync printer information"));
|
||||
}
|
||||
|
||||
PrinterPartsDialog *print_parts_dlg = new PrinterPartsDialog(nullptr);
|
||||
print_parts_dlg->update_machine_obj(obj);
|
||||
print_parts_dlg->ShowModal();
|
||||
} else {
|
||||
auto printer_name = get_selected_printer_name_in_combox(); // wxString(obj->get_preset_printer_model_name(machine_print_name))
|
||||
pop_warning_and_go_to_device_page(printer_name, Plater::PrinterWarningType::NOT_CONNECTED, _L("Sync printer information"));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -15973,7 +15974,7 @@ bool Plater::is_same_printer_for_connected_and_selected(bool popup_warning)
|
||||
if (obj == nullptr) {
|
||||
return false;
|
||||
}
|
||||
if (!check_printer_initialized(obj,true))
|
||||
if (!check_printer_initialized(obj, true, popup_warning))
|
||||
return false;
|
||||
Preset * machine_preset = get_printer_preset(obj);
|
||||
if (!machine_preset)
|
||||
|
@ -534,7 +534,7 @@ public:
|
||||
EMPTY_FILAMENT
|
||||
};
|
||||
void pop_warning_and_go_to_device_page(wxString printer_name, PrinterWarningType type, const wxString &title);
|
||||
bool check_printer_initialized(MachineObject *obj, bool only_warning = false);
|
||||
bool check_printer_initialized(MachineObject *obj, bool only_warning = false,bool popup_warning = true);
|
||||
bool is_same_printer_for_connected_and_selected(bool popup_warning = true);
|
||||
bool is_printer_configed_by_BBL();
|
||||
// BBS
|
||||
|
Loading…
x
Reference in New Issue
Block a user