Files
pyqcrm/gui/Programmeinstellungen.qml
2024-10-25 22:13:55 +02:00

227 lines
6.1 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")
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
Item
{
id: createUser
Layout.fillWidth: parent.width
Rectangle
{
anchors.fill: parent
anchors.rightMargin: 9
anchors.leftMargin: 9
anchors.topMargin: 9
anchors.bottomMargin: 9
GridLayout
{
id: createUserGrid
columns: 2
anchors.fill: parent
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
Rectangle
{
anchors.rightMargin: 9
anchors.leftMargin: 9
anchors.topMargin: 9
anchors.bottomMargin: 9
anchors.fill: parent
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.leftMargin: 9
Layout.rightMargin: 9
Layout.topMargin: 9
Layout.bottomMargin: 9
Item
{
Layout.fillWidth: true
}
Button
{
id: cancelBtn
text: qsTr("Abbrechen")
}
Button
{
id: submitBtn
text: qsTr("Speichern")
onClicked:
{
config.createUser(benutzerName.text)
}
}
}
}
}