diff --git a/nw/dialogs/docmerge.py b/nw/dialogs/docmerge.py index a609e63d..80c0f0e6 100644 --- a/nw/dialogs/docmerge.py +++ b/nw/dialogs/docmerge.py @@ -41,7 +41,7 @@ logger = logging.getLogger(__name__) class GuiDocMerge(QDialog): - def __init__(self, theParent, theProject): + def __init__(self, theParent): QDialog.__init__(self, theParent) logger.debug("Initialising GuiDocMerge ...") @@ -49,7 +49,7 @@ class GuiDocMerge(QDialog): self.mainConf = nw.CONFIG self.theParent = theParent - self.theProject = theProject + self.theProject = theParent.theProject self.sourceItem = None self.outerBox = QVBoxLayout() diff --git a/nw/dialogs/docsplit.py b/nw/dialogs/docsplit.py index 74fbedfa..1944c875 100644 --- a/nw/dialogs/docsplit.py +++ b/nw/dialogs/docsplit.py @@ -42,7 +42,7 @@ logger = logging.getLogger(__name__) class GuiDocSplit(QDialog): - def __init__(self, theParent, theProject): + def __init__(self, theParent): QDialog.__init__(self, theParent) logger.debug("Initialising GuiDocSplit ...") @@ -50,8 +50,8 @@ class GuiDocSplit(QDialog): self.mainConf = nw.CONFIG self.theParent = theParent - self.theProject = theProject - self.optState = self.theProject.optState + self.theProject = theParent.theProject + self.optState = theParent.theProject.optState self.sourceItem = None self.outerBox = QVBoxLayout() diff --git a/nw/dialogs/itemeditor.py b/nw/dialogs/itemeditor.py index b2c0f496..b8fa07f7 100644 --- a/nw/dialogs/itemeditor.py +++ b/nw/dialogs/itemeditor.py @@ -41,15 +41,15 @@ logger = logging.getLogger(__name__) class GuiItemEditor(QDialog): - def __init__(self, theParent, theProject, tHandle): + def __init__(self, theParent, tHandle): QDialog.__init__(self, theParent) logger.debug("Initialising GuiItemEditor ...") self.setObjectName("GuiItemEditor") self.mainConf = nw.CONFIG - self.theProject = theProject self.theParent = theParent + self.theProject = theParent.theProject ## # Build GUI diff --git a/nw/dialogs/preferences.py b/nw/dialogs/preferences.py index 66315e1d..5ed23996 100644 --- a/nw/dialogs/preferences.py +++ b/nw/dialogs/preferences.py @@ -45,7 +45,7 @@ logger = logging.getLogger(__name__) class GuiPreferences(PagedDialog): - def __init__(self, theParent, theProject): + def __init__(self, theParent): PagedDialog.__init__(self, theParent) logger.debug("Initialising GuiPreferences ...") @@ -53,7 +53,7 @@ class GuiPreferences(PagedDialog): self.mainConf = nw.CONFIG self.theParent = theParent - self.theProject = theProject + self.theProject = theParent.theProject self.setWindowTitle(self.tr("Preferences")) diff --git a/nw/dialogs/projsettings.py b/nw/dialogs/projsettings.py index 55fd3d8c..38952eed 100644 --- a/nw/dialogs/projsettings.py +++ b/nw/dialogs/projsettings.py @@ -42,7 +42,7 @@ logger = logging.getLogger(__name__) class GuiProjectSettings(PagedDialog): - def __init__(self, theParent, theProject): + def __init__(self, theParent): PagedDialog.__init__(self, theParent) logger.debug("Initialising GuiProjectSettings ...") @@ -50,8 +50,8 @@ class GuiProjectSettings(PagedDialog): self.mainConf = nw.CONFIG self.theParent = theParent - self.theProject = theProject - self.optState = theProject.optState + self.theProject = theParent.theProject + self.optState = theParent.theProject.optState self.theProject.countStatus() self.setWindowTitle(self.tr("Project Settings")) diff --git a/nw/dialogs/quotes.py b/nw/dialogs/quotes.py index 7c129332..f1c9bd26 100644 --- a/nw/dialogs/quotes.py +++ b/nw/dialogs/quotes.py @@ -42,7 +42,7 @@ class GuiQuoteSelect(QDialog): selectedQuote = "" - def __init__(self, theParent=None, currentQuote="\""): + def __init__(self, theParent=None, currentQuote='"'): QDialog.__init__(self, parent=theParent) self.mainConf = nw.CONFIG diff --git a/nw/dialogs/wordlist.py b/nw/dialogs/wordlist.py index 7b7d810f..6870c271 100644 --- a/nw/dialogs/wordlist.py +++ b/nw/dialogs/wordlist.py @@ -41,7 +41,7 @@ logger = logging.getLogger(__name__) class GuiWordList(QDialog): - def __init__(self, theParent, theProject): + def __init__(self, theParent): QDialog.__init__(self, theParent) logger.debug("Initialising GuiWordList ...") @@ -50,8 +50,8 @@ class GuiWordList(QDialog): self.mainConf = nw.CONFIG self.theParent = theParent self.theTheme = theParent.theTheme - self.theProject = theProject - self.optState = theProject.optState + self.theProject = theParent.theProject + self.optState = theParent.theProject.optState self.setWindowTitle(self.tr("Project Word List")) diff --git a/nw/gui/projdetails.py b/nw/gui/projdetails.py index 74e315c4..9fb13ef5 100644 --- a/nw/gui/projdetails.py +++ b/nw/gui/projdetails.py @@ -43,7 +43,7 @@ logger = logging.getLogger(__name__) class GuiProjectDetails(PagedDialog): - def __init__(self, theParent, theProject): + def __init__(self, theParent): PagedDialog.__init__(self, theParent) logger.debug("Initialising GuiProjectDetails ...") @@ -51,8 +51,8 @@ class GuiProjectDetails(PagedDialog): self.mainConf = nw.CONFIG self.theParent = theParent - self.theProject = theProject - self.optState = theProject.optState + self.theProject = theParent.theProject + self.optState = theParent.theProject.optState self.setWindowTitle(self.tr("Project Details")) diff --git a/nw/guimain.py b/nw/guimain.py index 8c97d6d5..529606ca 100644 --- a/nw/guimain.py +++ b/nw/guimain.py @@ -756,7 +756,7 @@ class GuiMain(QMainWindow): logger.error("No project open") return False - dlgMerge = GuiDocMerge(self, self.theProject) + dlgMerge = GuiDocMerge(self) dlgMerge.exec_() return True @@ -768,7 +768,7 @@ class GuiMain(QMainWindow): logger.error("No project open") return False - dlgSplit = GuiDocSplit(self, self.theProject) + dlgSplit = GuiDocSplit(self) dlgSplit.exec_() return True @@ -837,7 +837,7 @@ class GuiMain(QMainWindow): return logger.verbose("Requesting change to item %s" % tHandle) - dlgProj = GuiItemEditor(self, self.theProject, tHandle) + dlgProj = GuiItemEditor(self, tHandle) dlgProj.exec_() if dlgProj.result() == QDialog.Accepted: self.treeView.setTreeItemValues(tHandle) @@ -958,7 +958,7 @@ class GuiMain(QMainWindow): def showPreferencesDialog(self): """Open the preferences dialog. """ - dlgConf = GuiPreferences(self, self.theProject) + dlgConf = GuiPreferences(self) dlgConf.exec_() if dlgConf.result() == QDialog.Accepted: @@ -982,7 +982,7 @@ class GuiMain(QMainWindow): logger.error("No project open") return - dlgProj = GuiProjectSettings(self, self.theProject) + dlgProj = GuiProjectSettings(self) dlgProj.exec_() if dlgProj.result() == QDialog.Accepted: @@ -1001,7 +1001,7 @@ class GuiMain(QMainWindow): self.treeView.flushTreeOrder() - dlgDetails = GuiProjectDetails(self, self.theProject) + dlgDetails = GuiProjectDetails(self) dlgDetails.setModal(False) dlgDetails.show() @@ -1016,7 +1016,7 @@ class GuiMain(QMainWindow): dlgBuild = getGuiItem("GuiBuildNovel") if dlgBuild is None: - dlgBuild = GuiBuildNovel(self, self.theProject) + dlgBuild = GuiBuildNovel(self) dlgBuild.setModal(False) dlgBuild.show() @@ -1032,7 +1032,7 @@ class GuiMain(QMainWindow): logger.error("No project open") return - dlgWords = GuiWordList(self, self.theProject) + dlgWords = GuiWordList(self) dlgWords.exec_() if dlgWords.result() == QDialog.Accepted: @@ -1050,7 +1050,7 @@ class GuiMain(QMainWindow): dlgStats = getGuiItem("GuiWritingStats") if dlgStats is None: - dlgStats = GuiWritingStats(self, self.theProject) + dlgStats = GuiWritingStats(self) dlgStats.setModal(False) dlgStats.show() diff --git a/nw/tools/build.py b/nw/tools/build.py index a3093cea..ce3ad47d 100644 --- a/nw/tools/build.py +++ b/nw/tools/build.py @@ -66,17 +66,17 @@ class GuiBuildNovel(QDialog): FMT_JSON_H = 8 # HTML5 wrapped in JSON FMT_JSON_M = 9 # nW Markdown wrapped in JSON - def __init__(self, theParent, theProject): + def __init__(self, theParent): QDialog.__init__(self, theParent) logger.debug("Initialising GuiBuildNovel ...") self.setObjectName("GuiBuildNovel") self.mainConf = nw.CONFIG - self.theProject = theProject self.theParent = theParent self.theTheme = theParent.theTheme - self.optState = self.theProject.optState + self.theProject = theParent.theProject + self.optState = theParent.theProject.optState self.htmlText = [] # List of html documents self.htmlStyle = [] # List of html styles diff --git a/nw/tools/writingstats.py b/nw/tools/writingstats.py index cd50a3dd..55dfc8ea 100644 --- a/nw/tools/writingstats.py +++ b/nw/tools/writingstats.py @@ -56,7 +56,7 @@ class GuiWritingStats(QDialog): FMT_JSON = 0 FMT_CSV = 1 - def __init__(self, theParent, theProject): + def __init__(self, theParent): QDialog.__init__(self, theParent) logger.debug("Initialising GuiWritingStats ...") @@ -64,9 +64,9 @@ class GuiWritingStats(QDialog): self.mainConf = nw.CONFIG self.theParent = theParent - self.theProject = theProject self.theTheme = theParent.theTheme - self.optState = theProject.optState + self.theProject = theParent.theProject + self.optState = theParent.theProject.optState self.logData = [] self.filterData = []