Merge pull request #548 from alicevision/fix/nodeLog

Status and Log minor fixes
This commit is contained in:
Fabien Castan 2019-07-15 17:15:43 +02:00 committed by GitHub
commit 34d0b7ff20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 5 deletions

View file

@ -306,8 +306,12 @@ class UIGraph(QObject):
if self._sortedDFSChunks.objectList() == chunks:
return
self._sortedDFSChunks.setObjectList(chunks)
# Update the list of monitored chunks
self._chunksMonitor.setChunks(self._sortedDFSChunks)
# provide ChunkMonitor with the update list of chunks
self.updateChunkMonitor(self._sortedDFSChunks)
def updateChunkMonitor(self, chunks):
""" Update the list of chunks for status files monitoring. """
self._chunksMonitor.setChunks(chunks)
def clear(self):
if self._graph:
@ -342,6 +346,9 @@ class UIGraph(QObject):
localFile += ".mg"
self._graph.save(localFile)
self._undoStack.setClean()
# saving file on disk impacts cache folder location
# => force re-evaluation of monitored status files paths
self.updateChunkMonitor(self._sortedDFSChunks)
@Slot()
def save(self):

View file

@ -22,6 +22,7 @@ Item {
property bool loading: false
onSourceChanged: loadSource()
onAutoReloadChanged: loadSource()
onVisibleChanged: if(visible) loadSource()
RowLayout {
@ -307,11 +308,10 @@ Item {
// Auto-reload current file timer
Timer {
id: reloadTimer
running: root.autoReload
interval: root.autoReloadInterval
repeat: true
// reload file on start and stop
onRunningChanged: loadSource()
repeat: false // timer is restarted in request's callback (see loadSource)
onTriggered: loadSource()
}
@ -333,6 +333,9 @@ Item {
if(xhr.readyState === XMLHttpRequest.DONE) {
textView.setText(xhr.status === 200 ? xhr.responseText : "");
loading = false;
// re-trigger reload source file
if(autoReload)
reloadTimer.restart();
}
};
xhr.send();