From 6f4e9230a88bc2262a1093ae9f2507f1160bff54 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 7 Sep 2017 17:07:29 +0200 Subject: Single account mode It's hardcoded to be enabled and set to kolabnow at the moment (TBD). --- components/accounts/contents/ui/AccountWizard.qml | 18 ++++++++++++++---- components/accounts/contents/ui/AccountWizardPage.qml | 5 +++++ 2 files changed, 19 insertions(+), 4 deletions(-) (limited to 'components/accounts') 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 import org.kube.framework 1.0 as Kube Kube.Popup { - id: popup + id: root + + + property bool singleAccountMode: false + property string forceAccountType: "" modal: true focus: true - closePolicy: Controls2.Popup.CloseOnEscape | Controls2.Popup.CloseOnPressOutside + closePolicy: singleAccountMode ? Controls2.Popup.NoAutoClose : Controls2.Popup.CloseOnEscape | Controls2.Popup.CloseOnPressOutside clip: true @@ -35,7 +39,12 @@ Kube.Popup { anchors.fill: parent - initialItem: mainView + initialItem: root.singleAccountMode ? null : mainView + Component.onCompleted: { + if (root.singleAccountMode) { + stack.push(wizardPage.createObject(app, {accountType: root.forceAccountType})) + } + } } Component { @@ -72,8 +81,9 @@ Kube.Popup { Component { id: wizardPage AccountWizardPage { + singleAccountMode: root.singleAccountMode onDone: { - popup.close() + root.close() Kube.Fabric.postMessage(Kube.Messages.componentDone, {}) } } 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 { property string accountType signal done() + property bool isFirstView: root.Controls2.StackView.index == 0 + property bool singleAccountMode: false + Kube.AccountFactory { id: accountFactory accountType: root.accountType @@ -38,6 +41,7 @@ Item { id: backButton iconName: Kube.Icons.goBack tooltip: "go back" + visible: !root.isFirstView onClicked: { stack.pop() } @@ -115,6 +119,7 @@ Item { left: parent.left bottom: parent.bottom } + visible: !root.singleAccountMode text: qsTr("Discard") onClicked: { -- cgit v1.2.3