diff --git a/.gitignore b/.gitignore index 77ad946..e180c1d 100644 --- a/.gitignore +++ b/.gitignore @@ -195,8 +195,6 @@ venv.bak/ # mkdocs documentation /site -.qtcreator/ - # mypy .mypy_cache/ .dmypy.json diff --git a/Programmeinstellungen.qml b/Programmeinstellungen.qml deleted file mode 100644 index 28f34a4..0000000 --- a/Programmeinstellungen.qml +++ /dev/null @@ -1,77 +0,0 @@ -import QtQuick -import QtQuick.Layouts -import QtQuick.Controls - - - -// Item { - -// benutzername -// passwort -// server -// port -// benutzername(db) -// passwort(db) -// DbName -// type - - -// } - -Window -{ - width: 640 - height: 480 - visible: true - GridLayout - { - id: settingsGrid - columns: 2 - anchors.fill: parent - Label - { - text: qsTr("Benutzername:") - - } - TextField - { - id: benutzerName - placeholderText: qsTr("Hier Benutzername eingeben") - } - Label - { - text: qsTr("Passwort:") - - } - TextField - { - id: passWort - placeholderText: qsTr("Hier Passwort eingeben") - } - Label - { - text: qsTr("DB-Host:") - - } - TextField - { - id: dbHost - placeholderText: qsTr("Hier Host eingeben") - } - Label - { - text: qsTr("DB-Name:") - - } - TextField - { - id: dbName - placeholderText: qsTr("Hier DB-Name eingeben") - } - - - - } - - -} diff --git a/main.py b/main.py index 71f1c43..6712e7f 100644 --- a/main.py +++ b/main.py @@ -4,76 +4,13 @@ from pathlib import Path from PySide6.QtGui import QGuiApplication from PySide6.QtQml import QQmlApplicationEngine -from platformdirs import * -import toml - - -# [pyqcrm] -# program-name="" -# version= - -# [database] -# server="" -# port= -# user="" -# password="" -# name="" -# type="" - - -class ConfigLoader: - __config = None - - def __init__(self): - self.config_dir = user_config_dir() + '/pyqcrm' #user_config_dir = Funktion platformdirs - config_dir = Path(self.config_dir) - - config_dir.mkdir(0o027, True, True) - self.__configLoad() - - def __configLoad(self): - - try: - with open (self.config_dir + '/pyqcrm.toml', 'r') as f: - self.__config = toml.load(f) - except FileNotFoundError: - print("Konnte die Konfiguration nicht laden.") - - - def getConfig(self): - - return self.__config - - def createConfig(self): - - with open(self.config_dir + '/pyqcrm.toml', "w") as datei: - datei.write("[pyqcrm]") - - if __name__ == "__main__": app = QGuiApplication(sys.argv) engine = QQmlApplicationEngine() - - # qml_file = Path(__file__).resolve().parent / "main.qml" - # engine.load(qml_file) - - config = ConfigLoader() - - - if config.getConfig(): - try: - print (config.getConfig()['database']['server']) - qml_file = Path(__file__).resolve().parent / "main.qml" - engine.load(qml_file) - except: - print("Ausnahme") - qml_file = Path(__file__).resolve().parent / "Programmeinstellungen.qml" - engine.load(qml_file) - else: - config.createConfig() - + qml_file = Path(__file__).resolve().parent / "main.qml" + engine.load(qml_file) if not engine.rootObjects(): sys.exit(-1) sys.exit(app.exec()) diff --git a/pyqcrm.pyproject b/pyqcrm.pyproject index 8b6f5e8..ab91695 100644 --- a/pyqcrm.pyproject +++ b/pyqcrm.pyproject @@ -1,6 +1,5 @@ { "files": [ - "Programmeinstellungen.qml", "main.py", "main.qml" ] diff --git a/pyqcrm.pyproject.user b/pyqcrm.pyproject.user index 813fbfc..5488a4e 100644 --- a/pyqcrm.pyproject.user +++ b/pyqcrm.pyproject.user @@ -1,10 +1,10 @@ - + EnvironmentId - {39e37ca7-c3e2-4c38-a716-3e864b0bb4d2} + {ef26fdb1-82c6-45b3-a374-8052d24e0ffb} ProjectExplorer.Project.ActiveTarget @@ -69,16 +69,14 @@ true true - false - 0 true true true Builtin.DefaultTidyAndClazy - 6 + 8 true @@ -91,20 +89,18 @@ ProjectExplorer.Project.Target.0 Desktop - Python 3.12.6 - Python 3.12.6 - {2db3a2fc-21bd-4c08-acba-70fdc903d42a} + Python 3.12.7 + Python 3.12.7 + {bdea9678-212b-477e-b193-9ce30dcf3aba} 0 0 0 - C:\Users\gatze\Desktop\pyqcrm\.qtcreator\Python_3_12_6venv + /home/dstoppek/Coden/Projekte/pyqcrm/pyqcrm/.qtcreator/Python_3_12_7venv true Python.PysideBuildStep - C:\Users\gatze\Desktop\pyqcrm\.qtcreator\Python_3_12_6venv\Scripts\pyside6-project.exe - C:\Users\gatze\Desktop\pyqcrm\.qtcreator\Python_3_12_6venv\Scripts\pyside6-uic.exe 1 Erstellen @@ -122,10 +118,10 @@ false - Python 3.12.6 virtuelle Umgebung + Python 3.12.7 virtuelle Umgebung Python.PySideBuildConfiguration - C:/Users/gatze/Desktop/pyqcrm/.qtcreator/Python_3_12_6venv/Scripts/python.exe - C:/Users/gatze/Desktop/pyqcrm/.qtcreator/Python_3_12_6venv + /home/dstoppek/Coden/Projekte/pyqcrm/pyqcrm/.qtcreator/Python_3_12_7venv/bin/python + /home/dstoppek/Coden/Projekte/pyqcrm/pyqcrm/.qtcreator/Python_3_12_7venv 1 @@ -150,15 +146,16 @@ 2 false - -e cpu-cycles --call-graph "dwarf,4096" -F 250 + -e cpu-cycles --call-graph dwarf,4096 -F 250 main.py - PythonEditor.RunConfiguration.C:/Users/gatze/Desktop/pyqcrm/main.py - C:/Users/gatze/Desktop/pyqcrm/main.py - true - C:\Users\gatze\Desktop\pyqcrm\main.py + PythonEditor.RunConfiguration./home/dstoppek/Coden/Projekte/pyqcrm/pyqcrm/main.py + /home/dstoppek/Coden/Projekte/pyqcrm/pyqcrm/main.py + false + /home/dstoppek/Coden/Projekte/pyqcrm/pyqcrm/main.py true true - C:/Users/gatze/Desktop/pyqcrm + /home/dstoppek/Coden/Projekte/pyqcrm/pyqcrm + :0 1 diff --git a/pyqcrm.pyproject.user.ef26fdb b/pyqcrm.pyproject.user.ef26fdb deleted file mode 100644 index 5488a4e..0000000 --- a/pyqcrm.pyproject.user.ef26fdb +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - EnvironmentId - {ef26fdb1-82c6-45b3-a374-8052d24e0ffb} - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - true - - Cpp - - CppGlobal - - - - QmlJS - - QmlJSGlobal - - - 2 - UTF-8 - false - 4 - false - 80 - true - true - 1 - 0 - false - true - false - 2 - true - true - 0 - 8 - true - false - 1 - true - true - true - *.md, *.MD, Makefile - false - true - true - - - - ProjectExplorer.Project.PluginSettings - - - true - false - true - true - true - true - - - 0 - true - - true - true - Builtin.DefaultTidyAndClazy - 8 - true - - - - true - - - - - ProjectExplorer.Project.Target.0 - - Desktop - Python 3.12.7 - Python 3.12.7 - {bdea9678-212b-477e-b193-9ce30dcf3aba} - 0 - 0 - 0 - - /home/dstoppek/Coden/Projekte/pyqcrm/pyqcrm/.qtcreator/Python_3_12_7venv - - - true - Python.PysideBuildStep - - 1 - Erstellen - Erstellen - ProjectExplorer.BuildSteps.Build - - - 0 - Bereinigen - Bereinigen - ProjectExplorer.BuildSteps.Clean - - 2 - false - - false - - Python 3.12.7 virtuelle Umgebung - Python.PySideBuildConfiguration - /home/dstoppek/Coden/Projekte/pyqcrm/pyqcrm/.qtcreator/Python_3_12_7venv/bin/python - /home/dstoppek/Coden/Projekte/pyqcrm/pyqcrm/.qtcreator/Python_3_12_7venv - - 1 - - - 0 - Deployment - Deployment - ProjectExplorer.BuildSteps.Deploy - - 1 - - false - ProjectExplorer.DefaultDeployConfiguration - - 1 - - true - true - 0 - true - - 2 - - false - -e cpu-cycles --call-graph dwarf,4096 -F 250 - main.py - PythonEditor.RunConfiguration./home/dstoppek/Coden/Projekte/pyqcrm/pyqcrm/main.py - /home/dstoppek/Coden/Projekte/pyqcrm/pyqcrm/main.py - false - /home/dstoppek/Coden/Projekte/pyqcrm/pyqcrm/main.py - true - true - /home/dstoppek/Coden/Projekte/pyqcrm/pyqcrm - :0 - - 1 - - - - ProjectExplorer.Project.TargetCount - 1 - - - ProjectExplorer.Project.Updater.FileVersion - 22 - - - Version - 22 - - diff --git a/pyqcrm.toml b/pyqcrm.toml deleted file mode 100644 index 3d40a83..0000000 --- a/pyqcrm.toml +++ /dev/null @@ -1 +0,0 @@ -[pyqcrm] \ No newline at end of file