diff --git a/nw/config.py b/nw/config.py index ada60d85..5c8388b4 100644 --- a/nw/config.py +++ b/nw/config.py @@ -116,6 +116,7 @@ class Config: self.showTabsNSpaces = False self.showLineEndings = False self.bigDocLimit = 800 + self.showFullPath = True self.fmtApostrophe = nwUnicode.U_RSQUO self.fmtSingleQuotes = [nwUnicode.U_LSQUO,nwUnicode.U_RSQUO] @@ -398,6 +399,9 @@ class Config: self.bigDocLimit = self._parseLine( cnfParse, cnfSec, "bigdoclimit", self.CNF_INT, self.bigDocLimit ) + self.showFullPath = self._parseLine( + cnfParse, cnfSec, "showfullpath", self.CNF_BOOL, self.showFullPath + ) ## Backup cnfSec = "Backup" @@ -486,6 +490,7 @@ class Config: cnfParse.set(cnfSec,"showtabsnspaces", str(self.showTabsNSpaces)) cnfParse.set(cnfSec,"showlineendings", str(self.showLineEndings)) cnfParse.set(cnfSec,"bigdoclimit", str(self.bigDocLimit)) + cnfParse.set(cnfSec,"showfullpath", str(self.showFullPath)) ## Backup cnfSec = "Backup" diff --git a/nw/gui/elements/doceditor.py b/nw/gui/elements/doceditor.py index f09a6083..fb76ff67 100644 --- a/nw/gui/elements/doceditor.py +++ b/nw/gui/elements/doceditor.py @@ -132,6 +132,9 @@ class GuiDocEditor(QTextEdit): logger.debug("DocEditor initialisation complete") + # Connect Functions + self.setSelectedHandle = self.theParent.treeView.setSelectedHandle + return def clearEditor(self): diff --git a/nw/gui/elements/doctitlebar.py b/nw/gui/elements/doctitlebar.py index 6b612910..b8d5d739 100644 --- a/nw/gui/elements/doctitlebar.py +++ b/nw/gui/elements/doctitlebar.py @@ -85,7 +85,7 @@ class GuiDocTitleBar(QLabel): if tHandle is None: return False - if True: + if self.mainConf.showFullPath: tTitle = [] tTree = self.theProject.getItemPath(tHandle) for aHandle in reversed(tTree): @@ -111,7 +111,7 @@ class GuiDocTitleBar(QLabel): """Capture a click on the title and ensure that the item is selected in the project tree. """ - self.theParent.theParent.treeView.setSelectedHandle(self.theHandle) + self.theParent.setSelectedHandle(self.theHandle) return # END Class GuiDocTitleBar diff --git a/nw/gui/elements/docviewer.py b/nw/gui/elements/docviewer.py index 82434adc..84f4a8fd 100644 --- a/nw/gui/elements/docviewer.py +++ b/nw/gui/elements/docviewer.py @@ -71,6 +71,9 @@ class GuiDocViewer(QTextBrowser): logger.debug("DocViewer initialisation complete") + # Connect Functions + self.setSelectedHandle = self.theParent.treeView.setSelectedHandle + return def clearViewer(self): diff --git a/nw/guimain.py b/nw/guimain.py index a533526f..0b6ac0a5 100644 --- a/nw/guimain.py +++ b/nw/guimain.py @@ -90,12 +90,12 @@ class GuiMain(QMainWindow): # Main GUI Elements self.statusBar = GuiMainStatus(self) self.noticeBar = GuiNoticeBar(self) + self.treeView = GuiDocTree(self, self.theProject) self.docEditor = GuiDocEditor(self, self.theProject) self.docViewer = GuiDocViewer(self, self.theProject) self.viewMeta = GuiDocViewDetails(self, self.theProject) self.searchBar = GuiSearchBar(self) self.treeMeta = GuiDocDetails(self, self.theProject) - self.treeView = GuiDocTree(self, self.theProject) self.projView = GuiProjectOutline(self, self.theProject) self.mainMenu = GuiMainMenu(self, self.theProject) @@ -114,7 +114,7 @@ class GuiMain(QMainWindow): self.editPane = QFrame() self.docEdit = QVBoxLayout() self.docEdit.setContentsMargins(0,0,0,0) - self.docEdit.setSpacing(0) + self.docEdit.setSpacing(2) self.docEdit.addWidget(self.searchBar) self.docEdit.addWidget(self.noticeBar) self.docEdit.addWidget(self.docEditor) @@ -123,7 +123,7 @@ class GuiMain(QMainWindow): self.viewPane = QFrame() self.docView = QVBoxLayout() self.docView.setContentsMargins(0,0,0,0) - self.docView.setSpacing(0) + self.docView.setSpacing(2) self.docView.addWidget(self.docViewer) self.docView.addWidget(self.viewMeta) self.docView.setStretch(0, 1) diff --git a/tests/reference/novelwriter.conf b/tests/reference/novelwriter.conf index ad20b354..7102783d 100644 --- a/tests/reference/novelwriter.conf +++ b/tests/reference/novelwriter.conf @@ -1,5 +1,5 @@ [Main] -timestamp = 2020-04-14 22:47:16 +timestamp = 2020-05-01 21:28:25 theme = default syntax = default_light guidark = False @@ -38,6 +38,7 @@ spellcheck = en showtabsnspaces = False showlineendings = False bigdoclimit = 800 +showfullpath = True [Backup] backuppath =