Fixed typo in enum
This commit is contained in:
@@ -74,7 +74,7 @@ class nwDocAction(Enum):
|
||||
CUT = 3
|
||||
COPY = 4
|
||||
PASTE = 5
|
||||
ENPH = 6
|
||||
EMPH = 6
|
||||
STRONG = 7
|
||||
STRONGEMPH = 8
|
||||
STRIKE = 9
|
||||
|
||||
+1
-1
@@ -514,7 +514,7 @@ class GuiDocEditor(QTextEdit):
|
||||
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)
|
||||
|
||||
+1
-1
@@ -530,7 +530,7 @@ class GuiMainMenu(QMenuBar):
|
||||
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
|
||||
|
||||
+5
-5
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user