2023-11-22 23:13:33 +00:00
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Window
|
|
|
|
import QtQuick.Controls
|
|
|
|
import QtQuick.Layouts
|
2023-12-05 22:17:27 +00:00
|
|
|
import QtCore
|
2023-11-24 23:48:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
ApplicationWindow {
|
2023-11-22 23:13:33 +00:00
|
|
|
property int counter: 0
|
|
|
|
|
|
|
|
id: window
|
|
|
|
width: 640
|
|
|
|
height: 480
|
|
|
|
visible: true
|
2023-12-03 21:34:16 +00:00
|
|
|
title: "Magpie"
|
2023-11-24 23:48:01 +00:00
|
|
|
|
|
|
|
header: Label {
|
|
|
|
text: stack.currentItem.title
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
}
|
2023-11-22 23:13:33 +00:00
|
|
|
|
2023-11-24 23:48:01 +00:00
|
|
|
StackView {
|
|
|
|
id: stack
|
|
|
|
initialItem: welcome
|
2023-11-22 23:13:33 +00:00
|
|
|
anchors.fill: parent
|
2023-11-24 23:48:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Welcome {
|
|
|
|
id: welcome
|
2023-12-05 22:17:27 +00:00
|
|
|
serverAddress: settings.serverAddress
|
2023-11-24 23:48:01 +00:00
|
|
|
onPickServer: function (address) {
|
|
|
|
pick.address = address;
|
|
|
|
stack.push(pick)
|
2023-11-22 23:13:33 +00:00
|
|
|
}
|
2023-11-24 23:48:01 +00:00
|
|
|
}
|
2023-11-22 23:13:33 +00:00
|
|
|
|
2023-12-05 22:17:27 +00:00
|
|
|
Settings {
|
|
|
|
id: settings
|
|
|
|
|
|
|
|
property string serverAddress
|
|
|
|
}
|
|
|
|
|
2023-11-24 23:48:01 +00:00
|
|
|
ServerPick {
|
|
|
|
visible: false
|
|
|
|
id: pick
|
|
|
|
onBack: stack.pop()
|
|
|
|
onSuccess: function (address) {
|
2023-12-05 22:17:27 +00:00
|
|
|
settings.serverAddress = address;
|
2023-11-24 23:48:01 +00:00
|
|
|
stack.pop();
|
2023-11-22 23:13:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|