Added some the tree building code, with the help of 3 G&Ts.

This commit is contained in:
Veronica K. B. Olsen
2018-10-27 23:54:34 +02:00
parent c8dab032b9
commit 0f8090601b
6 changed files with 314 additions and 29 deletions
+11 -2
View File
@@ -52,7 +52,8 @@ class Config:
self.confChanged = False
## General
self.winGeometry = [1100, 650]
self.winGeometry = [1100, 650]
self.treeColWidth = [120, 30, 50]
# Check if config file exists
if path.isfile(path.join(self.confPath,self.confFile)):
@@ -83,6 +84,10 @@ class Config:
self.winGeometry = self.unpackList(
confParser.get(cnfSec,"geometry"), 2, self.winGeometry
)
if confParser.has_option(cnfSec,"treecols"):
self.treeColWidth = self.unpackList(
confParser.get(cnfSec,"treecols"), 3, self.treeColWidth
)
## Path
cnfSec = "Path"
@@ -105,6 +110,7 @@ class Config:
confParser.add_section(cnfSec)
confParser.set(cnfSec,"timestamp", datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
confParser.set(cnfSec,"geometry", self.packList(self.winGeometry))
confParser.set(cnfSec,"treecols", self.packList(self.treeColWidth))
## Path
cnfSec = "Path"
@@ -142,7 +148,6 @@ class Config:
self.recentList.insert(0,recentPath)
return
def setConfPath(self, newPath):
if newPath is None: return
if not path.isfile(newPath):
@@ -161,4 +166,8 @@ class Config:
self.confChanged = True
return
def setTreeColWidths(self, colWidths):
self.treeColWidth = colWidths
return
# End Class Config