Make the editor a plain text editor again
This commit is contained in:
@@ -212,7 +212,7 @@ def testGuiMenu_EditFormat(qtbot, monkeypatch, nwGUI, prjLipsum):
|
||||
# ==================
|
||||
|
||||
cleanText = "A single, short paragraph.\n\n"
|
||||
nwGUI.docEditor.setText(cleanText)
|
||||
nwGUI.docEditor.setPlainText(cleanText)
|
||||
assert nwGUI.docEditor.setCursorPosition(0)
|
||||
|
||||
# Left Align
|
||||
@@ -247,7 +247,7 @@ def testGuiMenu_EditFormat(qtbot, monkeypatch, nwGUI, prjLipsum):
|
||||
# Other Checks
|
||||
|
||||
# Replace Quotes
|
||||
nwGUI.docEditor.setText((
|
||||
nwGUI.docEditor.setPlainText((
|
||||
"### New Text\n\n"
|
||||
"Text with 'single' quotes and 'tricky stuff's'.\n\n"
|
||||
"Also text with \"double\" quotes which are \"less tricky\".\n\n"
|
||||
@@ -270,7 +270,7 @@ def testGuiMenu_EditFormat(qtbot, monkeypatch, nwGUI, prjLipsum):
|
||||
)
|
||||
|
||||
# Remove in-paragraph line breaks
|
||||
nwGUI.docEditor.setText((
|
||||
nwGUI.docEditor.setPlainText((
|
||||
"### New Text\n\n"
|
||||
"@char: Someone\n"
|
||||
"@location: Somewhere\n\n"
|
||||
@@ -288,7 +288,7 @@ def testGuiMenu_EditFormat(qtbot, monkeypatch, nwGUI, prjLipsum):
|
||||
"With another paragraph here.\n"
|
||||
)
|
||||
|
||||
nwGUI.docEditor.setText((
|
||||
nwGUI.docEditor.setPlainText((
|
||||
"### New Text\n\n"
|
||||
"@char: Someone\n"
|
||||
"@location: Somewhere\n\n"
|
||||
@@ -314,7 +314,7 @@ def testGuiMenu_EditFormat(qtbot, monkeypatch, nwGUI, prjLipsum):
|
||||
assert not nwGUI.docEditor.docAction(nwDocAction.NO_ACTION)
|
||||
|
||||
# Test Invalid Formats
|
||||
nwGUI.docEditor.setText((
|
||||
nwGUI.docEditor.setPlainText((
|
||||
"### New Text\n\n"
|
||||
"@tag: Bod\n\n"
|
||||
"Text with 'single' quotes and 'tricky stuff's'.\n\n"
|
||||
@@ -541,43 +541,43 @@ def testGuiMenu_Insert(qtbot, monkeypatch, nwGUI, fncPath, projPath, mockRnd):
|
||||
# Insert Keywords
|
||||
# ===============
|
||||
|
||||
nwGUI.docEditor.setText("Stuff")
|
||||
nwGUI.docEditor.setPlainText("Stuff")
|
||||
nwGUI.mainMenu.mInsKWItems[nwKeyWords.TAG_KEY][0].activate(QAction.Trigger)
|
||||
assert nwGUI.docEditor.getText() == "Stuff\n%s: " % nwKeyWords.TAG_KEY
|
||||
|
||||
nwGUI.docEditor.setText("Stuff")
|
||||
nwGUI.docEditor.setPlainText("Stuff")
|
||||
nwGUI.mainMenu.mInsKWItems[nwKeyWords.POV_KEY][0].activate(QAction.Trigger)
|
||||
assert nwGUI.docEditor.getText() == "Stuff\n%s: " % nwKeyWords.POV_KEY
|
||||
|
||||
nwGUI.docEditor.setText("Stuff")
|
||||
nwGUI.docEditor.setPlainText("Stuff")
|
||||
nwGUI.mainMenu.mInsKWItems[nwKeyWords.FOCUS_KEY][0].activate(QAction.Trigger)
|
||||
assert nwGUI.docEditor.getText() == "Stuff\n%s: " % nwKeyWords.FOCUS_KEY
|
||||
|
||||
nwGUI.docEditor.setText("Stuff")
|
||||
nwGUI.docEditor.setPlainText("Stuff")
|
||||
nwGUI.mainMenu.mInsKWItems[nwKeyWords.CHAR_KEY][0].activate(QAction.Trigger)
|
||||
assert nwGUI.docEditor.getText() == "Stuff\n%s: " % nwKeyWords.CHAR_KEY
|
||||
|
||||
nwGUI.docEditor.setText("Stuff")
|
||||
nwGUI.docEditor.setPlainText("Stuff")
|
||||
nwGUI.mainMenu.mInsKWItems[nwKeyWords.PLOT_KEY][0].activate(QAction.Trigger)
|
||||
assert nwGUI.docEditor.getText() == "Stuff\n%s: " % nwKeyWords.PLOT_KEY
|
||||
|
||||
nwGUI.docEditor.setText("Stuff")
|
||||
nwGUI.docEditor.setPlainText("Stuff")
|
||||
nwGUI.mainMenu.mInsKWItems[nwKeyWords.TIME_KEY][0].activate(QAction.Trigger)
|
||||
assert nwGUI.docEditor.getText() == "Stuff\n%s: " % nwKeyWords.TIME_KEY
|
||||
|
||||
nwGUI.docEditor.setText("Stuff")
|
||||
nwGUI.docEditor.setPlainText("Stuff")
|
||||
nwGUI.mainMenu.mInsKWItems[nwKeyWords.WORLD_KEY][0].activate(QAction.Trigger)
|
||||
assert nwGUI.docEditor.getText() == "Stuff\n%s: " % nwKeyWords.WORLD_KEY
|
||||
|
||||
nwGUI.docEditor.setText("Stuff")
|
||||
nwGUI.docEditor.setPlainText("Stuff")
|
||||
nwGUI.mainMenu.mInsKWItems[nwKeyWords.OBJECT_KEY][0].activate(QAction.Trigger)
|
||||
assert nwGUI.docEditor.getText() == "Stuff\n%s: " % nwKeyWords.OBJECT_KEY
|
||||
|
||||
nwGUI.docEditor.setText("Stuff")
|
||||
nwGUI.docEditor.setPlainText("Stuff")
|
||||
nwGUI.mainMenu.mInsKWItems[nwKeyWords.ENTITY_KEY][0].activate(QAction.Trigger)
|
||||
assert nwGUI.docEditor.getText() == "Stuff\n%s: " % nwKeyWords.ENTITY_KEY
|
||||
|
||||
nwGUI.docEditor.setText("Stuff")
|
||||
nwGUI.docEditor.setPlainText("Stuff")
|
||||
nwGUI.mainMenu.mInsKWItems[nwKeyWords.CUSTOM_KEY][0].activate(QAction.Trigger)
|
||||
assert nwGUI.docEditor.getText() == "Stuff\n%s: " % nwKeyWords.CUSTOM_KEY
|
||||
|
||||
@@ -592,22 +592,22 @@ def testGuiMenu_Insert(qtbot, monkeypatch, nwGUI, fncPath, projPath, mockRnd):
|
||||
# Insert Special Comments
|
||||
# =======================
|
||||
|
||||
nwGUI.docEditor.setText("Stuff\n")
|
||||
nwGUI.docEditor.setPlainText("Stuff\n")
|
||||
nwGUI.mainMenu.aInsSynopsis.activate(QAction.Trigger)
|
||||
assert nwGUI.docEditor.getText() == "Stuff\n% Synopsis: \n"
|
||||
|
||||
# Insert Break or Space
|
||||
# =====================
|
||||
|
||||
nwGUI.docEditor.setText("### Stuff\n")
|
||||
nwGUI.docEditor.setPlainText("### Stuff\n")
|
||||
nwGUI.mainMenu.aInsNewPage.activate(QAction.Trigger)
|
||||
assert nwGUI.docEditor.getText() == "[NEW PAGE]\n### Stuff\n"
|
||||
|
||||
nwGUI.docEditor.setText("### Stuff\n")
|
||||
nwGUI.docEditor.setPlainText("### Stuff\n")
|
||||
nwGUI.mainMenu.aInsVSpaceS.activate(QAction.Trigger)
|
||||
assert nwGUI.docEditor.getText() == "[VSPACE]\n### Stuff\n"
|
||||
|
||||
nwGUI.docEditor.setText("### Stuff\n")
|
||||
nwGUI.docEditor.setPlainText("### Stuff\n")
|
||||
nwGUI.mainMenu.aInsVSpaceM.activate(QAction.Trigger)
|
||||
assert nwGUI.docEditor.getText() == "[VSPACE:2]\n### Stuff\n"
|
||||
|
||||
@@ -637,7 +637,7 @@ def testGuiMenu_Insert(qtbot, monkeypatch, nwGUI, fncPath, projPath, mockRnd):
|
||||
|
||||
# Open the document from before, and add some text to it
|
||||
nwGUI.openDocument(C.hSceneDoc)
|
||||
nwGUI.docEditor.setText("Bar")
|
||||
nwGUI.docEditor.setPlainText("Bar")
|
||||
assert nwGUI.docEditor.getText() == "Bar"
|
||||
|
||||
# The document isn't empty, so the message box should pop
|
||||
|
||||
Reference in New Issue
Block a user