Save the window size and replace column width in project settings
This commit is contained in:
@@ -78,6 +78,11 @@ class OptionState():
|
|||||||
"columnWidth",
|
"columnWidth",
|
||||||
"columnHidden",
|
"columnHidden",
|
||||||
},
|
},
|
||||||
|
"GuiProjectSettings": {
|
||||||
|
"winWidth",
|
||||||
|
"winHeight",
|
||||||
|
"replaceColW",
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|||||||
+2
-2
@@ -871,8 +871,8 @@ class GuiBuildNovel(QDialog):
|
|||||||
"section" : self.fmtSection.text().strip(),
|
"section" : self.fmtSection.text().strip(),
|
||||||
})
|
})
|
||||||
|
|
||||||
winWidth = self.mainConf.pxInt(self.width())
|
winWidth = self.mainConf.rpxInt(self.width())
|
||||||
winHeight = self.mainConf.pxInt(self.height())
|
winHeight = self.mainConf.rpxInt(self.height())
|
||||||
justifyText = self.justifyText.isChecked()
|
justifyText = self.justifyText.isChecked()
|
||||||
noStyling = self.noStyling.isChecked()
|
noStyling = self.noStyling.isChecked()
|
||||||
textFont = self.textFont.text()
|
textFont = self.textFont.text()
|
||||||
|
|||||||
+36
-5
@@ -51,9 +51,17 @@ class GuiProjectSettings(PagedDialog):
|
|||||||
self.mainConf = nw.CONFIG
|
self.mainConf = nw.CONFIG
|
||||||
self.theParent = theParent
|
self.theParent = theParent
|
||||||
self.theProject = theProject
|
self.theProject = theProject
|
||||||
|
self.optState = theProject.optState
|
||||||
|
|
||||||
self.theProject.countStatus()
|
self.theProject.countStatus()
|
||||||
self.setWindowTitle("Project Settings")
|
self.setWindowTitle("Project Settings")
|
||||||
|
self.setMinimumWidth(self.mainConf.pxInt(570))
|
||||||
|
self.setMinimumHeight(self.mainConf.pxInt(355))
|
||||||
|
|
||||||
|
self.resize(
|
||||||
|
self.mainConf.pxInt(self.optState.getInt("GuiProjectSettings", "winWidth", 570)),
|
||||||
|
self.mainConf.pxInt(self.optState.getInt("GuiProjectSettings", "winHeight", 355))
|
||||||
|
)
|
||||||
|
|
||||||
self.tabMain = GuiProjectEditMain(self.theParent, self.theProject)
|
self.tabMain = GuiProjectEditMain(self.theParent, self.theProject)
|
||||||
self.tabMeta = GuiProjectEditMeta(self.theParent, self.theProject)
|
self.tabMeta = GuiProjectEditMeta(self.theParent, self.theProject)
|
||||||
@@ -76,7 +84,13 @@ class GuiProjectSettings(PagedDialog):
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
##
|
||||||
|
# Slots
|
||||||
|
##
|
||||||
|
|
||||||
def _doSave(self):
|
def _doSave(self):
|
||||||
|
"""Save settings and close dialog.
|
||||||
|
"""
|
||||||
logger.verbose("GuiProjectSettings save button clicked")
|
logger.verbose("GuiProjectSettings save button clicked")
|
||||||
|
|
||||||
projName = self.tabMain.editName.text()
|
projName = self.tabMain.editName.text()
|
||||||
@@ -100,13 +114,23 @@ class GuiProjectSettings(PagedDialog):
|
|||||||
newList = self.tabReplace.getNewList()
|
newList = self.tabReplace.getNewList()
|
||||||
self.theProject.setAutoReplace(newList)
|
self.theProject.setAutoReplace(newList)
|
||||||
|
|
||||||
self.close()
|
self._doClose()
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
def _doClose(self):
|
def _doClose(self):
|
||||||
logger.verbose("GuiProjectSettings close button clicked")
|
"""Close the dialog.
|
||||||
|
"""
|
||||||
|
winWidth = self.mainConf.rpxInt(self.width())
|
||||||
|
winHeight = self.mainConf.rpxInt(self.height())
|
||||||
|
replaceColW = self.mainConf.rpxInt(self.tabReplace.listBox.columnWidth(0))
|
||||||
|
|
||||||
|
self.optState.setValue("GuiProjectSettings", "winWidth", winWidth)
|
||||||
|
self.optState.setValue("GuiProjectSettings", "winHeight", winHeight)
|
||||||
|
self.optState.setValue("GuiProjectSettings", "replaceColW", replaceColW)
|
||||||
|
|
||||||
self.close()
|
self.close()
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
# END Class GuiProjectSettings
|
# END Class GuiProjectSettings
|
||||||
@@ -452,16 +476,23 @@ class GuiProjectEditReplace(QWidget):
|
|||||||
def __init__(self, theParent, theProject):
|
def __init__(self, theParent, theProject):
|
||||||
QWidget.__init__(self, theParent)
|
QWidget.__init__(self, theParent)
|
||||||
|
|
||||||
|
self.mainConf = nw.CONFIG
|
||||||
self.theParent = theParent
|
self.theParent = theParent
|
||||||
self.theTheme = theParent.theTheme
|
self.theTheme = theParent.theTheme
|
||||||
self.theProject = theProject
|
self.theProject = theProject
|
||||||
|
self.optState = theProject.optState
|
||||||
self.arChanged = False
|
self.arChanged = False
|
||||||
|
|
||||||
self.outerBox = QVBoxLayout()
|
self.outerBox = QVBoxLayout()
|
||||||
self.bottomBox = QHBoxLayout()
|
self.bottomBox = QHBoxLayout()
|
||||||
self.listBox = QTreeWidget()
|
|
||||||
|
wCol0 = self.mainConf.pxInt(
|
||||||
|
self.optState.getInt("GuiProjectSettings", "replaceColW", 100)
|
||||||
|
)
|
||||||
|
self.listBox = QTreeWidget()
|
||||||
self.listBox.setHeaderLabels(["Keyword","Replace With"])
|
self.listBox.setHeaderLabels(["Keyword","Replace With"])
|
||||||
self.listBox.itemSelectionChanged.connect(self._selectedItem)
|
self.listBox.itemSelectionChanged.connect(self._selectedItem)
|
||||||
|
self.listBox.setColumnWidth(0, wCol0)
|
||||||
self.listBox.setIndentation(0)
|
self.listBox.setIndentation(0)
|
||||||
|
|
||||||
for aKey, aVal in self.theProject.autoReplace.items():
|
for aKey, aVal in self.theProject.autoReplace.items():
|
||||||
|
|||||||
Reference in New Issue
Block a user