2023-11-24 23:48:01 +00:00
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Controls
|
|
|
|
import QtQuick.Layouts
|
|
|
|
|
2023-12-17 00:06:04 +00:00
|
|
|
import magpie.API
|
|
|
|
import "Forms" as Forms
|
2023-11-24 23:48:01 +00:00
|
|
|
|
2023-12-16 01:44:25 +00:00
|
|
|
Page {
|
2023-11-24 23:48:01 +00:00
|
|
|
signal pickServer(address: string)
|
|
|
|
|
|
|
|
title: qsTr("Welcome")
|
|
|
|
|
|
|
|
Column {
|
|
|
|
anchors.centerIn: parent
|
|
|
|
spacing: 10
|
|
|
|
|
|
|
|
Label {
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
2023-12-03 21:34:16 +00:00
|
|
|
text: qsTr("Welcome to Magpie!")
|
2023-11-24 23:48:01 +00:00
|
|
|
font {
|
|
|
|
pixelSize: 22
|
|
|
|
bold: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Row {
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
spacing: 5
|
|
|
|
|
|
|
|
Label {
|
|
|
|
horizontalAlignment: Label.AlignRight
|
|
|
|
text: qsTr("Current server:")
|
|
|
|
}
|
|
|
|
Label {
|
|
|
|
horizontalAlignment: Label.AlignLeft
|
2023-12-16 01:44:25 +00:00
|
|
|
text: API.state === API.NoServer ? qsTr("choose") : API.address
|
2023-11-24 23:48:01 +00:00
|
|
|
font {
|
|
|
|
italic: true
|
|
|
|
underline: true
|
|
|
|
}
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
2023-12-16 01:44:25 +00:00
|
|
|
onClicked: pickServer(API.address)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Row {
|
|
|
|
id: forms
|
|
|
|
property bool registering: false
|
|
|
|
|
|
|
|
visible: API.state === API.NotAuthenticated
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
topPadding: 10
|
|
|
|
|
2023-12-17 00:06:04 +00:00
|
|
|
Forms.Login {
|
|
|
|
id: login
|
|
|
|
visible: !forms.registering
|
|
|
|
onRegister: forms.registering = true
|
2023-12-16 01:44:25 +00:00
|
|
|
}
|
|
|
|
|
2023-12-17 00:06:04 +00:00
|
|
|
Forms.Register {
|
|
|
|
id: register
|
|
|
|
visible: forms.registering
|
|
|
|
onLogin: forms.registering = false
|
2023-11-24 23:48:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|