[ui] hide 'Submit' button if no submitter available

This commit is contained in:
Yann Lanthony 2018-07-27 22:38:07 +02:00
parent f798050799
commit 72a657ec48
2 changed files with 5 additions and 1 deletions

View file

@ -11,6 +11,7 @@ from meshroom.common.qt import QObjectListModel
from meshroom.core.attribute import Attribute, ListAttribute
from meshroom.core.graph import Graph, Edge, submitGraph, executeGraph
from meshroom.core.node import NodeChunk, Node, Status, CompatibilityNode, Position
from meshroom.core import submitters
from meshroom.ui import commands
from meshroom.ui.utils import makeProperty
@ -475,6 +476,7 @@ class UIGraph(QObject):
computing = Property(bool, isComputing, notify=computeStatusChanged)
computingExternally = Property(bool, isComputingExternally, notify=computeStatusChanged)
computingLocally = Property(bool, isComputingLocally, notify=computeStatusChanged)
canSubmit = Property(bool, lambda self: len(submitters), constant=True)
sortedDFSChunks = Property(QObject, lambda self: self._sortedDFSChunks, constant=True)
lockedChanged = Signal()

View file

@ -358,7 +358,8 @@ ApplicationWindow {
&& _reconstruction.graph.canComputeLeaves // graph has no uncomputable nodes
// evaluate if graph computation can be submitted externally
property bool canSubmit: canStartComputation // can be computed
property bool canSubmit: _reconstruction.canSubmit // current setup allows to compute externally
&& canStartComputation // can be computed
&& _reconstruction.graph.filepath // graph is saved on disk
// disable controls if graph is executed externally
@ -381,6 +382,7 @@ ApplicationWindow {
}
Item { width: 20; height: 1 }
Button {
visible: _reconstruction.canSubmit
enabled: parent.canSubmit
text: "Submit"
onClicked: _reconstruction.submit(null)