Configuration menu entry
This commit is contained in:
17
Gui/CompanyConf.qml
Normal file
17
Gui/CompanyConf.qml
Normal 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
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -161,6 +161,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
|
||||||
{
|
{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
@@ -170,16 +189,36 @@ GridLayout
|
|||||||
ListView
|
ListView
|
||||||
{
|
{
|
||||||
id: contactView
|
id: contactView
|
||||||
implicitHeight: parent.height
|
implicitHeight: 500
|
||||||
|
implicitWidth: parent.width
|
||||||
model: contactModel
|
model: contactModel
|
||||||
|
|
||||||
|
|
||||||
header: headline
|
header: headline
|
||||||
|
|
||||||
|
highlight: highlight
|
||||||
|
|
||||||
|
highlightFollowsCurrentItem: true
|
||||||
|
focus: true
|
||||||
|
|
||||||
delegate: Item
|
delegate: Item
|
||||||
{
|
{
|
||||||
width: parent.width
|
//width: parent.width
|
||||||
|
width: contactView.width
|
||||||
height: 15
|
height: 15
|
||||||
|
|
||||||
|
MouseArea
|
||||||
|
{
|
||||||
|
id: clickedRow
|
||||||
|
anchors.fill: parent
|
||||||
|
onClicked:
|
||||||
|
{
|
||||||
|
//var currentIndex = index
|
||||||
|
console.log(index)
|
||||||
|
console.log(contactView.currentItem.y)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Row
|
Row
|
||||||
{
|
{
|
||||||
//spacing: 9
|
//spacing: 9
|
||||||
@@ -203,6 +242,8 @@ GridLayout
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
95
Gui/PyqcrmConf.qml
Normal file
95
Gui/PyqcrmConf.qml
Normal file
@@ -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")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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") }
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import QtQuick.Controls
|
|||||||
|
|
||||||
Item
|
Item
|
||||||
{
|
{
|
||||||
|
property string name: "users"
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
Label
|
Label
|
||||||
|
|||||||
2
qml.qrc
2
qml.qrc
@@ -42,5 +42,7 @@
|
|||||||
<file>Gui/CustomerDetailsView.qml</file>
|
<file>Gui/CustomerDetailsView.qml</file>
|
||||||
<file>Gui/ReadMe.qml</file>
|
<file>Gui/ReadMe.qml</file>
|
||||||
<file>Gui/UsersPage.qml</file>
|
<file>Gui/UsersPage.qml</file>
|
||||||
|
<file>Gui/PyqcrmConf.qml</file>
|
||||||
|
<file>Gui/CompanyConf.qml</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|||||||
Reference in New Issue
Block a user