feat(plugin): enable/disable plugins from the Plugin Manager
The manager was a read-only inventory. Each plugin now has an Enable/Disable toggle: a disabled plugin keeps its manifest listed but drops its ribbon tab and command dispatch. The disabled-id set persists in settings.txt (disabled_plugins=) and the ribbon rebuilds on toggle. Part of the #100 extensibility epic. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
195415af84
commit
844069b4ef
9 changed files with 157 additions and 23 deletions
|
|
@ -135,6 +135,17 @@ impl Ribbon {
|
|||
self.active = index;
|
||||
}
|
||||
}
|
||||
|
||||
/// Replace the tab list (e.g. after a plugin is enabled/disabled in the
|
||||
/// Plugin Manager). Clamps the active tab so it stays in range.
|
||||
pub fn set_modules(&mut self, modules: Vec<Box<dyn CadModule>>) {
|
||||
self.modules = modules;
|
||||
if self.active >= self.modules.len() {
|
||||
self.active = self.modules.len().saturating_sub(1);
|
||||
}
|
||||
self.active_tool = None;
|
||||
self.open_dropdown = None;
|
||||
}
|
||||
pub fn activate_tool(&mut self, id: &str) {
|
||||
self.active_tool = Some(id.to_string());
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue