summaryrefslogtreecommitdiffstats
path: root/components/accounts/contents/ui
diff options
context:
space:
mode:
Diffstat (limited to 'components/accounts/contents/ui')
-rw-r--r--components/accounts/contents/ui/AccountWizard.qml18
-rw-r--r--components/accounts/contents/ui/AccountWizardPage.qml5
2 files changed, 19 insertions, 4 deletions
diff --git a/components/accounts/contents/ui/AccountWizard.qml b/components/accounts/contents/ui/AccountWizard.qml
index ea7b491f..996eeb6c 100644
--- a/components/accounts/contents/ui/AccountWizard.qml
+++ b/components/accounts/contents/ui/AccountWizard.qml
@@ -22,11 +22,15 @@ import QtQuick.Controls 2.0 as Controls2
22import org.kube.framework 1.0 as Kube 22import org.kube.framework 1.0 as Kube
23 23
24Kube.Popup { 24Kube.Popup {
25 id: popup 25 id: root
26
27
28 property bool singleAccountMode: false
29 property string forceAccountType: ""
26 30
27 modal: true 31 modal: true
28 focus: true 32 focus: true
29 closePolicy: Controls2.Popup.CloseOnEscape | Controls2.Popup.CloseOnPressOutside 33 closePolicy: singleAccountMode ? Controls2.Popup.NoAutoClose : Controls2.Popup.CloseOnEscape | Controls2.Popup.CloseOnPressOutside
30 34
31 clip: true 35 clip: true
32 36
@@ -35,7 +39,12 @@ Kube.Popup {
35 39
36 anchors.fill: parent 40 anchors.fill: parent
37 41
38 initialItem: mainView 42 initialItem: root.singleAccountMode ? null : mainView
43 Component.onCompleted: {
44 if (root.singleAccountMode) {
45 stack.push(wizardPage.createObject(app, {accountType: root.forceAccountType}))
46 }
47 }
39 } 48 }
40 49
41 Component { 50 Component {
@@ -72,8 +81,9 @@ Kube.Popup {
72 Component { 81 Component {
73 id: wizardPage 82 id: wizardPage
74 AccountWizardPage { 83 AccountWizardPage {
84 singleAccountMode: root.singleAccountMode
75 onDone: { 85 onDone: {
76 popup.close() 86 root.close()
77 Kube.Fabric.postMessage(Kube.Messages.componentDone, {}) 87 Kube.Fabric.postMessage(Kube.Messages.componentDone, {})
78 } 88 }
79 } 89 }
diff --git a/components/accounts/contents/ui/AccountWizardPage.qml b/components/accounts/contents/ui/AccountWizardPage.qml
index f5d10258..6c9befea 100644
--- a/components/accounts/contents/ui/AccountWizardPage.qml
+++ b/components/accounts/contents/ui/AccountWizardPage.qml
@@ -29,6 +29,9 @@ Item {
29 property string accountType 29 property string accountType
30 signal done() 30 signal done()
31 31
32 property bool isFirstView: root.Controls2.StackView.index == 0
33 property bool singleAccountMode: false
34
32 Kube.AccountFactory { 35 Kube.AccountFactory {
33 id: accountFactory 36 id: accountFactory
34 accountType: root.accountType 37 accountType: root.accountType
@@ -38,6 +41,7 @@ Item {
38 id: backButton 41 id: backButton
39 iconName: Kube.Icons.goBack 42 iconName: Kube.Icons.goBack
40 tooltip: "go back" 43 tooltip: "go back"
44 visible: !root.isFirstView
41 onClicked: { 45 onClicked: {
42 stack.pop() 46 stack.pop()
43 } 47 }
@@ -115,6 +119,7 @@ Item {
115 left: parent.left 119 left: parent.left
116 bottom: parent.bottom 120 bottom: parent.bottom
117 } 121 }
122 visible: !root.singleAccountMode
118 123
119 text: qsTr("Discard") 124 text: qsTr("Discard")
120 onClicked: { 125 onClicked: {