This commit is contained in:
2025-02-26 15:09:28 +01:00
parent 7228d5fae9
commit f0cde5ec20
12 changed files with 287 additions and 75 deletions

103
Gui/BackupSettings.qml Normal file
View File

@@ -0,0 +1,103 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Dialogs
GridLayout
{
anchors.fill: parent
anchors.topMargin: 150
columns: 2
Label
{
Layout.columnSpan: 2
Layout.alignment: Qt.AlignHCenter
text: qsTr("Sicherung")
font.pixelSize: 35
}
Label
{
text: qsTr("Konfiguration")
Layout.alignment: Qt.AlignRight
}
Button
{
id: saveConfig
text: qsTr("Jetzt sichern!")
onClicked: settingsFileDialog.open()
}
Label
{
text: qsTr("Verschlüsselung")
Layout.alignment: Qt.AlignRight
}
Button
{
id: saveEncryption
text: qsTr("Jetzt sichern!")
onClicked: Firsts.open()
}
Item
{
id: spacer
Layout.fillHeight: true
}
Dialog
{
anchors.centerIn: parent
id: dialog
title: "Title"
standardButtons: Dialog.Apply | Dialog.Cancel
onApplied:
{
if (configPwd.text === repeatConfigPwd.text)
{ console.log("true")
saveConfigFile.open()
}
else
{
configPwd.text = ""
configPwd.placeholderText = qsTr("Passwort stimmt nicht überein")
configPwd.placeholderTextColor = "red"
repeatConfigPwd.placeholderText = qsTr("")
repeatConfigPwd.text = ""
console.log("false")
}
}
onRejected: console.log("Cancel clicked")
GridLayout
{
columns: 2
Label
{
text: qsTr("Passwort eingeben")
}
TextField
{
id: configPwd
placeholderText: qsTr("Sicherungspasswort festlegen")
}
Label
{
text: qsTr("Passwort wiederholen")
}
TextField
{
id: repeatConfigPwd
placeholderText: qsTr("Sicherungspasswort wiederholen")
}
}
}
FileDialog
{
id: saveConfigFile
fileMode: FileDialog.SaveFile
}
}

17
Gui/CompanyConf.qml Normal file
View File

@@ -0,0 +1,17 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
Item
{
property string name: "company"
anchors.fill: parent
Label
{
text: qsTr("Das Unternehmen")
anchors.centerIn: parent
font.pixelSize: 57
font.bold: true
}
}

View File

@@ -11,7 +11,10 @@ Item
{ {
property string recpass: "" property string recpass: ""
property bool adminAvailable: true property bool adminAvailable: true
property alias recoverEnc: recoveryPaswordDialog
property alias first: firstStartItem
id: firstStartItem
anchors.fill: parent anchors.fill: parent
StackView StackView
{ {
@@ -87,6 +90,7 @@ Item
Dialog Dialog
{ {
id: recoveryPaswordDialog id: recoveryPaswordDialog
modal: true modal: true
title: qsTr("Wiederherstellung") title: qsTr("Wiederherstellung")
@@ -115,6 +119,19 @@ Item
implicitWidth: 300 implicitWidth: 300
placeholderText: qsTr("Hier Wiederherstellungspasswort eingeben") placeholderText: qsTr("Hier Wiederherstellungspasswort eingeben")
} }
Label
{
text: qsTr("Wiederherstellungspasswort eingeben: ")
}
TextField
{
id: repeatRecoveryPaswordInput
text: ""
echoMode: TextInput.Password
implicitWidth: 300
placeholderText: qsTr("Hier Wiederherstellungspasswort eingeben")
}
} }
} }
} }

View File

