Files
pyqcrm/gui/Programmeinstellungen.qml

213 lines
5.2 KiB
QML

import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import QtQuick.Controls.Material
// Item {
// benutzername
// passwort
// server
// port
// benutzername(db)
// passwort(db)
// DbName
// type
// }
ApplicationWindow
{
width: 640
height: 480
visible: true
title: qsTr("PYQCRM - Einstellungen")
Material.theme: Material.Dark
Material.accent: Material.BlueGrey
ColumnLayout
{
anchors.fill: parent
TabBar
{
id: bar
Layout.fillWidth: true
TabButton
{
text: qsTr("Benutzer erstellen")
}
TabButton
{
text: qsTr("Datenbank einrichten")
}
}
StackLayout
{
Layout.fillWidth: true
Layout.fillHeight: true
currentIndex: bar.currentIndex
Layout.margins: 9
Item
{
id: createUser
Layout.fillWidth: parent.width
GridLayout
{
id: createUserGrid
columns: 2
anchors.fill: parent
Layout.margins: 9
Label
{
text: qsTr("Benutzername:")
Layout.alignment: Qt.AlignRight
}
TextField
{
id: benutzerName
placeholderText: qsTr("Hier Benutzername eingeben")
Layout.fillWidth: true
height: 3
}
Label
{
text: qsTr("Passwort:")
Layout.alignment: Qt.AlignRight
}
TextField
{
id: password
echoMode: TextInput.Password
placeholderText: qsTr("Hier Passwort eingeben")
Layout.fillWidth: true
}
Item
{
Layout.fillHeight: true
}
}
}
Item
{
id: settingsDB
Layout.fillWidth: parent.width
GridLayout
{
id: dbGrid
columns: 2
anchors.fill: parent
Label
{
text: qsTr("DB-Host:")
Layout.alignment: Qt.AlignRight
}
TextField
{
id: dbHost
placeholderText: qsTr("Hier Host eingeben")
Layout.fillWidth: true
}
Label
{
text: qsTr("DB-Port:")
Layout.alignment: Qt.AlignRight
}
TextField
{
id: dbPort
placeholderText: qsTr("Hier DB-Port eingeben")
Layout.fillWidth: true
}
Label
{
text: qsTr("DB-Name:")
Layout.alignment: Qt.AlignRight
}
TextField
{
id: dbName
placeholderText: qsTr("Hier DB-Name eingeben")
Layout.fillWidth: true
}
Label
{
text: qsTr("DB-Benutzername:")
Layout.alignment: Qt.AlignRight
}
TextField
{
id: dbUserName
placeholderText: qsTr("Hier DB-Benutzername eingeben")
Layout.fillWidth: true
}
Label
{
text: qsTr("DB-Passwort:")
Layout.alignment: Qt.AlignRight
}
TextField
{
id: dbPassword
echoMode: TextInput.Password
placeholderText: qsTr("Hier DB-Passwort eingeben")
Layout.fillWidth: true
}
Item
{
Layout.fillHeight: true
}
}
}
}
RowLayout
{
Layout.margins: 9
Item
{
Layout.fillWidth: true
}
Button
{
id: cancelBtn
text: qsTr("Abbrechen")
}
Button
{
id: submitBtn
text: qsTr("Speichern")
onClicked:
{
config.createUser(benutzerName.text)
}
}
}
}
}