mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-08-06 10:18:42 +02:00
[ui] dont use native dialog
This commit is contained in:
parent
9a09310f07
commit
6edf0b654e
1 changed files with 22 additions and 17 deletions
|
@ -171,6 +171,7 @@ ApplicationWindow {
|
||||||
|
|
||||||
Platform.FileDialog {
|
Platform.FileDialog {
|
||||||
id: saveFileDialog
|
id: saveFileDialog
|
||||||
|
options: Platform.FileDialog.DontUseNativeDialog
|
||||||
|
|
||||||
signal closed(var result)
|
signal closed(var result)
|
||||||
|
|
||||||
|
@ -179,15 +180,16 @@ ApplicationWindow {
|
||||||
defaultSuffix: ".mg"
|
defaultSuffix: ".mg"
|
||||||
fileMode: Platform.FileDialog.SaveFile
|
fileMode: Platform.FileDialog.SaveFile
|
||||||
onAccepted: {
|
onAccepted: {
|
||||||
_reconstruction.saveAs(file)
|
_reconstruction.saveAs(currentFile)
|
||||||
closed(Platform.Dialog.Accepted)
|
closed(Platform.Dialog.Accepted)
|
||||||
MeshroomApp.addRecentProjectFile(file.toString())
|
MeshroomApp.addRecentProjectFile(currentFile.toString())
|
||||||
}
|
}
|
||||||
onRejected: closed(Platform.Dialog.Rejected)
|
onRejected: closed(Platform.Dialog.Rejected)
|
||||||
}
|
}
|
||||||
|
|
||||||
Platform.FileDialog {
|
Platform.FileDialog {
|
||||||
id: saveTemplateDialog
|
id: saveTemplateDialog
|
||||||
|
options: Platform.FileDialog.DontUseNativeDialog
|
||||||
|
|
||||||
signal closed(var result)
|
signal closed(var result)
|
||||||
|
|
||||||
|
@ -196,7 +198,7 @@ ApplicationWindow {
|
||||||
defaultSuffix: ".mg"
|
defaultSuffix: ".mg"
|
||||||
fileMode: Platform.FileDialog.SaveFile
|
fileMode: Platform.FileDialog.SaveFile
|
||||||
onAccepted: {
|
onAccepted: {
|
||||||
_reconstruction.saveAsTemplate(file)
|
_reconstruction.saveAsTemplate(currentFile)
|
||||||
closed(Platform.Dialog.Accepted)
|
closed(Platform.Dialog.Accepted)
|
||||||
MeshroomApp.reloadTemplateList()
|
MeshroomApp.reloadTemplateList()
|
||||||
}
|
}
|
||||||
|
@ -400,49 +402,52 @@ ApplicationWindow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FileDialog {
|
Platform.FileDialog {
|
||||||
id: openFileDialog
|
id: openFileDialog
|
||||||
|
options: Platform.FileDialog.DontUseNativeDialog
|
||||||
title: "Open File"
|
title: "Open File"
|
||||||
nameFilters: ["Meshroom Graphs (*.mg)"]
|
nameFilters: ["Meshroom Graphs (*.mg)"]
|
||||||
onAccepted: {
|
onAccepted: {
|
||||||
if (_reconstruction.loadUrl(fileUrl)) {
|
if (_reconstruction.loadUrl(currentFile)) {
|
||||||
MeshroomApp.addRecentProjectFile(fileUrl.toString())
|
MeshroomApp.addRecentProjectFile(currentFile.toString())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FileDialog {
|
Platform.FileDialog {
|
||||||
id: loadTemplateDialog
|
id: loadTemplateDialog
|
||||||
|
options: Platform.FileDialog.DontUseNativeDialog
|
||||||
title: "Load Template"
|
title: "Load Template"
|
||||||
nameFilters: ["Meshroom Graphs (*.mg)"]
|
nameFilters: ["Meshroom Graphs (*.mg)"]
|
||||||
onAccepted: {
|
onAccepted: {
|
||||||
// Open the template as a regular file
|
// Open the template as a regular file
|
||||||
if (_reconstruction.loadUrl(fileUrl, true, true)) {
|
if (_reconstruction.loadUrl(currentFile, true, true)) {
|
||||||
MeshroomApp.addRecentProjectFile(fileUrl.toString())
|
MeshroomApp.addRecentProjectFile(currentFile.toString())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FileDialog {
|
Platform.FileDialog {
|
||||||
id: importImagesDialog
|
id: importImagesDialog
|
||||||
|
options: FileDialog.DontUseNativeDialog
|
||||||
title: "Import Images"
|
title: "Import Images"
|
||||||
selectExisting: true
|
fileMode: Platform.FileDialog.OpenFiles
|
||||||
selectMultiple: true
|
|
||||||
nameFilters: []
|
nameFilters: []
|
||||||
onAccepted: {
|
onAccepted: {
|
||||||
_reconstruction.importImagesUrls(importImagesDialog.fileUrls)
|
_reconstruction.importImagesUrls(currentFiles)
|
||||||
imagesFolder = Filepath.dirname(importImagesDialog.fileUrls[0])
|
imagesFolder = Filepath.dirname(currentFiles[0])
|
||||||
MeshroomApp.addRecentImportedImagesFolder(imagesFolder)
|
MeshroomApp.addRecentImportedImagesFolder(imagesFolder)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FileDialog {
|
Platform.FileDialog {
|
||||||
id: importProjectDialog
|
id: importProjectDialog
|
||||||
|
options: FileDialog.DontUseNativeDialog
|
||||||
title: "Import Project"
|
title: "Import Project"
|
||||||
selectMultiple: false
|
fileMode: Platform.FileDialog.OpenFile
|
||||||
nameFilters: ["Meshroom Graphs (*.mg)"]
|
nameFilters: ["Meshroom Graphs (*.mg)"]
|
||||||
onAccepted: {
|
onAccepted: {
|
||||||
graphEditor.uigraph.importProject(importProjectDialog.fileUrl)
|
graphEditor.uigraph.importProject(currentFile)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue