feat(io): FILEASSOC command to toggle file association on/off (#205)

`FILEASSOC 1` (re)registers the app as a .dwg/.dxf/.bak handler; `FILEASSOC 0`
unregisters it (removes the .desktop + CAD mime package on Linux, the per-user
registry keys on Windows); bare `FILEASSOC` reports the current state. The
choice persists (file_assoc_enabled) and gates the every-launch
re-registration, so turning it off stays off across restarts.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-06-29 12:58:23 +03:00
commit 9ea800f049
5 changed files with 113 additions and 4 deletions

View file

@ -41,6 +41,7 @@ impl OpenCADStudio {
plugin_repos: self.plugin_repos.clone(),
texteditmode: self.texteditmode,
backup_on_save: self.backup_on_save,
file_assoc_enabled: self.file_assoc_enabled,
bg_color: self.default_bg_color.map(f4_to_u3),
paper_bg_color: self.default_paper_bg_color.map(f4_to_u3),
}
@ -60,6 +61,7 @@ impl OpenCADStudio {
self.plugin_repos = s.plugin_repos.clone();
self.texteditmode = s.texteditmode;
self.backup_on_save = s.backup_on_save;
self.file_assoc_enabled = s.file_assoc_enabled;
self.default_bg_color = s.bg_color.map(u3_to_f4);
self.default_paper_bg_color = s.paper_bg_color.map(u3_to_f4);
// Push the restored background onto every drawing tab that exists now