Turn off generating notes if all notes folders are off in the new project wizard (#1192)
This commit is contained in:
@@ -334,13 +334,18 @@ class ProjWizardCustomPage(QWizardPage):
|
|||||||
|
|
||||||
# Root Folders
|
# Root Folders
|
||||||
self.addPlot = QSwitch()
|
self.addPlot = QSwitch()
|
||||||
self.addChar = QSwitch()
|
|
||||||
self.addWorld = QSwitch()
|
|
||||||
self.addNotes = QSwitch()
|
|
||||||
|
|
||||||
self.addPlot.setChecked(True)
|
self.addPlot.setChecked(True)
|
||||||
|
self.addPlot.clicked.connect(self._syncSwitches)
|
||||||
|
|
||||||
|
self.addChar = QSwitch()
|
||||||
self.addChar.setChecked(True)
|
self.addChar.setChecked(True)
|
||||||
|
self.addChar.clicked.connect(self._syncSwitches)
|
||||||
|
|
||||||
|
self.addWorld = QSwitch()
|
||||||
self.addWorld.setChecked(False)
|
self.addWorld.setChecked(False)
|
||||||
|
self.addWorld.clicked.connect(self._syncSwitches)
|
||||||
|
|
||||||
|
self.addNotes = QSwitch()
|
||||||
self.addNotes.setChecked(False)
|
self.addNotes.setChecked(False)
|
||||||
|
|
||||||
# Generate Content
|
# Generate Content
|
||||||
@@ -391,6 +396,20 @@ class ProjWizardCustomPage(QWizardPage):
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
##
|
||||||
|
# Internal Functions
|
||||||
|
##
|
||||||
|
|
||||||
|
def _syncSwitches(self):
|
||||||
|
"""Check if the add notes option should also be switched off.
|
||||||
|
"""
|
||||||
|
addPlot = self.addPlot.isChecked()
|
||||||
|
addChar = self.addChar.isChecked()
|
||||||
|
addWorld = self.addWorld.isChecked()
|
||||||
|
if not (addPlot or addChar or addWorld):
|
||||||
|
self.addNotes.setChecked(False)
|
||||||
|
return
|
||||||
|
|
||||||
# END Class ProjWizardCustomPage
|
# END Class ProjWizardCustomPage
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -202,6 +202,14 @@ def testToolProjectWizard_Run(qtbot, monkeypatch, nwGUI, fncDir, prjType):
|
|||||||
assert isinstance(customPage, ProjWizardCustomPage)
|
assert isinstance(customPage, ProjWizardCustomPage)
|
||||||
assert nwWiz.button(QWizard.NextButton).isEnabled()
|
assert nwWiz.button(QWizard.NextButton).isEnabled()
|
||||||
|
|
||||||
|
# Make sure the fourth option is also turned off
|
||||||
|
customPage.addPlot.setChecked(False)
|
||||||
|
customPage.addChar.setChecked(False)
|
||||||
|
customPage.addWorld.setChecked(False)
|
||||||
|
customPage._syncSwitches()
|
||||||
|
assert not customPage.addNotes.isChecked()
|
||||||
|
|
||||||
|
# Switch everything back on again
|
||||||
customPage.addPlot.setChecked(True)
|
customPage.addPlot.setChecked(True)
|
||||||
customPage.addChar.setChecked(True)
|
customPage.addChar.setChecked(True)
|
||||||
customPage.addWorld.setChecked(True)
|
customPage.addWorld.setChecked(True)
|
||||||
|
|||||||
Reference in New Issue
Block a user