diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-09-22 11:58:47 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-09-22 11:58:47 +0200 |
commit | f25a8fb49abf8a9b7ba5d6f8fbd4c05bd647c1c0 (patch) | |
tree | c1066b0c9bd9d4a0e1be952dcad7b65af39baa79 /components/accounts/contents/ui/AccountWizardPage.qml | |
parent | 2a60a0723257cfd6855233b9af27dc9735915435 (diff) | |
download | kube-f25a8fb49abf8a9b7ba5d6f8fbd4c05bd647c1c0.tar.gz kube-f25a8fb49abf8a9b7ba5d6f8fbd4c05bd647c1c0.zip |
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.
Diffstat (limited to 'components/accounts/contents/ui/AccountWizardPage.qml')
-rw-r--r-- | components/accounts/contents/ui/AccountWizardPage.qml | 22 |
1 files changed, 13 insertions, 9 deletions
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 { | |||
32 | property bool isFirstView: root.Controls2.StackView.index == 0 | 32 | property bool isFirstView: root.Controls2.StackView.index == 0 |
33 | property bool requireSetup: false | 33 | property bool requireSetup: false |
34 | 34 | ||
35 | function save() { | ||
36 | if (loader.item.valid) { | ||
37 | loader.item.save() | ||
38 | Kube.Fabric.postMessage(Kube.Messages.synchronize, {"accountId": loader.item.accountIdentifier}); | ||
39 | root.done() | ||
40 | } else { | ||
41 | console.warn("Invalid settings."); | ||
42 | } | ||
43 | } | ||
44 | |||
35 | Kube.AccountFactory { | 45 | Kube.AccountFactory { |
36 | id: accountFactory | 46 | id: accountFactory |
37 | accountType: root.accountType | 47 | accountType: root.accountType |
@@ -47,6 +57,8 @@ FocusScope { | |||
47 | } | 57 | } |
48 | } | 58 | } |
49 | 59 | ||
60 | Keys.onReturnPressed: save() | ||
61 | |||
50 | //Item to avoid anchors conflict with stack | 62 | //Item to avoid anchors conflict with stack |
51 | Item { | 63 | Item { |
52 | anchors{ | 64 | anchors{ |
@@ -135,15 +147,7 @@ FocusScope { | |||
135 | } | 147 | } |
136 | 148 | ||
137 | text: qsTr("Save") | 149 | text: qsTr("Save") |
138 | onClicked: { | 150 | onClicked: save() |
139 | if (loader.item.valid) { | ||
140 | loader.item.save() | ||
141 | Kube.Fabric.postMessage(Kube.Messages.synchronize, {"accountId": loader.item.accountIdentifier}); | ||
142 | root.done() | ||
143 | } else { | ||
144 | console.warn("Invalid settings."); | ||
145 | } | ||
146 | } | ||
147 | } | 151 | } |
148 | } | 152 | } |
149 | } | 153 | } |