diff --git a/csaxs_bec/bec_widgets/widgets/tomo_params/tomo_params.py b/csaxs_bec/bec_widgets/widgets/tomo_params/tomo_params.py index e21b791..55ee053 100644 --- a/csaxs_bec/bec_widgets/widgets/tomo_params/tomo_params.py +++ b/csaxs_bec/bec_widgets/widgets/tomo_params/tomo_params.py @@ -1318,6 +1318,25 @@ class TomoQueueDialog(QDialog): # ── queue actions ───────────────────────────────────────────────────────── def add_to_queue(self) -> None: + # "Current params" here means the *live* global vars -- if the + # params panel has an unsubmitted edit open, that edit is NOT what + # gets queued (the panel's own "Add to queue" button is the one + # that reads the form; see TOMO_QUEUE_COMMAND_JOBS_PLAN.md section + # 6.1). Warn rather than silently queuing something other than + # what the operator is looking at. + if getattr(self.parent(), "_edit_mode", False): + reply = QMessageBox.warning( + self, + "Unsaved edit in progress", + "The tomo parameters panel has an edit in progress. This button " + "queues the current LIVE parameters -- not your unsaved edit. Use " + "\"Add to queue\" in the params panel itself if you want to queue " + "what you just typed.\n\n" + "Queue the live (unedited) parameters anyway?", + QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.Cancel, + ) + if reply != QMessageBox.StandardButton.Yes: + return label, ok = QInputDialog.getText(self, "Add to queue", "Job label (leave blank for auto):") if not ok: return