diff --git a/Gui/CompanyConf.qml b/Gui/CompanyConf.qml new file mode 100644 index 0000000..52aa97e --- /dev/null +++ b/Gui/CompanyConf.qml @@ -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 + } +} diff --git a/Gui/ObjectAddOnContactPerson.qml b/Gui/ObjectAddOnContactPerson.qml index 7d99aae..0d93195 100644 --- a/Gui/ObjectAddOnContactPerson.qml +++ b/Gui/ObjectAddOnContactPerson.qml @@ -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 { id: mainRect @@ -242,6 +261,7 @@ GridLayout ListView { id: contactView + implicitHeight: parent.height implicitWidth: parent.width model: contactModel @@ -249,10 +269,13 @@ GridLayout highlight: Rectangle { color: "grey"} highlightFollowsCurrentItem: false + onActiveFocusChanged: if(!focus) currentIndex = -1 delegate: Item + { width: contactView.width + height: 15 MouseArea { @@ -264,6 +287,7 @@ GridLayout } } + Row { //spacing: 9 @@ -297,6 +321,8 @@ GridLayout } } } + + } } } diff --git a/Gui/PyqcrmConf.qml b/Gui/PyqcrmConf.qml new file mode 100644 index 0000000..2527b3e --- /dev/null +++ b/Gui/PyqcrmConf.qml @@ -0,0 +1,95 @@ +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") + } + } + + 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 + } + } + } + + 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") + } + } + } + } +} diff --git a/Gui/TopBar.qml b/Gui/TopBar.qml index 758dfb0..16bf968 100644 --- a/Gui/TopBar.qml +++ b/Gui/TopBar.qml @@ -178,8 +178,15 @@ RowLayout id: mainMenu MenuItem { - text: qsTr("Benutzer-Verwaltung") - onTriggered: appLoader.source = "UsersPage.qml" + //text: qsTr("Benutzer-Verwaltung") + //onTriggered: appLoader.source = "UsersPage.qml" + text: qsTr("Einstellungen") + onTriggered: + { + // TODO: Check if logged-in user is admin first!! + + appLoader.source = "PyqcrmConf.qml" + } } MenuSeparator {} MenuItem { text: qsTr("Als PDF exportieren") } diff --git a/Gui/UsersPage.qml b/Gui/UsersPage.qml index 31d8c59..e9a9ec2 100644 --- a/Gui/UsersPage.qml +++ b/Gui/UsersPage.qml @@ -4,6 +4,7 @@ import QtQuick.Controls Item { + property string name: "users" anchors.fill: parent Label diff --git a/enc_key_backup.txt b/enc_key_backup.txt new file mode 100644 index 0000000..a4915d4 --- /dev/null +++ b/enc_key_backup.txt @@ -0,0 +1 @@ +Lj30yFOP7hJmY5Cub1Go8fJz0UE+Zyo9cEqNxfY23Sc= diff --git a/lib/Vermasseln.py b/lib/Vermasseln.py index 7857100..72e3190 100644 --- a/lib/Vermasseln.py +++ b/lib/Vermasseln.py @@ -20,7 +20,7 @@ class Vermasseln: return storable_data - def entschluesseln(self, data, local= True): + def entschluesseln(self, data, local = True): try: data_list = data.split(".") encoded_data = [b64decode(x) for x in data_list] @@ -37,7 +37,7 @@ class Vermasseln: 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 = key[0:31] hash_key = SHA256.new(key) diff --git a/qml.qrc b/qml.qrc index 1e6ca28..7996b66 100644 --- a/qml.qrc +++ b/qml.qrc @@ -42,5 +42,7 @@ Gui/CustomerDetailsView.qml Gui/ReadMe.qml Gui/UsersPage.qml + Gui/PyqcrmConf.qml + Gui/CompanyConf.qml