Run commands, tools and the plugin API through one operations layer

A Speed Dial command, the MCP tool that does the same thing and the plugin
API's preset calls now run one shared operation, so every route accepts and
refuses the same states, with one wording and a code for each refusal. An
import by a command or a tool is one undo step, and import_file adds geometry
only.

The cases where two routes behaved differently now behave the same: a project
is not saved under a .gcode.3mf name, an empty project exports as .3mf but not
as STL, arrange runs from any view and with a gizmo open, a mixed-colour
filament slot is refused as one, a hidden preset is shown before it is
selected, and a layer is refused while the Preview has none.
This commit is contained in:
SoftFever committed 2026-11-12 22:06:10 +08:00
1 parent a9c73c76b2
commit 0616068e26
84 files changed
+6416 -1093

No files matched your search

+16
View File
@@ -2904,6 +2904,22 @@ void GCodeViewer::update_sequential_view_current(unsigned int first, unsigned in
#endif // ENABLE_ACTUAL_SPEED_DEBUG
}
void GCodeViewer::show_layer_range(std::optional<int> low, int high)
{
if (m_layers_slider == nullptr)
return;
m_layers_slider->SetHigherValue(high);
if (low)
m_layers_slider->SetLowerValue(*low);
else if (m_layers_slider->is_one_layer())
m_layers_slider->SetLowerValue(high);
m_layers_slider->set_as_dirty();
if (m_moves_slider != nullptr) {
m_moves_slider->SetHigherValue(m_moves_slider->GetMaxValue());
m_moves_slider->set_as_dirty();
}
}
void GCodeViewer::enable_moves_slider(bool enable) const
{
bool render_as_disabled = !enable;