mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-08-03 16:58:24 +02:00
[ui] NodeLog: set TextFileViewer source when chunks ListView is ready
Avoid going through an empty source when switching from one node to another (currentChunk being invalid the time the ListView is being constructed).
This commit is contained in:
parent
17556427fd
commit
d7f8311dcf
1 changed files with 9 additions and 1 deletions
|
@ -85,6 +85,13 @@ FocusScope {
|
|||
id: fileSelector
|
||||
Layout.fillWidth: true
|
||||
property string currentFile: chunksLV.currentChunk ? chunksLV.currentChunk[currentItem.fileProperty] : ""
|
||||
onCurrentFileChanged: {
|
||||
// only set text file viewer source when ListView is fully ready
|
||||
// (either empty or fully populated with a valid currentChunk)
|
||||
// to avoid going through an empty url when switching between two nodes
|
||||
if(!chunksLV.count || chunksLV.currentChunk)
|
||||
textFileViewer.source = Filepath.stringToUrl(currentFile);
|
||||
}
|
||||
|
||||
TabButton {
|
||||
property string fileProperty: "logFile"
|
||||
|
@ -105,10 +112,11 @@ FocusScope {
|
|||
}
|
||||
|
||||
TextFileViewer {
|
||||
id: textFileViewer
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
autoReload: chunksLV.currentChunk !== undefined && chunksLV.currentChunk.statusName === "RUNNING"
|
||||
source: Filepath.stringToUrl(fileSelector.currentFile)
|
||||
// source is set in fileSelector
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue