Merge branch 'release' into release_1.1rc1

This commit is contained in:
Veronica K. B. Olsen
2021-01-30 15:18:10 +01:00
4 changed files with 126 additions and 120 deletions
+9 -3
View File
@@ -345,9 +345,14 @@ class GuiDocEditor(QTextEdit):
qApp.processEvents() qApp.processEvents()
self.setDocumentChanged(False) self.setDocumentChanged(False)
qApp.restoreOverrideCursor() qApp.restoreOverrideCursor()
# This is a hack to fix invisble cursor on an empty document
if self.qDocument.characterCount() <= 1:
self.setPlainText("\n")
self.setPlainText("")
self.setCursorPosition(0)
return True return True
def updateTagHighLighting(self, forceBigDoc=False): def updateTagHighLighting(self, forceBigDoc=False):
@@ -513,9 +518,10 @@ class GuiDocEditor(QTextEdit):
if not isinstance(thePosition, int): if not isinstance(thePosition, int):
return False return False
if thePosition >= 0: nChars = self.qDocument.characterCount()
if nChars > 1:
theCursor = self.textCursor() theCursor = self.textCursor()
theCursor.setPosition(thePosition) theCursor.setPosition(min(max(thePosition, 0), nChars-1))
self.setTextCursor(theCursor) self.setTextCursor(theCursor)
self.docFooter.updateLineCount() self.docFooter.updateLineCount()
+97 -97
View File
@@ -66,7 +66,7 @@ class GuiPreferences(PagedDialog):
self.addTab(self.tabProjects, "Projects") self.addTab(self.tabProjects, "Projects")
self.addTab(self.tabDocs, "Documents") self.addTab(self.tabDocs, "Documents")
self.addTab(self.tabEditor, "Editor") self.addTab(self.tabEditor, "Editor")
self.addTab(self.tabSyntax, "Syntax") self.addTab(self.tabSyntax, "Highlighting")
self.addTab(self.tabAuto, "Automation") self.addTab(self.tabAuto, "Automation")
self.buttonBox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel) self.buttonBox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)
@@ -133,44 +133,44 @@ class GuiPreferencesGeneral(QWidget):
self.mainForm.addGroupLabel("Look and Feel") self.mainForm.addGroupLabel("Look and Feel")
## Select Theme ## Select Theme
self.selectTheme = QComboBox() self.guiTheme = QComboBox()
self.selectTheme.setMinimumWidth(self.mainConf.pxInt(200)) self.guiTheme.setMinimumWidth(self.mainConf.pxInt(200))
self.theThemes = self.theTheme.listThemes() self.theThemes = self.theTheme.listThemes()
for themeDir, themeName in self.theThemes: for themeDir, themeName in self.theThemes:
self.selectTheme.addItem(themeName, themeDir) self.guiTheme.addItem(themeName, themeDir)
themeIdx = self.selectTheme.findData(self.mainConf.guiTheme) themeIdx = self.guiTheme.findData(self.mainConf.guiTheme)
if themeIdx != -1: if themeIdx != -1:
self.selectTheme.setCurrentIndex(themeIdx) self.guiTheme.setCurrentIndex(themeIdx)
self.mainForm.addRow( self.mainForm.addRow(
"Main GUI theme", "Main GUI theme",
self.selectTheme, self.guiTheme,
"Changing this requires restarting novelWriter." "Changing this requires restarting novelWriter."
) )
## Select Icon Theme ## Select Icon Theme
self.selectIcons = QComboBox() self.guiIcons = QComboBox()
self.selectIcons.setMinimumWidth(self.mainConf.pxInt(200)) self.guiIcons.setMinimumWidth(self.mainConf.pxInt(200))
self.theIcons = self.theTheme.theIcons.listThemes() self.theIcons = self.theTheme.theIcons.listThemes()
for iconDir, iconName in self.theIcons: for iconDir, iconName in self.theIcons:
self.selectIcons.addItem(iconName, iconDir) self.guiIcons.addItem(iconName, iconDir)
iconIdx = self.selectIcons.findData(self.mainConf.guiIcons) iconIdx = self.guiIcons.findData(self.mainConf.guiIcons)
if iconIdx != -1: if iconIdx != -1:
self.selectIcons.setCurrentIndex(iconIdx) self.guiIcons.setCurrentIndex(iconIdx)
self.mainForm.addRow( self.mainForm.addRow(
"Main icon theme", "Main icon theme",
self.selectIcons, self.guiIcons,
"Changing this requires restarting novelWriter." "Changing this requires restarting novelWriter."
) )
## Dark Icons ## Dark Icons
self.preferDarkIcons = QSwitch() self.guiDark = QSwitch()
self.preferDarkIcons.setChecked(self.mainConf.guiDark) self.guiDark.setChecked(self.mainConf.guiDark)
self.mainForm.addRow( self.mainForm.addRow(
"Prefer icons for dark backgrounds", "Prefer icons for dark backgrounds",
self.preferDarkIcons, self.guiDark,
"This may improve the look of icons on dark themes." "May improve the look of icons on dark themes."
) )
## Font Family ## Font Family
@@ -234,9 +234,9 @@ class GuiPreferencesGeneral(QWidget):
def saveValues(self): def saveValues(self):
"""Save the values set for this tab. """Save the values set for this tab.
""" """
guiTheme = self.selectTheme.currentData() guiTheme = self.guiTheme.currentData()
guiIcons = self.selectIcons.currentData() guiIcons = self.guiIcons.currentData()
guiDark = self.preferDarkIcons.isChecked() guiDark = self.guiDark.isChecked()
guiFont = self.guiFont.text() guiFont = self.guiFont.text()
guiFontSize = self.guiFontSize.value() guiFontSize = self.guiFontSize.value()
@@ -355,7 +355,7 @@ class GuiPreferencesProjects(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
"Ask before running backup", "Ask before running backup",
self.askBeforeBackup, self.askBeforeBackup,
"Disabling this will cause backups to run in the background." "If off, backups will run in the background."
) )
return return
@@ -428,29 +428,29 @@ class GuiPreferencesDocuments(QWidget):
self.mainForm.addGroupLabel("Text Style") self.mainForm.addGroupLabel("Text Style")
## Font Family ## Font Family
self.textStyleFont = QLineEdit() self.textFont = QLineEdit()
self.textStyleFont.setReadOnly(True) self.textFont.setReadOnly(True)
self.textStyleFont.setFixedWidth(self.mainConf.pxInt(162)) self.textFont.setFixedWidth(self.mainConf.pxInt(162))
self.textStyleFont.setText(self.mainConf.textFont) self.textFont.setText(self.mainConf.textFont)
self.fontButton = QPushButton("...") self.fontButton = QPushButton("...")
self.fontButton.setMaximumWidth(int(2.5*self.theTheme.getTextWidth("..."))) self.fontButton.setMaximumWidth(int(2.5*self.theTheme.getTextWidth("...")))
self.fontButton.clicked.connect(self._selectFont) self.fontButton.clicked.connect(self._selectFont)
self.mainForm.addRow( self.mainForm.addRow(
"Font family", "Font family",
self.textStyleFont, self.textFont,
"Font for the document editor and viewer.", "Font for the document editor and viewer.",
theButton = self.fontButton theButton = self.fontButton
) )
## Font Size ## Font Size
self.textStyleSize = QSpinBox(self) self.textSize = QSpinBox(self)
self.textStyleSize.setMinimum(8) self.textSize.setMinimum(8)
self.textStyleSize.setMaximum(60) self.textSize.setMaximum(60)
self.textStyleSize.setSingleStep(1) self.textSize.setSingleStep(1)
self.textStyleSize.setValue(self.mainConf.textSize) self.textSize.setValue(self.mainConf.textSize)
self.mainForm.addRow( self.mainForm.addRow(
"Font size", "Font size",
self.textStyleSize, self.textSize,
"Font size for the document editor and viewer.", "Font size for the document editor and viewer.",
theUnit = "pt" theUnit = "pt"
) )
@@ -460,38 +460,38 @@ class GuiPreferencesDocuments(QWidget):
self.mainForm.addGroupLabel("Text Flow") self.mainForm.addGroupLabel("Text Flow")
## Max Text Width in Normal Mode ## Max Text Width in Normal Mode
self.textFlowMax = QSpinBox(self) self.textWidth = QSpinBox(self)
self.textFlowMax.setMinimum(300) self.textWidth.setMinimum(300)
self.textFlowMax.setMaximum(10000) self.textWidth.setMaximum(10000)
self.textFlowMax.setSingleStep(10) self.textWidth.setSingleStep(10)
self.textFlowMax.setValue(self.mainConf.textWidth) self.textWidth.setValue(self.mainConf.textWidth)
self.mainForm.addRow( self.mainForm.addRow(
"Maximum text width in \"Normal Mode\"", "Maximum text width in \"Normal Mode\"",
self.textFlowMax, self.textWidth,
"Horizontal margins are scaled automatically.", "Horizontal margins are scaled automatically.",
theUnit="px" theUnit="px"
) )
## Max Text Width in Focus Mode ## Max Text Width in Focus Mode
self.focusDocWidth = QSpinBox(self) self.focusWidth = QSpinBox(self)
self.focusDocWidth.setMinimum(300) self.focusWidth.setMinimum(300)
self.focusDocWidth.setMaximum(10000) self.focusWidth.setMaximum(10000)
self.focusDocWidth.setSingleStep(10) self.focusWidth.setSingleStep(10)
self.focusDocWidth.setValue(self.mainConf.focusWidth) self.focusWidth.setValue(self.mainConf.focusWidth)
self.mainForm.addRow( self.mainForm.addRow(
"Maximum text width in \"Focus Mode\"", "Maximum text width in \"Focus Mode\"",
self.focusDocWidth, self.focusWidth,
"Horizontal margins are scaled automatically.", "Horizontal margins are scaled automatically.",
theUnit="px" theUnit="px"
) )
## Document Fixed Width ## Document Fixed Width
self.textFlowFixed = QSwitch() self.textFixedW = QSwitch()
self.textFlowFixed.setChecked(not self.mainConf.textFixedW) self.textFixedW.setChecked(not self.mainConf.textFixedW)
self.mainForm.addRow( self.mainForm.addRow(
"Disable maximum text width in \"Normal Mode\"", "Disable maximum text width in \"Normal Mode\"",
self.textFlowFixed, self.textFixedW,
"If disabled, minimum text width is defined by the margin." "Text width is defined by the margins only."
) )
## Focus Mode Footer ## Focus Mode Footer
@@ -504,11 +504,11 @@ class GuiPreferencesDocuments(QWidget):
) )
## Justify Text ## Justify Text
self.textJustify = QSwitch() self.doJustify = QSwitch()
self.textJustify.setChecked(self.mainConf.textFixedW) self.doJustify.setChecked(self.mainConf.doJustify)
self.mainForm.addRow( self.mainForm.addRow(
"Justify the text margins in editor and viewer", "Justify the text margins in editor and viewer",
self.textJustify, self.doJustify,
"Lay out text with straight edges in the editor and viewer." "Lay out text with straight edges in the editor and viewer."
) )
@@ -544,15 +544,15 @@ class GuiPreferencesDocuments(QWidget):
"""Save the values set for this tab. """Save the values set for this tab.
""" """
# Text Style # Text Style
self.mainConf.textFont = self.textStyleFont.text() self.mainConf.textFont = self.textFont.text()
self.mainConf.textSize = self.textStyleSize.value() self.mainConf.textSize = self.textSize.value()
# Text Flow # Text Flow
self.mainConf.textWidth = self.textFlowMax.value() self.mainConf.textWidth = self.textWidth.value()
self.mainConf.focusWidth = self.focusDocWidth.value() self.mainConf.focusWidth = self.focusWidth.value()
self.mainConf.textFixedW = not self.textFlowFixed.isChecked() self.mainConf.textFixedW = not self.textFixedW.isChecked()
self.mainConf.hideFocusFooter = self.hideFocusFooter.isChecked() self.mainConf.hideFocusFooter = self.hideFocusFooter.isChecked()
self.mainConf.doJustify = self.textJustify.isChecked() self.mainConf.doJustify = self.doJustify.isChecked()
self.mainConf.textMargin = self.textMargin.value() self.mainConf.textMargin = self.textMargin.value()
self.mainConf.tabWidth = self.tabWidth.value() self.mainConf.tabWidth = self.tabWidth.value()
@@ -572,8 +572,8 @@ class GuiPreferencesDocuments(QWidget):
currFont.setPointSize(self.mainConf.textSize) currFont.setPointSize(self.mainConf.textSize)
theFont, theStatus = QFontDialog.getFont(currFont, self) theFont, theStatus = QFontDialog.getFont(currFont, self)
if theStatus: if theStatus:
self.textStyleFont.setText(theFont.family()) self.textFont.setText(theFont.family())
self.textStyleSize.setValue(theFont.pointSize()) self.textSize.setValue(theFont.pointSize())
return return
@@ -687,7 +687,7 @@ class GuiPreferencesEditor(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
"Scroll past end of the document", "Scroll past end of the document",
self.scrollPastEnd, self.scrollPastEnd,
"Allow scrolling until the last line is centred in the editor." "Also improves trypewriter scrolling for short documents."
) )
## Typewriter Scrolling ## Typewriter Scrolling
@@ -708,7 +708,7 @@ class GuiPreferencesEditor(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
"Minimum position for Typewriter scrolling", "Minimum position for Typewriter scrolling",
self.autoScrollPos, self.autoScrollPos,
"In units of percentage of the editor height.", "Percentage of the editor height from the top.",
theUnit = "%" theUnit = "%"
) )
@@ -790,18 +790,18 @@ class GuiPreferencesSyntax(QWidget):
# ================== # ==================
self.mainForm.addGroupLabel("Highlighting Theme") self.mainForm.addGroupLabel("Highlighting Theme")
self.selectSyntax = QComboBox() self.guiSyntax = QComboBox()
self.selectSyntax.setMinimumWidth(self.mainConf.pxInt(200)) self.guiSyntax.setMinimumWidth(self.mainConf.pxInt(200))
self.theSyntaxes = self.theTheme.listSyntax() self.theSyntaxes = self.theTheme.listSyntax()
for syntaxFile, syntaxName in self.theSyntaxes: for syntaxFile, syntaxName in self.theSyntaxes:
self.selectSyntax.addItem(syntaxName, syntaxFile) self.guiSyntax.addItem(syntaxName, syntaxFile)
syntaxIdx = self.selectSyntax.findData(self.mainConf.guiSyntax) syntaxIdx = self.guiSyntax.findData(self.mainConf.guiSyntax)
if syntaxIdx != -1: if syntaxIdx != -1:
self.selectSyntax.setCurrentIndex(syntaxIdx) self.guiSyntax.setCurrentIndex(syntaxIdx)
self.mainForm.addRow( self.mainForm.addRow(
"Highlighting theme", "Highlighting theme",
self.selectSyntax, self.guiSyntax,
"Colour theme to apply to the editor and viewer." "Colour theme to apply to the editor and viewer."
) )
@@ -852,7 +852,7 @@ class GuiPreferencesSyntax(QWidget):
"""Save the values set for this tab. """Save the values set for this tab.
""" """
# Highlighting Theme # Highlighting Theme
self.mainConf.guiSyntax = self.selectSyntax.currentData() self.mainConf.guiSyntax = self.guiSyntax.currentData()
# Quotes & Dialogue # Quotes & Dialogue
self.mainConf.highlightQuotes = self.highlightQuotes.isChecked() self.mainConf.highlightQuotes = self.highlightQuotes.isChecked()
@@ -908,12 +908,12 @@ class GuiPreferencesAutomation(QWidget):
) )
## Auto-Replace as You Type Main Switch ## Auto-Replace as You Type Main Switch
self.autoReplaceMain = QSwitch() self.doReplace = QSwitch()
self.autoReplaceMain.setChecked(self.mainConf.doReplace) self.doReplace.setChecked(self.mainConf.doReplace)
self.autoReplaceMain.toggled.connect(self._toggleAutoReplaceMain) self.doReplace.toggled.connect(self._toggleAutoReplaceMain)
self.mainForm.addRow( self.mainForm.addRow(
"Auto-replace text as you type", "Auto-replace text as you type",
self.autoReplaceMain, self.doReplace,
"Allow the editor to replace symbols as you type." "Allow the editor to replace symbols as you type."
) )
@@ -922,42 +922,42 @@ class GuiPreferencesAutomation(QWidget):
self.mainForm.addGroupLabel("Replace as You Type") self.mainForm.addGroupLabel("Replace as You Type")
## Auto-Replace Single Quotes ## Auto-Replace Single Quotes
self.autoReplaceSQ = QSwitch() self.doReplaceSQuote = QSwitch()
self.autoReplaceSQ.setChecked(self.mainConf.doReplaceSQuote) self.doReplaceSQuote.setChecked(self.mainConf.doReplaceSQuote)
self.autoReplaceSQ.setEnabled(self.mainConf.doReplace) self.doReplaceSQuote.setEnabled(self.mainConf.doReplace)
self.mainForm.addRow( self.mainForm.addRow(
"Auto-replace single quotes", "Auto-replace single quotes",
self.autoReplaceSQ, self.doReplaceSQuote,
"Try to guess which is an opening or a closing single quote." "Try to guess which is an opening or a closing single quote."
) )
## Auto-Replace Double Quotes ## Auto-Replace Double Quotes
self.autoReplaceDQ = QSwitch() self.doReplaceDQuote = QSwitch()
self.autoReplaceDQ.setChecked(self.mainConf.doReplaceDQuote) self.doReplaceDQuote.setChecked(self.mainConf.doReplaceDQuote)
self.autoReplaceDQ.setEnabled(self.mainConf.doReplace) self.doReplaceDQuote.setEnabled(self.mainConf.doReplace)
self.mainForm.addRow( self.mainForm.addRow(
"Auto-replace double quotes", "Auto-replace double quotes",
self.autoReplaceDQ, self.doReplaceDQuote,
"Try to guess which is an opening or a closing double quote." "Try to guess which is an opening or a closing double quote."
) )
## Auto-Replace Hyphens ## Auto-Replace Hyphens
self.autoReplaceDash = QSwitch() self.doReplaceDash = QSwitch()
self.autoReplaceDash.setChecked(self.mainConf.doReplaceDash) self.doReplaceDash.setChecked(self.mainConf.doReplaceDash)
self.autoReplaceDash.setEnabled(self.mainConf.doReplace) self.doReplaceDash.setEnabled(self.mainConf.doReplace)
self.mainForm.addRow( self.mainForm.addRow(
"Auto-replace dashes", "Auto-replace dashes",
self.autoReplaceDash, self.doReplaceDash,
"Double and triple hyphens become short and long dashes." "Double and triple hyphens become short and long dashes."
) )
## Auto-Replace Dots ## Auto-Replace Dots
self.autoReplaceDots = QSwitch() self.doReplaceDots = QSwitch()
self.autoReplaceDots.setChecked(self.mainConf.doReplaceDots) self.doReplaceDots.setChecked(self.mainConf.doReplaceDots)
self.autoReplaceDots.setEnabled(self.mainConf.doReplace) self.doReplaceDots.setEnabled(self.mainConf.doReplace)
self.mainForm.addRow( self.mainForm.addRow(
"Auto-replace dots", "Auto-replace dots",
self.autoReplaceDots, self.doReplaceDots,
"Three consecutive dots become ellipsis." "Three consecutive dots become ellipsis."
) )
@@ -1042,13 +1042,13 @@ class GuiPreferencesAutomation(QWidget):
""" """
# Automatic Features # Automatic Features
self.mainConf.autoSelect = self.autoSelect.isChecked() self.mainConf.autoSelect = self.autoSelect.isChecked()
self.mainConf.doReplace = self.autoReplaceMain.isChecked() self.mainConf.doReplace = self.doReplace.isChecked()
# Replace as You Type # Replace as You Type
self.mainConf.doReplaceSQuote = self.autoReplaceSQ.isChecked() self.mainConf.doReplaceSQuote = self.doReplaceSQuote.isChecked()
self.mainConf.doReplaceDQuote = self.autoReplaceDQ.isChecked() self.mainConf.doReplaceDQuote = self.doReplaceDQuote.isChecked()
self.mainConf.doReplaceDash = self.autoReplaceDash.isChecked() self.mainConf.doReplaceDash = self.doReplaceDash.isChecked()
self.mainConf.doReplaceDots = self.autoReplaceDots.isChecked() self.mainConf.doReplaceDots = self.doReplaceDots.isChecked()
# Quotation Style # Quotation Style
self.mainConf.fmtSingleQuotes[0] = self.quoteSym["SO"].text() self.mainConf.fmtSingleQuotes[0] = self.quoteSym["SO"].text()
@@ -1068,10 +1068,10 @@ class GuiPreferencesAutomation(QWidget):
"""Enables or disables switches controlled by the main auto """Enables or disables switches controlled by the main auto
replace switch. replace switch.
""" """
self.autoReplaceSQ.setEnabled(theState) self.doReplaceSQuote.setEnabled(theState)
self.autoReplaceDQ.setEnabled(theState) self.doReplaceDQuote.setEnabled(theState)
self.autoReplaceDash.setEnabled(theState) self.doReplaceDash.setEnabled(theState)
self.autoReplaceDots.setEnabled(theState) self.doReplaceDots.setEnabled(theState)
return return
def _getQuote(self, qType): def _getQuote(self, qType):
@@ -34,7 +34,7 @@ margin = 45
tabwidth = 45 tabwidth = 45
focuswidth = 900 focuswidth = 900
hidefocusfooter = True hidefocusfooter = True
justify = False justify = True
autoselect = False autoselect = False
autoreplace = False autoreplace = False
repsquotes = True repsquotes = True
+19 -19
View File
@@ -86,9 +86,9 @@ def testGuiPreferences_Main(qtbot, monkeypatch, fncDir, outDir, refDir):
nwPrefs._tabBox.setCurrentWidget(tabGeneral) nwPrefs._tabBox.setCurrentWidget(tabGeneral)
qtbot.wait(keyDelay) qtbot.wait(keyDelay)
assert not tabGeneral.preferDarkIcons.isChecked() assert not tabGeneral.guiDark.isChecked()
qtbot.mouseClick(tabGeneral.preferDarkIcons, Qt.LeftButton) qtbot.mouseClick(tabGeneral.guiDark, Qt.LeftButton)
assert tabGeneral.preferDarkIcons.isChecked() assert tabGeneral.guiDark.isChecked()
qtbot.wait(keyDelay) qtbot.wait(keyDelay)
assert tabGeneral.showFullPath.isChecked() assert tabGeneral.showFullPath.isChecked()
@@ -144,16 +144,16 @@ def testGuiPreferences_Main(qtbot, monkeypatch, fncDir, outDir, refDir):
qtbot.mouseClick(tabDocs.fontButton, Qt.LeftButton) qtbot.mouseClick(tabDocs.fontButton, Qt.LeftButton)
qtbot.wait(keyDelay) qtbot.wait(keyDelay)
tabDocs.textStyleSize.setValue(13) tabDocs.textSize.setValue(13)
tabDocs.textFlowMax.setValue(700) tabDocs.textWidth.setValue(700)
tabDocs.focusDocWidth.setValue(900) tabDocs.focusWidth.setValue(900)
tabDocs.textMargin.setValue(45) tabDocs.textMargin.setValue(45)
tabDocs.tabWidth.setValue(45) tabDocs.tabWidth.setValue(45)
qtbot.wait(keyDelay) qtbot.wait(keyDelay)
assert not tabDocs.textFlowFixed.isChecked() assert not tabDocs.textFixedW.isChecked()
qtbot.mouseClick(tabDocs.textFlowFixed, Qt.LeftButton) qtbot.mouseClick(tabDocs.textFixedW, Qt.LeftButton)
assert tabDocs.textFlowFixed.isChecked() assert tabDocs.textFixedW.isChecked()
qtbot.wait(keyDelay) qtbot.wait(keyDelay)
assert not tabDocs.hideFocusFooter.isChecked() assert not tabDocs.hideFocusFooter.isChecked()
@@ -161,9 +161,9 @@ def testGuiPreferences_Main(qtbot, monkeypatch, fncDir, outDir, refDir):
assert tabDocs.hideFocusFooter.isChecked() assert tabDocs.hideFocusFooter.isChecked()
qtbot.wait(keyDelay) qtbot.wait(keyDelay)
assert tabDocs.textJustify.isChecked() assert not tabDocs.doJustify.isChecked()
qtbot.mouseClick(tabDocs.textJustify, Qt.LeftButton) qtbot.mouseClick(tabDocs.doJustify, Qt.LeftButton)
assert not tabDocs.textJustify.isChecked() assert tabDocs.doJustify.isChecked()
# Editor Settings # Editor Settings
qtbot.wait(keyDelay) qtbot.wait(keyDelay)
@@ -219,15 +219,15 @@ def testGuiPreferences_Main(qtbot, monkeypatch, fncDir, outDir, refDir):
assert not tabAuto.autoSelect.isChecked() assert not tabAuto.autoSelect.isChecked()
qtbot.wait(keyDelay) qtbot.wait(keyDelay)
assert tabAuto.autoReplaceMain.isChecked() assert tabAuto.doReplace.isChecked()
qtbot.mouseClick(tabAuto.autoReplaceMain, Qt.LeftButton) qtbot.mouseClick(tabAuto.doReplace, Qt.LeftButton)
assert not tabAuto.autoReplaceMain.isChecked() assert not tabAuto.doReplace.isChecked()
qtbot.wait(keyDelay) qtbot.wait(keyDelay)
assert not tabAuto.autoReplaceSQ.isEnabled() assert not tabAuto.doReplaceSQuote.isEnabled()
assert not tabAuto.autoReplaceDQ.isEnabled() assert not tabAuto.doReplaceDQuote.isEnabled()
assert not tabAuto.autoReplaceDash.isEnabled() assert not tabAuto.doReplaceDash.isEnabled()
assert not tabAuto.autoReplaceDots.isEnabled() assert not tabAuto.doReplaceDots.isEnabled()
monkeypatch.setattr(QuotesDialog, "selectedQuote", "'") monkeypatch.setattr(QuotesDialog, "selectedQuote", "'")
monkeypatch.setattr(QuotesDialog, "exec_", lambda *args: QDialog.Accepted) monkeypatch.setattr(QuotesDialog, "exec_", lambda *args: QDialog.Accepted)