diff --git a/qml/pages/LoginDialog.qml b/qml/pages/LoginDialog.qml index be57513..872ad4b 100644 --- a/qml/pages/LoginDialog.qml +++ b/qml/pages/LoginDialog.qml @@ -6,6 +6,7 @@ Dialog { id: loginDialog property string accountId + property bool addingNew: false ConfigurationGroup { id: account @@ -19,7 +20,7 @@ Dialog { } canAccept: (nameField.text.length > 0 && serverField.acceptableInput && usernameField.text.length > 0 && passwordField.text.length > 0) - onDone: { + onAccepted: { account.setValue("name", nameField.text) account.setValue("server", serverField.text) account.setValue("username", usernameField.text) @@ -27,12 +28,10 @@ Dialog { //account.setValue("unsecureConnection", unsecureConnectionTextSwitch.checked) //account.setValue("unencryptedConnection", unencryptedConnectionTextSwitch.checked) account.sync() - } - onAccepted: { api.uuid = accountId } onRejected: { - appSettings.removeAccount(accountId) + if (addingNew) appSettings.removeAccount(accountId) } SilicaFlickable { @@ -45,7 +44,7 @@ Dialog { DialogHeader { //title: qsTr("Nextcloud Login") - acceptText: qsTr("Login") + acceptText: addingNew ? qsTr("Login") : qsTr("Save") } Image { diff --git a/qml/pages/SettingsPage.qml b/qml/pages/SettingsPage.qml index 72bb261..eb9d456 100644 --- a/qml/pages/SettingsPage.qml +++ b/qml/pages/SettingsPage.qml @@ -89,7 +89,7 @@ Page { anchors.horizontalCenter: parent.horizontalCenter onClicked: { var newAccountID = appSettings.addAccount() - var login = pageStack.replace(Qt.resolvedUrl("LoginDialog.qml"), { accountId: newAccountID }) + var login = pageStack.replace(Qt.resolvedUrl("LoginDialog.qml"), { accountId: newAccountID, addingNew: true }) } } diff --git a/rpm/harbour-nextcloudnotes.changes b/rpm/harbour-nextcloudnotes.changes index f1849eb..8d5b3a8 100644 --- a/rpm/harbour-nextcloudnotes.changes +++ b/rpm/harbour-nextcloudnotes.changes @@ -12,6 +12,9 @@ # * date Author's Name version-release # - Summary of changes +* Thu Dec 06 2018 Scharel Clemens 0.2-2 +- Fixed an issue where accounts get deleted when the dialog is aborted + * Thu Dec 06 2018 Scharel Clemens 0.2-1 - Improved account handling - Directly go to edit page when creating a new note diff --git a/rpm/harbour-nextcloudnotes.spec b/rpm/harbour-nextcloudnotes.spec index a26c0ea..e0f57f2 100644 --- a/rpm/harbour-nextcloudnotes.spec +++ b/rpm/harbour-nextcloudnotes.spec @@ -14,7 +14,7 @@ Name: harbour-nextcloudnotes %{?qtc_builddir:%define _builddir %qtc_builddir} Summary: Nextcloud Notes Version: 0.2 -Release: 1 +Release: 2 Group: Qt/Qt License: LICENSE URL: http://example.org/ diff --git a/rpm/harbour-nextcloudnotes.yaml b/rpm/harbour-nextcloudnotes.yaml index e338f96..5768b28 100644 --- a/rpm/harbour-nextcloudnotes.yaml +++ b/rpm/harbour-nextcloudnotes.yaml @@ -1,7 +1,7 @@ Name: harbour-nextcloudnotes Summary: Nextcloud Notes Version: 0.2 -Release: 1 +Release: 2 # The contents of the Group field should be one of the groups listed here: # https://github.com/mer-tools/spectacle/blob/master/data/GROUPS Group: Qt/Qt diff --git a/translations/harbour-nextcloudnotes.ts b/translations/harbour-nextcloudnotes.ts index e4656a5..5b113cb 100644 --- a/translations/harbour-nextcloudnotes.ts +++ b/translations/harbour-nextcloudnotes.ts @@ -111,6 +111,10 @@ Password + + Save + + MITLicense