Make the Controller a singleton
This commit is contained in:
committed by
Nicolas Fella
parent
1739a454da
commit
2d1a7d6500
@@ -8,6 +8,8 @@ import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12 as QQC2
|
||||
import QtQuick.Layouts 1.12
|
||||
|
||||
import Spectral 0.1
|
||||
|
||||
import Spectral.Component 2.0
|
||||
|
||||
import org.kde.kirigami 2.12 as Kirigami
|
||||
@@ -17,8 +19,6 @@ Kirigami.ScrollablePage {
|
||||
|
||||
title: i18n("Login")
|
||||
|
||||
required property var spectralController
|
||||
|
||||
Kirigami.FormLayout {
|
||||
id: formLayout
|
||||
QQC2.TextField {
|
||||
@@ -55,9 +55,9 @@ Kirigami.ScrollablePage {
|
||||
|
||||
function doLogin() {
|
||||
if (accessTokenField.text.length > 0) {
|
||||
spectralController.loginWithAccessToken(serverField.text, usernameField.text, accessTokenField.text, deviceNameField.text)
|
||||
Controller.loginWithAccessToken(serverField.text, usernameField.text, accessTokenField.text, deviceNameField.text)
|
||||
} else {
|
||||
spectralController.loginWithCredentials(serverField.text, usernameField.text, passwordField.text, deviceNameField.text)
|
||||
Controller.loginWithCredentials(serverField.text, usernameField.text, passwordField.text, deviceNameField.text)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user