-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathApplication.qml
More file actions
1424 lines (1231 loc) · 52.9 KB
/
Application.qml
File metadata and controls
1424 lines (1231 loc) · 52.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import QtCore
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQml.Models
import Qt.labs.platform 1.0 as Platform
import QtQuick.Dialogs
import GraphEditor 1.0
import MaterialIcons 2.2
import Utils 1.0
import Controls 1.0
Page {
id: root
property alias computingAtExitDialog: computingAtExitDialog
property alias unsavedDialog: unsavedDialog
property alias workspaceView: workspaceView
readonly property var scenefile: _reconstruction ? _reconstruction.graph.filepath : "";
onScenefileChanged: {
// Check if we're not currently saving and emit the currentProjectChanged signal
if (! _reconstruction.graph.isSaving) {
// Refresh the NodeEditor
nodeEditor.refresh();
}
}
Settings {
id: settingsUILayout
category: "UILayout"
property alias showLiveReconstruction: liveSfMVisibilityCB.checked
property alias showGraphEditor: graphEditorVisibilityCB.checked
property alias showImageViewer: imageViewerVisibilityCB.checked
property alias showViewer3D: viewer3DVisibilityCB.checked
property alias showImageGallery: imageGalleryVisibilityCB.checked
}
property url imagesFolder: {
var recentImportedImagesFolders = MeshroomApp.recentImportedImagesFolders
if (recentImportedImagesFolders.length > 0) {
for (var i = 0; i < recentImportedImagesFolders.length; i++) {
if (Filepath.exists(recentImportedImagesFolders[i]))
return Filepath.stringToUrl(recentImportedImagesFolders[i])
else
MeshroomApp.removeRecentImportedImagesFolder(Filepath.stringToUrl(recentImportedImagesFolders[i]))
}
}
return ""
}
Component {
id: invalidFilepathDialog
MessageDialog {
title: "Invalid Filepath"
required property string filepath
preset: "Warning"
text: "The provided filepath is not valid."
detailedText: "Filepath: " + filepath
helperText: "Please provide a valid filepath to save the file."
standardButtons: Dialog.Ok
onClosed: destroy()
}
}
Component {
id: permissionsDialog
MessageDialog {
title: "Permission Denied"
required property string filepath
preset: "Warning"
text: "The location does not exist or you do not have necessary permissions to save to the provided filepath."
detailedText: "Filepath: " + filepath
helperText: "Please check the location or permissions and try again or choose a different location."
standardButtons: Dialog.Ok
onClosed: destroy()
}
}
function validateFilepathForSave(filepath: string, sourceSaveDialog): bool {
/**
* Return true if `filepath` is valid for saving a file to disk.
* Otherwise, show a warning dialog and returns false.
* Closing the warning dialog reopens the specified `sourceSaveDialog`, to allow the user to try again.
*/
const emptyFilename = Filepath.basename(filepath).trim() === ".mg";
// Provided filename is not valid
if (emptyFilename) {
// Instantiate the Warning Dialog with the provided filepath
const warningDialog = invalidFilepathDialog.createObject(root, {"filepath": Filepath.urlToString(filepath)});
// And open the dialog
warningDialog.closed.connect(sourceSaveDialog.open);
warningDialog.open();
return false;
}
// Check if the user has access to the directory where the file is to be saved
const hasPermission = Filepath.accessible(Filepath.dirname(filepath));
// Either the directory does not exist or is inaccessible for the user
if (!hasPermission) {
// Intantiate the permissions dialog with the provided filepath
const warningDialog = permissionsDialog.createObject(root, {"filepath": Filepath.urlToString(filepath)});
// Connect and show the dialog
warningDialog.closed.connect(sourceSaveDialog.open);
warningDialog.open();
return false;
}
// Everything is valid
return true;
}
// File dialogs
Platform.FileDialog {
id: saveFileDialog
options: Platform.FileDialog.DontUseNativeDialog
property var _callback: undefined
signal closed(var result)
title: "Save File"
nameFilters: ["Meshroom Graphs (*.mg)"]
defaultSuffix: ".mg"
fileMode: Platform.FileDialog.SaveFile
onAccepted: {
if (!validateFilepathForSave(currentFile, saveFileDialog))
{
return;
}
// Only save a valid file
_reconstruction.saveAs(currentFile)
MeshroomApp.addRecentProjectFile(currentFile.toString())
closed(Platform.Dialog.Accepted)
fireCallback(Platform.Dialog.Accepted)
}
onRejected: {
closed(Platform.Dialog.Rejected)
fireCallback(Platform.Dialog.Rejected)
}
function fireCallback(rc)
{
// Call the callback and reset it
if (_callback)
_callback(rc)
_callback = undefined
}
// Open the unsaved dialog warning with an optional
// callback to fire when the dialog is accepted/discarded
function prompt(callback)
{
_callback = callback
open()
}
}
Platform.FileDialog {
id: saveTemplateDialog
options: Platform.FileDialog.DontUseNativeDialog
signal closed(var result)
title: "Save Template"
nameFilters: ["Meshroom Graphs (*.mg)"]
defaultSuffix: ".mg"
fileMode: Platform.FileDialog.SaveFile
onAccepted: {
if (!validateFilepathForSave(currentFile, saveTemplateDialog))
{
return;
}
// Only save a valid template
_reconstruction.saveAsTemplate(currentFile)
closed(Platform.Dialog.Accepted)
MeshroomApp.reloadTemplateList()
}
onRejected: closed(Platform.Dialog.Rejected)
}
Platform.FileDialog {
id: loadTemplateDialog
options: Platform.FileDialog.DontUseNativeDialog
title: "Load Template"
nameFilters: ["Meshroom Graphs (*.mg)"]
onAccepted: {
// Open the template as a regular file
if (_reconstruction.load(currentFile)) {
MeshroomApp.addRecentProjectFile(currentFile.toString())
}
}
}
Platform.FileDialog {
id: importImagesDialog
options: Platform.FileDialog.DontUseNativeDialog
title: "Import Images"
fileMode: Platform.FileDialog.OpenFiles
nameFilters: []
onAccepted: {
_reconstruction.importImagesUrls(currentFiles)
imagesFolder = Filepath.dirname(currentFiles[0])
MeshroomApp.addRecentImportedImagesFolder(imagesFolder)
}
}
Platform.FileDialog {
id: importProjectDialog
options: Platform.FileDialog.DontUseNativeDialog
title: "Import Project"
fileMode: Platform.FileDialog.OpenFile
nameFilters: ["Meshroom Graphs (*.mg)"]
onAccepted: {
graphEditor.uigraph.importProject(currentFile)
}
}
Item {
id: computeManager
// Evaluate if graph computation can be submitted externally
property bool canSubmit: _reconstruction ?
_reconstruction.canSubmit // current setup allows to compute externally
&& _reconstruction.graph.filepath : // graph is saved on disk
false
function compute(nodes, force) {
if (!force && !_reconstruction.graph.filepath) {
unsavedComputeDialog.selectedNodes = nodes;
unsavedComputeDialog.open();
}
else {
try {
_reconstruction.execute(nodes)
}
catch (error) {
const data = ErrorHandler.analyseError(error)
if (data.context === "COMPUTATION")
computeSubmitErrorDialog.openError(data.type, data.msg, nodes)
}
}
}
function submit(nodes) {
if (!canSubmit) {
unsavedSubmitDialog.open()
} else {
try {
_reconstruction.submit(nodes)
}
catch (error) {
const data = ErrorHandler.analyseError(error)
if (data.context === "SUBMITTING")
computeSubmitErrorDialog.openError(data.type, data.msg, nodes)
}
}
}
MessageDialog {
id: computeSubmitErrorDialog
property string errorType // Used to specify signals' behavior
property var currentNode: null
function openError(type, msg, node) {
errorType = type
switch (type) {
case "Already Submitted": {
this.setupPendingStatusError(msg, node)
break
}
case "Compatibility Issue": {
this.setupCompatibilityIssue(msg)
break
}
default: {
this.onlyDisplayError(msg)
}
}
this.open()
}
function onlyDisplayError(msg) {
text = msg
standardButtons = Dialog.Ok
}
function setupPendingStatusError(msg, node) {
currentNode = node
text = msg + "\n\nDo you want to Clear Pending Status and Start Computing?"
standardButtons = (Dialog.Ok | Dialog.Cancel)
}
function setupCompatibilityIssue(msg) {
text = msg + "\n\nDo you want to open the Compatibility Manager?"
standardButtons = (Dialog.Ok | Dialog.Cancel)
}
canCopy: false
icon.text: MaterialIcons.warning
parent: Overlay.overlay
preset: "Warning"
title: "Computation/Submitting"
text: ""
onAccepted: {
switch (errorType) {
case "Already Submitted": {
close()
_reconstruction.graph.clearSubmittedNodes()
_reconstruction.execute(currentNode)
break
}
case "Compatibility Issue": {
close()
compatibilityManager.open()
break
}
default: close()
}
}
onRejected: close()
}
MessageDialog {
id: unsavedComputeDialog
property var selectedNodes: null
canCopy: false
icon.text: MaterialIcons.warning
parent: Overlay.overlay
preset: "Warning"
title: "Unsaved Project"
text: "Saving the project is required."
helperText: "Choose a location to save the project, or use the default temporary path."
standardButtons: Dialog.Discard | Dialog.Cancel | Dialog.Save
Component.onCompleted: {
// Set up discard button text
standardButton(Dialog.Discard).text = "Continue in Temp Folder"
standardButton(Dialog.Save).text = "Save As"
}
onDiscarded: {
_reconstruction.saveAsTemp()
close()
computeManager.compute(selectedNodes, true)
}
onAccepted: {
initFileDialogFolder(saveFileDialog)
saveFileDialog.prompt(function(rc) {
computeManager.compute(selectedNodes, true)
})
}
}
MessageDialog {
id: unsavedSubmitDialog
canCopy: false
icon.text: MaterialIcons.warning
parent: Overlay.overlay
preset: "Warning"
title: "Unsaved Project"
text: "The project cannot be submitted if it remains unsaved."
helperText: "Save the project to be able to submit it?"
standardButtons: Dialog.Cancel | Dialog.Save
onDiscarded: close()
onAccepted: saveAsAction.trigger()
}
MessageDialog {
id: fileModifiedDialog
canCopy: false
icon.text: MaterialIcons.warning
parent: Overlay.overlay
preset: "Warning"
title: "File Modified"
text: "The file has been modified by another instance."
detailedText: "Do you want to overwrite the file?"
// Add a reload file button next to the save button
footer: DialogButtonBox {
position: DialogButtonBox.Footer
standardButtons: Dialog.Save | Dialog.Cancel
Button {
text: "Reload File"
onClicked: {
_reconstruction.load(_reconstruction.graph.filepath)
fileModifiedDialog.close()
}
}
}
onAccepted: _reconstruction.save()
onDiscarded: close()
}
}
// Message dialogs
MessageDialog {
id: unsavedDialog
property var _callback: undefined
title: (_reconstruction ? Filepath.basename(_reconstruction.graph.filepath) : "") || "Unsaved Project"
preset: "Info"
canCopy: false
text: _reconstruction && _reconstruction.graph.filepath ? "Current project has unsaved modifications."
: "Current project has not been saved."
helperText: _reconstruction && _reconstruction.graph.filepath ? "Would you like to save those changes?"
: "Would you like to save this project?"
standardButtons: Dialog.Save | Dialog.Cancel | Dialog.Discard
onDiscarded: {
close() // BUG ? discard does not close window
fireCallback()
}
onRejected: {
_window.isClosing = false
}
onAccepted: {
// Save current file
if (saveAction.enabled && _reconstruction.graph.filepath) {
saveAction.trigger()
fireCallback()
}
// Open "Save As" dialog
else {
saveFileDialog.prompt(function(rc) {
if (rc === Platform.Dialog.Accepted)
fireCallback()
})
}
}
function fireCallback()
{
// Call the callback and reset it
if (_callback)
_callback()
_callback = undefined
}
// Open the unsaved dialog warning with an optional
// callback to fire when the dialog is accepted/discarded
function prompt(callback)
{
_callback = callback
open()
}
}
MessageDialog {
id: computingAtExitDialog
title: "Operation in progress"
modal: true
canCopy: false
Label {
text: "Please stop any local computation before exiting Meshroom"
}
}
MessageDialog {
// Popup displayed while the application
// is busy building intrinsics while importing images
id: buildingIntrinsicsDialog
modal: true
visible: _reconstruction ? _reconstruction.buildingIntrinsics : false
closePolicy: Popup.NoAutoClose
title: "Initializing Cameras"
icon.text: MaterialIcons.camera
icon.font.pointSize: 10
canCopy: false
standardButtons: Dialog.NoButton
detailedText: "Extracting images metadata and creating Camera intrinsics..."
ProgressBar {
indeterminate: true
Layout.fillWidth: true
}
}
AboutDialog {
id: aboutDialog
}
DialogsFactory {
id: dialogsFactory
}
CompatibilityManager {
id: compatibilityManager
uigraph: _reconstruction
}
// Actions
Action {
id: removeAllImagesAction
property string tooltip: "Remove all the images from the current CameraInit group"
text: "Remove All Images"
onTriggered: {
_reconstruction.removeAllImages()
_reconstruction.selectedViewId = "-1"
}
}
Action {
id: removeImagesFromAllGroupsAction
property string tooltip: "Remove all the images from all the CameraInit groups"
text: "Remove Images From All CameraInit Nodes"
onTriggered: {
_reconstruction.removeImagesFromAllGroups()
_reconstruction.selectedViewId = "-1"
}
}
Action {
id: undoAction
property string tooltip: 'Undo "' + (_reconstruction ? _reconstruction.undoStack.undoText : "Unknown") + '"'
text: "Undo"
shortcut: "Ctrl+Z"
enabled: _reconstruction ? _reconstruction.undoStack.canUndo && _reconstruction.undoStack.isUndoableIndex : false
onTriggered: _reconstruction.undoStack.undo()
}
Action {
id: redoAction
property string tooltip: 'Redo "' + (_reconstruction ? _reconstruction.undoStack.redoText : "Unknown") + '"'
text: "Redo"
shortcut: "Ctrl+Shift+Z"
enabled: _reconstruction ? _reconstruction.undoStack.canRedo && !_reconstruction.undoStack.lockedRedo : false
onTriggered: _reconstruction.undoStack.redo()
}
Action {
id: cutAction
property string tooltip: "Cut Selected Node(s)"
text: "Cut Node(s)"
enabled: _reconstruction ? _reconstruction.nodeSelection.hasSelection : false
onTriggered: {
graphEditor.copyNodes()
graphEditor.uigraph.removeSelectedNodes()
}
}
Action {
id: copyAction
property string tooltip: "Copy Selected Node(s)"
text: "Copy Node(s)"
enabled: _reconstruction ? _reconstruction.nodeSelection.hasSelection : false
onTriggered: graphEditor.copyNodes()
}
Action {
id: pasteAction
property string tooltip: "Paste the clipboard content to the project if it contains valid nodes"
text: "Paste Node(s)"
onTriggered: graphEditor.pasteNodes()
}
Action {
id: loadTemplateAction
property string tooltip: "Load a template like a regular project file (any \"Publish\" node will be displayed)"
text: "Load Template"
onTriggered: {
ensureSaved(function() {
initFileDialogFolder(loadTemplateDialog)
loadTemplateDialog.open()
})
}
}
header: RowLayout {
spacing: 0
MaterialToolButton {
id: homeButton
text: MaterialIcons.home
font.pointSize: 18
background: Rectangle {
color: homeButton.hovered ? activePalette.highlight : Qt.darker(activePalette.window, 1.15)
border.color: Qt.darker(activePalette.window, 1.15)
}
onClicked: {
if (!ensureNotComputing())
return
ensureSaved(function() {
_reconstruction.clear()
if (mainStack.depth == 1)
mainStack.replace("Homepage.qml")
else
mainStack.pop()
})
}
}
MenuBar {
palette.window: Qt.darker(activePalette.window, 1.15)
Menu {
title: "File"
Action {
id: newAction
text: "New"
shortcut: "Ctrl+N"
onTriggered: ensureSaved(function() {
_reconstruction.new()
})
}
Menu {
id: newPipelineMenu
title: "New Pipeline"
enabled: newPipelineMenuItems.model !== undefined && newPipelineMenuItems.model.length > 0
property int maxWidth: 1000
property int fullWidth: {
var result = 0;
for (var i = 0; i < count; ++i) {
var item = itemAt(i)
result = Math.max(item.implicitWidth + item.padding * 2, result)
}
return result;
}
implicitWidth: fullWidth
Repeater {
id: newPipelineMenuItems
model: MeshroomApp.pipelineTemplateFiles
MenuItem {
onTriggered: ensureSaved(function() {
_reconstruction.new(modelData["key"])
})
text: fileTextMetrics.elidedText
TextMetrics {
id: fileTextMetrics
text: modelData["name"]
elide: Text.ElideLeft
elideWidth: newPipelineMenu.maxWidth
}
ToolTip {
id: toolTip
delay: 200
text: modelData["path"]
visible: hovered
}
}
}
}
Action {
id: openActionItem
text: "Open"
shortcut: "Ctrl+O"
onTriggered: ensureSaved(function() {
initFileDialogFolder(openFileDialog)
openFileDialog.open()
})
}
Menu {
id: openRecentMenu
title: "Open Recent"
enabled: recentFilesMenuItems.model !== undefined && recentFilesMenuItems.model.length > 0
property int maxWidth: 1000
property int fullWidth: {
var result = 0;
for (var i = 0; i < count; ++i) {
var item = itemAt(i)
result = Math.max(item.implicitWidth + item.padding * 2, result)
}
return result
}
implicitWidth: fullWidth
Repeater {
id: recentFilesMenuItems
model: MeshroomApp.recentProjectFiles
MenuItem {
onTriggered: ensureSaved(function() {
openRecentMenu.dismiss()
if (_reconstruction.load(modelData["path"])) {
MeshroomApp.addRecentProjectFile(modelData["path"])
} else {
MeshroomApp.removeRecentProjectFile(modelData["path"])
}
})
text: fileTextMetrics.elidedText
TextMetrics {
id: fileTextMetrics
text: modelData["path"]
elide: Text.ElideLeft
elideWidth: openRecentMenu.maxWidth
}
}
}
}
MenuSeparator { }
Action {
id: saveAction
text: "Save"
shortcut: "Ctrl+S"
enabled: _reconstruction ? (_reconstruction.graph && !_reconstruction.graph.filepath) || !_reconstruction.undoStack.clean : false
onTriggered: {
if (_reconstruction.graph.filepath) {
// Get current time date
var date = _reconstruction.graph.getFileDateVersionFromPath(_reconstruction.graph.filepath)
// Check if the file has been modified by another instance
if (_reconstruction.graph.fileDateVersion !== date) {
fileModifiedDialog.open()
} else
_reconstruction.save()
} else {
initFileDialogFolder(saveFileDialog)
saveFileDialog.open()
}
}
}
Action {
id: saveAsAction
text: "Save As..."
shortcut: "Ctrl+Shift+S"
onTriggered: {
initFileDialogFolder(saveFileDialog)
saveFileDialog.open()
}
}
MenuSeparator { }
Action {
id: importImagesAction
text: "Import Images"
shortcut: "Ctrl+I"
onTriggered: {
initFileDialogFolder(importImagesDialog, true)
importImagesDialog.open()
}
}
MenuItem {
action: removeAllImagesAction
ToolTip.visible: hovered
ToolTip.text: removeAllImagesAction.tooltip
}
MenuSeparator { }
Menu {
id: advancedMenu
title: "Advanced"
implicitWidth: 300
Action {
id: saveAsTemplateAction
text: "Save As Template..."
shortcut: Shortcut {
sequence: "Ctrl+Shift+T"
context: Qt.ApplicationShortcut
onActivated: saveAsTemplateAction.triggered()
}
onTriggered: {
initFileDialogFolder(saveTemplateDialog)
saveTemplateDialog.open()
}
}
MenuItem {
action: loadTemplateAction
ToolTip.visible: hovered
ToolTip.text: loadTemplateAction.tooltip
}
Action {
id: importProjectAction
text: "Import Project"
shortcut: Shortcut {
sequence: "Ctrl+Shift+I"
context: Qt.ApplicationShortcut
onActivated: importProjectAction.triggered()
}
onTriggered: {
initFileDialogFolder(importProjectDialog)
importProjectDialog.open()
}
}
MenuItem {
action: removeImagesFromAllGroupsAction
ToolTip.visible: hovered
ToolTip.text: removeImagesFromAllGroupsAction.tooltip
}
}
MenuSeparator { }
Action {
text: "Quit"
onTriggered: _window.close()
}
}
Menu {
title: "Edit"
MenuItem {
action: undoAction
ToolTip.visible: hovered
ToolTip.text: undoAction.tooltip
}
MenuItem {
action: redoAction
ToolTip.visible: hovered
ToolTip.text: redoAction.tooltip
}
MenuItem {
action: cutAction
ToolTip.visible: hovered
ToolTip.text: cutAction.tooltip
}
MenuItem {
action: copyAction
ToolTip.visible: hovered
ToolTip.text: copyAction.tooltip
}
MenuItem {
action: pasteAction
ToolTip.visible: hovered
ToolTip.text: pasteAction.tooltip
}
}
Menu {
title: "View"
MenuItem {
id: graphEditorVisibilityCB
text: "Graph Editor"
checkable: true
checked: true
}
MenuItem {
id: liveSfMVisibilityCB
text: "Live Reconstruction"
checkable: true
checked: false
}
MenuItem {
id: imageViewerVisibilityCB
text: "Image Viewer"
checkable: true
checked: true
}
MenuItem {
id: viewer3DVisibilityCB
text: "3D Viewer"
checkable: true
checked: true
}
MenuItem {
id: imageGalleryVisibilityCB
text: "Image Gallery"
checkable: true
checked: true
}
MenuSeparator {}
Action {
text: "Fullscreen"
checkable: true
checked: _window.visibility == ApplicationWindow.FullScreen
shortcut: "Ctrl+F"
onTriggered: _window.visibility == ApplicationWindow.FullScreen ? _window.showNormal() : showFullScreen()
}
}
Menu {
title: "Process"
Action {
text: "Compute all nodes"
onTriggered: computeManager.compute(null)
enabled: _reconstruction ? !_reconstruction.computingLocally : false
}
Action {
text: "Submit all nodes"
onTriggered: computeManager.submit(null)
enabled: _reconstruction ? _reconstruction.canSubmit : false
}
MenuSeparator {}
Action {
text: "Stop computation"
onTriggered: _reconstruction.stopExecution()
enabled: _reconstruction ? _reconstruction.computingLocally : false
}
}
Menu {
title: "Help"
Action {
text: "Online Documentation"
onTriggered: Qt.openUrlExternally("https://meshroom-manual.readthedocs.io")
}
Action {
text: "About Meshroom"
onTriggered: aboutDialog.open()
// Should be StandardKey.HelpContents, but for some reason it's not stable
// (may cause crash, requires pressing F1 twice after closing the popup)
shortcut: "F1"
}
}
}
Rectangle {
Layout.fillWidth: true
Layout.fillHeight: true
color: Qt.darker(activePalette.window, 1.15)
}
Row {
// Process buttons
MaterialToolButton {
id: processButton
font.pointSize: 18
text: !(_reconstruction.computingLocally) ? MaterialIcons.send : MaterialIcons.cancel_schedule_send
ToolTip.text: !(_reconstruction.computingLocally) ? "Compute" : "Stop Computing"
ToolTip.visible: hovered
background: Rectangle {
color: processButton.hovered ? activePalette.highlight : Qt.darker(activePalette.window, 1.15)
border.color: Qt.darker(activePalette.window, 1.15)
}
onClicked: !(_reconstruction.computingLocally) ? computeManager.compute(null) : _reconstruction.stopExecution()
}
MaterialToolButton {
id: submitButton
font.pointSize: 18
visible: _reconstruction ? _reconstruction.canSubmit : false
text: MaterialIcons.rocket_launch
ToolTip.text: "Submit on Render Farm"
ToolTip.visible: hovered
background: Rectangle {
color: submitButton.hovered ? activePalette.highlight : Qt.darker(activePalette.window, 1.15)
border.color: Qt.darker(activePalette.window, 1.15)
}
onClicked: computeManager.submit(null)
}
}
Rectangle {
Layout.fillWidth: true
Layout.fillHeight: true
color: Qt.darker(activePalette.window, 1.15)
}
// CompatibilityManager indicator
ToolButton {
id: compatibilityIssuesButton
visible: compatibilityManager.issueCount
text: MaterialIcons.warning