dictionary
This commit is contained in:
@@ -2,6 +2,7 @@ import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Controls.Material
|
||||
import "../js/qmldict.js" as Qmldict
|
||||
|
||||
|
||||
|
||||
@@ -34,8 +35,15 @@ Item
|
||||
}
|
||||
|
||||
TabButton
|
||||
|
||||
{
|
||||
id: dbTab
|
||||
text: qsTr("Datenbank einrichten")
|
||||
|
||||
}
|
||||
onCurrentIndexChanged:
|
||||
{
|
||||
submitBtn.text = currentIndex === 0? "Weiter" : "Speichern"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,6 +53,7 @@ Item
|
||||
Layout.fillHeight: true
|
||||
currentIndex: bar.currentIndex
|
||||
Layout.margins: 9
|
||||
id: stackl
|
||||
|
||||
Item
|
||||
{
|
||||
@@ -109,10 +118,12 @@ Item
|
||||
rowSpacing: 9
|
||||
anchors.fill: parent
|
||||
|
||||
|
||||
Label
|
||||
{
|
||||
text: qsTr("DB-Host:")
|
||||
Layout.alignment: Qt.AlignRight
|
||||
|
||||
}
|
||||
|
||||
TextField
|
||||
@@ -120,6 +131,7 @@ Item
|
||||
id: dbHost
|
||||
placeholderText: qsTr("Hier Host eingeben")
|
||||
Layout.fillWidth: true
|
||||
property string name: "db-host"
|
||||
}
|
||||
|
||||
Label
|
||||
@@ -133,6 +145,7 @@ Item
|
||||
id: dbPort
|
||||
placeholderText: qsTr("Hier DB-Port eingeben")
|
||||
Layout.fillWidth: true
|
||||
property string name: "db-port"
|
||||
}
|
||||
|
||||
Label
|
||||
@@ -146,6 +159,7 @@ Item
|
||||
id: dbName
|
||||
placeholderText: qsTr("Hier DB-Name eingeben")
|
||||
Layout.fillWidth: true
|
||||
property string name: "db-name"
|
||||
}
|
||||
|
||||
Label
|
||||
@@ -159,6 +173,7 @@ Item
|
||||
id: dbUserName
|
||||
placeholderText: qsTr("Hier DB-Benutzername eingeben")
|
||||
Layout.fillWidth: true
|
||||
property string name: "db-username"
|
||||
|
||||
}
|
||||
|
||||
@@ -174,6 +189,7 @@ Item
|
||||
echoMode: TextInput.Password
|
||||
placeholderText: qsTr("Hier DB-Passwort eingeben")
|
||||
Layout.fillWidth: true
|
||||
property string name: "db-password"
|
||||
}
|
||||
|
||||
Item
|
||||
@@ -202,22 +218,27 @@ Item
|
||||
Button
|
||||
{
|
||||
id: submitBtn
|
||||
text: qsTr("Speichern")
|
||||
text: qsTr("Weiter")
|
||||
property var grids: [createUserGrid, dbGrid]
|
||||
property var dict: ({})
|
||||
onClicked:
|
||||
{
|
||||
config.createUser(benutzerName.text)
|
||||
for (var i = 0; i < createUserGrid.children.length; i++)
|
||||
if (bar.itemAt(bar.currentIndex) !== dbTab)
|
||||
{
|
||||
// console.log(createUserGrid.children[i].name)
|
||||
// console.log(createUserGrid.children[i].text)
|
||||
|
||||
if (createUserGrid.children[i].name)
|
||||
{
|
||||
console.log(createUserGrid.children[i].name);
|
||||
console.log(createUserGrid.children[i].text);
|
||||
}
|
||||
bar.currentIndex = 1
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
dict = Qmldict.func(submitBtn.grids)
|
||||
console.log(dict)
|
||||
if (dict)
|
||||
config.setConfig(dict)
|
||||
|
||||
appLoader.source = "start.qml"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -226,5 +247,6 @@ Item
|
||||
Component.onCompleted:
|
||||
{
|
||||
appLoader.window.title = "PYQCRM - Einstellungen"
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user