Commit df88e51f authored by Nicolas Fella's avatar Nicolas Fella
Browse files

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

parent b2061665
......@@ -18,6 +18,7 @@
NextcloudWizard::NextcloudWizard(QObject *parent)
: KAccountsUiPlugin(parent)
{
qmlRegisterUncreatableType<NextcloudController>("org.kde.kaccounts.nextcloud", 1, 0, "NextcloudController", QStringLiteral("Only for enums"));
}
NextcloudWizard::~NextcloudWizard()
......
......@@ -6,10 +6,12 @@
*/
import QtQuick 2.2
import org.kde.kirigami 2.5 as Kirigami
import QtQuick.Layouts 1.12
import QtQuick.Controls 2.5
import org.kde.kirigami 2.5 as Kirigami
import org.kde.kaccounts.nextcloud 1.0
Kirigami.ApplicationWindow {
id: ncAccountRoot
objectName: "_root"
......@@ -27,7 +29,16 @@ Kirigami.ApplicationWindow {
Loader {
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