Meshroom/meshroom/ui/qml/GraphEditor/NodeLog.qml
2024-11-07 18:15:37 +01:00

46 lines
1.1 KiB
QML

import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Controls 1.0
/**
* NodeLog displays the log file of Node's chunks (NodeChunks).
*
* To ease monitoring, it provides periodic auto-reload of the opened file
* if the related NodeChunk is being computed.
*/
FocusScope {
id: root
property variant node
property int currentChunkIndex
property variant currentChunk
Layout.fillWidth: true
Layout.fillHeight: true
SystemPalette { id: activePalette }
Loader {
id: componentLoader
clip: true
anchors.fill: parent
property string currentFile: (root.currentChunkIndex >= 0 && root.currentChunk) ? root.currentChunk["logFile"] : ""
property url sourceFile: Filepath.stringToUrl(currentFile)
sourceComponent: textFileViewerComponent
}
Component {
id: textFileViewerComponent
TextFileViewer {
id: textFileViewer
anchors.fill: parent
source: componentLoader.sourceFile
autoReload: root.currentChunk !== undefined && root.currentChunk.statusName === "RUNNING"
}
}
}