Commit c77d8df1 authored by Gus Grubba's avatar Gus Grubba

Make sure user knows an email is needed for log uploading.

parent 82446241
...@@ -57,8 +57,8 @@ Rectangle { ...@@ -57,8 +57,8 @@ Rectangle {
visible: false visible: false
icon: StandardIcon.Warning icon: StandardIcon.Warning
standardButtons: StandardButton.Close standardButtons: StandardButton.Close
title: qsTr("Uploading Log Files") title: qsTr("MAVLink Logging")
text: qsTr("Please enter an email address before uploading log files.") text: qsTr("Please enter an email address before uploading MAVLink log files.")
} }
QGCFlickable { QGCFlickable {
...@@ -235,6 +235,11 @@ Rectangle { ...@@ -235,6 +235,11 @@ Rectangle {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
onEditingFinished: { onEditingFinished: {
QGroundControl.mavlinkLogManager.emailAddress = emailField.text QGroundControl.mavlinkLogManager.emailAddress = emailField.text
if(emailField.text === "") {
autoUploadCheck.checked = false
QGroundControl.mavlinkLogManager.enableAutoUpload = false
console.log("forcing enableAutoUpload to false")
}
} }
} }
} }
...@@ -283,17 +288,22 @@ Rectangle { ...@@ -283,17 +288,22 @@ Rectangle {
id: autoUploadCheck id: autoUploadCheck
text: qsTr("Enable automatic log uploads") text: qsTr("Enable automatic log uploads")
checked: QGroundControl.mavlinkLogManager.enableAutoUpload checked: QGroundControl.mavlinkLogManager.enableAutoUpload
enabled: emailField.text !== "" && urlField !== ""
onClicked: { onClicked: {
QGroundControl.mavlinkLogManager.emailAddress = emailField.text
if(checked && QGroundControl.mavlinkLogManager.emailAddress === "") {
checked = false
emptyEmailDialog.open()
} else {
QGroundControl.mavlinkLogManager.enableAutoUpload = checked QGroundControl.mavlinkLogManager.enableAutoUpload = checked
} }
} }
}
//----------------------------------------------------------------- //-----------------------------------------------------------------
//-- Delete log after upload //-- Delete log after upload
QGCCheckBox { QGCCheckBox {
text: qsTr("Delete log file after uploading") text: qsTr("Delete log file after uploading")
checked: QGroundControl.mavlinkLogManager.deleteAfterUpload checked: QGroundControl.mavlinkLogManager.deleteAfterUpload
enabled: emailField.text !== "" && urlField !== "" && autoUploadCheck.checked enabled: autoUploadCheck.checked
onClicked: { onClicked: {
QGroundControl.mavlinkLogManager.deleteAfterUpload = checked QGroundControl.mavlinkLogManager.deleteAfterUpload = checked
} }
......
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