feat(plugin): add a Plugin Manager window listing installed add-ons

Read-only inventory of the add-ons compiled into the build — name, version,
id, API level, description, command prefixes — built from the extracted
`ocs_plugin_api` manifest. Opened with the `PLUGINS` / `PLUGINMANAGER` command
or the Start-page "Plugins" button.

Adds `installed_manifests()` to the plugin registry and wires the window the
same way as the existing About / Shortcuts windows.

Part of #100 (phase-1 plugin manager UI stub).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-06-15 01:46:09 +03:00
commit ec865a95aa
9 changed files with 221 additions and 2 deletions

View file

@ -1640,6 +1640,9 @@ impl OpenCADStudio {
self.about_window = None;
self.ribbon.deactivate_tool_if("ABOUT");
}
if self.plugin_manager_window == Some(id) {
self.plugin_manager_window = None;
}
if self.update_notice_window == Some(id) {
self.update_notice_window = None;
}
@ -5394,6 +5397,28 @@ impl OpenCADStudio {
iced::clipboard::write(info)
}
// ── Plugin Manager window ─────────────────────────────────────
Message::PluginManagerOpen => {
if let Some(id) = self.plugin_manager_window {
return window::gain_focus(id);
}
let (id, task) = window::open(window::Settings {
size: iced::Size::new(520.0, 460.0),
resizable: true,
level: window::Level::AlwaysOnTop,
..Default::default()
});
self.plugin_manager_window = Some(id);
task.map(|_| Message::Noop)
}
Message::PluginManagerClose => {
if let Some(id) = self.plugin_manager_window.take() {
window::close(id)
} else {
Task::none()
}
}
Message::EnterViewport(handle) => {
let i = self.active_tab;
// Clear paper-space selection before entering model space.