Remove dialogs in history screen

This commit is contained in:
Miguel Jacq 2025-11-04 18:15:43 +11:00
parent c5e871294e
commit 7971b147cb
Signed by: mig5
GPG key ID: 59B3F0C24135C6A9

View file

@ -167,22 +167,10 @@ class HistoryDialog(QDialog):
return return
sel = self._db.get_version(version_id=sel_id) sel = self._db.get_version(version_id=sel_id)
vno = sel["version_no"] vno = sel["version_no"]
# Confirm
if (
QMessageBox.question(
self,
"Revert",
f"Revert {self._date} to version v{vno}?\n\nYou can always change your mind later.",
QMessageBox.Yes | QMessageBox.No,
)
!= QMessageBox.Yes
):
return
# Flip head pointer # Flip head pointer
try: try:
self._db.revert_to_version(self._date, version_id=sel_id) self._db.revert_to_version(self._date, version_id=sel_id)
except Exception as e: except Exception as e:
QMessageBox.critical(self, "Revert failed", str(e)) QMessageBox.critical(self, "Revert failed", str(e))
return return
QMessageBox.information(self, "Reverted", f"{self._date} is now at v{vno}.")
self.accept() # let the caller refresh the editor self.accept() # let the caller refresh the editor