Unverified Commit 6e11459a authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #6996 from DonLakeFlyer/MobileFileDialog

Mobile file dialog: Fix delete file
parents 7bbadf68 e660233e
...@@ -10,6 +10,7 @@ Note: This file only contains high level features or important fixes. ...@@ -10,6 +10,7 @@ Note: This file only contains high level features or important fixes.
* Structure Scan: Fix loading of structure scan height * Structure Scan: Fix loading of structure scan height
* ArduPilot: Fix location of planned home position when not connected to vehicle. Issue #6840. * ArduPilot: Fix location of planned home position when not connected to vehicle. Issue #6840.
* Fix loading of parameters from multiple components. Would report download complete too early, thus missing all default component params. * Fix loading of parameters from multiple components. Would report download complete too early, thus missing all default component params.
* Fix file delete in mobile file dialogs
### 3.4.4 - Stable ### 3.4.4 - Stable
* Stable desktop versions now inform user at boot if newer version is available. * Stable desktop versions now inform user at boot if newer version is available.
......
...@@ -107,7 +107,7 @@ Item { ...@@ -107,7 +107,7 @@ Item {
spacing: ScreenTools.defaultFontPixelHeight / 2 spacing: ScreenTools.defaultFontPixelHeight / 2
Repeater { Repeater {
id: fileList id: fileRepeater
model: controller.getFiles(folder, _rgExtensions) model: controller.getFiles(folder, _rgExtensions)
FileButton { FileButton {
...@@ -136,7 +136,10 @@ Item { ...@@ -136,7 +136,10 @@ Item {
MenuItem { MenuItem {
text: qsTr("Delete") text: qsTr("Delete")
onTriggered: controller.deleteFile(hamburgerMenu.fileToDelete); onTriggered: {
controller.deleteFile(hamburgerMenu.fileToDelete)
fileRepeater.model = controller.getFiles(folder, _rgExtensions)
}
} }
} }
} }
...@@ -144,7 +147,7 @@ Item { ...@@ -144,7 +147,7 @@ Item {
QGCLabel { QGCLabel {
text: qsTr("No files") text: qsTr("No files")
visible: fileList.model.length === 0 visible: fileRepeater.model.length === 0
} }
} }
} }
...@@ -217,9 +220,11 @@ Item { ...@@ -217,9 +220,11 @@ Item {
} }
Repeater { Repeater {
model: controller.getFiles(folder, [ fileExtension ]) id: fileRepeater
model: controller.getFiles(folder, [ fileExtension ])
FileButton { FileButton {
id: fileButton
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
text: modelData text: modelData
...@@ -240,14 +245,14 @@ Item { ...@@ -240,14 +245,14 @@ Item {
property string fileToDelete property string fileToDelete
onAboutToHide: { onAboutToHide: fileButton.highlight = false
fileButton.highlight = false
hideDialog()
}
MenuItem { MenuItem {
text: qsTr("Delete") text: qsTr("Delete")
onTriggered: controller.deleteFile(hamburgerMenu.fileToDelete); onTriggered: {
controller.deleteFile(hamburgerMenu.fileToDelete)
fileRepeater.model = controller.getFiles(folder, [ fileExtension ])
}
} }
} }
} }
......
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