mirror of
https://github.com/storytold/wordcraft.git
synced 2026-11-27 00:01:12 +00:00
#3535: an existing file at the .xml name is refused on the status bar
CodeRabbit: export_dialog drops ask_file's result, so the refusal was silent with a blocking Save dialog. finish_pick now puts it on the status bar as well. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
66c159c228
commit
06b4d911cc
@@ -878,6 +878,8 @@ mod tests {
|
||||
// The appended name already exists: the system dialog never confirmed it, so refuse.
|
||||
let bare = dir.join("letter").to_string_lossy().into_owned();
|
||||
assert!(a.finish_pick(AfterPick::Export { ext: "xml".into() }, Some(bare)).is_err());
|
||||
let said = a.status_msg.as_ref().map(|(m, _)| m.clone()).unwrap_or_default();
|
||||
assert!(said.contains("letter.xml already exists"), "the refusal is on the status bar: {said:?}");
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
}
|
||||
|
||||
|
||||
@@ -310,7 +310,10 @@ impl WordApp {
|
||||
path.push_str(".xml");
|
||||
// The dialog only confirmed the name it was given, not this one.
|
||||
if std::path::Path::new(&path).exists() {
|
||||
return Err(format!("{path} already exists; choose another name"));
|
||||
// Callers drop the result, so say it where the person sees it.
|
||||
let msg = format!("{path} already exists; choose another name");
|
||||
self.status(msg.clone());
|
||||
return Err(msg);
|
||||
}
|
||||
}
|
||||
// Word XML even over a Word 2003 XML file, which a save by path would keep.
|
||||
|
||||
Reference in New Issue
Block a user