Refactor schema to support versioning of pages. Add HistoryDialog and diff with ability to revert.

This commit is contained in:
Miguel Jacq 2025-11-02 17:02:03 +11:00
parent cf9102939f
commit 82069053be
Signed by: mig5
GPG key ID: 59B3F0C24135C6A9
9 changed files with 520 additions and 33 deletions

View file

@ -15,6 +15,7 @@ class ToolBar(QToolBar):
bulletsRequested = Signal()
numbersRequested = Signal()
alignRequested = Signal(Qt.AlignmentFlag)
historyRequested = Signal()
def __init__(self, parent=None):
super().__init__("Format", parent)
@ -76,6 +77,10 @@ class ToolBar(QToolBar):
lambda: self.alignRequested.emit(Qt.AlignRight)
)
# History button
self.actHistory = QAction("History", self)
self.actHistory.triggered.connect(self.historyRequested)
self.addActions(
[
self.actBold,
@ -92,6 +97,7 @@ class ToolBar(QToolBar):
self.actAlignL,
self.actAlignC,
self.actAlignR,
self.actHistory,
]
)
@ -120,6 +126,9 @@ class ToolBar(QToolBar):
self._style_letter_button(self.actAlignC, "C")
self._style_letter_button(self.actAlignR, "R")
# History
self._style_letter_button(self.actHistory, "View History")
def _style_letter_button(
self,
action: QAction,