From f25a8fb49abf8a9b7ba5d6f8fbd4c05bd647c1c0 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Fri, 22 Sep 2017 11:58:47 +0200 Subject: Fixed showing a loginview after the account setup The view managment is starting to become a mess. I guess we'll need something like a state machine in the long run managing the view transitions. --- .../accounts/contents/ui/AccountWizardPage.qml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'components/accounts/contents/ui') diff --git a/components/accounts/contents/ui/AccountWizardPage.qml b/components/accounts/contents/ui/AccountWizardPage.qml index 74decf1f..18001419 100644 --- a/components/accounts/contents/ui/AccountWizardPage.qml +++ b/components/accounts/contents/ui/AccountWizardPage.qml @@ -32,6 +32,16 @@ FocusScope { property bool isFirstView: root.Controls2.StackView.index == 0 property bool requireSetup: false + function save() { + if (loader.item.valid) { + loader.item.save() + Kube.Fabric.postMessage(Kube.Messages.synchronize, {"accountId": loader.item.accountIdentifier}); + root.done() + } else { + console.warn("Invalid settings."); + } + } + Kube.AccountFactory { id: accountFactory accountType: root.accountType @@ -47,6 +57,8 @@ FocusScope { } } + Keys.onReturnPressed: save() + //Item to avoid anchors conflict with stack Item { anchors{ @@ -135,15 +147,7 @@ FocusScope { } text: qsTr("Save") - onClicked: { - if (loader.item.valid) { - loader.item.save() - Kube.Fabric.postMessage(Kube.Messages.synchronize, {"accountId": loader.item.accountIdentifier}); - root.done() - } else { - console.warn("Invalid settings."); - } - } + onClicked: save() } } } -- cgit v1.2.3