Save the state of the references panel

This commit is contained in:
Veronica K. B. Olsen
2019-11-02 19:41:41 +01:00
parent 69e3edfaee
commit 4c4c4548c4
2 changed files with 24 additions and 9 deletions
+21 -2
View File
@@ -62,6 +62,8 @@ class Config:
## General
self.guiTheme = "default"
self.guiSyntax = "default_light"
## Sizes
self.winGeometry = [1100, 650]
self.treeColWidth = [120, 30, 50]
self.mainPanePos = [300, 800]
@@ -94,12 +96,15 @@ class Config:
self.spellLanguage = "en_GB"
# Backup
## Backup
self.backupPath = ""
self.backupOnClose = False
self.askBeforeBackup = True
# Path
## State
self.showRefPanel = True
## Path
self.recentList = [""]*10
# Check Qt5 Versions
@@ -244,6 +249,10 @@ class Config:
self.backupOnClose = self._parseLine(cnfParse, cnfSec, "backuponclose", self.CNF_BOOL, self.backupOnClose)
self.askBeforeBackup = self._parseLine(cnfParse, cnfSec, "askbeforebackup", self.CNF_BOOL, self.askBeforeBackup)
## State
cnfSec = "State"
self.showRefPanel = self._parseLine(cnfParse, cnfSec, "showrefdetails", self.CNF_BOOL, self.showRefPanel)
## Path
cnfSec = "Path"
self.lastPath = self._parseLine(cnfParse, cnfSec, "lastpath", self.CNF_STR, self.lastPath)
@@ -312,6 +321,11 @@ class Config:
cnfParse.set(cnfSec,"backuponclose", str(self.backupOnClose))
cnfParse.set(cnfSec,"askbeforebackup",str(self.askBeforeBackup))
## State
cnfSec = "State"
cnfParse.add_section(cnfSec)
cnfParse.set(cnfSec,"showrefdetails",str(self.showRefPanel))
## Path
cnfSec = "Path"
cnfParse.add_section(cnfSec)
@@ -385,6 +399,11 @@ class Config:
self.confChanged = True
return True
def setShowRefPanel(self, checkState):
self.showRefPanel = checkState
self.confChanged = True
return
##
# Internal Functions
##
+3 -7
View File
@@ -48,7 +48,6 @@ class GuiDocViewDetails(QWidget):
self.showHide.setToolButtonStyle(Qt.ToolButtonIconOnly)
self.showHide.setArrowType(Qt.DownArrow)
self.showHide.setCheckable(True)
self.showHide.setChecked(True)
self.showHide.setIconSize(QSize(16,16))
self.showHide.toggled.connect(self._doShowHide)
@@ -79,6 +78,8 @@ class GuiDocViewDetails(QWidget):
self.setLayout(self.outerBox)
self.setContentsMargins(0,0,0,0)
self._doShowHide(self.mainConf.showRefPanel)
logger.debug("DocViewDetails initialisation complete")
return
@@ -91,12 +92,6 @@ class GuiDocViewDetails(QWidget):
return
theRefs = self.theParent.theIndex.buildReferenceList(tHandle)
if theRefs:
self.setVisible(True)
else:
self.setVisible(False)
return
theList = []
for tHandle in theRefs:
tItem = self.theProject.getItem(tHandle)
@@ -120,6 +115,7 @@ class GuiDocViewDetails(QWidget):
def _doShowHide(self, chState):
self.scrollBox.setVisible(chState)
self.mainConf.setShowRefPanel(chState)
if chState:
self.showHide.setArrowType(Qt.DownArrow)
else: