From 64c48be21165b4b40e37f76d538d68839b65e0fe Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Sat, 22 Jul 2017 15:42:08 +0200 Subject: [PATCH] Add cancel button on Locations view to go back to location selector --- retroshare-qml-app/src/Locations.qml | 8 ++++++++ retroshare-qml-app/src/RsLoginPassView.qml | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/retroshare-qml-app/src/Locations.qml b/retroshare-qml-app/src/Locations.qml index 1ccb734d2..ef721cb3d 100644 --- a/retroshare-qml-app/src/Locations.qml +++ b/retroshare-qml-app/src/Locations.qml @@ -62,6 +62,10 @@ Item createNewButton.enabled = false createNewButton.text = "Creating profile..." } + onCancel: + { + locationView.state = "selectLocation" + } } }, State @@ -83,6 +87,10 @@ Item locationView.attemptLogin = true attemptTimer.start() } + onCancel: + { + locationView.state = "selectLocation" + } } } ] diff --git a/retroshare-qml-app/src/RsLoginPassView.qml b/retroshare-qml-app/src/RsLoginPassView.qml index 7ea4a800d..a72d2114d 100644 --- a/retroshare-qml-app/src/RsLoginPassView.qml +++ b/retroshare-qml-app/src/RsLoginPassView.qml @@ -24,6 +24,7 @@ Item { id: loginView property string buttonText: qsTr("Unlock") + property string cancelText: qsTr("Cancel") property string iconUrl: "qrc:/icons/emblem-locked.svg" property string login property bool loginPreset: false @@ -32,6 +33,7 @@ Item property string password: advancedMode ? "" : hardcodedPassword property string suggestionText signal submit(string login, string password) + signal cancel() Component.onCompleted: loginPreset = login.length > 0 @@ -131,6 +133,12 @@ Item text: loginView.buttonText onClicked: loginView.submit(nameField.text, passwordField.text) } + Button + { + id: cancelButton + text: loginView.cancelText + onClicked: loginView.cancel() + } } } }