Rename ambiguous theParent variable to mainGui

This commit is contained in:
Veronica Berglyd Olsen
2022-06-11 15:33:32 +02:00
parent b8d557646a
commit 0181bebd70
28 changed files with 407 additions and 408 deletions
+7 -7
View File
@@ -42,16 +42,16 @@ logger = logging.getLogger(__name__)
class GuiWordList(QDialog):
def __init__(self, theParent):
QDialog.__init__(self, theParent)
def __init__(self, mainGui):
QDialog.__init__(self, mainGui)
logger.debug("Initialising GuiWordList ...")
self.setObjectName("GuiWordList")
self.mainConf = novelwriter.CONFIG
self.theParent = theParent
self.theTheme = theParent.theTheme
self.theProject = theParent.theProject
self.mainGui = mainGui
self.theTheme = mainGui.theTheme
self.theProject = mainGui.theProject
self.setWindowTitle(self.tr("Project Word List"))
@@ -121,13 +121,13 @@ class GuiWordList(QDialog):
"""
newWord = self.newEntry.text().strip()
if newWord == "":
self.theParent.makeAlert(self.tr(
self.mainGui.makeAlert(self.tr(
"Cannot add a blank word."
), nwAlert.ERROR)
return False
if self.listBox.findItems(newWord, Qt.MatchExactly):
self.theParent.makeAlert(self.tr(
self.mainGui.makeAlert(self.tr(
"The word '{0}' is already in the word list."
).format(newWord), nwAlert.ERROR)
return False