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 { ...@@ -17,8 +17,8 @@ Item {
property var qgcView property var qgcView
property string folder property string folder
property var nameFilters property var nameFilters
property string fileExtension // Primary 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 fileExtension2: "" // Secondary file extension to search for
property string title property string title
property bool selectExisting property bool selectExisting
property bool selectFolder property bool selectFolder
...@@ -28,12 +28,16 @@ Item { ...@@ -28,12 +28,16 @@ Item {
property bool _mobileDlg: QGroundControl.corePlugin.options.useMobileFileDialog property bool _mobileDlg: QGroundControl.corePlugin.options.useMobileFileDialog
property var _rgExtensions property var _rgExtensions
Component.onCompleted: { Component.onCompleted: setupFileExtensions()
if (fileExtension2 === "") {
onFileExtensionChanged: setupFileExtensions()
onFileExtension2Changed: setupFileExtensions()
function setupFileExtensions() {
if (fileExtension2 == "") {
_rgExtensions = [ fileExtension ] _rgExtensions = [ fileExtension ]
} else { } else {
_rgExtensions = [ fileExtension, fileExtension2 ] _rgExtensions = [ fileExtension, fileExtension2 ]
} }
} }
...@@ -128,10 +132,7 @@ Item { ...@@ -128,10 +132,7 @@ Item {
property string fileToDelete property string fileToDelete
onAboutToHide: { onAboutToHide: fileButton.highlight = false
fileButton.highlight = false
hideDialog()
}
MenuItem { MenuItem {
text: qsTr("Delete") text: qsTr("Delete")
...@@ -143,7 +144,7 @@ Item { ...@@ -143,7 +144,7 @@ Item {
QGCLabel { QGCLabel {
text: qsTr("No files") 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