magpie/qml/Application/Root.qml

46 lines
829 B
QML

// SPDX-FileCopyrightText: 2023 Yury Gubich <blue@macaw.me>
// SPDX-License-Identifier: GPL-3.0-or-later
import QtQuick
import QtQuick.Controls
import magpie
import magpie.Forms as Forms
import magpie.Components as Components
Item {
StackView {
id: stack
initialItem: main
anchors.fill: parent
}
Component {
id: main
Main {
onAddAsset: stack.push(addAssetForm);
}
}
Component {
id: addAssetForm
Forms.AddAsset {
onCancel: stack.pop()
onSuccess: stack.pop()
}
}
Connections {
target: Magpie
function onDisplayError (err) {
modal.status = err;
modal.open();
}
}
Components.Modal {
id: modal
closable: true
}
}