forked from 1b-agent/opencadstudio-upstream
feat(block-editor): add Test Block preview
Preview the current unsaved block in a disposable drawing with independent history. Keep normal Draw tools available, append Close Test Block, and return to the original editor without saving. Guard persistence paths and handle refresh and parent-close lifecycle by stable document identity.
This commit is contained in:
1 parent
0a29be07f7
commit
9632979d09
22 files changed
+801
-65
No files matched your search
@@ -149,6 +149,33 @@ impl OpenCADStudio {
|
||||
};
|
||||
let resolved = self.resolve_alias(cmd);
|
||||
let cmd = resolved.as_deref().unwrap_or(cmd);
|
||||
if self.tabs[i].block_test.is_some() {
|
||||
let name = cmd.split([' ', ':']).next().unwrap_or(cmd);
|
||||
if matches!(
|
||||
name,
|
||||
"BEDIT"
|
||||
| "BEDIT_BEGIN"
|
||||
| "BEDIT_OPEN"
|
||||
| "REFEDIT"
|
||||
| "REFEDIT_BEGIN"
|
||||
| "BSAVE"
|
||||
| "BSAVEAS"
|
||||
| "SAVE"
|
||||
| "QSAVE"
|
||||
| "SAVEAS"
|
||||
| "SAVEALL"
|
||||
| "WBLOCK"
|
||||
| "EXPORT"
|
||||
| "ETRANSMIT"
|
||||
| "ARCHIVE"
|
||||
) {
|
||||
self.command_line.push_error(
|
||||
crate::t!("Close Test Block before saving or opening another block editor.")
|
||||
.as_ref(),
|
||||
);
|
||||
return Task::none();
|
||||
}
|
||||
}
|
||||
if is_spacemouse_command(cmd) {
|
||||
return self.run_action(cmd);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user