Attempts to open the selected paper's PDF with the system viewer. Shows an error dialog if the PDF file is not found.
(&mut self)
| 434 | /// |
| 435 | /// Shows an error dialog if the PDF file is not found. |
| 436 | fn handle_open_pdf(&mut self) { |
| 437 | if let Some(paper) = self.selected_paper() { |
| 438 | let pdf_path = format!( |
| 439 | "{}/{}.pdf", |
| 440 | Database::default_storage_path().display(), |
| 441 | format_title(&paper.title, Some(50)) |
| 442 | ); |
| 443 | |
| 444 | if std::path::Path::new(&pdf_path).exists() { |
| 445 | self.open_pdf_with_system_viewer(&pdf_path); |
| 446 | } else { |
| 447 | self.dialog = DialogType::PDFNotFound; |
| 448 | self.needs_redraw = true; |
| 449 | } |
| 450 | } |
| 451 | } |
| 452 | |
| 453 | /// Updates the maximum scroll position for the details view. |
| 454 | /// |
no test coverage detected