From 5f17e726ad63eec6ef78d15baa8ed42625679197 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 23 Jan 2018 22:42:39 +0100 Subject: Dynamically create the accountwizard to avoid maintaining state. We used to see the old wizard when creating an additional account. --- views/accounts/qml/View.qml | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) (limited to 'views/accounts') diff --git a/views/accounts/qml/View.qml b/views/accounts/qml/View.qml index b81579ae..28849ae4 100644 --- a/views/accounts/qml/View.qml +++ b/views/accounts/qml/View.qml @@ -50,7 +50,9 @@ FocusScope { } text: qsTr("New Account") - onClicked: accountWizard.open() + onClicked: { + accountWizardComponent.createObject(root, {}).open() + } } Kube.ListView { @@ -112,32 +114,27 @@ FocusScope { //FIXME: this assumes we load accounts synchronously, which we do right now. if (accountId == "") { //Require the setup to be completed since it's the first account - accountWizard.requireSetup = true - //Launch account wizard - accountWizard.open() + accountWizardComponent.createObject(root, {requireSetup: true}).open() } } } } } - onActiveFocusChanged: { - if (activeFocus && accountWizard.visible) { - accountWizard.forceActiveFocus() - } - } - //BEGIN AccountWizard - KubeAccounts.AccountWizard { - id: accountWizard - - parent: ApplicationWindow.overlay - height: root.height - width: root.width - x: root.mapToGlobal(root.x, root.y).x - y: 0 - - availableAccountPlugins: root.availableAccountPlugins + Component { + id: accountWizardComponent + KubeAccounts.AccountWizard { + id: accountWizard + + parent: ApplicationWindow.overlay + height: root.height + width: root.width + x: root.mapToGlobal(root.x, root.y).x + y: 0 + + availableAccountPlugins: root.availableAccountPlugins + } } //END AccountWizard } -- cgit v1.2.3