Plugin-gate the reslice check and drop non-plugin leftovers

reslice() now enforces only the missing-plugin block via
refresh_missing_plugin_block (no second Print::validate); plate
ready-status returns to upstream's plain model_fits, matching
GLCanvas3D::reload_scene. Also restores main's use_bbl_device_tab and
the check_track_enable comment, and drops two unused MainFrame includes.
This commit is contained in:
SoftFever
2026-07-15 19:18:45 +08:00
parent e116181c07
commit 1551898846
5 changed files with 16 additions and 19 deletions
+3 -3
View File
@@ -695,15 +695,15 @@ bool PresetBundle::use_bbl_network()
} }
bool PresetBundle::use_bbl_device_tab() { bool PresetBundle::use_bbl_device_tab() {
const auto cfg = printers.get_edited_preset().config; if (!is_bbl_vendor()) {
if (!is_bbl_vendor())
return false; return false;
}
if (use_bbl_network()) { if (use_bbl_network()) {
return true; return true;
} }
const auto cfg = printers.get_edited_preset().config;
// Use bbl device tab if printhost webui url is not set // Use bbl device tab if printhost webui url is not set
return cfg.opt_string("print_host_webui").empty(); return cfg.opt_string("print_host_webui").empty();
} }
+1 -1
View File
@@ -5404,7 +5404,7 @@ void GUI_App::on_user_login_handle(wxCommandEvent &evt)
void GUI_App::check_track_enable() void GUI_App::check_track_enable()
{ {
// Orca: alaways disable track event // Orca: telemetry only exists on the BBL cloud agent; always disable it.
if (m_agent) { if (m_agent) {
m_agent->track_enable(false); m_agent->track_enable(false);
m_agent->track_remove_files(); m_agent->track_remove_files();
-4
View File
@@ -1,9 +1,5 @@
#include "MainFrame.hpp" #include "MainFrame.hpp"
#include <wx/event.h>
#ifdef __WXGTK__
#include <wx/gtk/app.h>
#endif
#include <wx/panel.h> #include <wx/panel.h>
#include <wx/notebook.h> #include <wx/notebook.h>
#include <wx/listbook.h> #include <wx/listbook.h>
+10 -9
View File
@@ -16761,14 +16761,15 @@ void Plater::reslice()
if (get_view3D_canvas3D()->get_gizmos_manager().is_in_editing_mode(true)) if (get_view3D_canvas3D()->get_gizmos_manager().is_in_editing_mode(true))
return; return;
// Keep slicing blocked even if a toolbar/menu path has not refreshed its enabled state yet. // Enforce the missing-plugin block at the slicing choke point: menu/keyboard/queued triggers can
// validate_current_plate also refreshes the missing-plugin notifications and plate readiness. // carry a stale enabled state while plugins load asynchronously. refresh_missing_plugin_block
bool model_fits = false; // rebuilds the missing sets and notifications from the active presets without running
bool validate_error = false; // Print::validate; all other validation keeps upstream behavior and is surfaced by
validate_current_plate(model_fits, validate_error); // update_background_process() below.
if (!model_fits || validate_error) { if (refresh_missing_plugin_block()) {
p->partplate_list.get_curr_plate()->update_slice_ready_status(false);
p->main_frame->update_slice_print_status(MainFrame::eEventPlateUpdate, false); p->main_frame->update_slice_print_status(MainFrame::eEventPlateUpdate, false);
BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << ": current plate validation failed; slicing blocked."; BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << ": required plugins missing; slicing blocked.";
return; return;
} }
@@ -18713,7 +18714,7 @@ void Plater::validate_current_plate(bool& model_fits, bool& validate_error)
} }
PartPlate* part_plate = p->partplate_list.get_curr_plate(); PartPlate* part_plate = p->partplate_list.get_curr_plate();
part_plate->update_slice_ready_status(model_fits && !validate_error); part_plate->update_slice_ready_status(model_fits);
// The toolbar Slice button is normally refreshed only by the canvas // The toolbar Slice button is normally refreshed only by the canvas
// (EVT_GLCANVAS_ENABLE_ACTION_BUTTONS) on geometry updates. When the missing-plugin block toggles // (EVT_GLCANVAS_ENABLE_ACTION_BUTTONS) on geometry updates. When the missing-plugin block toggles
@@ -18722,7 +18723,7 @@ void Plater::validate_current_plate(bool& model_fits, bool& validate_error)
// can_slice() flag that get_enable_slice_status() reads — so the button doesn't lag until the // can_slice() flag that get_enable_slice_status() reads — so the button doesn't lag until the
// next bed click. // next bed click.
if (plugins_block_changed && !p->background_process.running()) if (plugins_block_changed && !p->background_process.running())
p->main_frame->update_slice_print_status(MainFrame::eEventObjectUpdate, model_fits && !validate_error); p->main_frame->update_slice_print_status(MainFrame::eEventObjectUpdate, model_fits);
return; return;
} }
+1 -1
View File
@@ -722,7 +722,7 @@ public:
// Rebuild the missing-plugin sets from the active presets and (re)show/close their notifications. // Rebuild the missing-plugin sets from the active presets and (re)show/close their notifications.
// Returns true when slicing must be blocked (a referenced plugin is still missing); sets // Returns true when slicing must be blocked (a referenced plugin is still missing); sets
// *block_toggled when the blocked state changed since the previous call (so the caller can refresh // *block_toggled when the blocked state changed since the previous call (so the caller can refresh
// the Slice button). Helper for validate_current_plate. // the Slice button). Helper for validate_current_plate and the reslice() gate.
bool refresh_missing_plugin_block(bool* block_toggled = nullptr); bool refresh_missing_plugin_block(bool* block_toggled = nullptr);
// Re-run plate validation when a plugin finishes loading, but only while a missing-plugin // Re-run plate validation when a plugin finishes loading, but only while a missing-plugin
// notification is active, so it clears automatically once the required plugin is available. // notification is active, so it clears automatically once the required plugin is available.