Clean up class initialisation
This commit is contained in:
@@ -44,7 +44,7 @@ logger = logging.getLogger(__name__)
|
||||
class GuiAbout(QDialog):
|
||||
|
||||
def __init__(self, mainGui):
|
||||
QDialog.__init__(self, mainGui)
|
||||
super().__init__(parent=mainGui)
|
||||
|
||||
logger.debug("Initialising GuiAbout ...")
|
||||
self.setObjectName("GuiAbout")
|
||||
|
||||
@@ -42,7 +42,7 @@ logger = logging.getLogger(__name__)
|
||||
class GuiDocSplit(QDialog):
|
||||
|
||||
def __init__(self, mainGui):
|
||||
QDialog.__init__(self, mainGui)
|
||||
super().__init__(parent=mainGui)
|
||||
|
||||
logger.debug("Initialising GuiDocSplit ...")
|
||||
self.setObjectName("GuiDocSplit")
|
||||
|
||||
@@ -36,7 +36,7 @@ logger = logging.getLogger(__name__)
|
||||
class GuiEditLabel(QDialog):
|
||||
|
||||
def __init__(self, parent, text=""):
|
||||
QDialog.__init__(self, parent=parent)
|
||||
super().__init__(parent=parent)
|
||||
|
||||
self.setObjectName("GuiEditLabel")
|
||||
self.setWindowTitle(self.tr("Item Label"))
|
||||
|
||||
@@ -44,7 +44,7 @@ logger = logging.getLogger(__name__)
|
||||
class GuiPreferences(PagedDialog):
|
||||
|
||||
def __init__(self, mainGui):
|
||||
PagedDialog.__init__(self, mainGui)
|
||||
super().__init__(parent=mainGui)
|
||||
|
||||
logger.debug("Initialising GuiPreferences ...")
|
||||
self.setObjectName("GuiPreferences")
|
||||
@@ -55,13 +55,13 @@ class GuiPreferences(PagedDialog):
|
||||
|
||||
self.setWindowTitle(self.tr("Preferences"))
|
||||
|
||||
self.tabGeneral = GuiPreferencesGeneral(self.mainGui)
|
||||
self.tabProjects = GuiPreferencesProjects(self.mainGui)
|
||||
self.tabDocs = GuiPreferencesDocuments(self.mainGui)
|
||||
self.tabEditor = GuiPreferencesEditor(self.mainGui)
|
||||
self.tabSyntax = GuiPreferencesSyntax(self.mainGui)
|
||||
self.tabAuto = GuiPreferencesAutomation(self.mainGui)
|
||||
self.tabQuote = GuiPreferencesQuotes(self.mainGui)
|
||||
self.tabGeneral = GuiPreferencesGeneral(self, self.mainGui)
|
||||
self.tabProjects = GuiPreferencesProjects(self, self.mainGui)
|
||||
self.tabDocs = GuiPreferencesDocuments(self, self.mainGui)
|
||||
self.tabEditor = GuiPreferencesEditor(self, self.mainGui)
|
||||
self.tabSyntax = GuiPreferencesSyntax(self, self.mainGui)
|
||||
self.tabAuto = GuiPreferencesAutomation(self, self.mainGui)
|
||||
self.tabQuote = GuiPreferencesQuotes(self, self.mainGui)
|
||||
|
||||
self.addTab(self.tabGeneral, self.tr("General"))
|
||||
self.addTab(self.tabProjects, self.tr("Projects"))
|
||||
@@ -138,8 +138,8 @@ class GuiPreferences(PagedDialog):
|
||||
|
||||
class GuiPreferencesGeneral(QWidget):
|
||||
|
||||
def __init__(self, mainGui):
|
||||
QWidget.__init__(self, mainGui)
|
||||
def __init__(self, prefsGui, mainGui):
|
||||
super().__init__(parent=prefsGui)
|
||||
|
||||
self.mainConf = novelwriter.CONFIG
|
||||
self.mainGui = mainGui
|
||||
@@ -344,8 +344,8 @@ class GuiPreferencesGeneral(QWidget):
|
||||
|
||||
class GuiPreferencesProjects(QWidget):
|
||||
|
||||
def __init__(self, mainGui):
|
||||
QWidget.__init__(self, mainGui)
|
||||
def __init__(self, prefsGui, mainGui):
|
||||
super().__init__(parent=prefsGui)
|
||||
|
||||
self.mainConf = novelwriter.CONFIG
|
||||
self.mainGui = mainGui
|
||||
@@ -505,8 +505,8 @@ class GuiPreferencesProjects(QWidget):
|
||||
|
||||
class GuiPreferencesDocuments(QWidget):
|
||||
|
||||
def __init__(self, mainGui):
|
||||
QWidget.__init__(self, mainGui)
|
||||
def __init__(self, prefsGui, mainGui):
|
||||
super().__init__(parent=prefsGui)
|
||||
|
||||
self.mainConf = novelwriter.CONFIG
|
||||
self.mainGui = mainGui
|
||||
@@ -666,8 +666,8 @@ class GuiPreferencesDocuments(QWidget):
|
||||
|
||||
class GuiPreferencesEditor(QWidget):
|
||||
|
||||
def __init__(self, mainGui):
|
||||
QWidget.__init__(self, mainGui)
|
||||
def __init__(self, prefsGui, mainGui):
|
||||
super().__init__(parent=prefsGui)
|
||||
|
||||
self.mainConf = novelwriter.CONFIG
|
||||
self.mainGui = mainGui
|
||||
@@ -840,8 +840,8 @@ class GuiPreferencesEditor(QWidget):
|
||||
|
||||
class GuiPreferencesSyntax(QWidget):
|
||||
|
||||
def __init__(self, mainGui):
|
||||
QWidget.__init__(self, mainGui)
|
||||
def __init__(self, prefsGui, mainGui):
|
||||
super().__init__(parent=prefsGui)
|
||||
|
||||
self.mainConf = novelwriter.CONFIG
|
||||
self.mainGui = mainGui
|
||||
@@ -943,8 +943,8 @@ class GuiPreferencesSyntax(QWidget):
|
||||
|
||||
class GuiPreferencesAutomation(QWidget):
|
||||
|
||||
def __init__(self, mainGui):
|
||||
QWidget.__init__(self, mainGui)
|
||||
def __init__(self, prefsGui, mainGui):
|
||||
super().__init__(parent=prefsGui)
|
||||
|
||||
self.mainConf = novelwriter.CONFIG
|
||||
self.mainGui = mainGui
|
||||
@@ -1100,8 +1100,8 @@ class GuiPreferencesAutomation(QWidget):
|
||||
|
||||
class GuiPreferencesQuotes(QWidget):
|
||||
|
||||
def __init__(self, mainGui):
|
||||
QWidget.__init__(self, mainGui)
|
||||
def __init__(self, prefsGui, mainGui):
|
||||
super().__init__(parent=prefsGui)
|
||||
|
||||
self.mainConf = novelwriter.CONFIG
|
||||
self.mainGui = mainGui
|
||||
|
||||
@@ -46,7 +46,7 @@ logger = logging.getLogger(__name__)
|
||||
class GuiProjectDetails(PagedDialog):
|
||||
|
||||
def __init__(self, mainGui):
|
||||
PagedDialog.__init__(self, mainGui)
|
||||
super().__init__(parent=mainGui)
|
||||
|
||||
logger.debug("Initialising GuiProjectDetails ...")
|
||||
self.setObjectName("GuiProjectDetails")
|
||||
@@ -142,7 +142,7 @@ class GuiProjectDetails(PagedDialog):
|
||||
class GuiProjectDetailsMain(QWidget):
|
||||
|
||||
def __init__(self, mainGui, theProject):
|
||||
QWidget.__init__(self, mainGui)
|
||||
super().__init__(parent=mainGui)
|
||||
|
||||
self.mainConf = novelwriter.CONFIG
|
||||
self.theProject = theProject
|
||||
@@ -274,7 +274,7 @@ class GuiProjectDetailsContents(QWidget):
|
||||
C_PROG = 4
|
||||
|
||||
def __init__(self, mainGui, theProject):
|
||||
QWidget.__init__(self, mainGui)
|
||||
super().__init__(parent=mainGui)
|
||||
|
||||
self.mainConf = novelwriter.CONFIG
|
||||
self.theProject = theProject
|
||||
|
||||
@@ -54,7 +54,7 @@ class GuiProjectLoad(QDialog):
|
||||
C_TIME = 2
|
||||
|
||||
def __init__(self, mainGui):
|
||||
QDialog.__init__(self, mainGui)
|
||||
super().__init__(parent=mainGui)
|
||||
|
||||
logger.debug("Initialising GuiProjectLoad ...")
|
||||
self.setObjectName("GuiProjectLoad")
|
||||
|
||||
@@ -44,7 +44,7 @@ logger = logging.getLogger(__name__)
|
||||
class GuiProjectSettings(PagedDialog):
|
||||
|
||||
def __init__(self, mainGui):
|
||||
PagedDialog.__init__(self, mainGui)
|
||||
super().__init__(parent=mainGui)
|
||||
|
||||
logger.debug("Initialising GuiProjectSettings ...")
|
||||
self.setObjectName("GuiProjectSettings")
|
||||
@@ -67,10 +67,10 @@ class GuiProjectSettings(PagedDialog):
|
||||
self.mainConf.pxInt(pOptions.getInt("GuiProjectSettings", "winHeight", wH))
|
||||
)
|
||||
|
||||
self.tabMain = GuiProjectEditMain(self.mainGui, self.theProject)
|
||||
self.tabStatus = GuiProjectEditStatus(self.mainGui, self.theProject, True)
|
||||
self.tabImport = GuiProjectEditStatus(self.mainGui, self.theProject, False)
|
||||
self.tabReplace = GuiProjectEditReplace(self.mainGui, self.theProject)
|
||||
self.tabMain = GuiProjectEditMain(self, self.mainGui, self.theProject)
|
||||
self.tabStatus = GuiProjectEditStatus(self, self.mainGui, self.theProject, True)
|
||||
self.tabImport = GuiProjectEditStatus(self, self.mainGui, self.theProject, False)
|
||||
self.tabReplace = GuiProjectEditReplace(self, self.mainGui, self.theProject)
|
||||
|
||||
self.addTab(self.tabMain, self.tr("Settings"))
|
||||
self.addTab(self.tabStatus, self.tr("Status"))
|
||||
@@ -166,8 +166,8 @@ class GuiProjectSettings(PagedDialog):
|
||||
|
||||
class GuiProjectEditMain(QWidget):
|
||||
|
||||
def __init__(self, mainGui, theProject):
|
||||
QWidget.__init__(self, mainGui)
|
||||
def __init__(self, projGui, mainGui, theProject):
|
||||
super().__init__(parent=projGui)
|
||||
|
||||
self.mainConf = novelwriter.CONFIG
|
||||
self.mainGui = mainGui
|
||||
@@ -256,8 +256,8 @@ class GuiProjectEditStatus(QWidget):
|
||||
COL_ROLE = Qt.UserRole + 1
|
||||
NUM_ROLE = Qt.UserRole + 2
|
||||
|
||||
def __init__(self, mainGui, theProject, isStatus):
|
||||
QWidget.__init__(self, mainGui)
|
||||
def __init__(self, prefsGui, mainGui, theProject, isStatus):
|
||||
super().__init__(parent=prefsGui)
|
||||
|
||||
self.mainConf = novelwriter.CONFIG
|
||||
self.mainGui = mainGui
|
||||
@@ -527,8 +527,8 @@ class GuiProjectEditReplace(QWidget):
|
||||
COL_KEY = 0
|
||||
COL_REPL = 1
|
||||
|
||||
def __init__(self, mainGui, theProject):
|
||||
QWidget.__init__(self, mainGui)
|
||||
def __init__(self, prefsGui, mainGui, theProject):
|
||||
super().__init__(parent=prefsGui)
|
||||
|
||||
self.mainConf = novelwriter.CONFIG
|
||||
self.mainGui = mainGui
|
||||
|
||||
@@ -43,7 +43,7 @@ class GuiQuoteSelect(QDialog):
|
||||
selectedQuote = ""
|
||||
|
||||
def __init__(self, parent=None, currentQuote='"'):
|
||||
QDialog.__init__(self, parent=parent)
|
||||
super().__init__(parent=parent)
|
||||
|
||||
self.mainConf = novelwriter.CONFIG
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ logger = logging.getLogger(__name__)
|
||||
class GuiUpdates(QDialog):
|
||||
|
||||
def __init__(self, mainGui):
|
||||
QDialog.__init__(self, mainGui)
|
||||
super().__init__(parent=mainGui)
|
||||
|
||||
logger.debug("Initialising GuiUpdates ...")
|
||||
self.setObjectName("GuiUpdates")
|
||||
|
||||
@@ -43,7 +43,7 @@ logger = logging.getLogger(__name__)
|
||||
class GuiWordList(QDialog):
|
||||
|
||||
def __init__(self, mainGui):
|
||||
QDialog.__init__(self, mainGui)
|
||||
super().__init__(parent=mainGui)
|
||||
|
||||
logger.debug("Initialising GuiWordList ...")
|
||||
self.setObjectName("GuiWordList")
|
||||
|
||||
Reference in New Issue
Block a user