Skip to content

Commit 1fbdafe

Browse files
authored
Merge pull request #2568 from alicevision/fix/uiSplitView
[ui] multiple fixes related to split view and node status checks
2 parents bf6244e + 2a1802f commit 1fbdafe

File tree

3 files changed

+38
-17
lines changed

3 files changed

+38
-17
lines changed

meshroom/ui/qml/Application.qml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ Page {
3939
if (nodesName !== "")
4040
nodesName += ", "
4141
var node = _reconstruction.selectedNodes.at(i)
42-
nodesName += node.name
42+
if(node) {
43+
nodesName += node.name
44+
}
4345
}
4446
return nodesName
4547
}
@@ -983,15 +985,15 @@ Page {
983985
NodeChunks {
984986
id: chunksListView
985987
height: 6
986-
width: parent.width
988+
Layout.fillWidth: true
987989
model: _reconstruction ? _reconstruction.sortedDFSChunks : null
988990
highlightChunks: false
989991
}
990992

991993
MSplitView {
992994
id: topBottomSplit
993995
Layout.fillHeight: true
994-
width: parent.width
996+
Layout.fillWidth: true
995997

996998
orientation: Qt.Vertical
997999

@@ -1086,7 +1088,7 @@ Page {
10861088
}
10871089

10881090
Menu {
1089-
title: "Refresh Nodes Status"
1091+
title: "Refresh Nodes Method"
10901092

10911093
MenuItem {
10921094
id: enableAutoRefresh

meshroom/ui/qml/GraphEditor/GraphEditor.qml

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -559,11 +559,16 @@ Item {
559559
//canSubmitOrCompute: return int n : 0 >= n <= 3 | n=0 cannot submit or compute | n=1 can compute | n=2 can submit | n=3 can compute & submit
560560
property int canSubmitOrCompute: currentNode != null && uigraph.graph.canSubmitOrCompute(currentNode)
561561
property bool isComputed: {
562+
var count = 0
562563
for (var i = 0; i < uigraph.selectedNodes.count; ++i) {
563-
if (!uigraph.selectedNodes.at(i).isComputed)
564+
var node = uigraph.selectedNodes.at(i)
565+
if (!node)
566+
continue
567+
if (!node.isComputed)
564568
return false
569+
count += 1
565570
}
566-
return uigraph.selectedNodes.count > 0
571+
return count > 0
567572
}
568573
width: 220
569574
onClosed: currentNode = null
@@ -573,27 +578,34 @@ Item {
573578
property bool recompute: false
574579
text: nodeMenu.isComputed ? "Recompute" : "Compute"
575580
visible: {
581+
var count = 0
576582
for (var i = 0; i < uigraph.selectedNodes.count; ++i) {
577-
if (!uigraph.selectedNodes.at(i).isComputable)
583+
var node = uigraph.selectedNodes.at(i)
584+
if (!node)
585+
continue
586+
if (!node.isComputable)
578587
return false
588+
count += 1
579589
}
580-
return uigraph.selectedNodes.count > 0
590+
return count > 0
581591
}
582592
height: visible ? implicitHeight : 0
583593

584594
enabled: {
585595
var canCompute = false
586596
for (var i = 0; i < uigraph.selectedNodes.count; ++i) {
587-
if (uigraph.graph.canComputeTopologically(uigraph.selectedNodes.at(i))) {
597+
var node = uigraph.selectedNodes.at(i)
598+
if (!node)
599+
continue
600+
if (uigraph.graph.canComputeTopologically(node)) {
588601
if (nodeMenu.isComputed) {
589602
canCompute = true
590-
} else if (uigraph.graph.canSubmitOrCompute(uigraph.selectedNodes.at(i)) % 2 == 1) {
603+
} else if (uigraph.graph.canSubmitOrCompute(node) % 2 == 1) {
591604
canCompute = true
592605
}
593606
}
594607
}
595608
return canCompute //canSubmit if canSubmitOrCompute == 1(can compute) or 3(can compute & submit)
596-
597609
}
598610

599611
onTriggered: {
@@ -610,21 +622,27 @@ Item {
610622
property bool resubmit: false
611623
text: nodeMenu.isComputed ? "Re-Submit" : "Submit"
612624
visible: {
625+
var count = 0
613626
for (var i = 0; i < uigraph.selectedNodes.count; ++i) {
614-
if (!uigraph.selectedNodes.at(i).isComputable)
627+
var node = uigraph.selectedNodes.at(i)
628+
if (node && !node.isComputable)
615629
return false
630+
count += 1
616631
}
617-
return uigraph.selectedNodes.count > 0 || uigraph.canSubmit
632+
return count > 0 || uigraph.canSubmit
618633
}
619634
height: visible ? implicitHeight : 0
620635

621636
enabled: {
622637
var canSubmit = false
623638
for (var i = 0; i < uigraph.selectedNodes.count; ++i) {
624-
if (uigraph.graph.canComputeTopologically(uigraph.selectedNodes.at(i))) {
639+
var node = uigraph.selectedNodes.at(i)
640+
if (!node)
641+
continue
642+
if (uigraph.graph.canComputeTopologically(node)) {
625643
if (nodeMenu.isComputed) {
626644
canSubmit = true
627-
} else if (uigraph.graph.canSubmitOrCompute(uigraph.selectedNodes.at(i)) > 1) {
645+
} else if (uigraph.graph.canSubmitOrCompute(node) > 1) {
628646
canSubmit = true
629647
}
630648
}

meshroom/ui/qml/GraphEditor/NodeEditor.qml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,11 +261,12 @@ Panel {
261261
id: chunksLV
262262
visible: (tabBar.currentIndex >= 1 && tabBar.currentIndex <= 3)
263263
chunks: root.node.chunks
264+
SplitView.preferredWidth: 55
265+
SplitView.minimumWidth: 20
264266
}
265267

266268
StackLayout {
267-
Layout.fillHeight: true
268-
Layout.fillWidth: true
269+
SplitView.fillWidth: true
269270

270271
currentIndex: tabBar.currentIndex
271272

0 commit comments

Comments
 (0)