Merge branch 'style' into schnacke

merge mit style
This commit is contained in:
2025-03-17 09:11:58 +01:00
29 changed files with 427 additions and 238 deletions

View File

@@ -66,8 +66,6 @@ ColumnLayout
Label
{
text: qsTr("PLZ")
// font.pixelSize: 57
// font.bold: true
}
ComboBox

View File

@@ -3,226 +3,138 @@ import QtQuick
import QtQuick.Controls
import QtQuick.Dialogs
import QtQuick.Layouts
import TeroStyle
Item
{
Item {
property string recpass: ""
function dbConnectionFailed(msg) {
oschkar.notificationBox.informativeText = msg;
oschkar.notificationBox.text = "Verbindung zum Datenbankserver verloren";
oschkar.notificationBox.open();
}
function getEncryptionKey() {
recoveryPaswordDialog.open();
}
function loggedin() {
appLoader.source = "Dashboard.qml";
}
anchors.fill: parent
anchors.topMargin: Dimensions.l
ColumnLayout
{
Component.onCompleted: {
loggedin_user.loginOkay.connect(loggedin);
config.invalidEncryptionKey.connect(getEncryptionKey);
config.checkEncryptionKey();
loggedin_user.noDbConnection.connect(dbConnectionFailed);
benutzerName.forceActiveFocus();
}
anchors.fill: parent
ColumnLayout {
spacing: Dimensions.m
anchors.centerIn: parent
FontLoader
{
id: helloStranger
source: "qrc:/fonts/HelloStranger.otf"
}
FontLoader
{
id: damarWulan
source: "qrc:/fonts/Damarwulan.ttf"
}
FontLoader
{
id: hussarPrint
source: "qrc:/fonts/HussarPrintA.otf"
}
FontLoader
{
id: reginaldScript
source: "qrc:/fonts/ReginaldScript.ttf"
}
Item
{
height: 65
}
Label
{
text: qsTr ("Login*****")
font.family: helloStranger.font.family
font.weight: helloStranger.font.weight
font.styleName: helloStranger.font.styleName
font.pixelSize: 89
font.bold: true
Label {
font: Typography.h1
text: qsTr("Login")
Layout.alignment: Qt.AlignHCenter
color: "yellow"
Layout.bottomMargin: Dimensions.l
}
Item
{
height: 25
}
Field {
label: qsTr("Benutzername")
RowLayout
{
Layout.alignment: Qt.AlignHCenter
spacing: 15
Label
{
text: qsTr ("Benutzername")
minimumPixelSize: 20
Layout.preferredWidth: 150
horizontalAlignment: Text.AlignRight
font.family: damarWulan.font.family
font.weight: damarWulan.font.weight
font.styleName: damarWulan.font.styleName
font.pixelSize: 21
}
TextField
{
TextField {
id: benutzerName
placeholderText: qsTr ("Benutzernamen eingeben")
implicitWidth: 300
font: hussarPrint.font
focus: true
onAccepted:
{
if (benutzerName.text.trim() && passwort.text.trim())
loggedin_user.login(benutzerName.text.trim(), passwort.text)
else if(benutzerName.text.trim()) passwort.forceActiveFocus()
}
}
}
RowLayout
{
Layout.alignment: Qt.AlignHCenter
spacing: 15
Label
{
minimumPixelSize: 20
Layout.preferredWidth: 150
text: qsTr ("Passwort")
font.family: damarWulan.font.family
font.weight: damarWulan.font.weight
font.styleName: damarWulan.font.styleName
font.pixelSize: 21
horizontalAlignment: Text.AlignRight
}
TextField
{
id: passwort
placeholderText: qsTr ("Passwort eingeben")
implicitWidth: 300
font: hussarPrint.font
placeholderText: qsTr("Benutzernamen eingeben")
onAccepted: {
if (benutzerName.text.trim() && passwort.text.trim())
loggedin_user.login(benutzerName.text.trim(), passwort.text);
else if (benutzerName.text.trim())
passwort.forceActiveFocus();
}
}
}
Field {
label: qsTr("Passwort")
TextField {
id: passwort
echoMode: TextInput.Password
onAccepted:
{
implicitWidth: 300
placeholderText: qsTr("Passwort eingeben")
onAccepted: {
if (benutzerName.text.trim() && passwort.text.trim())
loggedin_user.login(benutzerName.text.trim(), passwort.text)
else if(passwort.text.trim()) benutzerName.forceActiveFocus()
loggedin_user.login(benutzerName.text.trim(), passwort.text);
else if (passwort.text.trim())
benutzerName.forceActiveFocus();
}
}
}
RowLayout
{
Layout.preferredWidth: 465
Layout.alignment: Qt.AlignHCenter
Button {
Layout.topMargin: Dimensions.m
text: qsTr("Login")
width: parent.width
Button
{
text: qsTr ("Feierabend für heute!")
Layout.alignment: Qt.AlignRight
font: reginaldScript.font
onClicked:
{
if (benutzerName.text.trim() && passwort.text.trim())
loggedin_user.login(benutzerName.text.trim(), passwort.text)
}
onClicked: {
if (benutzerName.text.trim() && passwort.text.trim())
loggedin_user.login(benutzerName.text.trim(), passwort.text);
}
}
Item
{
Item {
Layout.fillHeight: true
}
Dialog
{
Dialog {
id: recoveryPaswordDialog
modal: true
title: qsTr("Wiederherstellung")
anchors.centerIn: parent
modal: true
standardButtons: Dialog.Ok | Dialog.Cancel
onAccepted:
{
recpass = recoveryPaswordInput.text
getRecoveryDialog.open()
title: qsTr("Wiederherstellung")
onAccepted: {
recpass = recoveryPaswordInput.text;
getRecoveryDialog.open();
}
ColumnLayout
{
RowLayout
{
Label
{
ColumnLayout {
RowLayout {
Label {
text: qsTr("Wiederherstellungspasswort eingeben: ")
}
TextField
{
TextField {
id: recoveryPaswordInput
text: ""
echoMode: TextInput.Password
implicitWidth: 300
placeholderText: qsTr("Hier Wiederherstellungspasswort eingeben")
text: ""
}
}
}
}
FileDialog
{
FileDialog {
id: getRecoveryDialog
title: qsTr("Wiederherstellungsdatei")
currentFolder: StandardPaths.standardLocations(StandardPaths.DocumentsLocation)[0]
fileMode: FileDialog.OpenFile
nameFilters: ["PYQCRM Recovery files (*.pyqrec)"]
currentFolder: StandardPaths.standardLocations(StandardPaths.DocumentsLocation)[0]
title: qsTr("Wiederherstellungsdatei")
onAccepted: config.getRecoveryKey(getRecoveryDialog.currentFile, recpass)
onRejected: quit()
}
Notifications
{
Notifications {
id: oschkar
}
}
Component.onCompleted:
{
loggedin_user.loginOkay.connect(loggedin)
config.invalidEncryptionKey.connect(getEncryptionKey)
config.checkEncryptionKey()
loggedin_user.noDbConnection.connect(dbConnectionFailed)
benutzerName.forceActiveFocus()
}
function loggedin()
{
appLoader.source = "Dashboard.qml"
}
function getEncryptionKey()
{
recoveryPaswordDialog.open()
}
function dbConnectionFailed(msg)
{
oschkar.notificationBox.informativeText = msg
oschkar.notificationBox.text = "Verbindung zum Datenbankserver verloren"
oschkar.notificationBox.open()
}
}

View File

@@ -6,12 +6,13 @@ import QtCore
ApplicationWindow
{
//property alias appLoader: appLoader
id: appWindow
width: Screen.width * .75
height: Screen.height * .85
visible: true
title: "PYQCRM"
title: "TERO Personal"
font: Typography.body
color: Colors.mantle
property string confile: ""
property alias settingsFileDialog: settingsFiledialog