mobile/qml: add pref suppport for userid in Export

Handle reading/writing of userid/password settings in the
saveAsDialog and set field to visible when needed.

Activate divelogsde radio button

Signed-off-by: Jan Iversen <jan@casacondor.com>
This commit is contained in:
jan Iversen 2019-11-29 19:27:30 +01:00 committed by Dirk Hohndel
parent 03c9cdfbed
commit 422bb0da57

View file

@ -39,6 +39,7 @@ Kirigami.ScrollablePage {
columns: 2 columns: 2
Text { Text {
id: textUserID
text: qsTr("User ID") text: qsTr("User ID")
} }
TextField { TextField {
@ -47,6 +48,7 @@ Kirigami.ScrollablePage {
inputMethodHints: Qt.ImhNoAutoUppercase inputMethodHints: Qt.ImhNoAutoUppercase
} }
Text { Text {
id: textPassword
text: qsTr("Password:") text: qsTr("Password:")
} }
TextField { TextField {
@ -63,6 +65,16 @@ Kirigami.ScrollablePage {
} }
onApply: { onApply: {
if (selectedExport === ExportType.EX_DIVELOGS_DE) {
if (fieldUserID.text !== PrefCloudStorage.divelogde_user) {
PrefCloudStorage.divelogde_user = fieldUserID.text
}
if (fieldPassword.text !== PrefCloudStorage.divelogde_pass)
PrefCloudStorage.divelogde_pass = fieldPassword.text
} else {
// TO BE IMPLEMENTED
}
manager.exportToWEB(selectedExport, fieldUserID.text, fieldPassword.text, anonymize.checked) manager.exportToWEB(selectedExport, fieldUserID.text, fieldPassword.text, anonymize.checked)
close() close()
} }
@ -108,7 +120,6 @@ Kirigami.ScrollablePage {
} }
RadioButton { RadioButton {
Layout.fillWidth: true Layout.fillWidth: true
visible: false // TEMPORARY MEASURE, until non UI related WEB service is ready
text: qsTr("Upload divelogs.de") text: qsTr("Upload divelogs.de")
exclusiveGroup: radioGroup exclusiveGroup: radioGroup
onClicked: { onClicked: {
@ -212,9 +223,17 @@ Kirigami.ScrollablePage {
SsrfButton { SsrfButton {
text: qsTr("Next") text: qsTr("Next")
onClicked: { onClicked: {
if (selectedExport === ExportType.EX_DIVELOGS_DE || if (selectedExport === ExportType.EX_DIVELOGS_DE) {
selectedExport === ExportType.EX_DIVESHARE) { textUserID.visible = true
fieldUserID.visible = true
fieldUserID.text = PrefCloudStorage.divelogde_user
textPassword.visible = true
fieldPassword.visible = true
fieldPassword.text = PrefCloudStorage.divelogde_pass
anonymize.visible = false
uploadDialog.open() uploadDialog.open()
} else if (selectedExport === ExportType.EX_DIVESHARE) {
// TO BE IMPLEMENTED
} else { } else {
saveAsDialog.open() saveAsDialog.open()
} }