Merge branch 'style' into schnacke
merge mit style
This commit is contained in:
17
.idea/QtSettings.xml
generated
Normal file
17
.idea/QtSettings.xml
generated
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="QtSettings">
|
||||||
|
<option name="mySettingsPerProfile">
|
||||||
|
<map>
|
||||||
|
<entry key="">
|
||||||
|
<value>
|
||||||
|
<PerProfileState>
|
||||||
|
<option name="myCustomQmlPath" value="/opt/homebrew/share/qt/qml" />
|
||||||
|
<option name="myCustomQtBinPath" value="/opt/homebrew/bin" />
|
||||||
|
</PerProfileState>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
</map>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
5
.idea/codeStyles/codeStyleConfig.xml
generated
Normal file
5
.idea/codeStyles/codeStyleConfig.xml
generated
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<component name="ProjectCodeStyleConfiguration">
|
||||||
|
<state>
|
||||||
|
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
|
||||||
|
</state>
|
||||||
|
</component>
|
||||||
17
.idea/qmlSettings.xml
generated
Normal file
17
.idea/qmlSettings.xml
generated
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="QmlSettings">
|
||||||
|
<option name="mySettingsPerProfile">
|
||||||
|
<map>
|
||||||
|
<entry key="">
|
||||||
|
<value>
|
||||||
|
<PerProfileState>
|
||||||
|
<option name="myLSPEnabled" value="true" />
|
||||||
|
<option name="myQmlFormatEnabled" value="true" />
|
||||||
|
</PerProfileState>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
</map>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
17
.idea/runConfigurations/Compile_pyqcrm_qrc.xml
generated
Normal file
17
.idea/runConfigurations/Compile_pyqcrm_qrc.xml
generated
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="Compile pyqcrm.qrc" type="ShConfigurationType">
|
||||||
|
<option name="SCRIPT_TEXT" value=".venv/bin/pyside6-rcc -o rc_pyqcrm.py pyqcrm.qrc" />
|
||||||
|
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
|
||||||
|
<option name="SCRIPT_PATH" value=".venv/bin/pyside6-rcc" />
|
||||||
|
<option name="SCRIPT_OPTIONS" value="-o rc_qml.py qml.qrc" />
|
||||||
|
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
|
||||||
|
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||||
|
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
|
||||||
|
<option name="INTERPRETER_PATH" value="/bin/zsh" />
|
||||||
|
<option name="INTERPRETER_OPTIONS" value="" />
|
||||||
|
<option name="EXECUTE_IN_TERMINAL" value="false" />
|
||||||
|
<option name="EXECUTE_SCRIPT_FILE" value="false" />
|
||||||
|
<envs />
|
||||||
|
<method v="2" />
|
||||||
|
</configuration>
|
||||||
|
</component>
|
||||||
17
.idea/runConfigurations/Compile_qml_qrc.xml
generated
Normal file
17
.idea/runConfigurations/Compile_qml_qrc.xml
generated
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="Compile qml.qrc" type="ShConfigurationType">
|
||||||
|
<option name="SCRIPT_TEXT" value=".venv/bin/pyside6-rcc -o rc_qml.py qml.qrc" />
|
||||||
|
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
|
||||||
|
<option name="SCRIPT_PATH" value=".venv/bin/pyside6-rcc" />
|
||||||
|
<option name="SCRIPT_OPTIONS" value="-o rc_qml.py qml.qrc" />
|
||||||
|
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
|
||||||
|
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||||
|
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
|
||||||
|
<option name="INTERPRETER_PATH" value="/bin/zsh" />
|
||||||
|
<option name="INTERPRETER_OPTIONS" value="" />
|
||||||
|
<option name="EXECUTE_IN_TERMINAL" value="false" />
|
||||||
|
<option name="EXECUTE_SCRIPT_FILE" value="false" />
|
||||||
|
<envs />
|
||||||
|
<method v="2" />
|
||||||
|
</configuration>
|
||||||
|
</component>
|
||||||
31
.idea/runConfigurations/main.xml
generated
Normal file
31
.idea/runConfigurations/main.xml
generated
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="main" type="PythonConfigurationType" factoryName="Python" nameIsGenerated="true">
|
||||||
|
<module name="pyqcrm" />
|
||||||
|
<option name="INTERPRETER_OPTIONS" value="" />
|
||||||
|
<option name="PARENT_ENVS" value="true" />
|
||||||
|
<envs>
|
||||||
|
<env name="PYTHONUNBUFFERED" value="1" />
|
||||||
|
<env name="QT_LOGGING_RULES" value="*.debug=true; qt.*.debug=false" />
|
||||||
|
<env name="QT_LOGGING_TO_CONSOLE" value="1" />
|
||||||
|
<env name="QT_QML_DEBUG" value="1" />
|
||||||
|
</envs>
|
||||||
|
<option name="SDK_HOME" value="" />
|
||||||
|
<option name="SDK_NAME" value="Python 3.12 (pyqcrm)" />
|
||||||
|
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||||
|
<option name="IS_MODULE_SDK" value="false" />
|
||||||
|
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||||
|
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||||
|
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
||||||
|
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/main.py" />
|
||||||
|
<option name="PARAMETERS" value="" />
|
||||||
|
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||||
|
<option name="EMULATE_TERMINAL" value="false" />
|
||||||
|
<option name="MODULE_MODE" value="false" />
|
||||||
|
<option name="REDIRECT_INPUT" value="false" />
|
||||||
|
<option name="INPUT_FILE" value="" />
|
||||||
|
<method v="2">
|
||||||
|
<option name="RunConfigurationTask" enabled="true" run_configuration_name="Compile qml.qrc" run_configuration_type="ShConfigurationType" />
|
||||||
|
<option name="RunConfigurationTask" enabled="true" run_configuration_name="Compile pyqcrm.qrc" run_configuration_type="ShConfigurationType" />
|
||||||
|
</method>
|
||||||
|
</configuration>
|
||||||
|
</component>
|
||||||
45
.idea/watcherTasks.xml
generated
45
.idea/watcherTasks.xml
generated
@@ -1,45 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectTasksOptions">
|
|
||||||
<TaskOptions isEnabled="true">
|
|
||||||
<option name="arguments" value="-o rc_qml.py qml.qrc" />
|
|
||||||
<option name="checkSyntaxErrors" value="true" />
|
|
||||||
<option name="description" />
|
|
||||||
<option name="exitCodeBehavior" value="ERROR" />
|
|
||||||
<option name="fileExtension" value="qml" />
|
|
||||||
<option name="immediateSync" value="true" />
|
|
||||||
<option name="name" value="qml.qrc" />
|
|
||||||
<option name="output" value="" />
|
|
||||||
<option name="outputFilters">
|
|
||||||
<array />
|
|
||||||
</option>
|
|
||||||
<option name="outputFromStdout" value="false" />
|
|
||||||
<option name="program" value="$PROJECT_DIR$/.venv/bin/pyside6-rcc" />
|
|
||||||
<option name="runOnExternalChanges" value="true" />
|
|
||||||
<option name="scopeName" value="Project Files" />
|
|
||||||
<option name="trackOnlyRoot" value="false" />
|
|
||||||
<option name="workingDir" value="$PROJECT_DIR$" />
|
|
||||||
<envs />
|
|
||||||
</TaskOptions>
|
|
||||||
<TaskOptions isEnabled="true">
|
|
||||||
<option name="arguments" value="-o rc_pyqcrm.py pyqcrm.qrc" />
|
|
||||||
<option name="checkSyntaxErrors" value="true" />
|
|
||||||
<option name="description" />
|
|
||||||
<option name="exitCodeBehavior" value="ERROR" />
|
|
||||||
<option name="fileExtension" value="qml" />
|
|
||||||
<option name="immediateSync" value="true" />
|
|
||||||
<option name="name" value="pyqcrm.qrc" />
|
|
||||||
<option name="output" value="" />
|
|
||||||
<option name="outputFilters">
|
|
||||||
<array />
|
|
||||||
</option>
|
|
||||||
<option name="outputFromStdout" value="false" />
|
|
||||||
<option name="program" value="$PROJECT_DIR$/.venv/bin/pyside6-rcc" />
|
|
||||||
<option name="runOnExternalChanges" value="true" />
|
|
||||||
<option name="scopeName" value="Project Files" />
|
|
||||||
<option name="trackOnlyRoot" value="false" />
|
|
||||||
<option name="workingDir" value="$PROJECT_DIR$" />
|
|
||||||
<envs />
|
|
||||||
</TaskOptions>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
@@ -66,8 +66,6 @@ ColumnLayout
|
|||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
text: qsTr("PLZ")
|
text: qsTr("PLZ")
|
||||||
// font.pixelSize: 57
|
|
||||||
// font.bold: true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ComboBox
|
ComboBox
|
||||||
|
|||||||
@@ -3,226 +3,138 @@ import QtQuick
|
|||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Dialogs
|
import QtQuick.Dialogs
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
|
import TeroStyle
|
||||||
|
|
||||||
|
Item {
|
||||||
Item
|
|
||||||
{
|
|
||||||
property string recpass: ""
|
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.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
|
Label {
|
||||||
{
|
font: Typography.h1
|
||||||
id: helloStranger
|
text: qsTr("Login")
|
||||||
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
|
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
color: "yellow"
|
Layout.bottomMargin: Dimensions.l
|
||||||
}
|
}
|
||||||
|
|
||||||
Item
|
Field {
|
||||||
{
|
label: qsTr("Benutzername")
|
||||||
height: 25
|
|
||||||
}
|
|
||||||
|
|
||||||
RowLayout
|
TextField {
|
||||||
{
|
|
||||||
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
|
|
||||||
{
|
|
||||||
id: benutzerName
|
id: benutzerName
|
||||||
placeholderText: qsTr ("Benutzernamen eingeben")
|
|
||||||
implicitWidth: 300
|
|
||||||
font: hussarPrint.font
|
|
||||||
focus: true
|
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
|
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
|
echoMode: TextInput.Password
|
||||||
onAccepted:
|
implicitWidth: 300
|
||||||
{
|
placeholderText: qsTr("Passwort eingeben")
|
||||||
|
|
||||||
|
onAccepted: {
|
||||||
if (benutzerName.text.trim() && passwort.text.trim())
|
if (benutzerName.text.trim() && passwort.text.trim())
|
||||||
loggedin_user.login(benutzerName.text.trim(), passwort.text)
|
loggedin_user.login(benutzerName.text.trim(), passwort.text);
|
||||||
else if(passwort.text.trim()) benutzerName.forceActiveFocus()
|
else if (passwort.text.trim())
|
||||||
|
benutzerName.forceActiveFocus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout
|
Button {
|
||||||
{
|
Layout.topMargin: Dimensions.m
|
||||||
Layout.preferredWidth: 465
|
text: qsTr("Login")
|
||||||
Layout.alignment: Qt.AlignHCenter
|
width: parent.width
|
||||||
|
|
||||||
Button
|
onClicked: {
|
||||||
{
|
if (benutzerName.text.trim() && passwort.text.trim())
|
||||||
text: qsTr ("Feierabend für heute!")
|
loggedin_user.login(benutzerName.text.trim(), passwort.text);
|
||||||
Layout.alignment: Qt.AlignRight
|
|
||||||
font: reginaldScript.font
|
|
||||||
onClicked:
|
|
||||||
{
|
|
||||||
if (benutzerName.text.trim() && passwort.text.trim())
|
|
||||||
loggedin_user.login(benutzerName.text.trim(), passwort.text)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Item {
|
||||||
Item
|
|
||||||
{
|
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Dialog {
|
||||||
Dialog
|
|
||||||
{
|
|
||||||
id: recoveryPaswordDialog
|
id: recoveryPaswordDialog
|
||||||
modal: true
|
|
||||||
title: qsTr("Wiederherstellung")
|
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
modal: true
|
||||||
standardButtons: Dialog.Ok | Dialog.Cancel
|
standardButtons: Dialog.Ok | Dialog.Cancel
|
||||||
onAccepted:
|
title: qsTr("Wiederherstellung")
|
||||||
{
|
|
||||||
recpass = recoveryPaswordInput.text
|
onAccepted: {
|
||||||
getRecoveryDialog.open()
|
recpass = recoveryPaswordInput.text;
|
||||||
|
getRecoveryDialog.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
ColumnLayout
|
ColumnLayout {
|
||||||
{
|
RowLayout {
|
||||||
RowLayout
|
Label {
|
||||||
{
|
|
||||||
Label
|
|
||||||
{
|
|
||||||
text: qsTr("Wiederherstellungspasswort eingeben: ")
|
text: qsTr("Wiederherstellungspasswort eingeben: ")
|
||||||
}
|
}
|
||||||
|
TextField {
|
||||||
TextField
|
|
||||||
{
|
|
||||||
id: recoveryPaswordInput
|
id: recoveryPaswordInput
|
||||||
text: ""
|
|
||||||
echoMode: TextInput.Password
|
echoMode: TextInput.Password
|
||||||
implicitWidth: 300
|
implicitWidth: 300
|
||||||
placeholderText: qsTr("Hier Wiederherstellungspasswort eingeben")
|
placeholderText: qsTr("Hier Wiederherstellungspasswort eingeben")
|
||||||
|
text: ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
FileDialog {
|
||||||
FileDialog
|
|
||||||
{
|
|
||||||
id: getRecoveryDialog
|
id: getRecoveryDialog
|
||||||
title: qsTr("Wiederherstellungsdatei")
|
|
||||||
|
currentFolder: StandardPaths.standardLocations(StandardPaths.DocumentsLocation)[0]
|
||||||
fileMode: FileDialog.OpenFile
|
fileMode: FileDialog.OpenFile
|
||||||
nameFilters: ["PYQCRM Recovery files (*.pyqrec)"]
|
nameFilters: ["PYQCRM Recovery files (*.pyqrec)"]
|
||||||
currentFolder: StandardPaths.standardLocations(StandardPaths.DocumentsLocation)[0]
|
title: qsTr("Wiederherstellungsdatei")
|
||||||
|
|
||||||
onAccepted: config.getRecoveryKey(getRecoveryDialog.currentFile, recpass)
|
onAccepted: config.getRecoveryKey(getRecoveryDialog.currentFile, recpass)
|
||||||
onRejected: quit()
|
onRejected: quit()
|
||||||
}
|
}
|
||||||
Notifications
|
Notifications {
|
||||||
{
|
|
||||||
id: oschkar
|
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()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,12 +6,13 @@ import QtCore
|
|||||||
|
|
||||||
ApplicationWindow
|
ApplicationWindow
|
||||||
{
|
{
|
||||||
//property alias appLoader: appLoader
|
|
||||||
id: appWindow
|
id: appWindow
|
||||||
width: Screen.width * .75
|
width: Screen.width * .75
|
||||||
height: Screen.height * .85
|
height: Screen.height * .85
|
||||||
visible: true
|
visible: true
|
||||||
title: "PYQCRM"
|
title: "TERO Personal"
|
||||||
|
font: Typography.body
|
||||||
|
color: Colors.mantle
|
||||||
property string confile: ""
|
property string confile: ""
|
||||||
property alias settingsFileDialog: settingsFiledialog
|
property alias settingsFileDialog: settingsFiledialog
|
||||||
|
|
||||||
|
|||||||
30
TeroStyle/Button.qml
Normal file
30
TeroStyle/Button.qml
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Templates as T
|
||||||
|
|
||||||
|
T.Button {
|
||||||
|
id: control
|
||||||
|
|
||||||
|
implicitHeight: implicitContentHeight
|
||||||
|
implicitWidth: contentItem.width
|
||||||
|
|
||||||
|
background: Rectangle {
|
||||||
|
color: Colors.primary
|
||||||
|
radius: Dimensions.radius
|
||||||
|
}
|
||||||
|
contentItem: Text {
|
||||||
|
color: Colors.foreground
|
||||||
|
font: control.font
|
||||||
|
padding: Dimensions.s + 2
|
||||||
|
text: control.text
|
||||||
|
// Make sure the button is at least wide enough to be comfortably clickable
|
||||||
|
width: Math.max(implicitWidth, 120)
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
id: mouseArea
|
||||||
|
anchors.fill: parent
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
onPressed: (mouse) => mouse.accepted = false
|
||||||
|
}
|
||||||
|
}
|
||||||
19
TeroStyle/Colors.qml
Normal file
19
TeroStyle/Colors.qml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
pragma Singleton
|
||||||
|
|
||||||
|
import QtQuick
|
||||||
|
|
||||||
|
QtObject {
|
||||||
|
readonly property int dark: 0
|
||||||
|
readonly property int light: 1
|
||||||
|
|
||||||
|
property int theme: dark
|
||||||
|
|
||||||
|
readonly property color primary: "#b81a34"
|
||||||
|
readonly property color foreground: theme === dark ? "#fdfdfd" : "#110b0c"
|
||||||
|
readonly property color background: theme === dark ? "#303136" : "#eff1f5"
|
||||||
|
readonly property color mantle: theme === dark ? "#1e1f22" : "#e7e9ef"
|
||||||
|
readonly property color interactive: theme === dark ? "#878b97" : "#d9d9da"
|
||||||
|
readonly property color error: theme === dark ? "#ff2264" : "#ff004b"
|
||||||
|
|
||||||
|
readonly property double highlightOpacity: .3
|
||||||
|
}
|
||||||
75
TeroStyle/ComboBox.qml
Normal file
75
TeroStyle/ComboBox.qml
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Templates as T
|
||||||
|
import QtQuick.Controls
|
||||||
|
|
||||||
|
T.ComboBox {
|
||||||
|
id: control
|
||||||
|
|
||||||
|
font: Typography.body
|
||||||
|
implicitHeight: background.height
|
||||||
|
padding: Dimensions.m
|
||||||
|
|
||||||
|
background: Rectangle {
|
||||||
|
border.color: Colors.interactive
|
||||||
|
border.width: 1
|
||||||
|
color: Colors.mantle
|
||||||
|
height: 47
|
||||||
|
radius: Dimensions.radius
|
||||||
|
}
|
||||||
|
|
||||||
|
delegate: T.ItemDelegate {
|
||||||
|
width: control.width
|
||||||
|
height: implicitContentHeight + topPadding + bottomPadding
|
||||||
|
padding: Dimensions.s
|
||||||
|
leftPadding: control.leftPadding
|
||||||
|
contentItem: Label {
|
||||||
|
text: control.textRole ? model[control.textRole] : modelData
|
||||||
|
color: Colors.foreground
|
||||||
|
elide: Text.ElideRight
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
}
|
||||||
|
highlighted: control.highlightedIndex === index
|
||||||
|
}
|
||||||
|
indicator: Label {
|
||||||
|
x: control.width - width
|
||||||
|
height: control.height
|
||||||
|
width: contentWidth + Dimensions.s * 2
|
||||||
|
text: "▼"
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
padding: Dimensions.s
|
||||||
|
|
||||||
|
background: Rectangle {
|
||||||
|
anchors.fill: parent
|
||||||
|
color: Colors.primary
|
||||||
|
topRightRadius: Dimensions.radius
|
||||||
|
bottomRightRadius: Dimensions.radius
|
||||||
|
border.color: Colors.interactive
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
popup: T.Popup {
|
||||||
|
y: control.height
|
||||||
|
z: 2
|
||||||
|
width: control.width
|
||||||
|
contentItem: ListView {
|
||||||
|
clip: true
|
||||||
|
implicitHeight: contentHeight
|
||||||
|
model: control.popup.visible ? control.delegateModel : null
|
||||||
|
currentIndex: control.highlightedIndex
|
||||||
|
|
||||||
|
highlight: Rectangle {
|
||||||
|
color: Colors.primary
|
||||||
|
opacity: Colors.highlightOpacity
|
||||||
|
}
|
||||||
|
|
||||||
|
ScrollIndicator.vertical: ScrollIndicator {}
|
||||||
|
}
|
||||||
|
|
||||||
|
background: Rectangle {
|
||||||
|
color: Colors.mantle
|
||||||
|
border.color: Colors.interactive
|
||||||
|
radius: Dimensions.radius
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
25
TeroStyle/Dimensions.qml
Normal file
25
TeroStyle/Dimensions.qml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
pragma Singleton
|
||||||
|
|
||||||
|
import QtQuick
|
||||||
|
|
||||||
|
QtObject {
|
||||||
|
/**
|
||||||
|
* Distance for objects that are tied to each other,
|
||||||
|
* e.g. a field and its label.
|
||||||
|
*/
|
||||||
|
readonly property int s: 9
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Distance for objects that are grouped together, e.g. radio buttons of the
|
||||||
|
* same radio group.
|
||||||
|
*/
|
||||||
|
readonly property int m: 15
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Distance for objects that are not related to each other, or to objects
|
||||||
|
* and their container.
|
||||||
|
*/
|
||||||
|
readonly property int l: 30
|
||||||
|
|
||||||
|
readonly property int radius: 4
|
||||||
|
}
|
||||||
13
TeroStyle/Field.qml
Normal file
13
TeroStyle/Field.qml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Layouts
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
required property string label
|
||||||
|
spacing: Dimensions.s
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: label
|
||||||
|
font: Typography.body
|
||||||
|
}
|
||||||
|
}
|
||||||
20
TeroStyle/TextField.qml
Normal file
20
TeroStyle/TextField.qml
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Templates as T
|
||||||
|
|
||||||
|
T.TextField {
|
||||||
|
id: control
|
||||||
|
background: Rectangle {
|
||||||
|
id: background
|
||||||
|
color: Colors.mantle
|
||||||
|
radius: Dimensions.radius
|
||||||
|
border.width: !control.focus ? 1 : 2
|
||||||
|
border.color: Colors.interactive
|
||||||
|
height: 47
|
||||||
|
}
|
||||||
|
|
||||||
|
color: Colors.foreground
|
||||||
|
implicitHeight: background.height
|
||||||
|
placeholderTextColor: Colors.interactive
|
||||||
|
font: Typography.body
|
||||||
|
padding: Dimensions.m
|
||||||
|
}
|
||||||
26
TeroStyle/Typography.qml
Normal file
26
TeroStyle/Typography.qml
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
pragma Singleton
|
||||||
|
|
||||||
|
import QtCore
|
||||||
|
import QtQuick
|
||||||
|
|
||||||
|
Item {
|
||||||
|
readonly property FontLoader robotoCondensed: FontLoader {
|
||||||
|
source: "qrc:/fonts/RobotoCondensed.otf"
|
||||||
|
}
|
||||||
|
|
||||||
|
readonly property font body: ({
|
||||||
|
family: robotoCondensed.font,
|
||||||
|
pointSize: 16,
|
||||||
|
weight: Font.Medium,
|
||||||
|
letterSpacing: 0,
|
||||||
|
kerning: true,
|
||||||
|
})
|
||||||
|
|
||||||
|
readonly property font h1: ({
|
||||||
|
family: body.family,
|
||||||
|
pointSize: 38,
|
||||||
|
weight: body.weight,
|
||||||
|
letterSpacing: body.letterSpacing,
|
||||||
|
kerning: body.kerning,
|
||||||
|
})
|
||||||
|
}
|
||||||
8
TeroStyle/qmldir
Normal file
8
TeroStyle/qmldir
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
module TeroStyle
|
||||||
|
singleton Colors Colors.qml
|
||||||
|
singleton Dimensions Dimensions.qml
|
||||||
|
singleton Typography Typography.qml
|
||||||
|
Button Button.qml
|
||||||
|
ComboBox ComboBox.qml
|
||||||
|
Field Field.qml
|
||||||
|
TextField TextField.qml
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
fonts/RobotoCondensed.otf
Normal file
BIN
fonts/RobotoCondensed.otf
Normal file
Binary file not shown.
15
main.py
15
main.py
@@ -6,7 +6,7 @@ from PySide6.QtNetwork import QLocalServer, QLocalSocket
|
|||||||
from PySide6.QtWidgets import QSystemTrayIcon
|
from PySide6.QtWidgets import QSystemTrayIcon
|
||||||
from PySide6.QtGui import QGuiApplication, QIcon
|
from PySide6.QtGui import QGuiApplication, QIcon
|
||||||
from PySide6.QtQml import QQmlApplicationEngine
|
from PySide6.QtQml import QQmlApplicationEngine
|
||||||
from PySide6.QtCore import QIODevice #, QResource
|
from PySide6.QtCore import QIODevice
|
||||||
from lib.ConfigLoader import ConfigLoader
|
from lib.ConfigLoader import ConfigLoader
|
||||||
from lib.DB.BusinessModel import BusinessModel
|
from lib.DB.BusinessModel import BusinessModel
|
||||||
import rc_pyqcrm
|
import rc_pyqcrm
|
||||||
@@ -20,7 +20,6 @@ from lib.DB.EmployeeModel import EmployeeModel
|
|||||||
from lib.DB.ObjectModel import ObjectModel
|
from lib.DB.ObjectModel import ObjectModel
|
||||||
from lib.Printers import Printers
|
from lib.Printers import Printers
|
||||||
|
|
||||||
|
|
||||||
os.environ['QML_XHR_ALLOW_FILE_READ'] = '1'
|
os.environ['QML_XHR_ALLOW_FILE_READ'] = '1'
|
||||||
|
|
||||||
# [pyqcrm]
|
# [pyqcrm]
|
||||||
@@ -47,6 +46,7 @@ object_model = None
|
|||||||
printers = None
|
printers = None
|
||||||
user = None
|
user = None
|
||||||
|
|
||||||
|
|
||||||
def initializeProgram():
|
def initializeProgram():
|
||||||
print(f"In {__file__} file, initializeProgram()")
|
print(f"In {__file__} file, initializeProgram()")
|
||||||
global address_model, bad_config, business_model, user, business_type, contact_model, employee_model, object_model, db_con, printers
|
global address_model, bad_config, business_model, user, business_type, contact_model, employee_model, object_model, db_con, printers
|
||||||
@@ -65,6 +65,7 @@ def initializeProgram():
|
|||||||
object_model = ObjectModel()
|
object_model = ObjectModel()
|
||||||
publishContext()
|
publishContext()
|
||||||
|
|
||||||
|
|
||||||
def configReady():
|
def configReady():
|
||||||
global bad_config
|
global bad_config
|
||||||
bad_config = False
|
bad_config = False
|
||||||
@@ -82,12 +83,11 @@ def publishContext():
|
|||||||
engine.rootContext().setContextProperty("employee_model", employee_model)
|
engine.rootContext().setContextProperty("employee_model", employee_model)
|
||||||
engine.rootContext().setContextProperty("object_model", object_model)
|
engine.rootContext().setContextProperty("object_model", object_model)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
#QResource.registerResource("rc_qml.py")
|
|
||||||
app = QGuiApplication(sys.argv)
|
app = QGuiApplication(sys.argv)
|
||||||
engine = QQmlApplicationEngine()
|
engine = QQmlApplicationEngine()
|
||||||
|
|
||||||
|
|
||||||
pyq_sok = QLocalSocket()
|
pyq_sok = QLocalSocket()
|
||||||
pyq_sok.connectToServer("PYQCRM_INSTANCE", QIODevice.ReadOnly)
|
pyq_sok.connectToServer("PYQCRM_INSTANCE", QIODevice.ReadOnly)
|
||||||
|
|
||||||
@@ -100,9 +100,7 @@ if __name__ == "__main__":
|
|||||||
pyq_server = QLocalServer()
|
pyq_server = QLocalServer()
|
||||||
pyq_server.listen("PYQCRM_INSTANCE")
|
pyq_server.listen("PYQCRM_INSTANCE")
|
||||||
|
|
||||||
engine.addImportPath("qrc:/");
|
engine.addImportPath("qrc:/")
|
||||||
|
|
||||||
# qml_file = Path(__file__).resolve().parent / "Gui/main.qml"
|
|
||||||
|
|
||||||
qml_file = "qrc:/Gui/main.qml"
|
qml_file = "qrc:/Gui/main.qml"
|
||||||
|
|
||||||
@@ -123,13 +121,12 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
engine.rootContext().setContextProperty("config", config)
|
engine.rootContext().setContextProperty("config", config)
|
||||||
engine.rootContext().setContextProperty("sys_printers", printers)
|
engine.rootContext().setContextProperty("sys_printers", printers)
|
||||||
engine.rootContext().setContextProperty("bad_config", bad_config) # print(f"Fehler: {i}")
|
engine.rootContext().setContextProperty("bad_config", bad_config)
|
||||||
engine.rootContext().setContextProperty("db_con", db_con)
|
engine.rootContext().setContextProperty("db_con", db_con)
|
||||||
engine.rootContext().setContextProperty("systray", tray)
|
engine.rootContext().setContextProperty("systray", tray)
|
||||||
|
|
||||||
engine.load(qml_file)
|
engine.load(qml_file)
|
||||||
|
|
||||||
|
|
||||||
if not engine.rootObjects():
|
if not engine.rootObjects():
|
||||||
sys.exit(-1)
|
sys.exit(-1)
|
||||||
sys.exit(app.exec())
|
sys.exit(app.exec())
|
||||||
|
|||||||
@@ -12,11 +12,7 @@
|
|||||||
<file>sounds/puzzerr.ogg</file>
|
<file>sounds/puzzerr.ogg</file>
|
||||||
<file>sounds/sysnotify.ogg</file>
|
<file>sounds/sysnotify.ogg</file>
|
||||||
<file>sounds/wrong.ogg</file>
|
<file>sounds/wrong.ogg</file>
|
||||||
<file>fonts/Damarwulan.ttf</file>
|
<file>fonts/RobotoCondensed.otf</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>images/account.svg</file>
|
||||||
<file>README</file>
|
<file>README</file>
|
||||||
<file>LICENSE</file>
|
<file>LICENSE</file>
|
||||||
|
|||||||
10
qml.qrc
10
qml.qrc
@@ -49,5 +49,15 @@
|
|||||||
<file>Gui/UtilityDialogs.qml</file>
|
<file>Gui/UtilityDialogs.qml</file>
|
||||||
<file>Gui/OffersTable.qml</file>
|
<file>Gui/OffersTable.qml</file>
|
||||||
<file>Gui/OfferTable.qml</file>
|
<file>Gui/OfferTable.qml</file>
|
||||||
|
<file>TeroStyle/Button.qml</file>
|
||||||
|
<file>TeroStyle/Colors.qml</file>
|
||||||
|
<file>TeroStyle/ComboBox.qml</file>
|
||||||
|
<file>TeroStyle/Field.qml</file>
|
||||||
|
<file>TeroStyle/Dimensions.qml</file>
|
||||||
|
<file>TeroStyle/qmldir</file>
|
||||||
|
<file>TeroStyle/TextField.qml</file>
|
||||||
|
<file>TeroStyle/Typography.qml</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
|
<qresource prefix="/TeroStyle"/>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
[Controls]
|
[Controls]
|
||||||
Style=Fusion
|
Style=TeroStyle
|
||||||
|
|||||||
Reference in New Issue
Block a user