63 lines
1.6 KiB
QML
63 lines
1.6 KiB
QML
// SPDX-FileCopyrightText: 2024 Joshua Goins <josh@redstrate.com>
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
import QtQuick
|
|
import QtQuick.Controls as QQC2
|
|
import QtQuick.Layouts
|
|
import QtQuick.Effects
|
|
|
|
import org.kde.kirigami as Kirigami
|
|
import org.kde.kirigamiaddons.formcard as FormCard
|
|
|
|
import com.redstrate.sukai
|
|
|
|
Kirigami.Page {
|
|
id: root
|
|
|
|
title: i18nc("@title:window", "Login")
|
|
globalToolBarStyle: Kirigami.ApplicationHeaderStyle.None
|
|
|
|
header: Kirigami.Separator {
|
|
width: root.width
|
|
}
|
|
|
|
Connections {
|
|
target: AccountManager
|
|
|
|
function onLoginError(message: string): void {
|
|
// TODO: expose in a banner or something else in the UI
|
|
console.warn("login error:" + message);
|
|
}
|
|
}
|
|
|
|
contentItem: Item {
|
|
ColumnLayout {
|
|
anchors {
|
|
left: parent.left
|
|
right: parent.right
|
|
verticalCenter: parent.verticalCenter
|
|
}
|
|
|
|
spacing: Kirigami.Units.largeSpacing
|
|
|
|
FormCard.FormCard {
|
|
FormCard.FormTextFieldDelegate {
|
|
id: identifierDelegate
|
|
|
|
label: i18n("Identifier")
|
|
}
|
|
|
|
FormCard.FormTextFieldDelegate {
|
|
id: passwordDelegate
|
|
|
|
label: i18n("Password")
|
|
}
|
|
|
|
FormCard.FormButtonDelegate {
|
|
text: i18n("Login")
|
|
onClicked: AccountManager.login(identifierDelegate.text, passwordDelegate.text)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|