Commit df88e51f authored by Nicolas Fella's avatar Nicolas Fella

[nextcloud] Use controller's state property for view management

parent b2061665
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
NextcloudWizard::NextcloudWizard(QObject *parent) NextcloudWizard::NextcloudWizard(QObject *parent)
: KAccountsUiPlugin(parent) : KAccountsUiPlugin(parent)
{ {
qmlRegisterUncreatableType<NextcloudController>("org.kde.kaccounts.nextcloud", 1, 0, "NextcloudController", QStringLiteral("Only for enums"));
} }
NextcloudWizard::~NextcloudWizard() NextcloudWizard::~NextcloudWizard()
......
...@@ -6,10 +6,12 @@ ...@@ -6,10 +6,12 @@
*/ */
import QtQuick 2.2 import QtQuick 2.2
import org.kde.kirigami 2.5 as Kirigami
import QtQuick.Layouts 1.12 import QtQuick.Layouts 1.12
import QtQuick.Controls 2.5 import QtQuick.Controls 2.5
import org.kde.kirigami 2.5 as Kirigami
import org.kde.kaccounts.nextcloud 1.0
Kirigami.ApplicationWindow { Kirigami.ApplicationWindow {
id: ncAccountRoot id: ncAccountRoot
objectName: "_root" objectName: "_root"
...@@ -27,7 +29,16 @@ Kirigami.ApplicationWindow { ...@@ -27,7 +29,16 @@ Kirigami.ApplicationWindow {
Loader { Loader {
anchors.fill: parent anchors.fill: parent
source: helper.isLoginComplete ? Qt.resolvedUrl("Services.qml") : Qt.resolvedUrl("Server.qml") source: {
switch (helper.state) {
case NextcloudController.ServerUrl:
return Qt.resolvedUrl("Server.qml");
case NextcloudController.WebLogin:
return ""
case NextcloudController.Services:
return Qt.resolvedUrl("Services.qml")
}
}
} }
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment