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

@@ -0,0 +1,36 @@
name: Check operation calls
# The Speed Dial's command runners, the MCP tools and the plugin API's bindings change the app through
# src/slic3r/GUI/Operations. This fails when one of their files calls an owner method an operation
# stands for and scripts/operation_calls_baseline.txt does not list the line with its reason.
on:
push:
paths:
- 'src/slic3r/GUI/NativeCommands.cpp'
- 'src/slic3r/GUI/Mcp/McpTools*.cpp'
- 'src/slic3r/plugin/host/*.cpp'
- 'scripts/check_operation_calls.py'
- 'scripts/operation_calls_baseline.txt'
- '.github/workflows/check_operation_calls.yml'
pull_request:
paths:
- 'src/slic3r/GUI/NativeCommands.cpp'
- 'src/slic3r/GUI/Mcp/McpTools*.cpp'
- 'src/slic3r/plugin/host/*.cpp'
- 'scripts/check_operation_calls.py'
- 'scripts/operation_calls_baseline.txt'
- '.github/workflows/check_operation_calls.yml'
permissions: {}
jobs:
check_operation_calls:
name: Check operation calls
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Check the callers of the operations layer
run: python3 scripts/check_operation_calls.py