ElyTable: a CSV import pushed aside by another dialog comes back with its choices (T-10)

This commit is contained in:
ZacharyZhang-NY committed 2026-10-09 19:06:57 -04:00
1 parent 6145b5cea2
commit 345e248ff7
14 files changed
+73 -21

No files matched your search

+13 -1
View File
@@ -253,14 +253,26 @@ impl Book {
.detach_and_log_err(cx);
}
/// Opens `dialog`; a displaced import waits its turn again.
pub(crate) fn open_dialog(&mut self, dialog: Dialog) {
if let Some(Dialog::Import(pending)) = self.dialog.replace(dialog) {
log::info!("table: import waits behind another dialog");
self.imports.push_front(*pending);
}
}
/// The next waiting import asks, once no dialog is open.
pub(crate) fn next_import(&mut self, cx: &mut Context<Self>) {
if self.dialog.is_some() {
return;
}
if let Some(pending) = self.imports.pop_front() {
// A finished scan keeps the reader's column choices.
let unread = pending.reading;
self.dialog = Some(Dialog::Import(Box::new(pending)));
self.scan_import(cx);
if unread {
self.scan_import(cx);
}
}
}