From dad4677791c6cf6653f7f5e8f8151875ddecdab0 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Sat, 27 Jun 2020 21:06:19 +0200 Subject: [PATCH] Fixed typo in enum --- nw/constants/enum.py | 2 +- nw/gui/doceditor.py | 2 +- nw/gui/mainmenu.py | 2 +- tests/test_gui.py | 10 +++++----- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/nw/constants/enum.py b/nw/constants/enum.py index 2431d80f3..d068cb8ed 100644 --- a/nw/constants/enum.py +++ b/nw/constants/enum.py @@ -74,7 +74,7 @@ class nwDocAction(Enum): CUT = 3 COPY = 4 PASTE = 5 - ENPH = 6 + EMPH = 6 STRONG = 7 STRONGEMPH = 8 STRIKE = 9 diff --git a/nw/gui/doceditor.py b/nw/gui/doceditor.py index d140ae4c3..fce3d01ca 100644 --- a/nw/gui/doceditor.py +++ b/nw/gui/doceditor.py @@ -514,7 +514,7 @@ def docAction(self, theAction): self.copy() elif theAction == nwDocAction.PASTE: self.paste() - elif theAction == nwDocAction.ENPH: + elif theAction == nwDocAction.EMPH: self._toggleEmph(1) elif theAction == nwDocAction.STRONG: self._toggleEmph(2) diff --git a/nw/gui/mainmenu.py b/nw/gui/mainmenu.py index 9fefd21c7..2d2ecf013 100644 --- a/nw/gui/mainmenu.py +++ b/nw/gui/mainmenu.py @@ -530,7 +530,7 @@ def _buildFormatMenu(self): self.aFmtEmph = QAction("Emphasis", self) self.aFmtEmph.setStatusTip("Add emphasis to selected text (italic)") self.aFmtEmph.setShortcut("Ctrl+I") - self.aFmtEmph.triggered.connect(lambda: self._docAction(nwDocAction.ENPH)) + self.aFmtEmph.triggered.connect(lambda: self._docAction(nwDocAction.EMPH)) self.fmtMenu.addAction(self.aFmtEmph) # Format > Strong Emphasis diff --git a/tests/test_gui.py b/tests/test_gui.py index 28b20fbe2..5c8bf2acd 100644 --- a/tests/test_gui.py +++ b/tests/test_gui.py @@ -772,10 +772,10 @@ def testDocAction(qtbot, nwTempGUI, nwLipsum, nwRef, nwTemp): qtbot.wait(stepDelay) # Italic - assert nwGUI.passDocumentAction(nwDocAction.ENPH) + assert nwGUI.passDocumentAction(nwDocAction.EMPH) assert nwGUI.docEditor.getText()[27:76] == "*Pellentesque* nec erat ut nulla posuere commodo." qtbot.wait(stepDelay) - assert nwGUI.passDocumentAction(nwDocAction.ENPH) + assert nwGUI.passDocumentAction(nwDocAction.EMPH) assert nwGUI.docEditor.getText()[27:74] == cleanText qtbot.wait(stepDelay) @@ -798,9 +798,9 @@ def testDocAction(qtbot, nwTempGUI, nwLipsum, nwRef, nwTemp): # Should get us back to plain assert nwGUI.passDocumentAction(nwDocAction.STRONG) qtbot.wait(stepDelay) - assert nwGUI.passDocumentAction(nwDocAction.ENPH) + assert nwGUI.passDocumentAction(nwDocAction.EMPH) qtbot.wait(stepDelay) - assert nwGUI.passDocumentAction(nwDocAction.ENPH) + assert nwGUI.passDocumentAction(nwDocAction.EMPH) qtbot.wait(stepDelay) assert nwGUI.passDocumentAction(nwDocAction.STRONG) assert nwGUI.docEditor.getText()[27:74] == cleanText @@ -809,7 +809,7 @@ def testDocAction(qtbot, nwTempGUI, nwLipsum, nwRef, nwTemp): # Equivalent of the above assert nwGUI.passDocumentAction(nwDocAction.STRONGEMPH) qtbot.wait(stepDelay) - assert nwGUI.passDocumentAction(nwDocAction.ENPH) + assert nwGUI.passDocumentAction(nwDocAction.EMPH) qtbot.wait(stepDelay) assert nwGUI.passDocumentAction(nwDocAction.STRONG) assert nwGUI.docEditor.getText()[27:74] == cleanText