Also saving options for DocSplit dialog
This commit is contained in:
@@ -33,6 +33,7 @@ class GuiDocSplit(QDialog):
|
|||||||
self.mainConf = nw.CONFIG
|
self.mainConf = nw.CONFIG
|
||||||
self.theParent = theParent
|
self.theParent = theParent
|
||||||
self.theProject = theProject
|
self.theProject = theProject
|
||||||
|
self.optState = self.theProject.optState
|
||||||
self.sourceItem = None
|
self.sourceItem = None
|
||||||
|
|
||||||
self.outerBox = QHBoxLayout()
|
self.outerBox = QHBoxLayout()
|
||||||
@@ -56,7 +57,11 @@ class GuiDocSplit(QDialog):
|
|||||||
self.splitLevel.addItem("Split up to Header Level 2 (Chapter)", 2)
|
self.splitLevel.addItem("Split up to Header Level 2 (Chapter)", 2)
|
||||||
self.splitLevel.addItem("Split up to Header Level 3 (Scene)", 3)
|
self.splitLevel.addItem("Split up to Header Level 3 (Scene)", 3)
|
||||||
self.splitLevel.addItem("Split up to Header Level 4 (Section)", 4)
|
self.splitLevel.addItem("Split up to Header Level 4 (Section)", 4)
|
||||||
self.splitLevel.setCurrentIndex(2)
|
spIndex = self.splitLevel.findData(
|
||||||
|
self.optState.getInt("GuiDocSplit", "spLevel", 3)
|
||||||
|
)
|
||||||
|
if spIndex != -1:
|
||||||
|
self.splitLevel.setCurrentIndex(spIndex)
|
||||||
self.splitLevel.currentIndexChanged.connect(self._populateList)
|
self.splitLevel.currentIndexChanged.connect(self._populateList)
|
||||||
|
|
||||||
self.splitButton = QPushButton("Split")
|
self.splitButton = QPushButton("Split")
|
||||||
@@ -172,6 +177,7 @@ class GuiDocSplit(QDialog):
|
|||||||
"""Close the dialog window without doing anything.
|
"""Close the dialog window without doing anything.
|
||||||
"""
|
"""
|
||||||
logger.verbose("GuiDocSplit close button clicked")
|
logger.verbose("GuiDocSplit close button clicked")
|
||||||
|
self.optState.saveSettings()
|
||||||
self.close()
|
self.close()
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -206,6 +212,7 @@ class GuiDocSplit(QDialog):
|
|||||||
theText = theDoc.openDocument(self.sourceItem, False)
|
theText = theDoc.openDocument(self.sourceItem, False)
|
||||||
|
|
||||||
spLevel = self.splitLevel.currentData()
|
spLevel = self.splitLevel.currentData()
|
||||||
|
self.optState.setValue("GuiDocSplit", "spLevel", spLevel)
|
||||||
logger.debug("Scanning document %s for headings level <= %d" % (self.sourceItem, spLevel))
|
logger.debug("Scanning document %s for headings level <= %d" % (self.sourceItem, spLevel))
|
||||||
|
|
||||||
lineNo = 0
|
lineNo = 0
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ from PyQt5.QtWidgets import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
from nw.convert import TextFile, HtmlFile, MarkdownFile, LaTeXFile, ConcatFile
|
from nw.convert import TextFile, HtmlFile, MarkdownFile, LaTeXFile, ConcatFile
|
||||||
from nw.tools import OptionState
|
|
||||||
from nw.common import packageRefURL
|
from nw.common import packageRefURL
|
||||||
from nw.constants import nwFiles, nwItemType, nwAlert
|
from nw.constants import nwFiles, nwItemType, nwAlert
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ from PyQt5.QtWidgets import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
from nw.constants import nwConst, nwFiles, nwAlert
|
from nw.constants import nwConst, nwFiles, nwAlert
|
||||||
from nw.tools import OptionState
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ from PyQt5.QtWidgets import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
from nw.constants import nwFiles, nwItemClass
|
from nw.constants import nwFiles, nwItemClass
|
||||||
from nw.tools import OptionState
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user