Save the state of the references panel
This commit is contained in:
+21
-2
@@ -62,6 +62,8 @@ class Config:
|
|||||||
## General
|
## General
|
||||||
self.guiTheme = "default"
|
self.guiTheme = "default"
|
||||||
self.guiSyntax = "default_light"
|
self.guiSyntax = "default_light"
|
||||||
|
|
||||||
|
## Sizes
|
||||||
self.winGeometry = [1100, 650]
|
self.winGeometry = [1100, 650]
|
||||||
self.treeColWidth = [120, 30, 50]
|
self.treeColWidth = [120, 30, 50]
|
||||||
self.mainPanePos = [300, 800]
|
self.mainPanePos = [300, 800]
|
||||||
@@ -94,12 +96,15 @@ class Config:
|
|||||||
|
|
||||||
self.spellLanguage = "en_GB"
|
self.spellLanguage = "en_GB"
|
||||||
|
|
||||||
# Backup
|
## Backup
|
||||||
self.backupPath = ""
|
self.backupPath = ""
|
||||||
self.backupOnClose = False
|
self.backupOnClose = False
|
||||||
self.askBeforeBackup = True
|
self.askBeforeBackup = True
|
||||||
|
|
||||||
# Path
|
## State
|
||||||
|
self.showRefPanel = True
|
||||||
|
|
||||||
|
## Path
|
||||||
self.recentList = [""]*10
|
self.recentList = [""]*10
|
||||||
|
|
||||||
# Check Qt5 Versions
|
# Check Qt5 Versions
|
||||||
@@ -244,6 +249,10 @@ class Config:
|
|||||||
self.backupOnClose = self._parseLine(cnfParse, cnfSec, "backuponclose", self.CNF_BOOL, self.backupOnClose)
|
self.backupOnClose = self._parseLine(cnfParse, cnfSec, "backuponclose", self.CNF_BOOL, self.backupOnClose)
|
||||||
self.askBeforeBackup = self._parseLine(cnfParse, cnfSec, "askbeforebackup", self.CNF_BOOL, self.askBeforeBackup)
|
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
|
## Path
|
||||||
cnfSec = "Path"
|
cnfSec = "Path"
|
||||||
self.lastPath = self._parseLine(cnfParse, cnfSec, "lastpath", self.CNF_STR, self.lastPath)
|
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,"backuponclose", str(self.backupOnClose))
|
||||||
cnfParse.set(cnfSec,"askbeforebackup",str(self.askBeforeBackup))
|
cnfParse.set(cnfSec,"askbeforebackup",str(self.askBeforeBackup))
|
||||||
|
|
||||||
|
## State
|
||||||
|
cnfSec = "State"
|
||||||
|
cnfParse.add_section(cnfSec)
|
||||||
|
cnfParse.set(cnfSec,"showrefdetails",str(self.showRefPanel))
|
||||||
|
|
||||||
## Path
|
## Path
|
||||||
cnfSec = "Path"
|
cnfSec = "Path"
|
||||||
cnfParse.add_section(cnfSec)
|
cnfParse.add_section(cnfSec)
|
||||||
@@ -385,6 +399,11 @@ class Config:
|
|||||||
self.confChanged = True
|
self.confChanged = True
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def setShowRefPanel(self, checkState):
|
||||||
|
self.showRefPanel = checkState
|
||||||
|
self.confChanged = True
|
||||||
|
return
|
||||||
|
|
||||||
##
|
##
|
||||||
# Internal Functions
|
# Internal Functions
|
||||||
##
|
##
|
||||||
|
|||||||
@@ -48,7 +48,6 @@ class GuiDocViewDetails(QWidget):
|
|||||||
self.showHide.setToolButtonStyle(Qt.ToolButtonIconOnly)
|
self.showHide.setToolButtonStyle(Qt.ToolButtonIconOnly)
|
||||||
self.showHide.setArrowType(Qt.DownArrow)
|
self.showHide.setArrowType(Qt.DownArrow)
|
||||||
self.showHide.setCheckable(True)
|
self.showHide.setCheckable(True)
|
||||||
self.showHide.setChecked(True)
|
|
||||||
self.showHide.setIconSize(QSize(16,16))
|
self.showHide.setIconSize(QSize(16,16))
|
||||||
self.showHide.toggled.connect(self._doShowHide)
|
self.showHide.toggled.connect(self._doShowHide)
|
||||||
|
|
||||||
@@ -79,6 +78,8 @@ class GuiDocViewDetails(QWidget):
|
|||||||
self.setLayout(self.outerBox)
|
self.setLayout(self.outerBox)
|
||||||
self.setContentsMargins(0,0,0,0)
|
self.setContentsMargins(0,0,0,0)
|
||||||
|
|
||||||
|
self._doShowHide(self.mainConf.showRefPanel)
|
||||||
|
|
||||||
logger.debug("DocViewDetails initialisation complete")
|
logger.debug("DocViewDetails initialisation complete")
|
||||||
|
|
||||||
return
|
return
|
||||||
@@ -91,12 +92,6 @@ class GuiDocViewDetails(QWidget):
|
|||||||
return
|
return
|
||||||
|
|
||||||
theRefs = self.theParent.theIndex.buildReferenceList(tHandle)
|
theRefs = self.theParent.theIndex.buildReferenceList(tHandle)
|
||||||
if theRefs:
|
|
||||||
self.setVisible(True)
|
|
||||||
else:
|
|
||||||
self.setVisible(False)
|
|
||||||
return
|
|
||||||
|
|
||||||
theList = []
|
theList = []
|
||||||
for tHandle in theRefs:
|
for tHandle in theRefs:
|
||||||
tItem = self.theProject.getItem(tHandle)
|
tItem = self.theProject.getItem(tHandle)
|
||||||
@@ -120,6 +115,7 @@ class GuiDocViewDetails(QWidget):
|
|||||||
|
|
||||||
def _doShowHide(self, chState):
|
def _doShowHide(self, chState):
|
||||||
self.scrollBox.setVisible(chState)
|
self.scrollBox.setVisible(chState)
|
||||||
|
self.mainConf.setShowRefPanel(chState)
|
||||||
if chState:
|
if chState:
|
||||||
self.showHide.setArrowType(Qt.DownArrow)
|
self.showHide.setArrowType(Qt.DownArrow)
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user