import QtQuick import QtQuick.Window import QtQuick.Controls import QtQuick.Layouts import QtCore import magpie.API ApplicationWindow { property int counter: 0 property bool pickingServer: false width: 640 height: 480 visible: true title: "Magpie" header: Label { text: stack.currentItem.title horizontalAlignment: Text.AlignHCenter } StackView { id: stack initialItem: welcome anchors.fill: parent Component { id: welcome Welcome { onPickServer: stack.push(serverPick) } } Component { id: serverPick ServerPick { address: API.address onBack: stack.pop() StackView.onActivating: pickingServer = true; StackView.onDeactivating: pickingServer = false; } } } Connections { target: API function onAddressChanged (url) { if (pickingServer && url.toString().length > 0) stack.pop() } } }