Commit 957e2f3b authored by DonLakeFlyer's avatar DonLakeFlyer

Fix dynamic file extension changing

Don't close mobile dialog on file delete
parent fc8c0d7f
......@@ -17,8 +17,8 @@ Item {
property var qgcView
property string folder
property var nameFilters
property string fileExtension // Primary file extension to search for
property string fileExtension2 // Secondary file extension to search for
property string fileExtension // Primary file extension to search for
property string fileExtension2: "" // Secondary file extension to search for
property string title
property bool selectExisting
property bool selectFolder
......@@ -28,12 +28,16 @@ Item {
property bool _mobileDlg: QGroundControl.corePlugin.options.useMobileFileDialog
property var _rgExtensions
Component.onCompleted: {
if (fileExtension2 === "") {
Component.onCompleted: setupFileExtensions()
onFileExtensionChanged: setupFileExtensions()
onFileExtension2Changed: setupFileExtensions()
function setupFileExtensions() {
if (fileExtension2 == "") {
_rgExtensions = [ fileExtension ]
} else {
_rgExtensions = [ fileExtension, fileExtension2 ]
}
}
......@@ -128,10 +132,7 @@ Item {
property string fileToDelete
onAboutToHide: {
fileButton.highlight = false
hideDialog()
}
onAboutToHide: fileButton.highlight = false
MenuItem {
text: qsTr("Delete")
......@@ -143,7 +144,7 @@ Item {
QGCLabel {
text: qsTr("No files")
visible: fileList.model.length == 0 && fileList2.model.length == 0
visible: fileList.model.length == 0
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment