Added new quote setting to Preferences and updated tests

This commit is contained in:
Veronica K. B. Olsen
2021-01-19 18:37:19 +01:00
parent 4934ec2ea1
commit 6868b683d8
5 changed files with 122 additions and 129 deletions
+113 -124
View File
@@ -113,7 +113,7 @@ class GuiPreferences(PagedDialog):
msgBox = QMessageBox() msgBox = QMessageBox()
msgBox.information( msgBox.information(
self, "Preferences", self, "Preferences",
"Some changes will not be applied until novelWriter has been restarted." "Some changes will not be applied until novelWriter has been restarted"
) )
if validEntries: if validEntries:
@@ -161,7 +161,7 @@ class GuiConfigEditGeneralTab(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
"Main GUI theme", "Main GUI theme",
self.selectTheme, self.selectTheme,
"Changing this requires restarting novelWriter." "Changing this requires restarting novelWriter"
) )
## Select Icon Theme ## Select Icon Theme
@@ -177,7 +177,7 @@ class GuiConfigEditGeneralTab(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
"Main icon theme", "Main icon theme",
self.selectIcons, self.selectIcons,
"Changing this requires restarting novelWriter." "Changing this requires restarting novelWriter"
) )
## Dark Icons ## Dark Icons
@@ -186,7 +186,7 @@ class GuiConfigEditGeneralTab(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
"Prefer icons for dark backgrounds", "Prefer icons for dark backgrounds",
self.preferDarkIcons, self.preferDarkIcons,
"This may improve the look of icons on dark themes." "This may improve the look of icons on dark themes"
) )
## Font Family ## Font Family
@@ -200,7 +200,7 @@ class GuiConfigEditGeneralTab(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
"Font family", "Font family",
self.guiFont, self.guiFont,
"Changing this requires restarting novelWriter.", "Changing this requires restarting novelWriter",
theButton = self.fontButton theButton = self.fontButton
) )
@@ -213,7 +213,7 @@ class GuiConfigEditGeneralTab(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
"Font size", "Font size",
self.guiFontSize, self.guiFontSize,
"Changing this requires restarting novelWriter.", "Changing this requires restarting novelWriter",
theUnit = "pt" theUnit = "pt"
) )
@@ -226,7 +226,7 @@ class GuiConfigEditGeneralTab(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
"Show full path in document header", "Show full path in document header",
self.showFullPath, self.showFullPath,
"Add the parent folder names to the header." "Add the parent folder names to the header"
) )
self.hideVScroll = QSwitch() self.hideVScroll = QSwitch()
@@ -234,7 +234,7 @@ class GuiConfigEditGeneralTab(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
"Hide vertical scroll bars in main windows", "Hide vertical scroll bars in main windows",
self.hideVScroll, self.hideVScroll,
"Scrolling available with mouse wheel and keys only." "Scrolling available with mouse wheel and keys only"
) )
self.hideHScroll = QSwitch() self.hideHScroll = QSwitch()
@@ -242,7 +242,7 @@ class GuiConfigEditGeneralTab(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
"Hide horizontal scroll bars in main windows", "Hide horizontal scroll bars in main windows",
self.hideHScroll, self.hideHScroll,
"Scrolling available with mouse wheel and keys only." "Scrolling available with mouse wheel and keys only"
) )
return return
@@ -258,13 +258,11 @@ class GuiConfigEditGeneralTab(QWidget):
guiDark = self.preferDarkIcons.isChecked() guiDark = self.preferDarkIcons.isChecked()
guiFont = self.guiFont.text() guiFont = self.guiFont.text()
guiFontSize = self.guiFontSize.value() guiFontSize = self.guiFontSize.value()
showFullPath = self.showFullPath.isChecked()
hideVScroll = self.hideVScroll.isChecked()
hideHScroll = self.hideHScroll.isChecked()
# Check if restart is needed # Check if restart is needed
needsRestart |= self.mainConf.guiTheme != guiTheme needsRestart |= self.mainConf.guiTheme != guiTheme
needsRestart |= self.mainConf.guiIcons != guiIcons needsRestart |= self.mainConf.guiIcons != guiIcons
needsRestart |= self.mainConf.guiDark != guiDark
needsRestart |= self.mainConf.guiFont != guiFont needsRestart |= self.mainConf.guiFont != guiFont
needsRestart |= self.mainConf.guiFontSize != guiFontSize needsRestart |= self.mainConf.guiFontSize != guiFontSize
@@ -273,9 +271,9 @@ class GuiConfigEditGeneralTab(QWidget):
self.mainConf.guiDark = guiDark self.mainConf.guiDark = guiDark
self.mainConf.guiFont = guiFont self.mainConf.guiFont = guiFont
self.mainConf.guiFontSize = guiFontSize self.mainConf.guiFontSize = guiFontSize
self.mainConf.showFullPath = showFullPath self.mainConf.showFullPath = self.showFullPath.isChecked()
self.mainConf.hideVScroll = hideVScroll self.mainConf.hideVScroll = self.hideVScroll.isChecked()
self.mainConf.hideHScroll = hideHScroll self.mainConf.hideHScroll = self.hideHScroll.isChecked()
self.mainConf.confChanged = True self.mainConf.confChanged = True
@@ -326,7 +324,7 @@ class GuiConfigEditProjectsTab(QWidget):
self.backupPathRow = self.mainForm.addRow( self.backupPathRow = self.mainForm.addRow(
"Save document interval", "Save document interval",
self.autoSaveDoc, self.autoSaveDoc,
"How often the open document is automatically saved.", "How often the open document is automatically saved",
theUnit="seconds" theUnit="seconds"
) )
@@ -339,7 +337,7 @@ class GuiConfigEditProjectsTab(QWidget):
self.backupPathRow = self.mainForm.addRow( self.backupPathRow = self.mainForm.addRow(
"Save project interval", "Save project interval",
self.autoSaveProj, self.autoSaveProj,
"How often the open project is automatically saved.", "How often the open project is automatically saved",
theUnit="seconds" theUnit="seconds"
) )
@@ -364,7 +362,7 @@ class GuiConfigEditProjectsTab(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
"Run backup when the project is closed", "Run backup when the project is closed",
self.backupOnClose, self.backupOnClose,
"Can be overridden for individual projects in project settings." "Can be overridden for individual projects in project settings"
) )
## Ask before backup ## Ask before backup
@@ -375,7 +373,7 @@ class GuiConfigEditProjectsTab(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." "Disabling this will cause backups to run in the background"
) )
return return
@@ -386,17 +384,11 @@ class GuiConfigEditProjectsTab(QWidget):
validEntries = True validEntries = True
needsRestart = False needsRestart = False
autoSaveDoc = self.autoSaveDoc.value() self.mainConf.autoSaveDoc = self.autoSaveDoc.value()
autoSaveProj = self.autoSaveProj.value() self.mainConf.autoSaveProj = self.autoSaveProj.value()
backupPath = self.backupPath self.mainConf.backupPath = self.backupPath
backupOnClose = self.backupOnClose.isChecked() self.mainConf.backupOnClose = self.backupOnClose.isChecked()
askBeforeBackup = self.askBeforeBackup.isChecked() self.mainConf.askBeforeBackup = self.askBeforeBackup.isChecked()
self.mainConf.autoSaveDoc = autoSaveDoc
self.mainConf.autoSaveProj = autoSaveProj
self.mainConf.backupPath = backupPath
self.mainConf.backupOnClose = backupOnClose
self.mainConf.askBeforeBackup = askBeforeBackup
self.mainConf.confChanged = True self.mainConf.confChanged = True
@@ -464,7 +456,7 @@ class GuiConfigEditLayoutTab(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
"Font family", "Font family",
self.textStyleFont, self.textStyleFont,
"Font for the document editor and viewer.", "Font for the document editor and viewer",
theButton = self.fontButton theButton = self.fontButton
) )
@@ -477,7 +469,7 @@ class GuiConfigEditLayoutTab(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
"Font size", "Font size",
self.textStyleSize, self.textStyleSize,
"Font size for the document editor and viewer.", "Font size for the document editor and viewer",
theUnit = "pt" theUnit = "pt"
) )
@@ -494,7 +486,7 @@ class GuiConfigEditLayoutTab(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
"Maximum text width in \"Normal Mode\"", "Maximum text width in \"Normal Mode\"",
self.textFlowMax, self.textFlowMax,
"Horizontal margins are scaled automatically.", "Horizontal margins are scaled automatically",
theUnit="px" theUnit="px"
) )
@@ -507,7 +499,7 @@ class GuiConfigEditLayoutTab(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
"Maximum text width in \"Focus Mode\"", "Maximum text width in \"Focus Mode\"",
self.focusDocWidth, self.focusDocWidth,
"Horizontal margins are scaled automatically.", "Horizontal margins are scaled automatically",
theUnit="px" theUnit="px"
) )
@@ -517,7 +509,7 @@ class GuiConfigEditLayoutTab(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
"Disable maximum text width in \"Normal Mode\"", "Disable maximum text width in \"Normal Mode\"",
self.textFlowFixed, self.textFlowFixed,
"If disabled, minimum text width is defined by the margin." "If disabled, minimum text width is defined by the margin"
) )
## Focus Mode Footer ## Focus Mode Footer
@@ -526,7 +518,7 @@ class GuiConfigEditLayoutTab(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
"Hide document footer in \"Focus Mode\"", "Hide document footer in \"Focus Mode\"",
self.hideFocusFooter, self.hideFocusFooter,
"Hide the information bar at the bottom of the document." "Hide the information bar at the bottom of the document"
) )
## Justify Text ## Justify Text
@@ -535,7 +527,7 @@ class GuiConfigEditLayoutTab(QWidget):
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.textJustify,
"Lay out text with straight edges in the editor and viewer." "Lay out text with straight edges in the editor and viewer"
) )
## Document Margins ## Document Margins
@@ -547,7 +539,7 @@ class GuiConfigEditLayoutTab(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
"Text margin", "Text margin",
self.textMargin, self.textMargin,
"If maximum width is set, this becomes the minimum margin.", "If maximum width is set, this becomes the minimum margin",
theUnit="px" theUnit="px"
) )
@@ -560,7 +552,7 @@ class GuiConfigEditLayoutTab(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
"Tab width", "Tab width",
self.tabWidth, self.tabWidth,
"The width of a tab key press in the editor and viewer.", "The width of a tab key press in the editor and viewer",
theUnit="px" theUnit="px"
) )
@@ -574,7 +566,7 @@ class GuiConfigEditLayoutTab(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." "Allow scrolling until the last line is centred in the editor"
) )
## Typewriter Scrolling ## Typewriter Scrolling
@@ -583,7 +575,7 @@ class GuiConfigEditLayoutTab(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
"Typewriter style scrolling when you type", "Typewriter style scrolling when you type",
self.autoScroll, self.autoScroll,
"Try to keep the cursor at a fixed vertical position." "Try to keep the cursor at a fixed vertical position"
) )
## Font Size ## Font Size
@@ -595,7 +587,7 @@ class GuiConfigEditLayoutTab(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.", "In units of percentage of the editor height",
theUnit = "%" theUnit = "%"
) )
@@ -607,31 +599,18 @@ class GuiConfigEditLayoutTab(QWidget):
validEntries = True validEntries = True
needsRestart = False needsRestart = False
textFont = self.textStyleFont.text() self.mainConf.textFont = self.textStyleFont.text()
textSize = self.textStyleSize.value() self.mainConf.textSize = self.textStyleSize.value()
textWidth = self.textFlowMax.value() self.mainConf.textWidth = self.textFlowMax.value()
focusWidth = self.focusDocWidth.value() self.mainConf.focusWidth = self.focusDocWidth.value()
textFixedW = not self.textFlowFixed.isChecked() self.mainConf.textFixedW = not self.textFlowFixed.isChecked()
hideFocusFooter = self.hideFocusFooter.isChecked() self.mainConf.hideFocusFooter = self.hideFocusFooter.isChecked()
doJustify = self.textJustify.isChecked() self.mainConf.doJustify = self.textJustify.isChecked()
textMargin = self.textMargin.value() self.mainConf.textMargin = self.textMargin.value()
tabWidth = self.tabWidth.value() self.mainConf.tabWidth = self.tabWidth.value()
scrollPastEnd = self.scrollPastEnd.isChecked() self.mainConf.scrollPastEnd = self.scrollPastEnd.isChecked()
autoScroll = self.autoScroll.isChecked() self.mainConf.autoScroll = self.autoScroll.isChecked()
autoScrollPos = self.autoScrollPos.value() self.mainConf.autoScrollPos = self.autoScrollPos.value()
self.mainConf.textFont = textFont
self.mainConf.textSize = textSize
self.mainConf.textWidth = textWidth
self.mainConf.focusWidth = focusWidth
self.mainConf.textFixedW = textFixedW
self.mainConf.hideFocusFooter = hideFocusFooter
self.mainConf.doJustify = doJustify
self.mainConf.textMargin = textMargin
self.mainConf.tabWidth = tabWidth
self.mainConf.scrollPastEnd = scrollPastEnd
self.mainConf.autoScroll = autoScroll
self.mainConf.autoScrollPos = autoScrollPos
self.mainConf.confChanged = True self.mainConf.confChanged = True
@@ -686,15 +665,32 @@ class GuiConfigEditEditingTab(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
"Highlight theme", "Highlight theme",
self.selectSyntax, self.selectSyntax,
"Colour theme to apply to the editor and viewer." "Colour theme to apply to the editor and viewer"
) )
self.highlightQuotes = QSwitch() self.highlightQuotes = QSwitch()
self.highlightQuotes.setChecked(self.mainConf.highlightQuotes) self.highlightQuotes.setChecked(self.mainConf.highlightQuotes)
self.highlightQuotes.toggled.connect(self._toggleHighlightQuotes)
self.mainForm.addRow( self.mainForm.addRow(
"Highlight text wrapped in quotes", "Highlight text wrapped in quotes",
self.highlightQuotes, self.highlightQuotes,
"Applies to single, double and straight quotes." "Applies to single, double and straight quotes"
)
self.allowOpenSQuote = QSwitch()
self.allowOpenSQuote.setChecked(self.mainConf.allowOpenSQuote)
self.mainForm.addRow(
"Allow open-ended single quotes",
self.allowOpenSQuote,
"Highlight single-quoted line with no closing quote"
)
self.allowOpenDQuote = QSwitch()
self.allowOpenDQuote.setChecked(self.mainConf.allowOpenDQuote)
self.mainForm.addRow(
"Allow open-ended double quotes",
self.allowOpenDQuote,
"Highlight double-quoted line with no closing quote"
) )
self.highlightEmph = QSwitch() self.highlightEmph = QSwitch()
@@ -702,7 +698,7 @@ class GuiConfigEditEditingTab(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
"Add highlight colour to emphasised text", "Add highlight colour to emphasised text",
self.highlightEmph, self.highlightEmph,
"Applies to emphasis, strong and strikethrough." "Applies to emphasis, strong and strikethrough"
) )
# Spell Checking # Spell Checking
@@ -728,12 +724,12 @@ class GuiConfigEditEditingTab(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
"Spell check provider", "Spell check provider",
self.spellToolList, self.spellToolList,
"Note that the internal spell check tool is quite slow." "Note that the internal spell check tool is quite slow"
) )
self.mainForm.addRow( self.mainForm.addRow(
"Spell check language", "Spell check language",
self.spellLangList, self.spellLangList,
"Available languages are determined by your system." "Available languages are determined by your system"
) )
## Big Document Size Limit ## Big Document Size Limit
@@ -745,7 +741,7 @@ class GuiConfigEditEditingTab(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
"Big document limit", "Big document limit",
self.bigDocLimit, self.bigDocLimit,
"Full spell checking is disabled above this limit.", "Full spell checking is disabled above this limit",
theUnit="kB" theUnit="kB"
) )
@@ -759,7 +755,7 @@ class GuiConfigEditEditingTab(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
"Show tabs and spaces", "Show tabs and spaces",
self.showTabsNSpaces, self.showTabsNSpaces,
"Add symbols to indicate tabs and spaces in the editor." "Add symbols to indicate tabs and spaces in the editor"
) )
## Show Line Endings ## Show Line Endings
@@ -768,7 +764,7 @@ class GuiConfigEditEditingTab(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
"Show line endings", "Show line endings",
self.showLineEndings, self.showLineEndings,
"Add a symbol to indicate line endings in the editor." "Add a symbol to indicate line endings in the editor"
) )
return return
@@ -779,23 +775,16 @@ class GuiConfigEditEditingTab(QWidget):
validEntries = True validEntries = True
needsRestart = False needsRestart = False
guiSyntax = self.selectSyntax.currentData() self.mainConf.guiSyntax = self.selectSyntax.currentData()
highlightQuotes = self.highlightQuotes.isChecked() self.mainConf.highlightQuotes = self.highlightQuotes.isChecked()
highlightEmph = self.highlightEmph.isChecked() self.mainConf.allowOpenSQuote = self.allowOpenSQuote.isChecked()
spellTool = self.spellToolList.currentData() self.mainConf.allowOpenDQuote = self.allowOpenDQuote.isChecked()
spellLanguage = self.spellLangList.currentData() self.mainConf.highlightEmph = self.highlightEmph.isChecked()
bigDocLimit = self.bigDocLimit.value() self.mainConf.spellTool = self.spellToolList.currentData()
showTabsNSpaces = self.showTabsNSpaces.isChecked() self.mainConf.spellLanguage = self.spellLangList.currentData()
showLineEndings = self.showLineEndings.isChecked() self.mainConf.bigDocLimit = self.bigDocLimit.value()
self.mainConf.showTabsNSpaces = self.showTabsNSpaces.isChecked()
self.mainConf.guiSyntax = guiSyntax self.mainConf.showLineEndings = self.showLineEndings.isChecked()
self.mainConf.highlightQuotes = highlightQuotes
self.mainConf.highlightEmph = highlightEmph
self.mainConf.spellTool = spellTool
self.mainConf.spellLanguage = spellLanguage
self.mainConf.bigDocLimit = bigDocLimit
self.mainConf.showTabsNSpaces = showTabsNSpaces
self.mainConf.showLineEndings = showLineEndings
self.mainConf.confChanged = True self.mainConf.confChanged = True
@@ -833,6 +822,18 @@ class GuiConfigEditEditingTab(QWidget):
return return
##
# Slots
##
def _toggleHighlightQuotes(self, theState):
"""Enables or disables switches controlled by the highlight
quotes switch.
"""
self.allowOpenSQuote.setEnabled(theState)
self.allowOpenDQuote.setEnabled(theState)
return
# END Class GuiConfigEditEditingTab # END Class GuiConfigEditEditingTab
class GuiConfigEditAutoReplaceTab(QWidget): class GuiConfigEditAutoReplaceTab(QWidget):
@@ -859,7 +860,7 @@ class GuiConfigEditAutoReplaceTab(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
"Auto-select word under cursor", "Auto-select word under cursor",
self.autoSelect, self.autoSelect,
"Apply formatting to word under cursor if no selection is made." "Apply formatting to word under cursor if no selection is made"
) )
## Auto-Replace as You Type Main Switch ## Auto-Replace as You Type Main Switch
@@ -869,7 +870,7 @@ class GuiConfigEditAutoReplaceTab(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
"Auto-replace text as you type", "Auto-replace text as you type",
self.autoReplaceMain, self.autoReplaceMain,
"Allow the editor to replace symbols as you type." "Allow the editor to replace symbols as you type"
) )
# Auto-Replace # Auto-Replace
@@ -883,7 +884,7 @@ class GuiConfigEditAutoReplaceTab(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
"Auto-replace single quotes", "Auto-replace single quotes",
self.autoReplaceSQ, self.autoReplaceSQ,
"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
@@ -893,7 +894,7 @@ class GuiConfigEditAutoReplaceTab(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
"Auto-replace double quotes", "Auto-replace double quotes",
self.autoReplaceDQ, self.autoReplaceDQ,
"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
@@ -903,7 +904,7 @@ class GuiConfigEditAutoReplaceTab(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
"Auto-replace dashes", "Auto-replace dashes",
self.autoReplaceDash, self.autoReplaceDash,
"Double and triple hyphens become short and long dashes." "Double and triple hyphens become short and long dashes"
) )
## Auto-Replace Dots ## Auto-Replace Dots
@@ -913,7 +914,7 @@ class GuiConfigEditAutoReplaceTab(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
"Auto-replace dots", "Auto-replace dots",
self.autoReplaceDots, self.autoReplaceDots,
"Three consecutive dots becomes ellipsis." "Three consecutive dots becomes ellipsis"
) )
# Quotation Style # Quotation Style
@@ -937,7 +938,7 @@ class GuiConfigEditAutoReplaceTab(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
"Single quote open style", "Single quote open style",
self.quoteSym["SO"], self.quoteSym["SO"],
"The symbol to use for a leading single quote.", "The symbol to use for a leading single quote",
theButton=self.btnSingleStyleO theButton=self.btnSingleStyleO
) )
@@ -953,7 +954,7 @@ class GuiConfigEditAutoReplaceTab(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
"Single quote close style", "Single quote close style",
self.quoteSym["SC"], self.quoteSym["SC"],
"The symbol to use for a trailing single quote.", "The symbol to use for a trailing single quote",
theButton=self.btnSingleStyleC theButton=self.btnSingleStyleC
) )
@@ -970,7 +971,7 @@ class GuiConfigEditAutoReplaceTab(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
"Double quote open style", "Double quote open style",
self.quoteSym["DO"], self.quoteSym["DO"],
"The symbol to use for a leading double quote.", "The symbol to use for a leading double quote",
theButton=self.btnDoubleStyleO theButton=self.btnDoubleStyleO
) )
@@ -986,7 +987,7 @@ class GuiConfigEditAutoReplaceTab(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
"Double quote close style", "Double quote close style",
self.quoteSym["DC"], self.quoteSym["DC"],
"The symbol to use for a trailing double quote.", "The symbol to use for a trailing double quote",
theButton=self.btnDoubleStyleC theButton=self.btnDoubleStyleC
) )
@@ -998,29 +999,17 @@ class GuiConfigEditAutoReplaceTab(QWidget):
validEntries = True validEntries = True
needsRestart = False needsRestart = False
autoSelect = self.autoSelect.isChecked() self.mainConf.autoSelect = self.autoSelect.isChecked()
doReplace = self.autoReplaceMain.isChecked() self.mainConf.doReplace = self.autoReplaceMain.isChecked()
doReplaceSQuote = self.autoReplaceSQ.isChecked() self.mainConf.doReplaceSQuote = self.autoReplaceSQ.isChecked()
doReplaceDQuote = self.autoReplaceDQ.isChecked() self.mainConf.doReplaceDQuote = self.autoReplaceDQ.isChecked()
doReplaceDash = self.autoReplaceDash.isChecked() self.mainConf.doReplaceDash = self.autoReplaceDash.isChecked()
doReplaceDots = self.autoReplaceDots.isChecked() self.mainConf.doReplaceDots = self.autoReplaceDots.isChecked()
self.mainConf.autoSelect = autoSelect self.mainConf.fmtSingleQuotes[0] = self.quoteSym["SO"].text()
self.mainConf.doReplace = doReplace self.mainConf.fmtSingleQuotes[1] = self.quoteSym["SC"].text()
self.mainConf.doReplaceSQuote = doReplaceSQuote self.mainConf.fmtDoubleQuotes[0] = self.quoteSym["DO"].text()
self.mainConf.doReplaceDQuote = doReplaceDQuote self.mainConf.fmtDoubleQuotes[1] = self.quoteSym["DC"].text()
self.mainConf.doReplaceDash = doReplaceDash
self.mainConf.doReplaceDots = doReplaceDots
fmtSingleQuotesO = self.quoteSym["SO"].text()
fmtSingleQuotesC = self.quoteSym["SC"].text()
fmtDoubleQuotesO = self.quoteSym["DO"].text()
fmtDoubleQuotesC = self.quoteSym["DC"].text()
self.mainConf.fmtSingleQuotes[0] = fmtSingleQuotesO
self.mainConf.fmtSingleQuotes[1] = fmtSingleQuotesC
self.mainConf.fmtDoubleQuotes[0] = fmtDoubleQuotesO
self.mainConf.fmtDoubleQuotes[1] = fmtDoubleQuotesC
self.mainConf.confChanged = True self.mainConf.confChanged = True
+4 -4
View File
@@ -178,7 +178,7 @@ class GuiProjectEditMain(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
"Working title", "Working title",
self.editName, self.editName,
"Should be set only once." "Should be set only once"
) )
self.editTitle = QLineEdit() self.editTitle = QLineEdit()
@@ -201,7 +201,7 @@ class GuiProjectEditMain(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
"Author(s)", "Author(s)",
self.editAuthors, self.editAuthors,
"One name per line." "One name per line"
) )
self.spellLang = QComboBox(self) self.spellLang = QComboBox(self)
@@ -214,7 +214,7 @@ class GuiProjectEditMain(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
"Spell check language", "Spell check language",
self.spellLang, self.spellLang,
"Overrides main preferences." "Overrides main preferences"
) )
spellIdx = 0 spellIdx = 0
@@ -228,7 +228,7 @@ class GuiProjectEditMain(QWidget):
self.mainForm.addRow( self.mainForm.addRow(
"No backup on close", "No backup on close",
self.doBackup, self.doBackup,
"Overrides main preferences." "Overrides main preferences"
) )
return return
@@ -53,6 +53,8 @@ showlineendings = False
bigdoclimit = 800 bigdoclimit = 800
showfullpath = True showfullpath = True
highlightquotes = True highlightquotes = True
allowopensquote = False
allowopendquote = True
highlightemph = True highlightemph = True
[Backup] [Backup]
@@ -53,6 +53,8 @@ showlineendings = True
bigdoclimit = 500 bigdoclimit = 500
showfullpath = False showfullpath = False
highlightquotes = False highlightquotes = False
allowopensquote = False
allowopendquote = True
highlightemph = False highlightemph = False
[Backup] [Backup]
+1 -1
View File
@@ -74,7 +74,7 @@ def testBaseConfig_Constructor(monkeypatch):
monkeypatch.undo() monkeypatch.undo()
# Other # Other
monkeypatch.setattr("sys.platform", "some_ther_os") monkeypatch.setattr("sys.platform", "some_other_os")
tstConf = Config() tstConf = Config()
assert tstConf.osLinux is False assert tstConf.osLinux is False
assert tstConf.osDarwin is False assert tstConf.osDarwin is False