Merge branch 'main' into feature/build_gui
This commit is contained in:
@@ -1201,17 +1201,18 @@ class GuiDocViewDetails(QScrollArea):
|
||||
return
|
||||
|
||||
##
|
||||
# Internal Functions
|
||||
# Private Slots
|
||||
##
|
||||
|
||||
@pyqtSlot(str)
|
||||
def _linkClicked(self, theLink):
|
||||
"""Capture the link-click and forward it to the document viewer
|
||||
class for handling.
|
||||
"""
|
||||
logger.debug("Clicked link: '%s'", theLink)
|
||||
if len(theLink) == 21:
|
||||
if len(theLink) >= 13:
|
||||
tHandle = theLink[:13]
|
||||
tAnchor = theLink[13:]
|
||||
tAnchor = theLink[13:] or None
|
||||
self.mainGui.viewDocument(tHandle, tAnchor)
|
||||
return
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ from PyQt5.QtWidgets import (
|
||||
QVBoxLayout, QWidget
|
||||
)
|
||||
|
||||
from novelwriter.enum import nwDocMode, nwItemType, nwItemClass, nwItemLayout, nwAlert
|
||||
from novelwriter.enum import nwDocMode, nwItemType, nwItemClass, nwItemLayout, nwAlert, nwWidget
|
||||
from novelwriter.constants import nwHeaders, nwUnicode, trConst, nwLabels
|
||||
from novelwriter.core.coretools import DocMerger, DocSplitter
|
||||
from novelwriter.dialogs.docmerge import GuiDocMerge
|
||||
@@ -630,6 +630,7 @@ class GuiProjectTree(QTreeWidget):
|
||||
|
||||
# Add the new item to the project tree
|
||||
self.revealNewTreeItem(tHandle, nHandle=nHandle, wordCount=True)
|
||||
self.mainGui.switchFocus(nwWidget.TREE)
|
||||
|
||||
return True
|
||||
|
||||
@@ -1087,7 +1088,6 @@ class GuiProjectTree(QTreeWidget):
|
||||
if tItem is None:
|
||||
return False
|
||||
|
||||
self.setFocus()
|
||||
if tHandle in self._treeMap:
|
||||
self.setCurrentItem(self._treeMap[tHandle])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user