Einstellungen importieren
This commit is contained in:
33
Gui/main.qml
33
Gui/main.qml
@@ -2,6 +2,8 @@ import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
import Gui
|
||||
import QtQuick.Dialogs
|
||||
import QtCore
|
||||
|
||||
ApplicationWindow
|
||||
{
|
||||
@@ -43,7 +45,36 @@ ApplicationWindow
|
||||
leftMargin: 9
|
||||
}
|
||||
|
||||
source: bad_config? "firststart.qml": "Dashboard.qml"
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user