mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-23 10:52:15 +00:00
refactor
This commit is contained in:
@@ -3208,7 +3208,9 @@ std::map<int, DynamicPrintConfig> Sidebar::build_filament_ams_list(MachineObject
|
||||
// For pull-mode agents (e.g., HTTP REST API), refresh DevFilaSystem first
|
||||
auto* agent = wxGetApp().getDeviceManager()->get_agent();
|
||||
if (agent && agent->get_filament_sync_mode() == FilamentSyncMode::pull) {
|
||||
agent->fetch_filament_info(obj->get_dev_id());
|
||||
if (!agent->fetch_filament_info(obj->get_dev_id())) {
|
||||
return filament_ams_list;
|
||||
}
|
||||
}
|
||||
|
||||
auto build_tray_config = [](DevAmsTray const &tray, std::string const &name, std::string ams_id, std::string slot_id) {
|
||||
@@ -16631,8 +16633,15 @@ void Plater::pop_warning_and_go_to_device_page(wxString printer_name, PrinterWar
|
||||
{
|
||||
printer_name.Replace("Bambu Lab", "", false);
|
||||
wxString content;
|
||||
bool device_page = (wxGetApp().mainframe == nullptr) && (wxGetApp().mainframe->m_monitor->IsShown());
|
||||
if (type == PrinterWarningType::NOT_CONNECTED) {
|
||||
content = wxString::Format(_L("Printer not connected. Please go to the device page to connect %s before syncing."), printer_name);
|
||||
if (device_page) {
|
||||
content = wxString::Format(_L("Printer not connected. Please go to the device page to connect %s before syncing."),
|
||||
printer_name);
|
||||
} else {
|
||||
content = wxString::Format(
|
||||
_L("OrcaSlicer can't connect to %s. Please check if the printer is powered on and connected to the network."), printer_name);
|
||||
}
|
||||
} else if (type == PrinterWarningType::INCONSISTENT) {
|
||||
content = wxString::Format(_L("The currently connected printer on the device page is not %s. Please switch to %s before syncing."), printer_name, printer_name);
|
||||
} else if (type == PrinterWarningType::UNINSTALL_FILAMENT) {
|
||||
|
||||
Reference in New Issue
Block a user