101 lines
2.2 KiB
QML
101 lines
2.2 KiB
QML
import QtQuick
|
|
import QtQuick.Layouts
|
|
import QtQuick.Controls
|
|
|
|
import "../js/qmldict.js" as Qmldict
|
|
|
|
|
|
|
|
// Item {
|
|
|
|
// benutzername
|
|
// passwort
|
|
// server
|
|
// port
|
|
// benutzername(db)
|
|
// passwort(db)
|
|
// DbName
|
|
// type
|
|
|
|
|
|
// }
|
|
|
|
Item
|
|
{
|
|
anchors.fill: parent
|
|
StackView
|
|
{
|
|
id: firstStart
|
|
anchors.fill: parent
|
|
initialItem: "DbConfiguration.qml"
|
|
}
|
|
RowLayout
|
|
{
|
|
anchors.bottom: parent.bottom
|
|
anchors.margins: 9
|
|
width: parent.width
|
|
|
|
|
|
Item
|
|
{
|
|
Layout.fillWidth: true
|
|
}
|
|
|
|
Button
|
|
{
|
|
id: cancelBtn
|
|
text: qsTr("Abbrechen")
|
|
onClicked:
|
|
{
|
|
Qt.quit()
|
|
}
|
|
}
|
|
|
|
Button
|
|
{
|
|
id: submitBtn
|
|
text: qsTr("Speichern")
|
|
property var grids: firstStart.currentItem
|
|
property var pyqcrm_conf: ({})
|
|
property var admin: Boolean
|
|
onClicked:
|
|
{
|
|
if (firstStart.currentItem.name === "database")
|
|
{
|
|
pyqcrm_conf = Qmldict.func(submitBtn.grids)
|
|
if (pyqcrm_conf)
|
|
{
|
|
admin = config.setConfig(pyqcrm_conf)
|
|
if (admin)
|
|
{
|
|
firstStart.push("EncryptionKey.qml")
|
|
}
|
|
else
|
|
{
|
|
firstStart.push("AdminUserConfig.qml")
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
pyqcrm_conf = Qmldict.func(submitBtn.grids)
|
|
if (pyqcrm_conf)
|
|
{
|
|
admin = config.addAdminUser(pyqcrm_conf)
|
|
if (admin)
|
|
{
|
|
appLoader.source = "Dashboard.qml"
|
|
topBar.visible = true
|
|
}
|
|
else
|
|
{
|
|
console.log("Konfiguration Admin fehlgeschlagen")
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|