From ccce242c848594643c5bebc78cf7d0452b311ebf Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 17 Apr 2018 12:27:03 +0200 Subject: React to removal of last account --- views/accounts/qml/View.qml | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'views/accounts') diff --git a/views/accounts/qml/View.qml b/views/accounts/qml/View.qml index 5fe307a2..84ba2ef1 100644 --- a/views/accounts/qml/View.qml +++ b/views/accounts/qml/View.qml @@ -70,6 +70,11 @@ FocusScope { model: Kube.AccountsModel {} + onCountChanged: { + if (count == 0) { + edit.accountId = "" + } + } onCurrentItemChanged: { if (currentItem) { edit.accountId = currentItem.currentData.accountId @@ -109,6 +114,13 @@ FocusScope { canRemove: !root.singleAccountMode + onAccountIdChanged: { + if (accountId == "") { + //Require the setup to be completed since it's the first account + accountWizardComponent.createObject(root, {requireSetup: true}).open() + } + } + Component.onCompleted: { //We don't have any accounts setup if accountId is empty, so we trigger the accountWizard //FIXME: this assumes we load accounts synchronously, which we do right now. -- cgit v1.2.3