Merge pull request #1358 from HakanSeven12/plot/b4-windows-printer-routing

fix(print): send Windows plots to the chosen printer, name the default, report failures

# Conflicts:
#	locales/ar-SA/opencadstudio.ftl
#	locales/bg-BG/opencadstudio.ftl
#	locales/cs-CZ/opencadstudio.ftl
#	locales/de-DE/opencadstudio.ftl
#	locales/el-GR/opencadstudio.ftl
#	locales/en-US/opencadstudio.ftl
#	locales/es-ES/opencadstudio.ftl
#	locales/fi-FI/opencadstudio.ftl
#	locales/fr-FR/opencadstudio.ftl
#	locales/hi-IN/opencadstudio.ftl
#	locales/hu-HU/opencadstudio.ftl
#	locales/it-IT/opencadstudio.ftl
#	locales/ja-JP/opencadstudio.ftl
#	locales/ko-KR/opencadstudio.ftl
#	locales/nl-NL/opencadstudio.ftl
#	locales/pl-PL/opencadstudio.ftl
#	locales/pt-BR/opencadstudio.ftl
#	locales/ru-RU/opencadstudio.ftl
#	locales/tr-TR/opencadstudio.ftl
#	locales/zh-CN/opencadstudio.ftl
#	locales/zh-TW/opencadstudio.ftl
#	src/locale_catalog.rs
This commit is contained in:
Hakan Seven committed 2026-09-19 23:00:18 +03:00
commit 377f551b48
29 files changed
+592 -112

No files matched your search

+29
View File
@@ -869,6 +869,15 @@ impl OpenCADStudio {
"PRINTALL" => {
return Some(Task::done(Message::PrintAllOpen));
}
// PRINTERS — what the system reports about printing, on the
// command line: the default printer, every printer it lists (or
// why it could not), and how a plot will reach them. The report
// a user pastes into a bug report instead of a screenshot.
"PRINTERS" => {
for line in crate::io::print_to_printer::printer_report() {
self.command_line.push_output(&line);
}
}
"EXPORT" | "EXPORTPDF" => {
return Some(Task::done(Message::PlotExport));
}
@@ -2098,3 +2107,23 @@ mod tests {
}
}
}
#[cfg(test)]
mod printers_command_tests {
use crate::app::OpenCADStudio;
#[test]
fn printers_reports_the_default_and_the_list() {
let mut app = OpenCADStudio::new_for_test();
app.automation_op(r#"{"op":"new"}"#);
let before = app.command_line.history.len();
let _ = app.run_command_line("PRINTERS");
let lines: Vec<String> = app.command_line.history[before..]
.iter()
.map(|line| line.text.clone())
.collect();
// One line for the default printer, at least one for the list (a
// count and names, "none", or the system's error).
assert!(lines.len() >= 2, "{lines:?}");
}
}
+1
View File
@@ -726,6 +726,7 @@ inventory::submit!(crate::command::CommandRegistration {
"PERF",
"PERSP",
"PLOT",
"PRINTERS",
"PLOTSTYLE",
"PLOTSTYLEEDITOR",
"PLOTSTYLEPANEL",