forked from 1b-agent/opencadstudio-upstream
Merge pull request #1754 from ramox81/codex/attach-command-line
ATTACH: FILEDIA, -ATTACH command line and reference file types # Conflicts: # src/app/settings.rs # src/app/update/file.rs
This commit is contained in:
commit
f8908e151f
33 files changed
+519
-47
No files matched your search
@@ -1213,6 +1213,7 @@ impl OpenCADStudio {
|
||||
| "DGNOSNAP"
|
||||
| "UOSNAP"
|
||||
| "FIELDDISPLAY"
|
||||
| "FILEDIA"
|
||||
| "SURFACEASSOCIATIVITY"
|
||||
| "UCSORTHO"
|
||||
| "UCSVIEW"
|
||||
@@ -1602,6 +1603,35 @@ impl OpenCADStudio {
|
||||
}
|
||||
return Some(self.finish_dispatch(cmd));
|
||||
}
|
||||
if name == "FILEDIA" {
|
||||
let current = i16::from(crate::sys::file_dia());
|
||||
match value
|
||||
.as_deref()
|
||||
.map(|v| v.trim().parse::<i16>().ok().filter(|v| (0..=1).contains(v)))
|
||||
{
|
||||
Some(Some(mode)) => {
|
||||
if current != mode {
|
||||
crate::sys::set_file_dia(mode == 1);
|
||||
self.save_config();
|
||||
}
|
||||
}
|
||||
Some(None) => {
|
||||
self.command_line
|
||||
.push_error(crate::t!("Requires 0 or 1 only.").as_ref());
|
||||
self.command_line.push_output(&format!(
|
||||
"Enter new value for FILEDIA <{current}>:"
|
||||
));
|
||||
self.pending_setvar = Some(name.clone());
|
||||
}
|
||||
None => {
|
||||
self.command_line.push_output(&format!(
|
||||
"Enter new value for FILEDIA <{current}>:"
|
||||
));
|
||||
self.pending_setvar = Some(name.clone());
|
||||
}
|
||||
}
|
||||
return Some(self.finish_dispatch(cmd));
|
||||
}
|
||||
if matches!(
|
||||
name.as_str(),
|
||||
"PDFOSNAP" | "DWFOSNAP" | "DGNOSNAP" | "UOSNAP"
|
||||
|
||||
Reference in new issue
Block a user