Add Preferences window size to Config and update tests
This commit is contained in:
@@ -104,6 +104,7 @@ class Config:
|
|||||||
|
|
||||||
## Sizes
|
## Sizes
|
||||||
self.winGeometry = [1200, 650]
|
self.winGeometry = [1200, 650]
|
||||||
|
self.prefGeometry = [700, 615]
|
||||||
self.treeColWidth = [200, 50, 30]
|
self.treeColWidth = [200, 50, 30]
|
||||||
self.novelColWidth = [200, 50]
|
self.novelColWidth = [200, 50]
|
||||||
self.projColWidth = [200, 60, 140]
|
self.projColWidth = [200, 60, 140]
|
||||||
@@ -472,6 +473,9 @@ class Config:
|
|||||||
self.winGeometry = self._parseLine(
|
self.winGeometry = self._parseLine(
|
||||||
cnfParse, cnfSec, "geometry", self.CNF_I_LST, self.winGeometry
|
cnfParse, cnfSec, "geometry", self.CNF_I_LST, self.winGeometry
|
||||||
)
|
)
|
||||||
|
self.prefGeometry = self._parseLine(
|
||||||
|
cnfParse, cnfSec, "preferences", self.CNF_I_LST, self.prefGeometry
|
||||||
|
)
|
||||||
self.treeColWidth = self._parseLine(
|
self.treeColWidth = self._parseLine(
|
||||||
cnfParse, cnfSec, "treecols", self.CNF_I_LST, self.treeColWidth
|
cnfParse, cnfSec, "treecols", self.CNF_I_LST, self.treeColWidth
|
||||||
)
|
)
|
||||||
@@ -701,6 +705,7 @@ class Config:
|
|||||||
cnfSec = "Sizes"
|
cnfSec = "Sizes"
|
||||||
cnfParse.add_section(cnfSec)
|
cnfParse.add_section(cnfSec)
|
||||||
cnfParse.set(cnfSec, "geometry", self._packList(self.winGeometry))
|
cnfParse.set(cnfSec, "geometry", self._packList(self.winGeometry))
|
||||||
|
cnfParse.set(cnfSec, "preferences", self._packList(self.prefGeometry))
|
||||||
cnfParse.set(cnfSec, "treecols", self._packList(self.treeColWidth))
|
cnfParse.set(cnfSec, "treecols", self._packList(self.treeColWidth))
|
||||||
cnfParse.set(cnfSec, "novelcols", self._packList(self.novelColWidth))
|
cnfParse.set(cnfSec, "novelcols", self._packList(self.novelColWidth))
|
||||||
cnfParse.set(cnfSec, "projcols", self._packList(self.projColWidth))
|
cnfParse.set(cnfSec, "projcols", self._packList(self.projColWidth))
|
||||||
@@ -921,6 +926,12 @@ class Config:
|
|||||||
self.confChanged = True
|
self.confChanged = True
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def setPreferencesSize(self, newWidth, newHeight):
|
||||||
|
self.prefGeometry[0] = int(newWidth/self.guiScale)
|
||||||
|
self.prefGeometry[1] = int(newHeight/self.guiScale)
|
||||||
|
self.confChanged = True
|
||||||
|
return True
|
||||||
|
|
||||||
def setTreeColWidths(self, colWidths):
|
def setTreeColWidths(self, colWidths):
|
||||||
self.treeColWidth = [int(x/self.guiScale) for x in colWidths]
|
self.treeColWidth = [int(x/self.guiScale) for x in colWidths]
|
||||||
self.confChanged = True
|
self.confChanged = True
|
||||||
@@ -984,6 +995,9 @@ class Config:
|
|||||||
def getWinSize(self):
|
def getWinSize(self):
|
||||||
return [int(x*self.guiScale) for x in self.winGeometry]
|
return [int(x*self.guiScale) for x in self.winGeometry]
|
||||||
|
|
||||||
|
def getPreferencesSize(self):
|
||||||
|
return [int(x*self.guiScale) for x in self.prefGeometry]
|
||||||
|
|
||||||
def getTreeColWidths(self):
|
def getTreeColWidths(self):
|
||||||
return [int(x*self.guiScale) for x in self.treeColWidth]
|
return [int(x*self.guiScale) for x in self.treeColWidth]
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ guilang = en-GB
|
|||||||
|
|
||||||
[Sizes]
|
[Sizes]
|
||||||
geometry = 1200, 650
|
geometry = 1200, 650
|
||||||
|
preferences = 700, 615
|
||||||
treecols = 200, 50, 30
|
treecols = 200, 50, 30
|
||||||
novelcols = 200, 50
|
novelcols = 200, 50
|
||||||
projcols = 200, 60, 140
|
projcols = 200, 60, 140
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ guilang = en-GB
|
|||||||
|
|
||||||
[Sizes]
|
[Sizes]
|
||||||
geometry = 1200, 650
|
geometry = 1200, 650
|
||||||
|
preferences = 700, 615
|
||||||
treecols = 200, 50, 30
|
treecols = 200, 50, 30
|
||||||
novelcols = 200, 50
|
novelcols = 200, 50
|
||||||
projcols = 200, 60, 140
|
projcols = 200, 60, 140
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ def testGuiProjSettings_Dialog(qtbot, monkeypatch, nwGUI, fncDir, fncProj, outDi
|
|||||||
|
|
||||||
assert projEdit.tabMain.editName.text() == "New Project"
|
assert projEdit.tabMain.editName.text() == "New Project"
|
||||||
assert projEdit.tabMain.editTitle.text() == ""
|
assert projEdit.tabMain.editTitle.text() == ""
|
||||||
assert projEdit.tabMain.editAuthors.toPlainText() == "Jane Smith\nJohn Smith\n"
|
assert projEdit.tabMain.editAuthors.toPlainText() == "Jane Smith\nJohn Smith"
|
||||||
assert projEdit.tabMain.spellLang.currentData() == "en"
|
assert projEdit.tabMain.spellLang.currentData() == "en"
|
||||||
assert projEdit.tabMain.doBackup.isChecked() is False
|
assert projEdit.tabMain.doBackup.isChecked() is False
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user