From 422bb0da576690da40c34c572d9c4e51baf4f730 Mon Sep 17 00:00:00 2001 From: jan Iversen Date: Fri, 29 Nov 2019 19:27:30 +0100 Subject: 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 --- mobile-widgets/qml/Export.qml | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'mobile-widgets/qml') diff --git a/mobile-widgets/qml/Export.qml b/mobile-widgets/qml/Export.qml index 094749dbc..d770e21b6 100644 --- a/mobile-widgets/qml/Export.qml +++ b/mobile-widgets/qml/Export.qml @@ -39,6 +39,7 @@ Kirigami.ScrollablePage { columns: 2 Text { + id: textUserID text: qsTr("User ID") } TextField { @@ -47,6 +48,7 @@ Kirigami.ScrollablePage { inputMethodHints: Qt.ImhNoAutoUppercase } Text { + id: textPassword text: qsTr("Password:") } TextField { @@ -63,6 +65,16 @@ Kirigami.ScrollablePage { } 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) close() } @@ -108,7 +120,6 @@ Kirigami.ScrollablePage { } RadioButton { Layout.fillWidth: true - visible: false // TEMPORARY MEASURE, until non UI related WEB service is ready text: qsTr("Upload divelogs.de") exclusiveGroup: radioGroup onClicked: { @@ -212,9 +223,17 @@ Kirigami.ScrollablePage { SsrfButton { text: qsTr("Next") onClicked: { - if (selectedExport === ExportType.EX_DIVELOGS_DE || - selectedExport === ExportType.EX_DIVESHARE) { + if (selectedExport === ExportType.EX_DIVELOGS_DE) { + 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() + } else if (selectedExport === ExportType.EX_DIVESHARE) { + // TO BE IMPLEMENTED } else { saveAsDialog.open() } -- cgit v1.2.3-70-g09d2