forked from 1b-agent/opencadstudio-upstream
The ABOUT command and its version-reporting window already exist, but the ToolDef sat dead-code in the draw module with no ribbon entry, so the only way in was typing ABOUT. Move it to the manage module and give it an Application group on the Manage tab, as a discoverable fallback for version diagnostics. Co-Authored-By: Claude Fable 5 <[email protected]>
88 lines
3.7 KiB
Rust
88 lines
3.7 KiB
Rust
// Manage module — customization and drawing cleanup tools.
|
|
|
|
mod about;
|
|
mod audit;
|
|
mod cui_export;
|
|
mod cui_import;
|
|
mod find_nonpurgeable;
|
|
mod options;
|
|
mod overkill;
|
|
mod purge;
|
|
mod user_interface;
|
|
|
|
use crate::modules::{CadModule, IconKind, RibbonGroup, RibbonItem};
|
|
|
|
pub struct ManageModule;
|
|
|
|
impl CadModule for ManageModule {
|
|
fn id(&self) -> &'static str {
|
|
"manage"
|
|
}
|
|
fn title(&self) -> &'static str {
|
|
"Manage"
|
|
}
|
|
|
|
fn ribbon_groups(&self) -> &[RibbonGroup] {
|
|
static GROUPS: std::sync::OnceLock<Vec<RibbonGroup>> = std::sync::OnceLock::new();
|
|
GROUPS.get_or_init(|| {
|
|
vec![
|
|
// ── Customization ─────────────────────────────────────────────────
|
|
RibbonGroup {
|
|
title: "Customization",
|
|
tools: vec![
|
|
RibbonItem::LargeTool(user_interface::tool()),
|
|
RibbonItem::LargeTool(crate::modules::ToolDef {
|
|
id: "TOOLPALETTES",
|
|
label: "Tool\nPalettes",
|
|
icon: IconKind::Svg(include_bytes!(
|
|
"../../../assets/icons/tool_palettes.svg"
|
|
)),
|
|
event: crate::modules::ModuleEvent::Command("TOOLPALETTES".to_string()),
|
|
}),
|
|
RibbonItem::Tool(cui_import::tool()),
|
|
RibbonItem::Tool(cui_export::tool()),
|
|
RibbonItem::Dropdown {
|
|
id: "ALIASEDIT_DROPDOWN",
|
|
icon: IconKind::Svg(include_bytes!(
|
|
"../../../assets/icons/edit_aliases.svg"
|
|
)),
|
|
items: vec![
|
|
(
|
|
"ALIASEDIT",
|
|
"Edit Aliases",
|
|
IconKind::Svg(include_bytes!(
|
|
"../../../assets/icons/edit_aliases.svg"
|
|
)),
|
|
),
|
|
(
|
|
"CUILOAD",
|
|
"Load Partial CUI",
|
|
IconKind::Svg(include_bytes!(
|
|
"../../../assets/icons/cui_import.svg"
|
|
)),
|
|
),
|
|
],
|
|
default: "ALIASEDIT",
|
|
},
|
|
],
|
|
},
|
|
// ── Cleanup ───────────────────────────────────────────────────────
|
|
RibbonGroup {
|
|
title: "Cleanup",
|
|
tools: vec![
|
|
RibbonItem::LargeTool(find_nonpurgeable::tool()),
|
|
RibbonItem::Tool(purge::tool()),
|
|
RibbonItem::Tool(overkill::tool()),
|
|
RibbonItem::Tool(audit::tool()),
|
|
],
|
|
},
|
|
// ── Application ───────────────────────────────────────────────────
|
|
RibbonGroup {
|
|
title: "Application",
|
|
tools: vec![RibbonItem::LargeTool(about::tool())],
|
|
},
|
|
]
|
|
})
|
|
}
|
|
}
|