import QtQuick import QtQuick.Layouts import QtQuick.Controls import Gui import QtQuick.Dialogs import QtCore ApplicationWindow { id: appWindow width: Screen.width * .6 height: Screen.height * .7 visible: true title: "PYQCRM" TopBar { id:topBar anchors { rightMargin: 9 leftMargin: 9 } visible: bad_config? false: true } Item { id: mainView } Loader { id: appLoader anchors { left: parent.left right: parent.right top: topBar.bottom bottom: parent.bottom topMargin: 0 rightMargin: 9 leftMargin: 9 } property alias window: appWindow } Component.onCompleted: { if(bad_config) { importDialog.open() } else appLoader.source= "Dashboard.qml" } Dialog { id: importDialog modal: true anchors.centerIn: parent standardButtons: Dialog.Yes | Dialog.No onAccepted: settingsFiledialog.open() onRejected: appLoader.source= "firststart.qml" title: qsTr("Einstellungen importieren") } FileDialog { id: settingsFiledialog title: qsTr("pyqcrm Einstellungen") currentFolder: StandardPaths.standardLocations(StandardPaths.DocumentsLocation)[0] modality: "ApplicationModal" nameFilters: ["pyqcrm Einstellungen (*.toml)"] onAccepted: config.importConfig(selectedFile) } }