diff --git a/pasta_eln/GUI/table.py b/pasta_eln/GUI/table.py index 61ef5bd2..2782000a 100644 --- a/pasta_eln/GUI/table.py +++ b/pasta_eln/GUI/table.py @@ -269,16 +269,13 @@ def execute(self, command:list[Any]) -> None: break self.comm.changeTable.emit(self.docType, '') elif command[0] is Command.DELETE: + ret = None for row in range(self.models[-1].rowCount()): item, docID = self.itemFromRow(row) if item.checkState() == Qt.CheckState.Checked: - ret = QMessageBox.critical( - self, - 'Warning', - f'Are you sure you want to delete this data: {item.text()}?', - QMessageBox.StandardButton.Yes, - QMessageBox.StandardButton.No, - ) + if ret is None: + ret = QMessageBox.critical(self, 'Warning', 'Are you sure you want to delete the data?', + QMessageBox.StandardButton.Yes, QMessageBox.StandardButton.No) if ret==QMessageBox.StandardButton.Yes: doc = self.comm.backend.db.getDoc(docID) for branch in doc['-branch']: