mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-12-04 21:13:13 -05:00
Open Space Audit from the Compress tool
This commit is contained in:
1 parent
561823dbcd
commit
e89d9edefc
4 files changed
+19
-1
No files matched your search
@@ -326,7 +326,7 @@ pub static TOOL_GROUPS: &[ToolGroup] = &[
|
||||
items: &[
|
||||
item("Reduce file size", "file-down", "optimize.reduce", Ready),
|
||||
item("Advanced optimization", "settings-2", "optimize.advanced", Ready),
|
||||
item("Audit space usage", "gauge", "optimize.audit", Planned("M11")),
|
||||
item("Audit space usage", "gauge", "optimize.audit", Ready),
|
||||
],
|
||||
}],
|
||||
},
|
||||
|
||||
@@ -404,6 +404,7 @@ pub const COMMANDS: &[CommandSpec] = &[
|
||||
c("export.image", "Export to image…", FILE, None, Copying, "image"),
|
||||
c("optimize.reduce", "Reduce file size…", FILE, None, Document, "file-down"),
|
||||
c("optimize.advanced", "Optimize PDF…", FILE, None, Document, "settings-2"),
|
||||
c("optimize.audit", "Audit space usage…", None, None, Document, "gauge"),
|
||||
c("export.text", "Export to text…", FILE, None, Copying, "type"),
|
||||
c("export.docx", "Export to Word…", FILE, None, Copying, "file-text"),
|
||||
c("export.pptx", "Export to PowerPoint…", FILE, None, Copying, "presentation"),
|
||||
|
||||
@@ -461,6 +461,7 @@ impl PdfCraftApp {
|
||||
"protect.remove_hidden" => self.open_remove_hidden(),
|
||||
"print.dialog" => self.open_print(),
|
||||
"optimize.advanced" => crate::optimize_ui::open_optimizer(self, ctx),
|
||||
"optimize.audit" => crate::optimize_ui::open_space_audit(self, ctx, false),
|
||||
"doc.compare" => crate::compare_ui::open_compare_dialog(self, ctx),
|
||||
"standards.pdfa" => self.open_pdfa(),
|
||||
"actions.wizard" => crate::actions_ui::open_wizard(self, ctx, None),
|
||||
|
||||
@@ -251,6 +251,22 @@ fn tool_details_return_to_all_tools_by_keyboard_and_accessibility() {
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn compress_tool_opens_the_shipped_space_audit() {
|
||||
let mut h = tools_dock(1200.0);
|
||||
tool_row(&h, "Compress a PDF").click();
|
||||
h.run_steps(4);
|
||||
let row = h.get_by(|n| {
|
||||
n.role() == egui::accesskit::Role::ListItem && n.label().is_some_and(|s| s == "Audit space usage" || s.starts_with("Audit space usage,"))
|
||||
});
|
||||
assert!(!row.is_disabled());
|
||||
row.click();
|
||||
h.run_steps(3);
|
||||
h.get_by_role_and_label(egui::accesskit::Role::Dialog, "Space Audit");
|
||||
assert!(crate::support::step_until(&mut h, |h| h.query_by_role_and_label(egui::accesskit::Role::ListItem, "Total").is_some()));
|
||||
assert_eq!(h.state().dialogs.open_dialogs().len(), 1, "the audit opens on its own");
|
||||
}
|
||||
|
||||
fn tools_dock_rect(h: &Harness<'static, PdfCraftApp>) -> egui::Rect {
|
||||
let header = h.get_by_label("Close All tools").rect();
|
||||
let first = tool_row(h, "Export a PDF").rect();
|
||||
|
||||
Reference in new issue
Block a user