@@ -231,6 +231,25 @@ GridLayout
} }
} }
Component
{
id: highlight
Rectangle
{
width: 230; height: 15
color: "lightsteelblue"; radius: 5
y: contactView.currentItem.y
Behavior on y
{
SpringAnimation
{
spring: 3
damping: 0.2
}
}
}
}
Rectangle Rectangle
{ {
id: mainRect id: mainRect
@@ -242,6 +261,7 @@ GridLayout
ListView ListView
{ {
id: contactView id: contactView
implicitHeight: parent.height implicitHeight: parent.height
implicitWidth: parent.width implicitWidth: parent.width
model: contactModel model: contactModel
@@ -249,10 +269,13 @@ GridLayout
highlight: Rectangle { color: "grey"} highlight: Rectangle { color: "grey"}
highlightFollowsCurrentItem: false highlightFollowsCurrentItem: false
onActiveFocusChanged: if(!focus) currentIndex = -1 onActiveFocusChanged: if(!focus) currentIndex = -1
delegate: Item delegate: Item
{ {
width: contactView.width width: contactView.width
height: 15 height: 15
MouseArea MouseArea
{ {
@@ -264,6 +287,7 @@ GridLayout
} }
} }
Row Row
{ {
//spacing: 9 //spacing: 9
@@ -297,6 +321,8 @@ GridLayout
} }
} }
} }
} }
} }
} }

108
Gui/PyqcrmConf.qml Normal file
View File

@@ -0,0 +1,108 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
Item
{
anchors.fill: parent
TabBar
{
id: bar
width: parent.width
TabButton
{
text: qsTr("Benutzer")
}
TabButton
{
text: qsTr("Datenbank")
}
TabButton
{
text: qsTr("Das Unternehmen")
}
TabButton
{
text: qsTr("Sicherung")
}
}
StackLayout
{
id: confContainer
anchors.fill: parent
currentIndex: bar.currentIndex
Item
{
id: userTab
UsersPage
{
id: usersPage
anchors.fill: parent
}
}
Item
{
id: dbTab
DbConfiguration
{
id: dbConf
anchors.fill: parent
}
}
Item
{
id: companyTab
CompanyConf
{
id: companyConf
anchors.fill: parent
}
}
Item
{
id: backup
BackupSettings
{
id: backupSettings
anchors.fill: parent
}
}
}
RowLayout
{
width: parent.width
anchors.bottom: parent.bottom
Item
{
Layout.fillWidth: true
}
Button
{
text: qsTr("Ablehnen")
onClicked: appLoader.source = "Dashboard.qml"
}
Button
{
text: qsTr("Speichern")
onClicked:
{
switch (confContainer.currentIndex)
{
case 1:
console.log("Need to update DB paramenters")
break
case 2:
console.log("Need to update company's info.")
break
default:
console.log("Need to handle users")
}
}
}
}
}

View File

@@ -178,8 +178,15 @@ RowLayout
id: mainMenu id: mainMenu
MenuItem MenuItem
{ {
text: qsTr("Benutzer-Verwaltung") //text: qsTr("Benutzer-Verwaltung")
onTriggered: appLoader.source = "UsersPage.qml" //onTriggered: appLoader.source = "UsersPage.qml"
text: qsTr("Einstellungen")
onTriggered:
{
// TODO: Check if logged-in user is admin first!!
appLoader.source = "PyqcrmConf.qml"
}
} }
MenuSeparator {} MenuSeparator {}
MenuItem { text: qsTr("Als PDF exportieren") } MenuItem { text: qsTr("Als PDF exportieren") }

View File

