Connect the change of view methods to all relevant actions

This commit is contained in:
Veronica Berglyd Olsen
2022-05-14 18:27:18 +02:00
parent 864b06a0e7
commit e8a0a6d5f9
4 changed files with 48 additions and 38 deletions
+1
View File
@@ -115,6 +115,7 @@ class GuiItemDetails(QWidget):
self.usageData = QLabel("")
self.usageData.setFont(fntValue)
self.usageData.setAlignment(Qt.AlignLeft)
self.usageData.setWordWrap(True)
# Character Count
self.cCountName = QLabel(" "+self.tr("Characters"))
+5 -1
View File
@@ -26,11 +26,12 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
import logging
import novelwriter
from PyQt5.QtCore import Qt, QT_TRANSLATE_NOOP
from PyQt5.QtCore import Qt, QT_TRANSLATE_NOOP, pyqtSignal
from PyQt5.QtWidgets import (
QScrollArea, QWidget, QGridLayout, QHBoxLayout, QGroupBox, QLabel
)
from novelwriter.enum import nwView
from novelwriter.common import checkInt
from novelwriter.constants import trConst, nwKeyWords, nwLabels
@@ -46,6 +47,8 @@ class GuiOutlineDetails(QScrollArea):
"H4": QT_TRANSLATE_NOOP("GuiOutlineDetails", "Section"),
}
viewChangeRequested = pyqtSignal(nwView)
def __init__(self, theParent):
QScrollArea.__init__(self, theParent)
@@ -329,6 +332,7 @@ class GuiOutlineDetails(QScrollArea):
if len(theLink) > 0:
theBits = theLink.split("=")
if len(theBits) == 2:
self.viewChangeRequested.emit(nwView.PROJECT)
self.theParent.docViewer.loadFromTag(theBits[1])
return