@@ -4,6 +4,7 @@ import QtQuick.Controls
Item Item
{ {
property string name: "users"
anchors.fill: parent anchors.fill: parent
Label Label

View File

@@ -12,6 +12,7 @@ ApplicationWindow
visible: true visible: true
title: "PYQCRM" title: "PYQCRM"
property string confile: "" property string confile: ""
property alias settingsFileDialog: settingsFiledialog
TopBar TopBar
{ {
@@ -80,12 +81,13 @@ ApplicationWindow
anchors.centerIn: parent anchors.centerIn: parent
standardButtons: Dialog.Yes | Dialog.No standardButtons: Dialog.Yes | Dialog.No
onAccepted: settingsFiledialog.open() onAccepted: settingsFiledialog.open()
onRejected: appLoader.source= "firststart.qml" onRejected: appLoader.source= "Firststart.qml"
title: qsTr("Einstellungen importieren") title: qsTr("Einstellungen importieren")
} }
FileDialog FileDialog
{ {
id: settingsFiledialog id: settingsFiledialog
title: qsTr("PYQCRM Einstellungen") title: qsTr("PYQCRM Einstellungen")
currentFolder: StandardPaths.standardLocations(StandardPaths.DocumentsLocation)[0] currentFolder: StandardPaths.standardLocations(StandardPaths.DocumentsLocation)[0]

1
enc_key_backup.txt Normal file
View File

@@ -0,0 +1 @@
Lj30yFOP7hJmY5Cub1Go8fJz0UE+Zyo9cEqNxfY23Sc=

View File

@@ -20,7 +20,7 @@ class Vermasseln:
return storable_data return storable_data
def entschluesseln(self, data, local= True): def entschluesseln(self, data, local = True):
try: try:
data_list = data.split(".") data_list = data.split(".")
encoded_data = [b64decode(x) for x in data_list] encoded_data = [b64decode(x) for x in data_list]
@@ -37,7 +37,7 @@ class Vermasseln:
return decrypted_data return decrypted_data
def __vermasslungsKobold(self, local= True): def __vermasslungsKobold(self, local = True):
key = platform.processor().encode("utf-8") if local else b"(==daniishtverhaftetwegensexy#)" key = platform.processor().encode("utf-8") if local else b"(==daniishtverhaftetwegensexy#)"
key = key[0:31] key = key[0:31]
hash_key = SHA256.new(key) hash_key = SHA256.new(key)

View File

@@ -1,24 +0,0 @@
<RCC>
<qresource prefix="/">
<file>qtquickcontrols2.conf</file>
<file>images/add.svg</file>
<file>images/addbusiness.svg</file>
<file>images/addperson.svg</file>
<file>images/filter.svg</file>
<file>images/menu.svg</file>
<file>images/search.svg</file>
<file>sounds/error.ogg</file>
<file>sounds/fail2c.ogg</file>
<file>sounds/puzzerr.ogg</file>
<file>sounds/sysnotify.ogg</file>
<file>sounds/wrong.ogg</file>
<file>fonts/Damarwulan.ttf</file>
<file>fonts/HelloStranger.otf</file>
<file>fonts/HussarPrintA.otf</file>
<file>fonts/LittleBirdsRegular.ttf</file>
<file>fonts/ReginaldScript.ttf</file>
<file>images/account.svg</file>
<file>README</file>
<file>LICENSE</file>
</qresource>
</RCC>

46
qml.qrc
View File

@@ -1,46 +0,0 @@
<RCC>
<qresource prefix="/">
<file>Gui/TopBar.qml</file>
<file>Gui/AdminUserConfig.qml</file>
<file>Gui/EncryptionKey.qml</file>
<file>Gui/DbConfiguration.qml</file>
<file>Gui/LoginScreen.qml</file>
<file>Gui/AddContact.qml</file>
<file>Gui/AddCustomer.qml</file>
<file>Gui/CustomerTable.qml</file>
<file>Gui/Dashboard.qml</file>
<file>Gui/EmployeeTable.qml</file>
<file>Gui/firststart.qml</file>
<file>Gui/main.qml</file>
<file>Gui/SearchBar.qml</file>
<file>js/qmldict.js</file>
<file>Gui/CustomerView.qml</file>
<file>Gui/NoDbConnection.qml</file>
<file>Gui/Notifications.qml</file>
<file>Gui/ObjectTable.qml</file>
<file>Gui/AddObject.qml</file>
<file>Gui/ObjectView.qml</file>
<file>Gui/ObjectAddOns.qml</file>
<file>Gui/ObjectAddOnContactPerson.qml</file>
<file>Gui/ObjectAddOnEmployee.qml</file>
<file>Gui/AddObjectEmployee.qml</file>
<file>Gui/AddApplicant.qml</file>
<file>Gui/ApplicantPersonalData.qml</file>
<file>Gui/ApplicantBankData.qml</file>
<file>Gui/ApplicantNationalInsurance.qml</file>
<file>Gui/ApplicantVarious.qml</file>
<file>Gui/CustomersTable.qml</file>
<file>Gui/CustomerDetails.qml</file>
<file>Gui/ObjectsTable.qml</file>
<file>Gui/EmployeesTable.qml</file>
<file>Gui/EmployeeDetails.qml</file>
<file>Gui/ObjectDetails.qml</file>
<file>Gui/AddNewObject.qml</file>
<file>Gui/PrinterDialog.qml</file>
<file>Gui/CustomerContactDetails.qml</file>
<file>Gui/NoCustomerContact.qml</file>
<file>Gui/CustomerDetailsView.qml</file>
<file>Gui/ReadMe.qml</file>
<file>Gui/UsersPage.qml</file>
</qresource>
</RCC>