224
.gitignore
vendored
Normal file
224
.gitignore
vendored
Normal file
@@ -0,0 +1,224 @@
|
||||
# ---> Python
|
||||
# Byte-compiled / optimized / DLL files
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
|
||||
# C extensions
|
||||
*.so
|
||||
|
||||
# Distribution / packaging
|
||||
.Python
|
||||
build/
|
||||
develop-eggs/
|
||||
dist/
|
||||
downloads/
|
||||
eggs/
|
||||
.eggs/
|
||||
lib/
|
||||
lib64/
|
||||
parts/
|
||||
sdist/
|
||||
var/
|
||||
wheels/
|
||||
share/python-wheels/
|
||||
*.egg-info/
|
||||
.installed.cfg
|
||||
*.egg
|
||||
MANIFEST
|
||||
|
||||
# PyInstaller
|
||||
# Usually these files are written by a python script from a template
|
||||
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
||||
*.manifest
|
||||
*.spec
|
||||
|
||||
# Installer logs
|
||||
pip-log.txt
|
||||
pip-delete-this-directory.txt
|
||||
|
||||
# Unit test / coverage reports
|
||||
htmlcov/
|
||||
.tox/
|
||||
.nox/
|
||||
.coverage
|
||||
.coverage.*
|
||||
.cache
|
||||
nosetests.xml
|
||||
coverage.xml
|
||||
*.cover
|
||||
*.py,cover
|
||||
.hypothesis/
|
||||
.pytest_cache/
|
||||
cover/
|
||||
|
||||
# Translations
|
||||
*.mo
|
||||
*.pot
|
||||
|
||||
# Django stuff:
|
||||
*.log
|
||||
local_settings.py
|
||||
db.sqlite3
|
||||
db.sqlite3-journal
|
||||
|
||||
# Flask stuff:
|
||||
instance/
|
||||
.webassets-cache
|
||||
|
||||
# Scrapy stuff:
|
||||
.scrapy
|
||||
|
||||
# Sphinx documentation
|
||||
docs/_build/
|
||||
|
||||
# PyBuilder
|
||||
.pybuilder/
|
||||
target/
|
||||
|
||||
# Jupyter Notebook
|
||||
.ipynb_checkpoints
|
||||
|
||||
# IPython
|
||||
profile_default/
|
||||
ipython_config.py
|
||||
|
||||
# pyenv
|
||||
# For a library or package, you might want to ignore these files since the code is
|
||||
# intended to run in multiple environments; otherwise, check them in:
|
||||
# .python-version
|
||||
|
||||
# pipenv
|
||||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
||||
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
||||
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
||||
# install all needed dependencies.
|
||||
#Pipfile.lock
|
||||
|
||||
# poetry
|
||||
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
||||
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
||||
# commonly ignored for libraries.
|
||||
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
||||
#poetry.lock
|
||||
|
||||
# pdm
|
||||
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
||||
#pdm.lock
|
||||
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
||||
# in version control.
|
||||
# https://pdm.fming.dev/#use-with-ide
|
||||
.pdm.toml
|
||||
|
||||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
||||
__pypackages__/
|
||||
|
||||
# Celery stuff
|
||||
celerybeat-schedule
|
||||
celerybeat.pid
|
||||
|
||||
# SageMath parsed files
|
||||
*.sage.py
|
||||
|
||||
# Environments
|
||||
.env
|
||||
.venv
|
||||
env/
|
||||
venv/
|
||||
ENV/
|
||||
env.bak/
|
||||
venv.bak/
|
||||
|
||||
# Spyder project settings
|
||||
.spyderproject
|
||||
.spyproject
|
||||
|
||||
# Rope project settings
|
||||
.ropeproject
|
||||
|
||||
# mkdocs documentation
|
||||
/site
|
||||
|
||||
# mypy
|
||||
.mypy_cache/
|
||||
.dmypy.json
|
||||
dmypy.json
|
||||
|
||||
# Pyre type checker
|
||||
.pyre/
|
||||
|
||||
# pytype static type analyzer
|
||||
.pytype/
|
||||
|
||||
# Cython debug symbols
|
||||
cython_debug/
|
||||
|
||||
# PyCharm
|
||||
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
||||
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
||||
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
||||
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
||||
#.idea/
|
||||
|
||||
# ---> Qt
|
||||
# C++ objects and libs
|
||||
*.slo
|
||||
*.lo
|
||||
*.o
|
||||
*.a
|
||||
*.la
|
||||
*.lai
|
||||
*.so
|
||||
*.so.*
|
||||
*.dll
|
||||
*.dylib
|
||||
|
||||
# Qt-es
|
||||
object_script.*.Release
|
||||
object_script.*.Debug
|
||||
*_plugin_import.cpp
|
||||
/.qmake.cache
|
||||
/.qmake.stash
|
||||
*.pro.user
|
||||
*.pro.user.*
|
||||
*.qbs.user
|
||||
*.qbs.user.*
|
||||
*.moc
|
||||
moc_*.cpp
|
||||
moc_*.h
|
||||
qrc_*.cpp
|
||||
ui_*.h
|
||||
*.qmlc
|
||||
*.jsc
|
||||
Makefile*
|
||||
*build-*
|
||||
*.qm
|
||||
*.prl
|
||||
|
||||
# Qt unit tests
|
||||
target_wrapper.*
|
||||
|
||||
# QtCreator
|
||||
*.autosave
|
||||
|
||||
# QtCreator Qml
|
||||
*.qmlproject.user
|
||||
*.qmlproject.user.*
|
||||
|
||||
# QtCreator CMake
|
||||
CMakeLists.txt.user*
|
||||
|
||||
# QtCreator 4.8< compilation database
|
||||
compile_commands.json
|
||||
|
||||
# QtCreator local machine specific files for imported projects
|
||||
*creator.user*
|
||||
|
||||
*_qmlcache.qrc
|
||||
|
||||
|
||||
.history
|
||||
depend
|
||||
output/output/LOGtoJSON.exe
|
||||
|
||||
.pytest_cache
|
||||
9
.trunk/.gitignore
vendored
Normal file
9
.trunk/.gitignore
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
*out
|
||||
*logs
|
||||
*actions
|
||||
*notifications
|
||||
*tools
|
||||
plugins
|
||||
user_trunk.yaml
|
||||
user.yaml
|
||||
tmp
|
||||
10
.trunk/configs/.flake8
Normal file
10
.trunk/configs/.flake8
Normal file
@@ -0,0 +1,10 @@
|
||||
# Autoformatter friendly flake8 config (all formatting rules disabled)
|
||||
[flake8]
|
||||
extend-ignore = D1, D2, E1, E2, E3, E501, W1, W2, W3, W5
|
||||
exclude =
|
||||
.history
|
||||
.vscode
|
||||
.git
|
||||
.venv
|
||||
__pycache__
|
||||
|
||||
2
.trunk/configs/.isort.cfg
Normal file
2
.trunk/configs/.isort.cfg
Normal file
@@ -0,0 +1,2 @@
|
||||
[settings]
|
||||
profile=black
|
||||
10
.trunk/configs/.markdownlint.yaml
Normal file
10
.trunk/configs/.markdownlint.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
# Autoformatter friendly markdownlint config (all formatting rules disabled)
|
||||
default: true
|
||||
blank_lines: false
|
||||
bullet: false
|
||||
html: false
|
||||
indentation: false
|
||||
line_length: false
|
||||
spaces: false
|
||||
url: false
|
||||
whitespace: false
|
||||
2
.trunk/configs/.sqlfluff
Normal file
2
.trunk/configs/.sqlfluff
Normal file
@@ -0,0 +1,2 @@
|
||||
[sqlfluff]
|
||||
dialect = ansi
|
||||
10
.trunk/configs/.yamllint.yaml
Normal file
10
.trunk/configs/.yamllint.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
rules:
|
||||
quoted-strings:
|
||||
required: only-when-needed
|
||||
extra-allowed: ["{|}"]
|
||||
empty-values:
|
||||
forbid-in-block-mappings: true
|
||||
forbid-in-flow-mappings: true
|
||||
key-duplicates: {}
|
||||
octal-values:
|
||||
forbid-implicit-octal: true
|
||||
22
.trunk/configs/ruff.toml
Normal file
22
.trunk/configs/ruff.toml
Normal file
@@ -0,0 +1,22 @@
|
||||
# Generic, formatter-friendly config.
|
||||
select = ["B", "D3", "D4", "E", "F"]
|
||||
|
||||
# Never enforce `E501` (line length violations). This should be handled by formatters.
|
||||
ignore = ["E501","F401"]
|
||||
exclude = [
|
||||
".trunk",
|
||||
".git",
|
||||
".github",
|
||||
"build",
|
||||
"dist",
|
||||
"docs",
|
||||
"examples",
|
||||
"tests",
|
||||
".history",
|
||||
".vscode",
|
||||
"venv",
|
||||
".venv",
|
||||
"__pycache__",
|
||||
]
|
||||
line-length = 88
|
||||
indent-width = 4
|
||||
59
.trunk/trunk.yaml
Normal file
59
.trunk/trunk.yaml
Normal file
@@ -0,0 +1,59 @@
|
||||
# This file controls the behavior of Trunk: https://docs.trunk.io/cli
|
||||
# To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml
|
||||
version: 0.1
|
||||
cli:
|
||||
version: 1.19.0
|
||||
plugins:
|
||||
sources:
|
||||
- id: trunk
|
||||
ref: v1.4.2
|
||||
uri: https://github.com/trunk-io/plugins
|
||||
runtimes:
|
||||
enabled:
|
||||
- node@18.12.1
|
||||
- python@3.10.8
|
||||
lint:
|
||||
disabled:
|
||||
- flake8
|
||||
- taplo
|
||||
- pylint
|
||||
- mypy
|
||||
- git-diff-check
|
||||
- checkov
|
||||
- oxipng
|
||||
- prettier
|
||||
- trivy
|
||||
- trufflehog
|
||||
enabled:
|
||||
- osv-scanner@1.6.1
|
||||
- sql-formatter@15.1.2
|
||||
- sqlfluff@2.3.5
|
||||
- isort@5.13.2
|
||||
- ruff@0.1.14
|
||||
- bandit@1.7.7
|
||||
- markdownlint@0.38.0
|
||||
- yamllint@1.33.0
|
||||
- black@23.12.1
|
||||
actions:
|
||||
disabled:
|
||||
- trunk-fmt-pre-commit
|
||||
enabled:
|
||||
- trunk-announce
|
||||
- trunk-check-pre-push
|
||||
- trunk-upgrade-available
|
||||
#ignore the following folders
|
||||
# .history
|
||||
# .vscode
|
||||
# .idea
|
||||
# .git
|
||||
# .github
|
||||
# .trunk# .vscode
|
||||
# node_modules
|
||||
# .DS_Store
|
||||
# .pytest_cache
|
||||
# .mypy_cache
|
||||
# build
|
||||
# dist
|
||||
# __pycache__
|
||||
# .venv
|
||||
# .ipynb_checkpoints
|
||||
30
.vscode/settings.json
vendored
Normal file
30
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"files.exclude": {
|
||||
"**/.git": true,
|
||||
"**/.svn": true,
|
||||
"**/.hg": true,
|
||||
"**/CVS": true,
|
||||
"**/.DS_Store": true,
|
||||
"**/Thumbs.db": true,
|
||||
"**/.trunk/*actions/": true,
|
||||
"**/.trunk/*logs/": true,
|
||||
"**/.trunk/*notifications/": true,
|
||||
"**/.trunk/*out/": true,
|
||||
"**/.trunk/*plugins/": true,
|
||||
"**/.history": true,
|
||||
"**/.pytest_cache": true,
|
||||
".pytest_cache": true,
|
||||
"**/__pycache__": true,
|
||||
"__pycache__": true
|
||||
},
|
||||
"explorerExclude.backup": {},
|
||||
"python.testing.unittestEnabled": false,
|
||||
"python.testing.unittestArgs": [
|
||||
"-v",
|
||||
"-s",
|
||||
"./test",
|
||||
"-p",
|
||||
"*_test.py"
|
||||
],
|
||||
"python.testing.pytestEnabled": true,
|
||||
}
|
||||
14
.vscode/tasks.json
vendored
Normal file
14
.vscode/tasks.json
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "Compile UI",
|
||||
"type": "shell",
|
||||
"command": "pyuic6 ${file} -o ${fileDirname}/${fileBasenameNoExtension}_ui.py",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
18
LICENSE
18
LICENSE
@@ -2,20 +2,8 @@ MIT License
|
||||
|
||||
Copyright (c) 2024 WorldTeacher
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
# SemesterapparatsManager
|
||||
A software created to manage media
|
||||
# Semesterapparate
|
||||
|
||||
this repo will be used to create a GUI application to manage the semesterapparate of the PH Freiburg.
|
||||
0
__main__.py
Normal file
0
__main__.py
Normal file
79
config.yaml
Normal file
79
config.yaml
Normal file
@@ -0,0 +1,79 @@
|
||||
default_apps: true
|
||||
save_path: C:\Users\aky547\Desktop\testfolder\
|
||||
custom_applications:
|
||||
- name: Text files
|
||||
extensions:
|
||||
- txt
|
||||
- md
|
||||
- rst
|
||||
application: Notepad
|
||||
- name: CSV files
|
||||
extensions:
|
||||
- csv
|
||||
application: Excel
|
||||
- name: pdf files
|
||||
extensions:
|
||||
- pdf
|
||||
application: Firefox
|
||||
- name: Word files
|
||||
extensions:
|
||||
- docx
|
||||
- doc
|
||||
application: Word
|
||||
- name: Excel files
|
||||
extensions:
|
||||
- xlsx
|
||||
- xls
|
||||
application: Excel
|
||||
database:
|
||||
name: database.db
|
||||
path: C:\Users\aky547\Desktop\semap\db\
|
||||
subjects:
|
||||
- name: Biologie
|
||||
aliases: null
|
||||
- name: Chemie
|
||||
aliases: null
|
||||
- name: Deutsch
|
||||
aliases: null
|
||||
- name: Englisch
|
||||
aliases: null
|
||||
- name: Erziehungswissenschaft
|
||||
aliases: null
|
||||
- name: Französisch
|
||||
aliases: null
|
||||
- name: Geographie
|
||||
aliases: null
|
||||
- name: Geschichte
|
||||
aliases: null
|
||||
- name: Gesundheitspädagogik
|
||||
aliases: null
|
||||
- name: Haushalt / Textil
|
||||
aliases: null
|
||||
- name: Kunst
|
||||
aliases: null
|
||||
- name: Mathematik / Informatik
|
||||
aliases: null
|
||||
- name: Medien in der Bildung
|
||||
aliases: null
|
||||
- name: Musik
|
||||
aliases: null
|
||||
- name: Philosophie
|
||||
aliases: null
|
||||
- name: Physik
|
||||
aliases: null
|
||||
- name: Politikwissenschaft
|
||||
aliases: null
|
||||
- name: Prorektorat Lehre und Studium
|
||||
aliases: null
|
||||
- name: Psychologie
|
||||
aliases: null
|
||||
- name: Soziologie
|
||||
aliases: null
|
||||
- name: Sport
|
||||
aliases: null
|
||||
- name: Technik
|
||||
aliases: null
|
||||
- name: Theologie
|
||||
aliases: null
|
||||
- name: Wirtschaftslehre
|
||||
aliases: null
|
||||
19
database_testing.py
Normal file
19
database_testing.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from src.backend.database import Database
|
||||
from src.logic.dataclass import ApparatData
|
||||
|
||||
apparat = ApparatData()
|
||||
apparat.appname = "testapparat123"
|
||||
apparat.appnr = 155
|
||||
apparat.dauerapp = True
|
||||
apparat.profname = "Mustermanns, Max"
|
||||
apparat.subject = "Physik"
|
||||
apparat.semester = "SoSe 2021"
|
||||
|
||||
|
||||
files = {"name": "test.png", "type": "png",
|
||||
"path": r"C:\Users\aky547\Desktop\test.png"}
|
||||
db = Database()
|
||||
# print(db.recreate_file("testfile.pdf",files,3))
|
||||
# db.insert_file(files,3)
|
||||
# recreate_file("test.pdf",files,1))#insert_file(files,1))
|
||||
db.get_apparats_name(70)
|
||||
46
db_testing.py
Normal file
46
db_testing.py
Normal file
@@ -0,0 +1,46 @@
|
||||
from omegaconf import OmegaConf
|
||||
|
||||
from codebase import Database
|
||||
from codebase.pickles import load_pickle, make_pickle
|
||||
from webrequest import BibTextTransformer, WebRequest
|
||||
|
||||
config = OmegaConf.load("config.yaml")
|
||||
db = Database()
|
||||
# # # f = db.get_media(1, 1)
|
||||
# # # dataclass_objects = []
|
||||
|
||||
# # # for dataclass_str in f:
|
||||
# # # print(f"dataclass {dataclass_str}")
|
||||
# # # # dataclass_obj = ast.literal_eval(dataclass_str[0])
|
||||
# # # dataclass_objects.append(dataclass_str)
|
||||
|
||||
# # # cla = BookData().from_string(dataclass_objects[0])
|
||||
# # # print(type(cla))
|
||||
# # book = (
|
||||
# # BibTextTransformer("ARRAY")
|
||||
# # .get_data(WebRequest().get_ppn("ST 250 U42 (15)").get_data())
|
||||
# # .return_data()
|
||||
# # )
|
||||
# # print(book)
|
||||
|
||||
# # bpickle = make_pickle(book)
|
||||
# # print(bpickle)
|
||||
|
||||
# # print(load_pickle(bpickle))
|
||||
|
||||
|
||||
# # # print(pickle.dumps(book), type(pickle.dumps(book)))
|
||||
|
||||
# # # db.add_medium(book, "2", "1")
|
||||
# # # db.get_app_data("1", "Testapparat")
|
||||
|
||||
# # books = db.get_media(1, 1, 0)
|
||||
|
||||
# # print(len(books))
|
||||
# book = db.get_specific_book(16)
|
||||
|
||||
# print(book)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(db.get_media(15, 2))
|
||||
65
log.py
Normal file
65
log.py
Normal file
@@ -0,0 +1,65 @@
|
||||
import logging
|
||||
import os
|
||||
|
||||
if not os.path.exists("logs"):
|
||||
os.mkdir("logs")
|
||||
with open("logs/application.log", "w") as f:
|
||||
pass
|
||||
|
||||
# Create a common file handler for all loggers
|
||||
common_file_handler = logging.FileHandler("logs/application.log")
|
||||
common_file_handler.setLevel(logging.DEBUG)
|
||||
formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
|
||||
common_file_handler.setFormatter(formatter)
|
||||
|
||||
|
||||
class MyLogger:
|
||||
def __init__(self, logger_name):
|
||||
self.logger = logging.getLogger(logger_name)
|
||||
self.logger.setLevel(logging.DEBUG)
|
||||
self.logger.addHandler(common_file_handler)
|
||||
self.encoding = "utf-8"
|
||||
|
||||
def log_info(self, message: str):
|
||||
# ensure that the message is encoded in utf-8
|
||||
self.logger.info(message.encode(self.encoding))
|
||||
|
||||
def log_debug(self, message: str):
|
||||
self.logger.debug(message.encode(self.encoding))
|
||||
|
||||
def log_warning(self, message: str):
|
||||
self.logger.warning(message.encode(self.encoding))
|
||||
|
||||
def log_error(self, message: str):
|
||||
self.logger.error(message.encode(self.encoding))
|
||||
|
||||
def log_critical(self, message: str):
|
||||
self.logger.critical(message.encode(self.encoding))
|
||||
|
||||
def log_exception(self, message: str):
|
||||
self.logger.exception(message)
|
||||
|
||||
|
||||
# Usage example:
|
||||
if __name__ == "__main__":
|
||||
logger1 = MyLogger("Logger1")
|
||||
logger2 = MyLogger("Logger2")
|
||||
|
||||
logger1.log_info("This is an info message from Logger1")
|
||||
logger1.log_debug("This is a debug message from Logger1")
|
||||
logger1.log_warning("This is a warning message from Logger1")
|
||||
logger1.log_error("This is an error message from Logger1")
|
||||
logger1.log_critical("This is a critical message from Logger1")
|
||||
|
||||
logger2.log_info("This is an info message from Logger2")
|
||||
logger2.log_debug("This is a debug message from Logger2")
|
||||
logger2.log_warning("This is a warning message from Logger2")
|
||||
logger2.log_error("This is an error message from Logger2")
|
||||
logger2.log_critical("This is a critical message from Logger2")
|
||||
|
||||
try:
|
||||
# Simulate an exception
|
||||
raise Exception("An exception occurred")
|
||||
except Exception as e:
|
||||
logger1.log_exception("An exception occurred in Logger1")
|
||||
logger2.log_exception("An exception occurred in Logger2")
|
||||
8
main.py
Normal file
8
main.py
Normal file
@@ -0,0 +1,8 @@
|
||||
from src.logic import userInterface
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
userInterface.launch_gui()
|
||||
BIN
requirements.txt
Normal file
BIN
requirements.txt
Normal file
Binary file not shown.
0
src/__init__.py
Normal file
0
src/__init__.py
Normal file
0
src/backend/__init__.py
Normal file
0
src/backend/__init__.py
Normal file
52
src/backend/admin_console.py
Normal file
52
src/backend/admin_console.py
Normal file
@@ -0,0 +1,52 @@
|
||||
import hashlib
|
||||
import random
|
||||
|
||||
from src.backend.database import Database
|
||||
|
||||
|
||||
# change passwords for apparats, change passwords for users, list users, create and delete users etc
|
||||
# create a class that has all commands. for each command, create a function that does the thing
|
||||
class AdminCommands:
|
||||
def __init__(self):
|
||||
self.db = Database()
|
||||
|
||||
def create_password(self, password):
|
||||
salt = self.create_salt()
|
||||
hashed_password = self.hash_password(password)
|
||||
return (hashed_password,salt)
|
||||
def create_salt(self):
|
||||
return "".join(
|
||||
random.choices(
|
||||
"abcdefghijklmnopqrstuvwxyzQWERTZUIOPLKJHGFDSAYXCVBNM0123456789", k=16
|
||||
)
|
||||
)
|
||||
|
||||
def create_admin(self):
|
||||
salt = self.create_salt()
|
||||
hashed_password = self.hash_password("admin")
|
||||
self.db.create_user("admin", salt+hashed_password, "admin", salt)
|
||||
|
||||
def hash_password(self, password):
|
||||
hashed = hashlib.sha256((password).encode("utf-8")).hexdigest()
|
||||
return hashed
|
||||
|
||||
def list_users(self):
|
||||
return self.db.get_users()
|
||||
|
||||
def delete_user(self, username):
|
||||
self.db.delete_user(username)
|
||||
|
||||
def change_password(self, username, password):
|
||||
hashed_password = self.hash_password(password)
|
||||
self.db.change_password(username, hashed_password)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
c = AdminCommands()
|
||||
c.create_user("test", "test", "user")
|
||||
c.create_user("admin", "admin", "admin")
|
||||
print(c.list_users())
|
||||
c.delete_user("test")
|
||||
print(c.list_users())
|
||||
c.change_password("admin", "nopass")
|
||||
print(c.list_users())
|
||||
748
src/backend/database.py
Normal file
748
src/backend/database.py
Normal file
@@ -0,0 +1,748 @@
|
||||
import datetime
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
import sqlite3 as sql3
|
||||
import tempfile
|
||||
from typing import Any
|
||||
|
||||
from omegaconf import OmegaConf
|
||||
|
||||
from src.backend.db import main as template
|
||||
# from src.data import pickles
|
||||
import pickle
|
||||
from src.logic.constants import SEMAP_MEDIA_ACCOUNTS
|
||||
from src.logic.dataclass import ApparatData, BookData
|
||||
from log import MyLogger
|
||||
from icecream import ic
|
||||
config = OmegaConf.load("config.yaml")
|
||||
|
||||
logger = MyLogger("Database")
|
||||
|
||||
|
||||
class Database:
|
||||
logger.log_info("Database imported")
|
||||
|
||||
def __init__(self) -> None:
|
||||
# TODO: change path later on to a variable based on the settings
|
||||
self.database_path = f"{config.database.path}{config.database.name}"
|
||||
ic(self.database_path)
|
||||
# self.database_path = "sap.db"
|
||||
logger.log_info("Connecting to database")
|
||||
self.database = sql3.connect(self.database_path)
|
||||
self.cur = self.database.cursor()
|
||||
|
||||
pass
|
||||
def create_database(self):
|
||||
#create database from template
|
||||
template(self.database_path)
|
||||
subjects = config.subjects
|
||||
for subject in subjects:
|
||||
self.cur.execute(f"INSERT INTO subjects (name) VALUES ('{subject}')")
|
||||
self.database.commit()
|
||||
|
||||
def create_blob(self, file):
|
||||
with open(file, "rb") as f:
|
||||
blob = f.read()
|
||||
return blob
|
||||
|
||||
def recreate_file(self, filename, app_id: int):
|
||||
blob = self.get_blob(filename, app_id)
|
||||
# write the blob to the file and save it to a preset destination
|
||||
# with open(filename, "wb") as f:
|
||||
# f.write(blob)
|
||||
#use tempfile to create a temporary file
|
||||
if not os.path.exists(config.database.tempdir):
|
||||
os.mkdir(config.database.tempdir)
|
||||
tempfile.NamedTemporaryFile(filename=filename,delete=False,dir=config.database.tempdir,mode="wb").write(blob)
|
||||
|
||||
# user = os.getlogin()
|
||||
# home = os.path.expanduser("~")
|
||||
|
||||
# # check if the folder exists, if not, create it
|
||||
# if not os.path.exists(f"{home}/Desktop/SemApp/{user}"):
|
||||
# os.mkdir(f"{home}/Desktop/SemApp/{user}")
|
||||
# shutil.move(filename, f"{home}/Desktop/SemApp/{user}")
|
||||
|
||||
def get_blob(self, filename: str, app_id: int):
|
||||
query = f"SELECT fileblob FROM files WHERE filename='{filename}' AND app_id={app_id}"
|
||||
logger.log_info(f"Retrieving blob for {filename}, Appid {app_id} from database")
|
||||
result = self.cur.execute(query).fetchone()
|
||||
return result[0]
|
||||
|
||||
def get_kto_no(self, app_id: int):
|
||||
query = f"SELECT konto FROM semesterapparat WHERE id={app_id}"
|
||||
result = self.cur.execute(query).fetchone()
|
||||
return result[0]
|
||||
|
||||
def insert_file(self, file: list[dict], app_id: int, prof_id):
|
||||
for f in file:
|
||||
filename = f["name"]
|
||||
path = f["path"]
|
||||
filetyp = f["type"]
|
||||
print(f"filename: {filename}, path: {path}, filetyp: {filetyp}")
|
||||
if path == "Database":
|
||||
continue
|
||||
blob = self.create_blob(path)
|
||||
|
||||
query = "INSERT OR IGNORE INTO files (filename, fileblob, app_id, filetyp,prof_id) VALUES (?, ?, ?, ?,?)"
|
||||
params = (filename, blob, app_id, filetyp, prof_id)
|
||||
self.cur.execute(query, params)
|
||||
logger.log_info(
|
||||
f"Inserted {len(file)} file(s) of Apparat {app_id} into database"
|
||||
)
|
||||
self.database.commit()
|
||||
|
||||
def get_files(self, app_id: int, prof_id: int):
|
||||
query = f"SELECT filename, filetyp FROM files WHERE app_id={app_id} AND prof_id={prof_id}"
|
||||
result: list[tuple] = self.cur.execute(query).fetchall()
|
||||
return result
|
||||
|
||||
def get_prof_name_by_id(self, id, add_title: bool = False):
|
||||
if add_title is True:
|
||||
query = f"SELECT titel, fname, lname FROM prof WHERE id={id}"
|
||||
result = self.cur.execute(query).fetchone()
|
||||
name = " ".join(result[0:3])
|
||||
return name
|
||||
else:
|
||||
query = f"SELECT fullname FROM prof WHERE id={id}"
|
||||
print(query)
|
||||
result = self.cur.execute(query).fetchone()
|
||||
name = result[0]
|
||||
return name
|
||||
|
||||
def get_prof_id(self, profname: str):
|
||||
query = f"SELECT id FROM prof WHERE fullname='{profname.replace(',', '')}'"
|
||||
result = self.cur.execute(query).fetchone()
|
||||
if result is None:
|
||||
return None
|
||||
return self.cur.execute(query).fetchone()[0]
|
||||
|
||||
def get_app_id(self, appname: str):
|
||||
query = f"SELECT id FROM semesterapparat WHERE name='{appname}'"
|
||||
result = self.cur.execute(query).fetchone()
|
||||
if result is None:
|
||||
return None
|
||||
return self.cur.execute(query).fetchone()[0]
|
||||
|
||||
def get_profs(self):
|
||||
query = "select * from prof"
|
||||
return self.cur.execute(query).fetchall()
|
||||
|
||||
def app_exists(self, appnr: str) -> bool:
|
||||
query = f"SELECT appnr FROM semesterapparat WHERE appnr='{appnr}'"
|
||||
result = self.cur.execute(query).fetchone()
|
||||
if result is None:
|
||||
return False
|
||||
return True
|
||||
|
||||
def get_prof_data(self, profname: str = None, id: int = None) -> dict[str, str]:
|
||||
if profname is not None:
|
||||
profname = profname.replace(",", "")
|
||||
profname = re.sub(r"\s+", " ", profname).strip()
|
||||
if id:
|
||||
query = "Select prof_id FROM semesterapparat WHERE appnr=?"
|
||||
params = (id,)
|
||||
result = self.cur.execute(query, params).fetchone()
|
||||
id = result[0]
|
||||
query = (
|
||||
f"SELECT * FROM prof WHERE fullname='{profname}'"
|
||||
if id is None
|
||||
else f"SELECT * FROM prof WHERE id={id}"
|
||||
)
|
||||
result = self.cur.execute(query).fetchone()
|
||||
return_data = {
|
||||
"prof_title": result[1],
|
||||
"profname": f"{result[3], result[2]}",
|
||||
"prof_mail": result[5],
|
||||
"prof_tel": result[6],
|
||||
"id": result[0],
|
||||
}
|
||||
print(return_data)
|
||||
# select the entry that contains the first name
|
||||
return return_data
|
||||
|
||||
def set_new_sem_date(self, appnr, new_sem_date, dauerapp=False):
|
||||
# Todo: use extend_semester in new release
|
||||
date = datetime.datetime.now().strftime("%Y-%m-%d")
|
||||
|
||||
query = f"UPDATE semesterapparat SET verlängert_am='{date}', verlängerung_bis='{new_sem_date}' WHERE appnr='{appnr}'"
|
||||
if dauerapp is not False:
|
||||
query = f"UPDATE semesterapparat SET verlängert_am='{date}', verlängerung_bis='{new_sem_date}', dauerapp='{dauerapp} WHERE appnr='{appnr}'"
|
||||
self.cur.execute(query)
|
||||
|
||||
self.database.commit()
|
||||
|
||||
def create_apparat(self, ApparatData: ApparatData):
|
||||
prof_id = self.get_prof_id(ApparatData.profname)
|
||||
app_id = self.get_app_id(ApparatData.appname)
|
||||
if app_id is None:
|
||||
if prof_id is None:
|
||||
self.create_prof(ApparatData.get_prof_details())
|
||||
prof_id = self.get_prof_id(ApparatData.profname)
|
||||
|
||||
query = f"INSERT OR IGNORE INTO semesterapparat (appnr, name, erstellsemester, dauer, prof_id, fach,deletion_status,konto) VALUES ('{ApparatData.appnr}', '{ApparatData.appname}', '{ApparatData.semester}', '{ApparatData.dauerapp}', {prof_id}, '{ApparatData.app_fach}', '{ApparatData.deleted}', '{SEMAP_MEDIA_ACCOUNTS[ApparatData.appnr]}')"
|
||||
print(query)
|
||||
self.cur.execute(query)
|
||||
self.database.commit()
|
||||
logger.log_info(f"Created new apparat {ApparatData.appname}")
|
||||
app_id = self.get_app_id(ApparatData.appname)
|
||||
# if ApparatData.media_list is not None: #! Deprecated
|
||||
# for media in ApparatData.media_list:
|
||||
# self.insert_file(media, app_id)
|
||||
# self.database.commit()
|
||||
return app_id
|
||||
|
||||
def create_prof(self, prof_details: dict):
|
||||
prof_title = prof_details["prof_title"]
|
||||
prof_fname = prof_details["profname"].split(",")[1]
|
||||
prof_fname = prof_fname.strip()
|
||||
prof_lname = prof_details["profname"].split(",")[0]
|
||||
prof_lname = prof_lname.strip()
|
||||
prof_fullname = prof_details["profname"].replace(",", "")
|
||||
prof_mail = prof_details["prof_mail"]
|
||||
prof_tel = prof_details["prof_tel"]
|
||||
|
||||
query = f'INSERT OR IGNORE INTO prof (titel, fname, lname, fullname, mail, telnr) VALUES ("{prof_title}", "{prof_fname}", "{prof_lname}", "{prof_fullname}", "{prof_mail}", "{prof_tel}")'
|
||||
self.cur.execute(query)
|
||||
self.database.commit()
|
||||
pass
|
||||
|
||||
def get_apparat_nrs(self) -> list:
|
||||
try:
|
||||
self.cur.execute(
|
||||
"SELECT appnr FROM semesterapparat Where deletion_status=0"
|
||||
)
|
||||
except sql3.OperationalError:
|
||||
return []
|
||||
return [i[0] for i in self.cur.fetchall()]
|
||||
|
||||
def get_all_apparts(self, deleted=0):
|
||||
|
||||
self.cur.execute(
|
||||
f"SELECT * FROM semesterapparat WHERE deletion_status={deleted}"
|
||||
)
|
||||
return self.cur.fetchall()
|
||||
|
||||
#
|
||||
def get_app_data(self, appnr, appname) -> ApparatData:
|
||||
result = self.cur.execute(
|
||||
f"SELECT * FROM semesterapparat WHERE appnr='{appnr}' AND name='{appname}'"
|
||||
).fetchone()
|
||||
print(f"result: {result}")
|
||||
# app_id=result[0]
|
||||
data = ApparatData()
|
||||
data.appnr = appnr
|
||||
data.app_fach = result[3]
|
||||
data.appname = result[1]
|
||||
profname = self.get_prof_name_by_id(result[2])
|
||||
# set profname to lastname, firstname
|
||||
profname = f"{profname.split(' ')[0]}, {profname.split(' ')[1]}"
|
||||
data.profname = profname
|
||||
prof_data = self.get_prof_data(data.profname)
|
||||
data.prof_mail = prof_data["prof_mail"]
|
||||
data.prof_tel = prof_data["prof_tel"]
|
||||
data.prof_title = prof_data["prof_title"]
|
||||
data.erstellsemester = result[5]
|
||||
data.semester = result[8]
|
||||
data.deleted = result[9]
|
||||
data.apparat_adis_id = result[12]
|
||||
data.prof_adis_id = None
|
||||
|
||||
print(data)
|
||||
# data.media_list=self.get_media(app_id)
|
||||
|
||||
return data
|
||||
|
||||
def add_medium(self, bookdata: BookData, app_id: str, prof_id: str, *args):
|
||||
# insert the bookdata into the media table
|
||||
# try to retrieve the bookdata from the media table, check if the to be inserted bookdata is already in the table for the corresponding apparat
|
||||
# if yes, do not insert the bookdata
|
||||
# if no, insert the bookdata
|
||||
t_query = (
|
||||
f"SELECT bookdata FROM media WHERE app_id={app_id} AND prof_id={prof_id}"
|
||||
)
|
||||
# print(t_query)
|
||||
result = self.cur.execute(t_query).fetchall()
|
||||
result = [pickle.loads(i[0]) for i in result]
|
||||
if bookdata in result:
|
||||
print("Bookdata already in database")
|
||||
# check if the book was deleted in the apparat
|
||||
query = (
|
||||
"SELECT deleted FROM media WHERE app_id=? AND prof_id=? AND bookdata=?"
|
||||
)
|
||||
params = (app_id, prof_id, pickle.dumps(bookdata))
|
||||
result = self.cur.execute(query, params).fetchone()
|
||||
if result[0] == 1:
|
||||
print("Book was deleted, updating bookdata")
|
||||
query = "UPDATE media SET deleted=0 WHERE app_id=? AND prof_id=? AND bookdata=?"
|
||||
params = (app_id, prof_id, pickle.dumps(bookdata))
|
||||
self.cur.execute(query, params)
|
||||
self.database.commit()
|
||||
return
|
||||
|
||||
query = (
|
||||
"INSERT INTO media (bookdata, app_id, prof_id,deleted) VALUES (?, ?, ?,?)"
|
||||
)
|
||||
converted = pickle.dumps(bookdata)
|
||||
params = (converted, app_id, prof_id, 0)
|
||||
self.cur.execute(query, params)
|
||||
self.database.commit()
|
||||
|
||||
def request_medium(self, app_id, prof_id, signature) -> int:
|
||||
query = "SELECT bookdata, id FROM media WHERE app_id=? AND prof_id=?"
|
||||
params = (app_id, prof_id)
|
||||
result = self.cur.execute(query, params).fetchall()
|
||||
books = [(i[1], pickle.loads(i[0])) for i in result]
|
||||
print(books)
|
||||
book = [i[0] for i in books if i[1].signature == signature]
|
||||
return book[0]
|
||||
|
||||
def add_message(self, message: dict, user, appnr):
|
||||
def __get_user_id(user):
|
||||
query = "SELECT id FROM user WHERE username=?"
|
||||
params = (user,)
|
||||
result = self.cur.execute(query, params).fetchone()
|
||||
return result[0]
|
||||
|
||||
user_id = __get_user_id(user)
|
||||
query = "INSERT INTO messages (message, user_id, remind_at) VALUES (?, ?, ?)"
|
||||
params = (message["message"], user_id, message["remind_at"])
|
||||
self.cur.execute(query, params)
|
||||
self.database.commit()
|
||||
|
||||
def get_messages(self, date: str):
|
||||
def __get_user_name(id):
|
||||
query = "SELECT username FROM user WHERE id=?"
|
||||
params = (id,)
|
||||
result = self.cur.execute(query, params).fetchone()
|
||||
return result[0]
|
||||
|
||||
query = f"SELECT * FROM messages WHERE remind_at='{date}'"
|
||||
result = self.cur.execute(query).fetchall()
|
||||
ret = [
|
||||
{
|
||||
"message": i[2],
|
||||
"user": __get_user_name(i[4]),
|
||||
"apparatnr": i[5],
|
||||
"id": i[0],
|
||||
}
|
||||
for i in result
|
||||
]
|
||||
return ret
|
||||
|
||||
def get_apparat_id(self, appname):
|
||||
query = f"SELECT appnr FROM semesterapparat WHERE name='{appname}'"
|
||||
result = self.cur.execute(query).fetchone()
|
||||
return result[0]
|
||||
|
||||
|
||||
def get_apparats_by_semester(self, semester: str):
|
||||
query = f"SELECT * FROM semesterapparat WHERE erstellsemester='{semester}'"
|
||||
result = self.cur.execute(query).fetchall()
|
||||
return result
|
||||
|
||||
def get_semester(self) -> list[str]:
|
||||
query = "SELECT DISTINCT erstellsemester FROM semesterapparat"
|
||||
result = self.cur.execute(query).fetchall()
|
||||
return [i for i in result]
|
||||
|
||||
def is_eternal(self, id):
|
||||
query = f"SELECT dauer FROM semesterapparat WHERE id={id}"
|
||||
result = self.cur.execute(query).fetchone()
|
||||
return result[0]
|
||||
|
||||
def statistic_request(self, **kwargs: Any):
|
||||
def __query(query):
|
||||
result = self.cur.execute(query).fetchall()
|
||||
for result_a in result:
|
||||
orig_value = result_a
|
||||
prof_name = self.get_prof_name_by_id(result_a[2])
|
||||
# replace the prof_id with the prof_name
|
||||
result_a = list(result_a)
|
||||
result_a[2] = prof_name
|
||||
result_a = tuple(result_a)
|
||||
result[result.index(orig_value)] = result_a
|
||||
|
||||
return result
|
||||
|
||||
if "deletable" in kwargs.keys():
|
||||
query = f"SELECT * FROM semesterapparat WHERE deletion_status=0 AND dauer=0 AND (erstellsemester!='{kwargs['deletesemester']}' OR verlängerung_bis!='{kwargs['deletesemester']}')"
|
||||
return __query(query)
|
||||
|
||||
if "dauer" in kwargs.keys():
|
||||
kwargs["dauer"] = kwargs["dauer"].replace("Ja", "1").replace("Nein", "0")
|
||||
query = "SELECT * FROM semesterapparat WHERE "
|
||||
for key, value in kwargs.items() if kwargs.items() is not None else {}:
|
||||
print(key, value)
|
||||
query += f"{key}='{value}' AND "
|
||||
print(query)
|
||||
# remove deletesemester part from normal query, as this will be added to the database upon deleting the apparat
|
||||
if "deletesemester" in kwargs.keys():
|
||||
query = query.replace(
|
||||
f"deletesemester='{kwargs['deletesemester']}' AND ", ""
|
||||
)
|
||||
if "endsemester" in kwargs.keys():
|
||||
if "erstellsemester" in kwargs.keys():
|
||||
query = query.replace(f"endsemester='{kwargs['endsemester']}' AND ", "")
|
||||
query = query.replace(
|
||||
f"erstellsemester='{kwargs['erstellsemester']} AND ", "xyz"
|
||||
)
|
||||
else:
|
||||
query = query.replace(
|
||||
f"endsemester='{kwargs['endsemester']}' AND ", "xyz"
|
||||
)
|
||||
print("replaced")
|
||||
query = query.replace(
|
||||
"xyz",
|
||||
f"(erstellsemester='{kwargs['endsemester']}' OR verlängerung_bis='{kwargs['endsemester']}') AND ",
|
||||
)
|
||||
#remove all x="" parts from the query where x is a key in kwargs
|
||||
|
||||
query = query[:-5]
|
||||
print(query)
|
||||
return __query(query)
|
||||
|
||||
def get_app_count_by_semester(self) -> tuple[list[str], list[int]]:
|
||||
"""get the apparats created and deleted in the distinct semesters"""
|
||||
|
||||
# get unique semesters
|
||||
query = "SELECT DISTINCT erstellsemester FROM semesterapparat"
|
||||
result = self.cur.execute(query).fetchall()
|
||||
semesters = [i[0] for i in result]
|
||||
created = []
|
||||
deleted = []
|
||||
for semester in semesters:
|
||||
query = f"SELECT COUNT(*) FROM semesterapparat WHERE erstellsemester='{semester}'"
|
||||
result = self.cur.execute(query).fetchone()
|
||||
created.append(result[0])
|
||||
query = f"SELECT COUNT(*) FROM semesterapparat WHERE deletion_status=1 AND deleted_date='{semester}'"
|
||||
result = self.cur.execute(query).fetchone()
|
||||
deleted.append(result[0])
|
||||
# store data in a tuple
|
||||
ret = []
|
||||
e_tuple = ()
|
||||
for sem in semesters:
|
||||
e_tuple = (
|
||||
sem,
|
||||
created[semesters.index(sem)],
|
||||
deleted[semesters.index(sem)],
|
||||
)
|
||||
ret.append(e_tuple)
|
||||
return ret
|
||||
# get the count of apparats created in the semesters
|
||||
|
||||
def apparats_by_semester(self, semester: str):
|
||||
"""Get a list of all created and deleted apparats in the given semester"""
|
||||
# get a list of apparats created and in the given semester
|
||||
query = f"SELECT name,prof_id FROM semesterapparat WHERE erstellsemester='{semester}'"
|
||||
result = self.cur.execute(query).fetchall()
|
||||
c_tmp = []
|
||||
for i in result:
|
||||
c_tmp.append((i[0], self.get_prof_name_by_id(i[1])))
|
||||
query = (
|
||||
f"SELECT name,prof_id FROM semesterapparat WHERE deleted_date='{semester}'"
|
||||
)
|
||||
result = self.cur.execute(query).fetchall()
|
||||
d_tmp = []
|
||||
for i in result:
|
||||
d_tmp.append((i[0], self.get_prof_name_by_id(i[1])))
|
||||
# group the apparats by prof
|
||||
c_ret = {}
|
||||
for i in c_tmp:
|
||||
if i[1] not in c_ret.keys():
|
||||
c_ret[i[1]] = [i[0]]
|
||||
else:
|
||||
c_ret[i[1]].append(i[0])
|
||||
d_ret = {}
|
||||
for i in d_tmp:
|
||||
if i[1] not in d_ret.keys():
|
||||
d_ret[i[1]] = [i[0]]
|
||||
else:
|
||||
d_ret[i[1]].append(i[0])
|
||||
return {"created": c_ret, "deleted": d_ret}
|
||||
|
||||
def delete_message(self, message_id):
|
||||
query = "DELETE FROM messages WHERE id=?"
|
||||
params = (message_id,)
|
||||
self.cur.execute(query, params)
|
||||
self.database.commit()
|
||||
|
||||
def delete_medium(self, title_id):
|
||||
# delete the bookdata from the media table
|
||||
query = "UPDATE media SET deleted=1 WHERE id=?"
|
||||
params = (title_id,)
|
||||
self.cur.execute(query, params)
|
||||
self.database.commit()
|
||||
pass
|
||||
|
||||
def update_bookdata(self, bookdata: BookData, title_id):
|
||||
query = "UPDATE media SET bookdata=? WHERE id=?"
|
||||
converted = pickle.dumps(bookdata)
|
||||
params = (converted, title_id)
|
||||
self.cur.execute(query, params)
|
||||
self.database.commit()
|
||||
|
||||
def get_specific_book(self, book_id):
|
||||
query = "SELECT bookdata FROM media WHERE id=?"
|
||||
params = (book_id,)
|
||||
result = self.cur.execute(query, params).fetchone()
|
||||
return pickle.loads(result[0])
|
||||
|
||||
def get_media(self, app_id, prof_id, del_state=0) -> list[dict[int, BookData, int]]:
|
||||
"""request media from database and return result as list.
|
||||
|
||||
Args:
|
||||
----
|
||||
- app_id (int): ID of the apparat
|
||||
- prof_id (int): ID of the prof
|
||||
- del_state (int, optional): If deleted books should be requested as well. 1 = yes 0 = no. Defaults to 0.
|
||||
|
||||
Returns:
|
||||
-------
|
||||
- list[dict[int,BookData,int]]: Returns a list of dictionaries containing the bookdata, the id and the availability of the book in the following format:
|
||||
-------
|
||||
{"id": int,
|
||||
"bookdata": BookData,
|
||||
"available": int}
|
||||
"""
|
||||
query = f"SELECT id,bookdata,available FROM media WHERE (app_id={app_id} AND prof_id={prof_id}) AND (deleted={del_state if del_state == 0 else '1 OR deleted=0'})"
|
||||
logger.log_info(f"Requesting media from database with query: {query}")
|
||||
result = self.cur.execute(query).fetchall()
|
||||
ret_result = []
|
||||
for result_a in result:
|
||||
ic(result_a)
|
||||
data = {"id": int, "bookdata": BookData, "available": int}
|
||||
data["id"] = result_a[0]
|
||||
data["bookdata"] = pickle.loads(result_a[1])
|
||||
data["available"] = result_a[2]
|
||||
ret_result.append(data)
|
||||
return ret_result
|
||||
|
||||
def get_subjects_and_aliases(self):
|
||||
query = "SELECT subjects.name, aliases.name FROM subjects LEFT JOIN aliases ON subjects.id = aliases.subject_id"
|
||||
return self.cur.execute(query).fetchall()
|
||||
|
||||
def get_subjects(self):
|
||||
query = "SELECT id,name FROM subjects"
|
||||
return self.cur.execute(query).fetchall()
|
||||
|
||||
def get_aliases(self,subject_id):
|
||||
query = f"SELECT name FROM aliases WHERE subject_id={subject_id}"
|
||||
return self.cur.execute(query).fetchall()
|
||||
|
||||
def add_subject(self,subject_name):
|
||||
query = f"INSERT INTO subjects (name) VALUES ('{subject_name}')"
|
||||
self.cur.execute(query)
|
||||
self.database.commit()
|
||||
|
||||
def get_apparats_by_prof(self,prof_id):
|
||||
query = f"SELECT * FROM semesterapparat WHERE prof_id={prof_id}"
|
||||
return self.cur.execute(query).fetchall()
|
||||
def add_alias(self,alias_name,subject):
|
||||
query = f"SELECT id FROM subjects WHERE name='{subject}'"
|
||||
subject_id = self.cur.execute(query).fetchone()[0]
|
||||
query = f"INSERT INTO aliases (name,subject_id) VALUES ('{alias_name}',{subject_id})"
|
||||
self.cur.execute(query)
|
||||
self.database.commit()
|
||||
|
||||
def update_apparat(self, apparat_data: ApparatData):
|
||||
data = apparat_data
|
||||
query = f"UPDATE semesterapparat SET name = ?, fach = ?, dauer = ?, prof_id = ? WHERE appnr = ?"
|
||||
params = (
|
||||
data.appname,
|
||||
data.app_fach,
|
||||
data.dauerapp,
|
||||
self.get_prof_id(data.profname),
|
||||
data.appnr,
|
||||
)
|
||||
print(query)
|
||||
self.cur.execute(query, params)
|
||||
self.database.commit()
|
||||
|
||||
def delete_apparat(self, appnr: str, semester: str):
|
||||
# update the deletion status to 1 and the deleted_state to semester for the given apparat
|
||||
query = f"UPDATE semesterapparat SET deletion_status=1, deleted_date='{semester}' WHERE appnr='{appnr}'"
|
||||
self.cur.execute(query)
|
||||
self.database.commit()
|
||||
|
||||
def get_book_id(self, bookdata: BookData, app_id: int, prof_id: int):
|
||||
query = "SELECT id FROM media WHERE bookdata=? AND app_id=? AND prof_id=?"
|
||||
params = (pickle.loads(bookdata), app_id, prof_id)
|
||||
result = self.cur.execute(query, params).fetchone()
|
||||
return result
|
||||
|
||||
|
||||
|
||||
def set_availability(self, book_id, available):
|
||||
query = "UPDATE media SET available=? WHERE id=?"
|
||||
params = (available, book_id)
|
||||
self.cur.execute(query, params)
|
||||
self.database.commit()
|
||||
|
||||
def get_latest_book_id(self):
|
||||
query = "SELECT id FROM media ORDER BY id DESC LIMIT 1"
|
||||
result = self.cur.execute(query).fetchone()
|
||||
return result[0]
|
||||
|
||||
def close(self):
|
||||
self.database.close()
|
||||
|
||||
def login(self, username, hashed_password) -> bool:
|
||||
# check if the user and password exist in the database
|
||||
# if yes, return True
|
||||
# if no, return False
|
||||
query = "SELECT salt FROM user WHERE username=?"
|
||||
params = (username,)
|
||||
result = self.cur.execute(query, params).fetchone()
|
||||
|
||||
if result is None:
|
||||
return False
|
||||
salt = result[0]
|
||||
print(salt)
|
||||
query = "SELECT password FROM user WHERE username=?"
|
||||
params = (str(username),)
|
||||
result = self.cur.execute(query, params).fetchone()
|
||||
password = result[0]
|
||||
if password == f"{salt}{hashed_password}":
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
# admin stuff below here
|
||||
def get_users(self):
|
||||
query = "SELECT * FROM user"
|
||||
return self.cur.execute(query).fetchall()
|
||||
|
||||
def get_apparats(self) -> list[tuple]:
|
||||
query = "SELECT * FROM semesterapparat"
|
||||
return self.cur.execute(query).fetchall()
|
||||
|
||||
def change_password(self, user, password):
|
||||
saltq = "SELECT salt FROM user WHERE username=?"
|
||||
params = (user,)
|
||||
salt = self.cur.execute(saltq, params).fetchone()[0]
|
||||
password = f"{salt}{password}"
|
||||
query = "UPDATE user SET password=? WHERE username=?"
|
||||
params = (password, user)
|
||||
self.cur.execute(query, params)
|
||||
self.database.commit()
|
||||
|
||||
def get_role(self, username):
|
||||
query = "SELECT role FROM user WHERE username=?"
|
||||
params = (username,)
|
||||
result = self.cur.execute(query,params).fetchone()
|
||||
return result[0]
|
||||
|
||||
def get_roles(self):
|
||||
query = "SELECT role FROM user"
|
||||
return self.cur.execute(query).fetchall()
|
||||
|
||||
def create_user(self, username, password, role, salt):
|
||||
"""Create a user based on passed data.
|
||||
|
||||
Args:
|
||||
----
|
||||
- username (str): Username to be used
|
||||
- password (str): the salted password
|
||||
- role (str): Role of the user
|
||||
- salt (str): a random salt for the user
|
||||
"""
|
||||
query = "INSERT OR IGNORE INTO user (username, password, role, salt) VALUES (?, ?, ?, ?)"
|
||||
params = (username, password, role, salt)
|
||||
self.cur.execute(query, params)
|
||||
self.database.commit()
|
||||
|
||||
def delete_user(self, user):
|
||||
query = "DELETE FROM user WHERE username=?"
|
||||
params = (user,)
|
||||
self.cur.execute(query, params)
|
||||
self.database.commit()
|
||||
|
||||
def get_faculty_members(self,name:str=None):
|
||||
query = "SELECT titel, fname,lname,mail,telnr,fullname FROM prof"
|
||||
if name:
|
||||
query = query.replace(",fullname", "")
|
||||
query += f" WHERE fullname='{name}'"
|
||||
return self.cur.execute(query).fetchall()
|
||||
|
||||
def update_faculty_member(self,data,oldlname,oldfname):
|
||||
placeholders = ', '.join(f"{k} = :{k}" for k in data.keys())
|
||||
sql = f"UPDATE prof SET {placeholders} WHERE lname = :oldlname AND fname = :oldfname"
|
||||
data["oldlname"] = oldlname
|
||||
data["oldfname"] = oldfname
|
||||
print(sql, data)
|
||||
self.cur.execute(sql, data)
|
||||
self.database.commit()
|
||||
|
||||
def faculty_data(self,name):
|
||||
query = f"SELECT * FROM prof WHERE fullname='{name}'"
|
||||
result = self.cur.execute(query).fetchone()
|
||||
return result
|
||||
|
||||
def update_user(self,username, data:dict[str,str]):
|
||||
|
||||
query = "UPDATE user SET "
|
||||
for key,value in data.items():
|
||||
if key == "username":
|
||||
continue
|
||||
query += f"{key}='{value}',"
|
||||
query = query[:-1]
|
||||
query += " WHERE username=?"
|
||||
params = (username,)
|
||||
|
||||
self.cur.execute(query,params)
|
||||
self.database.commit()
|
||||
|
||||
def check_username(self,username):
|
||||
query = "SELECT username FROM user WHERE username=?"
|
||||
params = (username,)
|
||||
result = self.cur.execute(query,params).fetchone()
|
||||
if result is None:
|
||||
return False
|
||||
return True
|
||||
def get_apparats_name(self, app_id,prof_id):
|
||||
query = f"SELECT name FROM semesterapparat WHERE appnr={app_id} AND prof_id={prof_id}"
|
||||
ic(query)
|
||||
result = self.cur.execute(query).fetchone()
|
||||
return result[0]
|
||||
|
||||
def search_book(self, data:dict[str,str])->list[tuple[BookData,int]]:
|
||||
query = "SELECT * FROM media "
|
||||
result = self.database.execute(query).fetchall()
|
||||
ret = []
|
||||
#get length of data dict
|
||||
length = len(data)
|
||||
mode = 0
|
||||
if length == 1:
|
||||
if "signature" in data.keys():
|
||||
mode = 1
|
||||
elif "title" in data.keys():
|
||||
mode = 2
|
||||
elif length == 2:
|
||||
mode = 3
|
||||
else:
|
||||
return None
|
||||
print(len(result))
|
||||
for res in result:
|
||||
bookdata = pickle.loads(res[1])
|
||||
app_id = res[2]
|
||||
prof_id = res[3]
|
||||
#if signature and title present in dict:
|
||||
#if signature present in dict:
|
||||
if mode == 1:
|
||||
if data["signature"] in bookdata.signature:
|
||||
ret.append((bookdata,app_id,prof_id))
|
||||
#if title present in dict:
|
||||
elif mode == 2:
|
||||
if data["title"] in bookdata.title:
|
||||
ret.append((bookdata,app_id,prof_id))
|
||||
elif mode == 3:
|
||||
if data["signature"] in bookdata.signature and data["title"] in bookdata.title:
|
||||
ret.append((bookdata,app_id,prof_id))
|
||||
return ret
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
db = Database()
|
||||
print(db.login("kirchner", "loginpass"))
|
||||
130
src/backend/db.py
Normal file
130
src/backend/db.py
Normal file
@@ -0,0 +1,130 @@
|
||||
import sqlite3
|
||||
from omegaconf import OmegaConf
|
||||
config = OmegaConf.load("config.yaml")
|
||||
subjects = config.subjects
|
||||
|
||||
# Connect to the database
|
||||
def main(database):
|
||||
conn = sqlite3.connect(database)
|
||||
conn.execute(
|
||||
"""CREATE TABLE app_kontos (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
app_id INTEGER,
|
||||
konto INTEGER,
|
||||
passwort TEXT,
|
||||
FOREIGN KEY (app_id) REFERENCES semesterapparat (id)
|
||||
)"""
|
||||
)
|
||||
|
||||
conn.execute(
|
||||
"""CREATE TABLE files (
|
||||
id INTEGER PRIMARY KEY,
|
||||
filename TEXT,
|
||||
fileblob BLOB,
|
||||
app_id INTEGER,
|
||||
filetyp TEXT,
|
||||
prof_id INTEGER REFERENCES prof (id),
|
||||
FOREIGN KEY (app_id) REFERENCES semesterapparat (id)
|
||||
)"""
|
||||
)
|
||||
|
||||
conn.execute(
|
||||
"""CREATE TABLE media (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
bookdata BLOB,
|
||||
app_id INTEGER,
|
||||
prof_id INTEGER,
|
||||
deleted INTEGER DEFAULT (0),
|
||||
available BOOLEAN,
|
||||
reservation BOOLEAN,
|
||||
FOREIGN KEY (prof_id) REFERENCES prof (id),
|
||||
FOREIGN KEY (app_id) REFERENCES semesterapparat (id)
|
||||
)"""
|
||||
)
|
||||
|
||||
conn.execute(
|
||||
"""CREATE TABLE messages (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
created_at date NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
message TEXT NOT NULL,
|
||||
remind_at date NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
user_id INTEGER NOT NULL,
|
||||
appnr INTEGER,
|
||||
FOREIGN KEY (user_id) REFERENCES user (id)
|
||||
)"""
|
||||
)
|
||||
|
||||
conn.execute(
|
||||
"""CREATE TABLE prof (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
titel TEXT,
|
||||
fname TEXT,
|
||||
lname TEXT,
|
||||
fullname TEXT NOT NULL UNIQUE,
|
||||
mail TEXT,
|
||||
telnr TEXT
|
||||
)"""
|
||||
)
|
||||
|
||||
conn.execute(
|
||||
"""CREATE TABLE semesterapparat (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
name TEXT,
|
||||
prof_id INTEGER,
|
||||
fach TEXT,
|
||||
appnr INTEGER,
|
||||
erstellsemester TEXT,
|
||||
verlängert_am TEXT,
|
||||
dauer BOOLEAN,
|
||||
verlängerung_bis TEXT,
|
||||
deletion_status INTEGER,
|
||||
deleted_date TEXT,
|
||||
apparat_id_adis INTEGER,
|
||||
prof_id_adis INTEGER,
|
||||
konto INTEGER REFERENCES app_kontos (id),
|
||||
FOREIGN KEY (prof_id) REFERENCES prof (id)
|
||||
)"""
|
||||
)
|
||||
|
||||
conn.execute(
|
||||
"""CREATE TABLE user (
|
||||
id integer NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
created_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
username TEXT NOT NULL UNIQUE,
|
||||
password TEXT NOT NULL,
|
||||
salt TEXT NOT NULL,
|
||||
role TEXT NOT NULL,
|
||||
email TEXT UNIQUE,
|
||||
name TEXT
|
||||
)"""
|
||||
)
|
||||
conn.execute(
|
||||
"""
|
||||
CREATE TABLE subjects (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
name TEXT NOT NULL UNIQUE
|
||||
)
|
||||
"""
|
||||
)
|
||||
|
||||
conn.execute(
|
||||
"""
|
||||
CREATE TABLE aliases (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
name TEXT NOT NULL UNIQUE,
|
||||
subject_id INTEGER,
|
||||
FOREIGN KEY (subject_id) REFERENCES subjects (id)
|
||||
)
|
||||
"""
|
||||
)
|
||||
|
||||
# Commit the changes and close the connection
|
||||
conn.commit()
|
||||
#insert subjects
|
||||
|
||||
|
||||
conn.close()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
9
src/backend/pickles.py
Normal file
9
src/backend/pickles.py
Normal file
@@ -0,0 +1,9 @@
|
||||
import pickle
|
||||
from typing import ByteString, Any
|
||||
|
||||
def make_pickle(data:Any):
|
||||
return pickle.dumps(data)
|
||||
|
||||
|
||||
def load_pickle(data:ByteString):
|
||||
return pickle.loads(data)
|
||||
26
src/backend/settings.py
Normal file
26
src/backend/settings.py
Normal file
@@ -0,0 +1,26 @@
|
||||
from dataclasses import dataclass, field
|
||||
|
||||
import yaml
|
||||
|
||||
|
||||
@dataclass
|
||||
class Settings:
|
||||
"""Settings for the app."""
|
||||
|
||||
save_path: str
|
||||
database_name: str
|
||||
database_path: str
|
||||
bib_id: str
|
||||
default_apps: bool = True
|
||||
custom_applications: list[dict] = field(default_factory=list)
|
||||
|
||||
def save_settings(self):
|
||||
"""Save the settings to the config file."""
|
||||
with open("config.yaml", "w") as f:
|
||||
yaml.dump(self.__dict__, f)
|
||||
|
||||
def load_settings(self):
|
||||
"""Load the settings from the config file."""
|
||||
with open("config.yaml", "r") as f:
|
||||
data = yaml.safe_load(f)
|
||||
return data
|
||||
0
src/logic/__init__.py
Normal file
0
src/logic/__init__.py
Normal file
59
src/logic/c_sort.py
Normal file
59
src/logic/c_sort.py
Normal file
@@ -0,0 +1,59 @@
|
||||
from typing import List, Tuple
|
||||
|
||||
from natsort import natsorted
|
||||
|
||||
|
||||
def custom_sort(unsorted: List[Tuple[str, int, int]]) -> List[Tuple[str, int, int]]:
|
||||
"""Sort a list of semesters in the format "SoSe n" and "WiSe n/n+1" in the correct order.
|
||||
Where n == year in 2 digit format
|
||||
|
||||
Args:
|
||||
----
|
||||
unsorted (list[tuple]): List of semesters in the format "SoSe n" and "WiSe n/n+1"
|
||||
|
||||
Returns:
|
||||
-------
|
||||
ret (list[tuple]): Sorted list in correct order of WiSe n/n+1 and SoSe n
|
||||
"""
|
||||
summer = natsorted([i for i in unsorted if "SoSe" in i[0]])
|
||||
winter = natsorted([i for i in unsorted if "WiSe" in i[0]])
|
||||
summer = natsorted(summer, key=lambda x: x[0])
|
||||
winter = natsorted(winter, key=lambda x: x[0])
|
||||
|
||||
# Merge the lists
|
||||
ret = []
|
||||
i = 0
|
||||
j = 0
|
||||
while i < len(summer) and j < len(winter):
|
||||
if summer[i][0][5:] <= winter[j][0][5:]:
|
||||
ret.append(summer[i])
|
||||
i += 1
|
||||
else:
|
||||
ret.append(winter[j])
|
||||
j += 1
|
||||
|
||||
# Append the remaining items
|
||||
while i < len(summer):
|
||||
ret.append(summer[i])
|
||||
i += 1
|
||||
while j < len(winter):
|
||||
ret.append(winter[j])
|
||||
j += 1
|
||||
|
||||
return ret
|
||||
|
||||
# Test the function
|
||||
|
||||
pass
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unsorted = [
|
||||
("WiSe 23/24", 7, 5),
|
||||
("SoSe 23", 5, 0),
|
||||
("SoSe 22", 1, 0),
|
||||
("WiSe 22/23", 1, 0),
|
||||
("SoSe 15", 1, 0),
|
||||
]
|
||||
|
||||
print(custom_sort(unsorted))
|
||||
221
src/logic/constants.py
Normal file
221
src/logic/constants.py
Normal file
@@ -0,0 +1,221 @@
|
||||
APP_NRS = [i for i in range(1, 181)]
|
||||
|
||||
PROF_TITLES = [
|
||||
"Dr. mult.",
|
||||
"Dr. paed.",
|
||||
"Dr. rer. pol.",
|
||||
"Dr. sc. techn.",
|
||||
"Drs.",
|
||||
"Dr. agr.",
|
||||
"Dr. habil.",
|
||||
"Dr. oec.",
|
||||
"Dr. med.",
|
||||
"Dr. e. h.",
|
||||
"Dr. oec. publ.",
|
||||
"Dr. -Ing.",
|
||||
"Dr. theol.",
|
||||
"Dr. med. vet.",
|
||||
"Dr. ing.",
|
||||
"Dr. rer. nat.",
|
||||
"Dr. des.",
|
||||
"Dr. sc. mus.",
|
||||
"Dr. h. c.",
|
||||
"Dr. pharm.",
|
||||
"Dr. med. dent.",
|
||||
"Dr. phil. nat.",
|
||||
"Dr. phil.",
|
||||
"Dr. iur.",
|
||||
"Dr.",
|
||||
"Kein Titel",
|
||||
]
|
||||
SEMAP_MEDIA_ACCOUNT_PREFIX = "10080"
|
||||
semaps = {
|
||||
"1": "0005",
|
||||
"2": "0018",
|
||||
"3": "0021",
|
||||
"4": "0034",
|
||||
"5": "0047",
|
||||
"6": "0050",
|
||||
"7": "0063",
|
||||
"8": "0076",
|
||||
"9": "0089",
|
||||
"10": "0092",
|
||||
"11": "0104",
|
||||
"12": "0117",
|
||||
"13": "0120",
|
||||
"14": "0133",
|
||||
"15": "0146",
|
||||
"16": "0159",
|
||||
"17": "0162",
|
||||
"18": "0175",
|
||||
"19": "0188",
|
||||
"20": "0191",
|
||||
"21": "0203",
|
||||
"22": "0216",
|
||||
"23": "0229",
|
||||
"24": "0232",
|
||||
"25": "0245",
|
||||
"26": "0258",
|
||||
"27": "0261",
|
||||
"28": "0274",
|
||||
"29": "0287",
|
||||
"30": "0290",
|
||||
"31": "0302",
|
||||
"32": "0315",
|
||||
"33": "0328",
|
||||
"34": "0331",
|
||||
"35": "0344",
|
||||
"36": "0357",
|
||||
"37": "0360",
|
||||
"38": "0373",
|
||||
"39": "0386",
|
||||
"40": "0399",
|
||||
"41": "0401",
|
||||
"42": "0414",
|
||||
"43": "0427",
|
||||
"44": "0430",
|
||||
"45": "0443",
|
||||
"46": "0456",
|
||||
"47": "0469",
|
||||
"48": "0472",
|
||||
"49": "0485",
|
||||
"50": "0498",
|
||||
"51": "0500",
|
||||
"52": "0513",
|
||||
"53": "0526",
|
||||
"54": "0539",
|
||||
"55": "0542",
|
||||
"56": "0555",
|
||||
"57": "0568",
|
||||
"58": "0571",
|
||||
"59": "0584",
|
||||
"60": "0597",
|
||||
"61": "0609",
|
||||
"62": "0612",
|
||||
"63": "0625",
|
||||
"64": "0638",
|
||||
"65": "0641",
|
||||
"66": "0654",
|
||||
"67": "0667",
|
||||
"68": "0670",
|
||||
"69": "0683",
|
||||
"70": "0696",
|
||||
"71": "0708",
|
||||
"72": "0711",
|
||||
"73": "0724",
|
||||
"74": "0737",
|
||||
"75": "0740",
|
||||
"76": "0753",
|
||||
"77": "0766",
|
||||
"78": "0779",
|
||||
"79": "0782",
|
||||
"80": "0795",
|
||||
"81": "0807",
|
||||
"82": "0810",
|
||||
"83": "0823",
|
||||
"84": "0836",
|
||||
"85": "0849",
|
||||
"86": "0852",
|
||||
"87": "0865",
|
||||
"88": "0878",
|
||||
"89": "0881",
|
||||
"90": "0894",
|
||||
"91": "0906",
|
||||
"92": "0919",
|
||||
"93": "0922",
|
||||
"94": "0935",
|
||||
"95": "0948",
|
||||
"96": "0951",
|
||||
"97": "0964",
|
||||
"98": "0977",
|
||||
"99": "0980",
|
||||
"100": "0993",
|
||||
"101": "1002",
|
||||
"102": "1015",
|
||||
"103": "1028",
|
||||
"104": "1031",
|
||||
"105": "1044",
|
||||
"106": "1057",
|
||||
"107": "1060",
|
||||
"108": "1073",
|
||||
"109": "1086",
|
||||
"110": "1099",
|
||||
"111": "1101",
|
||||
"112": "1114",
|
||||
"113": "1127",
|
||||
"114": "1130",
|
||||
"115": "1143",
|
||||
"116": "1156",
|
||||
"117": "1169",
|
||||
"118": "1172",
|
||||
"119": "1185",
|
||||
"120": "1198",
|
||||
"121": "1200",
|
||||
"122": "1213",
|
||||
"123": "1226",
|
||||
"124": "1239",
|
||||
"125": "1242",
|
||||
"126": "1255",
|
||||
"127": "1268",
|
||||
"128": "1271",
|
||||
"129": "1284",
|
||||
"130": "1297",
|
||||
"131": "1309",
|
||||
"132": "1312",
|
||||
"133": "1325",
|
||||
"134": "1338",
|
||||
"135": "1341",
|
||||
"136": "1354",
|
||||
"137": "1367",
|
||||
"138": "1370",
|
||||
"139": "1383",
|
||||
"140": "1396",
|
||||
"141": "1408",
|
||||
"142": "1411",
|
||||
"143": "1424",
|
||||
"144": "1437",
|
||||
"145": "1440",
|
||||
"146": "1453",
|
||||
"147": "1466",
|
||||
"148": "1479",
|
||||
"149": "1482",
|
||||
"150": "1495",
|
||||
"151": "1507",
|
||||
"152": "1510",
|
||||
"153": "1523",
|
||||
"154": "1536",
|
||||
"155": "1549",
|
||||
"156": "1552",
|
||||
"157": "1565",
|
||||
"158": "1578",
|
||||
"159": "1581",
|
||||
"160": "1594",
|
||||
"161": "1606",
|
||||
"162": "1619",
|
||||
"163": "1622",
|
||||
"164": "1635",
|
||||
"165": "1648",
|
||||
"166": "1651",
|
||||
"167": "1664",
|
||||
"168": "1677",
|
||||
"169": "1680",
|
||||
"170": "1693",
|
||||
"171": "1705",
|
||||
"172": "1718",
|
||||
"173": "1721",
|
||||
"174": "1734",
|
||||
"175": "1747",
|
||||
"176": "1750",
|
||||
"177": "1763",
|
||||
"178": "1776",
|
||||
"179": "1789",
|
||||
"180": "1792",
|
||||
}
|
||||
# take the semaps dict and add the prefix to the values
|
||||
for key, value in semaps.items():
|
||||
semaps[key] = f"{SEMAP_MEDIA_ACCOUNT_PREFIX}{value}{value[-1]}"
|
||||
SEMAP_MEDIA_ACCOUNTS = semaps
|
||||
|
||||
# for s in SEMAP_MEDIA_ACCOUNTS:
|
||||
# assert len(SEMAP_MEDIA_ACCOUNTS[s]) == 10, f"semap {s} has wrong length"
|
||||
# print(f"{SEMAP_MEDIA_ACCOUNTS[s]}")
|
||||
27
src/logic/csvparser.py
Normal file
27
src/logic/csvparser.py
Normal file
@@ -0,0 +1,27 @@
|
||||
import csv
|
||||
|
||||
import pandas as pdf
|
||||
|
||||
|
||||
def csv_to_list(path: str) -> list[str]:
|
||||
"""
|
||||
Extracts the data from a csv file and returns it as a pandas dataframe
|
||||
"""
|
||||
with open(path, newline='') as csvfile:
|
||||
reader = csv.reader(csvfile, delimiter=';', quotechar='|')
|
||||
data = []
|
||||
for row in reader:
|
||||
for i in range(len(row)):
|
||||
row[i] = row[i].replace('"', "")
|
||||
data.append(row)
|
||||
ret= []
|
||||
for i in data:
|
||||
ret.append(i[0])
|
||||
return ret
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
text = csv_to_list("C:/Users/aky547/Desktop/semap/71.csv")
|
||||
#remove linebreaks
|
||||
print(text)
|
||||
76
src/logic/dataclass.py
Normal file
76
src/logic/dataclass.py
Normal file
@@ -0,0 +1,76 @@
|
||||
import re
|
||||
from dataclasses import dataclass, field
|
||||
|
||||
|
||||
@dataclass
|
||||
class ApparatData:
|
||||
prof_title: str | None = None
|
||||
profname: str | None = None
|
||||
dauerapp: bool = False
|
||||
appnr: int | None = None
|
||||
appname: str | None = None
|
||||
app_fach: str | None = None
|
||||
semester: str | None = None
|
||||
erstellsemester: str | None = None
|
||||
prof_mail: str | None = None
|
||||
prof_tel: int | None = None
|
||||
deleted: int = 0
|
||||
prof_adis_id: int | None = None
|
||||
apparat_adis_id: int | None = None
|
||||
|
||||
def get_prof_details(self) -> dict:
|
||||
return {
|
||||
"prof_title": self.prof_title,
|
||||
"profname": self.profname,
|
||||
"prof_mail": self.prof_mail,
|
||||
"prof_tel": self.prof_tel,
|
||||
"fullname": self.profname,
|
||||
}
|
||||
|
||||
|
||||
@dataclass
|
||||
class BookData:
|
||||
ppn: str | None = None
|
||||
title: str | None = None
|
||||
signature: str | None = None
|
||||
edition: str | None = None
|
||||
link: str | None = None
|
||||
isbn: str | list | None = field(default_factory=list)
|
||||
author: str | None = None
|
||||
language: str | list | None = field(default_factory=list)
|
||||
publisher: str | None = None
|
||||
year: str | None = None
|
||||
pages: str | None = None
|
||||
# avaliability: dict | None = field(default_factory=dict)
|
||||
# def assign(self, field,value):
|
||||
# self.__setattr__(field,value)
|
||||
|
||||
def from_dict(self, data: dict):
|
||||
for key, value in data.items():
|
||||
setattr(self, key, value)
|
||||
|
||||
def to_dict(self):
|
||||
return self.__dict__
|
||||
|
||||
def from_dataclass(self, dataclass):
|
||||
for key, value in dataclass.__dict__.items():
|
||||
setattr(self, key, value)
|
||||
|
||||
def from_string(self, data: str):
|
||||
if not data.startswith("BookData"):
|
||||
raise ValueError("No valid BookData string")
|
||||
else:
|
||||
pattern = r"(\w+)='([^']*)'"
|
||||
data_dict = dict(re.findall(pattern, data))
|
||||
print(data_dict)
|
||||
for key, value in data_dict.items():
|
||||
setattr(self, key, value)
|
||||
return self
|
||||
|
||||
|
||||
@dataclass
|
||||
class MailData:
|
||||
subject: str | None = None
|
||||
body: str | None = None
|
||||
mailto: str | None = None
|
||||
prof: str | None = None
|
||||
45
src/logic/fileparser.py
Normal file
45
src/logic/fileparser.py
Normal file
@@ -0,0 +1,45 @@
|
||||
import csv
|
||||
|
||||
import pandas as pd
|
||||
from docx import Document
|
||||
|
||||
|
||||
def csv_to_list(path: str) -> list[str]:
|
||||
"""
|
||||
Extracts the data from a csv file and returns it as a pandas dataframe
|
||||
"""
|
||||
with open(path, newline="") as csvfile:
|
||||
reader = csv.reader(csvfile, delimiter=";", quotechar="|")
|
||||
data = []
|
||||
for row in reader:
|
||||
for i in range(len(row)):
|
||||
row[i] = row[i].replace('"', "")
|
||||
data.append(row)
|
||||
ret = []
|
||||
for i in data:
|
||||
ret.append(i[0])
|
||||
return ret
|
||||
|
||||
|
||||
def word_docx_to_csv(path) -> pd.DataFrame:
|
||||
doc = Document(path)
|
||||
tables = doc.tables
|
||||
|
||||
m_data = []
|
||||
for table in tables:
|
||||
data = []
|
||||
for row in table.rows:
|
||||
row_data = []
|
||||
for cell in row.cells:
|
||||
text = cell.text
|
||||
text = text.replace("\n", "")
|
||||
row_data.append(text)
|
||||
data.append(row_data)
|
||||
df = pd.DataFrame(data)
|
||||
df.columns = df.iloc[0]
|
||||
df = df.iloc[1:]
|
||||
|
||||
m_data.append(df)
|
||||
|
||||
df = m_data[2]
|
||||
return df
|
||||
31
src/logic/get_msword_content.py
Normal file
31
src/logic/get_msword_content.py
Normal file
@@ -0,0 +1,31 @@
|
||||
from docx import Document
|
||||
|
||||
data={}
|
||||
wordDoc = Document('files/Semesterapparat - Anmeldung.docx')
|
||||
paragraphs = wordDoc.tables
|
||||
for table in paragraphs:
|
||||
for column in table.columns:
|
||||
cellcount=0
|
||||
for cell in column.cells:
|
||||
if cellcount<12:
|
||||
cellcount+=1
|
||||
print(f'cell:{cell.text}')
|
||||
|
||||
|
||||
# print(f'paragraphs[{i}]: {paragraphs[i]}')
|
||||
# data[i] = paragraphs[i]
|
||||
|
||||
# for i in range(0, len(paragraphs)):
|
||||
# for i in range(2, len(paragraphs)):
|
||||
# data[i] = paragraphs[i]
|
||||
|
||||
print(data)
|
||||
|
||||
# for table in wordDoc.tables:
|
||||
# for row in table.rows:
|
||||
# print('---')
|
||||
# for cell in row.cells:
|
||||
# print(f'cell:{cell.text}')
|
||||
|
||||
|
||||
|
||||
11
src/logic/get_pdf_content.py
Normal file
11
src/logic/get_pdf_content.py
Normal file
@@ -0,0 +1,11 @@
|
||||
import tabula
|
||||
|
||||
|
||||
file="files/Semesterapparat - Anmeldung.pdf"
|
||||
|
||||
def extract_book_data(file):
|
||||
tables=tabula.read_pdf(file,pages="all",encoding="utf-8",multiple_tables=True)
|
||||
tabula.convert_into(file, file.replace(".pdf"), output_format="csv", pages="all")
|
||||
with open("files/Semesterapparat - Anmeldung.csv", "r") as f:
|
||||
content=f.read()
|
||||
|
||||
0
src/logic/mail.py
Normal file
0
src/logic/mail.py
Normal file
30
src/logic/pdfparser.py
Normal file
30
src/logic/pdfparser.py
Normal file
@@ -0,0 +1,30 @@
|
||||
# add depend path to system path
|
||||
import os
|
||||
import sys
|
||||
|
||||
import pandas as pd
|
||||
from pdfquery import PDFQuery
|
||||
|
||||
|
||||
def pdf_to_csv(path: str) -> pd.DataFrame:
|
||||
"""
|
||||
Extracts the data from a pdf file and returns it as a pandas dataframe
|
||||
"""
|
||||
file = PDFQuery(path)
|
||||
file.load()
|
||||
#get the text from the pdf file
|
||||
text_elems = file.extract([
|
||||
('with_formatter', 'text'),
|
||||
('all_text', '*')
|
||||
])
|
||||
extracted_text = text_elems['all_text']
|
||||
|
||||
return extracted_text
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
text = pdf_to_csv("54_pdf.pdf")
|
||||
#remove linebreaks
|
||||
text = text.replace("\n", "")
|
||||
print(text)
|
||||
|
||||
20
src/logic/settings.py
Normal file
20
src/logic/settings.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import yaml
|
||||
from dataclasses import dataclass, field
|
||||
|
||||
@dataclass
|
||||
class Settings:
|
||||
"""Settings for the app."""
|
||||
save_path: str
|
||||
database_name: str
|
||||
database_path: str
|
||||
default_apps:bool = True
|
||||
custom_applications: list[dict] = field(default_factory=list)
|
||||
def save_settings(self):
|
||||
"""Save the settings to the config file."""
|
||||
with open("config.yaml", "w") as f:
|
||||
yaml.dump(self.__dict__, f)
|
||||
|
||||
#open the config file and load the settings
|
||||
with open("config.yaml", "r") as f:
|
||||
data = yaml.safe_load(f)
|
||||
|
||||
195
src/logic/threads.py
Normal file
195
src/logic/threads.py
Normal file
@@ -0,0 +1,195 @@
|
||||
import threading
|
||||
import time
|
||||
|
||||
from PyQt6.QtCore import QThread, pyqtSignal
|
||||
|
||||
from src.backend.database import Database
|
||||
from log import MyLogger
|
||||
from src.transformers import RDS_AVAIL_DATA
|
||||
from src.logic.webrequest import BibTextTransformer, WebRequest
|
||||
import sqlite3
|
||||
|
||||
class BookGrabber(QThread):
|
||||
updateSignal = pyqtSignal(int, int)
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
mode: str = None,
|
||||
data: list = None,
|
||||
app_id: int = None,
|
||||
prof_id: int = None,
|
||||
parent=None,
|
||||
):
|
||||
super().__init__(parent)
|
||||
self.logger = MyLogger("Worker")
|
||||
self.logger.log_info("Starting worker thread")
|
||||
self.logger.log_info("Worker thread started")
|
||||
self.app_id = app_id
|
||||
self.prof_id = prof_id
|
||||
self.mode = mode
|
||||
self.data = data
|
||||
self.book_id = None
|
||||
self.db_lock = threading.Lock()
|
||||
|
||||
def run(self):
|
||||
self.db = Database()
|
||||
item = 0
|
||||
for entry in self.data:
|
||||
signature = str(entry)
|
||||
self.logger.log_info("Processing entry: " + signature)
|
||||
|
||||
webdata = WebRequest().get_ppn(entry).get_data()
|
||||
if webdata == "error":
|
||||
continue
|
||||
bd = BibTextTransformer(self.mode).get_data(webdata).return_data()
|
||||
transformer = BibTextTransformer("RDS")
|
||||
rds = transformer.get_data(webdata).return_data("rds_availability")
|
||||
bd.signature = entry
|
||||
with self.db_lock:
|
||||
#confirm lock is acquired
|
||||
print("lock acquired, adding book to database")
|
||||
self.db.add_medium(bd, self.app_id, self.prof_id)
|
||||
# get latest book id
|
||||
self.book_id = self.db.get_latest_book_id()
|
||||
self.logger.log_info("Added book to database")
|
||||
state = 0
|
||||
for rds_item in rds.items:
|
||||
sign = rds_item.superlocation
|
||||
loc = rds_item.location
|
||||
# print(item.location)
|
||||
if self.app_id in sign or self.app_id in loc:
|
||||
state = 1
|
||||
book_id = None
|
||||
# for book in self.books:
|
||||
# if book["bookdata"].signature == entry:
|
||||
# book_id = book["id"]
|
||||
# break
|
||||
self.logger.log_info(f"State of {signature}: {state}")
|
||||
with self.db_lock:
|
||||
print(
|
||||
"lock acquired, updating availability of "
|
||||
+ str(book_id)
|
||||
+ " to "
|
||||
+ str(state)
|
||||
)
|
||||
try:
|
||||
self.db.set_availability(self.book_id, state)
|
||||
except sqlite3.OperationalError as e:
|
||||
self.logger.log_error(f"Failed to update availability: {e}")
|
||||
break
|
||||
|
||||
# time.sleep(5)
|
||||
item += 1
|
||||
self.updateSignal.emit(item, len(self.data))
|
||||
self.logger.log_info("Worker thread finished")
|
||||
# teminate thread
|
||||
|
||||
self.quit()
|
||||
|
||||
|
||||
class AvailChecker(QThread):
|
||||
updateSignal = pyqtSignal(str, int)
|
||||
|
||||
def __init__(
|
||||
self, links: list = [], appnumber: int = None, parent=None, books=list[dict]
|
||||
):
|
||||
if links is None:
|
||||
links = []
|
||||
super().__init__(parent)
|
||||
self.logger = MyLogger("AvailChecker")
|
||||
self.logger.log_info("Starting worker thread")
|
||||
self.logger.log_info(
|
||||
"Checking availability for "
|
||||
+ str(links)
|
||||
+ " with appnumber "
|
||||
+ str(appnumber)
|
||||
+ "..."
|
||||
)
|
||||
self.links = links
|
||||
self.appnumber = appnumber
|
||||
self.books = books
|
||||
self.db_lock = threading.Lock()
|
||||
|
||||
def run(self):
|
||||
self.db = Database()
|
||||
state = 0
|
||||
|
||||
for link in self.links:
|
||||
self.logger.log_info("Processing entry: " + str(link))
|
||||
data = WebRequest().get_ppn(link).get_data()
|
||||
transformer = BibTextTransformer("RDS")
|
||||
rds = transformer.get_data(data).return_data("rds_availability")
|
||||
print(rds)
|
||||
for item in rds.items:
|
||||
sign = item.superlocation
|
||||
loc = item.location
|
||||
# print(item.location)
|
||||
if self.appnumber in sign or self.appnumber in loc:
|
||||
state = 1
|
||||
book_id = None
|
||||
for book in self.books:
|
||||
if book["bookdata"].signature == link:
|
||||
book_id = book["id"]
|
||||
break
|
||||
self.logger.log_info(f"State of {link}: " + str(state))
|
||||
with self.db_lock:
|
||||
print(
|
||||
"lock acquired, updating availability of "
|
||||
+ str(book_id)
|
||||
+ " to "
|
||||
+ str(state)
|
||||
)
|
||||
self.db.set_availability(book_id, state)
|
||||
break
|
||||
self.updateSignal.emit(item.callnumber, state)
|
||||
|
||||
self.logger.log_info("Worker thread finished")
|
||||
# teminate thread
|
||||
|
||||
self.quit()
|
||||
|
||||
|
||||
class AutoAdder(QThread):
|
||||
updateSignal = pyqtSignal(int)
|
||||
|
||||
setTextSignal = pyqtSignal(int)
|
||||
progress = pyqtSignal(int)
|
||||
|
||||
def __init__(self, data=None, app_id=None, prof_id=None, parent=None):
|
||||
super().__init__(parent)
|
||||
self.logger = MyLogger("AutoAdder")
|
||||
self.data = data
|
||||
self.app_id = app_id
|
||||
self.prof_id = prof_id
|
||||
|
||||
print("Launched AutoAdder")
|
||||
print(self.data, self.app_id, self.prof_id)
|
||||
|
||||
def run(self):
|
||||
self.db = Database()
|
||||
# show the dialog, start the thread to gather data and dynamically update progressbar and listwidget
|
||||
self.logger.log_info("Starting worker thread")
|
||||
item = 0
|
||||
for entry in self.data:
|
||||
try:
|
||||
# webdata = WebRequest().get_ppn(entry).get_data()
|
||||
# bd = BibTextTransformer("ARRAY").get_data(webdata).return_data()
|
||||
# bd.signature = entry
|
||||
self.updateSignal.emit(item)
|
||||
self.setTextSignal.emit(entry)
|
||||
# qsleep
|
||||
item += 1
|
||||
self.progress.emit(item)
|
||||
print(item, len(self.data))
|
||||
time.sleep(1)
|
||||
|
||||
except Exception as e:
|
||||
print(e)
|
||||
self.logger.log_exception(
|
||||
f"The query failed with message {e} for signature {entry}"
|
||||
)
|
||||
continue
|
||||
if item == len(self.data):
|
||||
self.logger.log_info("Worker thread finished")
|
||||
# teminate thread
|
||||
self.finished.emit()
|
||||
1974
src/logic/userInterface.py
Normal file
1974
src/logic/userInterface.py
Normal file
File diff suppressed because it is too large
Load Diff
176
src/logic/webrequest.py
Normal file
176
src/logic/webrequest.py
Normal file
@@ -0,0 +1,176 @@
|
||||
import requests
|
||||
from bs4 import BeautifulSoup
|
||||
from omegaconf import OmegaConf
|
||||
|
||||
from src.logic.dataclass import BookData
|
||||
from log import MyLogger
|
||||
from src.transformers import ARRAYData, BibTeXData, COinSData, RDSData, RISData
|
||||
#import sleep_and_retry decorator to retry requests
|
||||
from ratelimit import limits, sleep_and_retry
|
||||
|
||||
logger = MyLogger(__name__)
|
||||
config = OmegaConf.load("config.yaml")
|
||||
|
||||
API_URL = "https://rds.ibs-bw.de/phfreiburg/opac/RDSIndexrecord/{}/"
|
||||
PPN_URL = 'https://rds.ibs-bw.de/phfreiburg/opac/RDSIndex/Search?lookfor="{}"+&type=AllFields&limit=10&sort=py+desc%2C+title'
|
||||
TITLE = "RDS_TITLE"
|
||||
SIGNATURE = "RDS_SIGNATURE"
|
||||
EDITION = "RDS_EDITION"
|
||||
ISBN = "RDS_ISBN"
|
||||
AUTHOR = "RDS_PERSON"
|
||||
|
||||
HEADERS = {
|
||||
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 \
|
||||
(KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36",
|
||||
"Accept-Language": "en-US, en;q=0.5",
|
||||
}
|
||||
|
||||
|
||||
class WebRequest:
|
||||
def __init__(self) -> None:
|
||||
"""Request data from the web, and format it depending on the mode."""
|
||||
self.signature = None
|
||||
self.ppn = None
|
||||
self.data = None
|
||||
logger.log_info("Initialized WebRequest")
|
||||
|
||||
def get_ppn(self, signature):
|
||||
self.signature = signature
|
||||
if "+" in signature:
|
||||
signature = signature.replace("+", "%2B")
|
||||
if "doi.org" in signature:
|
||||
signature = signature.split("/")[-1]
|
||||
url = PPN_URL.format(signature)
|
||||
page = requests.get(url)
|
||||
|
||||
soup = BeautifulSoup(page.content, "html.parser", from_encoding="utf-8")
|
||||
if soup.find("div", class_="media") is None:
|
||||
logger.log_error(f"No data found for {signature}")
|
||||
return self
|
||||
ppn = soup.find("div", class_="media").get("id")
|
||||
self.ppn = ppn
|
||||
return self
|
||||
|
||||
def get_link_data(self):
|
||||
page = requests.get(PPN_URL.format(self.ppn))
|
||||
soup = BeautifulSoup(page.content, "html.parser")
|
||||
# find div that contains daia_ in the id
|
||||
# find the pre tag in that div
|
||||
# return the text
|
||||
# div = soup.find("div",id=lambda x: x and "daia_" in x)
|
||||
# pre = div.find("pre")
|
||||
return soup
|
||||
|
||||
def get_data(self) -> list[str] | str:
|
||||
# url = API_URL.format(self.ppn)
|
||||
if self.ppn is None:
|
||||
logger.log_error("No PPN found")
|
||||
return "error"
|
||||
page = requests.get(API_URL.format(self.ppn))
|
||||
logger.log_info(f"Requesting data from {API_URL.format(self.ppn)}")
|
||||
logger.log_info(f"Status code: {page.status_code}")
|
||||
# print(page.content)
|
||||
soup = BeautifulSoup(page.content, "html.parser")
|
||||
pre_tag = soup.find_all("pre")
|
||||
# print(pre_tag)
|
||||
return_data = []
|
||||
|
||||
if pre_tag:
|
||||
for tag in pre_tag:
|
||||
data = tag.text.strip()
|
||||
return_data.append(data)
|
||||
return return_data
|
||||
else:
|
||||
print("No <pre> tag found")
|
||||
logger.log_error("No <pre> tag found")
|
||||
return return_data
|
||||
|
||||
|
||||
class BibTextTransformer:
|
||||
def __init__(self, mode: str) -> None:
|
||||
self.mode = mode
|
||||
self.field = None
|
||||
# print(self.field)
|
||||
self.data = None
|
||||
# self.bookdata = BookData(**self.data)
|
||||
|
||||
def get_data(self, data: list) -> str:
|
||||
RIS_IDENT = "TY -"
|
||||
ARRAY_IDENT = "[kid]"
|
||||
COinS_IDENT = "ctx_ver"
|
||||
BIBTEX_IDENT = "@book"
|
||||
RDS_IDENT = "RDS ---------------------------------- "
|
||||
if self.mode == "RIS":
|
||||
for line in data:
|
||||
if RIS_IDENT in line:
|
||||
self.data = line
|
||||
elif self.mode == "ARRAY":
|
||||
for line in data:
|
||||
if ARRAY_IDENT in line:
|
||||
self.data = line
|
||||
elif self.mode == "COinS":
|
||||
for line in data:
|
||||
if COinS_IDENT in line:
|
||||
self.data = line
|
||||
elif self.mode == "BibTeX":
|
||||
for line in data:
|
||||
if BIBTEX_IDENT in line:
|
||||
self.data = line
|
||||
elif self.mode == "RDS":
|
||||
for line in data:
|
||||
if RDS_IDENT in line:
|
||||
self.data = line
|
||||
return self
|
||||
|
||||
def return_data(self, option=None) -> BookData:
|
||||
"""Return Data to caller.
|
||||
|
||||
Args:
|
||||
option (string, optional): Option for RDS as there are two filetypes. Use rds_availability or rds_data. Anything else gives a dict of both responses. Defaults to None.
|
||||
|
||||
Returns:
|
||||
BookData: _description_
|
||||
"""
|
||||
if self.mode == "ARRAY":
|
||||
return ARRAYData().transform(self.data)
|
||||
elif self.mode == "COinS":
|
||||
return COinSData().transform(self.data)
|
||||
elif self.mode == "BibTeX":
|
||||
return BibTeXData().transform(self.data)
|
||||
elif self.mode == "RIS":
|
||||
return RISData().transform(self.data)
|
||||
elif self.mode == "RDS":
|
||||
return RDSData().transform(self.data).return_data(option)
|
||||
|
||||
|
||||
def cover(isbn):
|
||||
test_url = f"https://www.buchhandel.de/cover/{isbn}/{isbn}-cover-m.jpg"
|
||||
print(test_url)
|
||||
data = requests.get(test_url, stream=True)
|
||||
return data.content
|
||||
|
||||
|
||||
def get_content(soup, css_class):
|
||||
return soup.find("div", class_=css_class).text.strip()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print("main")
|
||||
link = "ZE 77000 W492"
|
||||
data = WebRequest().get_ppn(link).get_data()
|
||||
|
||||
print(data)
|
||||
# # data.get_ppn("ME 3000 S186 (2)")
|
||||
# # print(data.ppn)
|
||||
# # desc=data.get_data()
|
||||
# # print(type(desc))
|
||||
# # print(desc)
|
||||
# txt = (
|
||||
# BibTextTransformer("RIS")
|
||||
# .get_data(WebRequest().get_ppn("ST 250 U42 (15)").get_data())
|
||||
# .return_data()
|
||||
# )
|
||||
# print(txt)
|
||||
|
||||
# print(data)
|
||||
# print(BibTextTransformer(data).bookdata)
|
||||
26
src/logic/wordparser.py
Normal file
26
src/logic/wordparser.py
Normal file
@@ -0,0 +1,26 @@
|
||||
import pandas as pd
|
||||
from docx import Document
|
||||
|
||||
|
||||
def word_docx_to_csv(path) -> pd.DataFrame:
|
||||
doc = Document(path)
|
||||
tables = doc.tables
|
||||
|
||||
m_data = []
|
||||
for table in tables:
|
||||
data = []
|
||||
for row in table.rows:
|
||||
row_data = []
|
||||
for cell in row.cells:
|
||||
text = cell.text
|
||||
text = text.replace("\n", "")
|
||||
row_data.append(text)
|
||||
data.append(row_data)
|
||||
df = pd.DataFrame(data)
|
||||
df.columns = df.iloc[0]
|
||||
df = df.iloc[1:]
|
||||
|
||||
m_data.append(df)
|
||||
|
||||
df = m_data[2]
|
||||
return df
|
||||
1
src/transformers/__init__.py
Normal file
1
src/transformers/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from .transformers import RDS_AVAIL_DATA, ARRAYData, COinSData, BibTeXData, RISData, RDSData
|
||||
310
src/transformers/transformers.py
Normal file
310
src/transformers/transformers.py
Normal file
@@ -0,0 +1,310 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import re
|
||||
from dataclasses import dataclass
|
||||
from dataclasses import field as dataclass_field
|
||||
from typing import Any, List, Optional
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from src.logic.dataclass import BookData
|
||||
from log import MyLogger
|
||||
|
||||
logger = MyLogger("transformers.py")
|
||||
|
||||
|
||||
###Pydatnic models
|
||||
@dataclass
|
||||
class Item:
|
||||
superlocation: str | None = dataclass_field(default_factory=str)
|
||||
status: str | None = dataclass_field(default_factory=str)
|
||||
availability: str | None = dataclass_field(default_factory=str)
|
||||
notes: str | None = dataclass_field(default_factory=str)
|
||||
limitation: str | None = dataclass_field(default_factory=str)
|
||||
duedate: str | None = dataclass_field(default_factory=str)
|
||||
id: str | None = dataclass_field(default_factory=str)
|
||||
item_id: str | None = dataclass_field(default_factory=str)
|
||||
ilslink: str | None = dataclass_field(default_factory=str)
|
||||
number: int | None = dataclass_field(default_factory=int)
|
||||
barcode: str | None = dataclass_field(default_factory=str)
|
||||
reserve: str | None = dataclass_field(default_factory=str)
|
||||
callnumber: str | None = dataclass_field(default_factory=str)
|
||||
department: str | None = dataclass_field(default_factory=str)
|
||||
locationhref: str | None = dataclass_field(default_factory=str)
|
||||
location: str | None = dataclass_field(default_factory=str)
|
||||
|
||||
def from_dict(self, data: dict) -> self:
|
||||
"""Import data from dict"""
|
||||
data = data["items"]
|
||||
for entry in data:
|
||||
for key, value in entry.items():
|
||||
setattr(self, key, value)
|
||||
return self
|
||||
|
||||
|
||||
@dataclass
|
||||
class RDS_AVAIL_DATA:
|
||||
"""Class to store RDS availability data"""
|
||||
|
||||
library_sigil: str = dataclass_field(default_factory=str)
|
||||
items: List[Item] = dataclass_field(default_factory=list)
|
||||
|
||||
def import_from_dict(self, data: str) -> self:
|
||||
"""Import data from dict"""
|
||||
edata = json.loads(data)
|
||||
# library sigil is first key
|
||||
|
||||
self.library_sigil = str(list(edata.keys())[0])
|
||||
# get data from first key
|
||||
edata = edata[self.library_sigil]
|
||||
for location in edata:
|
||||
item = Item(superlocation=location).from_dict(edata[location])
|
||||
|
||||
self.items.append(item)
|
||||
return self
|
||||
|
||||
|
||||
@dataclass
|
||||
class RDS_DATA:
|
||||
"""Class to store RDS data"""
|
||||
|
||||
RDS_SIGNATURE: str = dataclass_field(default_factory=str)
|
||||
RDS_STATUS: str = dataclass_field(default_factory=str)
|
||||
RDS_LOCATION: str = dataclass_field(default_factory=str)
|
||||
RDS_URL: Any = dataclass_field(default_factory=str)
|
||||
RDS_HINT: Any = dataclass_field(default_factory=str)
|
||||
RDS_COMMENT: Any = dataclass_field(default_factory=str)
|
||||
RDS_HOLDING: Any = dataclass_field(default_factory=str)
|
||||
RDS_HOLDING_LEAK: Any = dataclass_field(default_factory=str)
|
||||
RDS_INTERN: Any = dataclass_field(default_factory=str)
|
||||
RDS_PROVENIENCE: Any = dataclass_field(default_factory=str)
|
||||
RDS_LOCAL_NOTATION: str = dataclass_field(default_factory=str)
|
||||
RDS_LEA: Any = dataclass_field(default_factory=str)
|
||||
|
||||
def import_from_dict(self, data: dict) -> RDS_DATA:
|
||||
"""Import data from dict"""
|
||||
for key, value in data.items():
|
||||
setattr(self, key, value)
|
||||
return self
|
||||
|
||||
|
||||
@dataclass
|
||||
class RDS_GENERIC_DATA:
|
||||
LibrarySigil: str = dataclass_field(default_factory=str)
|
||||
RDS_DATA: List[RDS_DATA] = dataclass_field(default_factory=list)
|
||||
|
||||
def import_from_dict(self, data: str) -> RDS_GENERIC_DATA:
|
||||
"""Import data from dict"""
|
||||
edata = json.loads(data)
|
||||
# library sigil is first key
|
||||
self.LibrarySigil = str(list(edata.keys())[0])
|
||||
# get data from first key
|
||||
edata = edata[self.LibrarySigil]
|
||||
for entry in edata:
|
||||
rds_data = RDS_DATA() # Create a new RDS_DATA instance
|
||||
# Populate the RDS_DATA instance from the entry
|
||||
# This assumes that the entry is a dictionary that matches the structure of the RDS_DATA class
|
||||
rds_data.import_from_dict(entry)
|
||||
self.RDS_DATA.append(rds_data) # Add the RDS_DATA instance to the list
|
||||
return self
|
||||
|
||||
|
||||
class BaseStruct:
|
||||
def __init__(self, **kwargs):
|
||||
for key, value in kwargs.items():
|
||||
setattr(self, key, value)
|
||||
|
||||
|
||||
class ARRAYData:
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def transform(self, data: str) -> BookData:
|
||||
def _get_line(source: str, search: str) -> str:
|
||||
try:
|
||||
return (
|
||||
source.split(search)[1]
|
||||
.split("\n")[0]
|
||||
.strip()
|
||||
.replace("=>", "")
|
||||
.strip()
|
||||
)
|
||||
|
||||
except Exception as e:
|
||||
logger.log_exception("ARRAYData.transform failed")
|
||||
return ""
|
||||
|
||||
def _get_list_entry(source: str, search: str, entry: str) -> str:
|
||||
try:
|
||||
source = source.replace("\t", "").replace("\r", "")
|
||||
source = source.split(search)[1].split(")")[0]
|
||||
return _get_line(source, entry).replace("=>", "").strip()
|
||||
except:
|
||||
return ""
|
||||
|
||||
def _get_isbn(source: str) -> list:
|
||||
try:
|
||||
isbn = source.split("[isbn]")[1].split(")")[0].strip()
|
||||
isbn = isbn.split("(")[1]
|
||||
isbns = isbn.split("=>")
|
||||
ret = []
|
||||
for _ in isbns:
|
||||
# remove _ from list
|
||||
isb = _.split("\n")[0].strip()
|
||||
if isb == "":
|
||||
continue
|
||||
ret.append(isb) if isb not in ret else None
|
||||
return ret
|
||||
except:
|
||||
isbn = []
|
||||
return isbn
|
||||
|
||||
return BookData(
|
||||
ppn=_get_line(data, "[kid]"),
|
||||
title=_get_line(data, "[ti_long]").split("/")[0].strip(),
|
||||
author=_get_list_entry(data, "[au]", "[0]"),
|
||||
edition=_get_list_entry(data, "[ausgabe]", "[0]").replace(",", ""),
|
||||
link=f"https://rds.ibs-bw.de/phfreiburg/link?kid={_get_line(data,'[kid]')}",
|
||||
isbn=_get_isbn(data),
|
||||
# [self._get_list_entry(data,"[isbn]","[0]"),self._get_list_entry(data,"[is]","[1]")],
|
||||
language=_get_list_entry(data, "[la_facet]", "[0]"),
|
||||
publisher=_get_list_entry(data, "[hg]", "[0]"),
|
||||
year=_get_line(data, "[py]"),
|
||||
pages=_get_list_entry(data, "[umfang]", "[0]").split(":")[0].strip(),
|
||||
)
|
||||
|
||||
|
||||
class COinSData:
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
def transform(self, data: str) -> BookData:
|
||||
def _get_line(source: str, search: str) -> str:
|
||||
try:
|
||||
data = source.split(f"{search}=")[1] # .split("")[0].strip()
|
||||
return data.split("rft")[0].strip() if "rft" in data else data
|
||||
except:
|
||||
return ""
|
||||
|
||||
return BookData(
|
||||
ppn=_get_line(data, "rft_id").split("=")[1],
|
||||
title=_get_line(data, "rft.btitle"),
|
||||
author=f"{_get_line(data,'rft.aulast')}, {_get_line(data,'rft.aufirst')}",
|
||||
edition=_get_line(data, "rft.edition"),
|
||||
link=_get_line(data, "rft_id"),
|
||||
isbn=_get_line(data, "rft.isbn"),
|
||||
publisher=_get_line(data, "rft.pub"),
|
||||
year=_get_line(data, "rft.date"),
|
||||
pages=_get_line(data, "rft.tpages").split(":")[0].strip(),
|
||||
)
|
||||
|
||||
|
||||
class RISData:
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
def transform(self, data: str) -> BookData:
|
||||
def _get_line(source: str, search: str) -> str:
|
||||
try:
|
||||
data = source.split(f"{search} - ")[1] # .split("")[0].strip()
|
||||
return data.split("\n")[0].strip() if "\n" in data else data
|
||||
except:
|
||||
return ""
|
||||
|
||||
return BookData(
|
||||
ppn=_get_line(data, "DP").split("=")[1],
|
||||
title=_get_line(data, "TI"),
|
||||
signature=_get_line(data, "CN"),
|
||||
edition=_get_line(data, "ET").replace(",", ""),
|
||||
link=_get_line(data, "DP"),
|
||||
isbn=_get_line(data, "SN").split(","),
|
||||
author=_get_line(data, "AU").split("[")[0].strip(),
|
||||
language=_get_line(data, "LA"),
|
||||
publisher=_get_line(data, "PB"),
|
||||
year=_get_line(data, "PY"),
|
||||
pages=_get_line(data, "SP"),
|
||||
)
|
||||
|
||||
|
||||
class BibTeXData:
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def transform(self, data: str) -> BookData:
|
||||
def _get_line(source: str, search: str) -> str:
|
||||
try:
|
||||
return (
|
||||
data.split(search)[1]
|
||||
.split("\n")[0]
|
||||
.strip()
|
||||
.split("=")[1]
|
||||
.strip()
|
||||
.replace("{", "")
|
||||
.replace("}", "")
|
||||
.replace(",", "")
|
||||
.replace("[", "")
|
||||
.replace("];", "")
|
||||
)
|
||||
except:
|
||||
return ""
|
||||
|
||||
return BookData(
|
||||
ppn=None,
|
||||
title=_get_line(data, "title"),
|
||||
signature=_get_line(data, "bestand"),
|
||||
edition=_get_line(data, "edition"),
|
||||
isbn=_get_line(data, "isbn"),
|
||||
author=";".join(_get_line(data, "author").split(" and ")),
|
||||
language=_get_line(data, "language"),
|
||||
publisher=_get_line(data, "publisher"),
|
||||
year=_get_line(data, "year"),
|
||||
pages=_get_line(data, "pages"),
|
||||
)
|
||||
|
||||
|
||||
class RDSData:
|
||||
retlist = []
|
||||
|
||||
def transform(self, data: str):
|
||||
# rds_availability = RDS_AVAIL_DATA()
|
||||
# rds_data = RDS_GENERIC_DATA()
|
||||
def __get_raw_data(data: str) -> list:
|
||||
# create base data to be turned into pydantic classes
|
||||
data = data.split("RDS ----------------------------------")[1]
|
||||
edata = data.strip()
|
||||
edata = edata.split("\n", 9)[9]
|
||||
edata = edata.split("\n")[1:]
|
||||
entry_1 = edata[0]
|
||||
edata = edata[1:]
|
||||
entry_2 = "".join(edata)
|
||||
edata = []
|
||||
edata.append(entry_1)
|
||||
edata.append(entry_2)
|
||||
return edata
|
||||
|
||||
ret_data = __get_raw_data(data)
|
||||
# assign data[1] to RDS_AVAIL_DATA
|
||||
# assign data[0] to RDS_DATA
|
||||
self.rds_data = RDS_GENERIC_DATA().import_from_dict(ret_data[1])
|
||||
self.rds_availability = RDS_AVAIL_DATA().import_from_dict(ret_data[0])
|
||||
self.retlist.append(self.rds_availability)
|
||||
self.retlist.append(self.rds_data)
|
||||
return self
|
||||
|
||||
def return_data(self, option=None):
|
||||
if option == "rds_availability":
|
||||
return self.retlist[0]
|
||||
elif option == "rds_data":
|
||||
return self.retlist[1]
|
||||
else:
|
||||
return {"rds_availability": self.retlist[0], "rds_data": self.retlist[1]}
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
with open("daiadata", "r") as f:
|
||||
data = f.read()
|
||||
|
||||
ret = RDSData().transform(data)
|
||||
data = ret.return_data("rds_availability")
|
||||
print(data)
|
||||
47
src/ui/Ui_plotdata.py
Normal file
47
src/ui/Ui_plotdata.py
Normal file
@@ -0,0 +1,47 @@
|
||||
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\Semesterapparate\ui\plotdata.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.3.1
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt6 import QtCore, QtWidgets
|
||||
|
||||
|
||||
class Ui_MainWindow(object):
|
||||
def setupUi(self, MainWindow):
|
||||
MainWindow.setObjectName("MainWindow")
|
||||
MainWindow.resize(640, 480)
|
||||
self.centralwidget = QtWidgets.QWidget(MainWindow)
|
||||
self.centralwidget.setObjectName("centralwidget")
|
||||
self.graphicsView = QtWidgets.QGraphicsView(self.centralwidget)
|
||||
self.graphicsView.setGeometry(QtCore.QRect(330, 10, 256, 192))
|
||||
self.graphicsView.setObjectName("graphicsView")
|
||||
self.widget = QtWidgets.QWidget(self.centralwidget)
|
||||
self.widget.setGeometry(QtCore.QRect(10, 0, 251, 271))
|
||||
self.widget.setObjectName("widget")
|
||||
self.stackedWidget = QtWidgets.QStackedWidget(self.centralwidget)
|
||||
self.stackedWidget.setGeometry(QtCore.QRect(300, 220, 291, 201))
|
||||
self.stackedWidget.setObjectName("stackedWidget")
|
||||
self.page = QtWidgets.QWidget()
|
||||
self.page.setObjectName("page")
|
||||
self.stackedWidget.addWidget(self.page)
|
||||
self.page_2 = QtWidgets.QWidget()
|
||||
self.page_2.setObjectName("page_2")
|
||||
self.stackedWidget.addWidget(self.page_2)
|
||||
MainWindow.setCentralWidget(self.centralwidget)
|
||||
self.menubar = QtWidgets.QMenuBar(MainWindow)
|
||||
self.menubar.setGeometry(QtCore.QRect(0, 0, 640, 21))
|
||||
self.menubar.setObjectName("menubar")
|
||||
MainWindow.setMenuBar(self.menubar)
|
||||
self.statusbar = QtWidgets.QStatusBar(MainWindow)
|
||||
self.statusbar.setObjectName("statusbar")
|
||||
MainWindow.setStatusBar(self.statusbar)
|
||||
|
||||
self.retranslateUi(MainWindow)
|
||||
QtCore.QMetaObject.connectSlotsByName(MainWindow)
|
||||
|
||||
def retranslateUi(self, MainWindow):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
|
||||
1445
src/ui/Ui_semesterapparat_ui.py
Normal file
1445
src/ui/Ui_semesterapparat_ui.py
Normal file
File diff suppressed because it is too large
Load Diff
232
src/ui/Ui_semesterapparat_ui.ts
Normal file
232
src/ui/Ui_semesterapparat_ui.ts
Normal file
@@ -0,0 +1,232 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="de_DE" sourcelanguage="de_DE">
|
||||
<context>
|
||||
<name>MainWindow</name>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="543"/>
|
||||
<source>MainWindow</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="544"/>
|
||||
<source>Load the Semesterapparate from the database</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="545"/>
|
||||
<source>App. aufrufen</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="546"/>
|
||||
<source>neu. App anlegen</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="547"/>
|
||||
<source>Auswahl abbrechen</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="550"/>
|
||||
<source>AppNr</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="552"/>
|
||||
<source>App Name</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="554"/>
|
||||
<source>Professor</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="556"/>
|
||||
<source>gültig bis</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="580"/>
|
||||
<source>Dauerapparat</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="560"/>
|
||||
<source>KontoNr</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="561"/>
|
||||
<source>Apparatsdetails</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="563"/>
|
||||
<source>Dokumentname</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="565"/>
|
||||
<source>Dateityp</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="567"/>
|
||||
<source>Neu?</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="569"/>
|
||||
<source>path</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="570"/>
|
||||
<source>Apparatsname</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="571"/>
|
||||
<source>Winter</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="572"/>
|
||||
<source>Prof. Name</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="573"/>
|
||||
<source>Sommer</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="574"/>
|
||||
<source>Prof. Titel</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="575"/>
|
||||
<source>Semester</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="576"/>
|
||||
<source>2023</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="577"/>
|
||||
<source>Apparatsnummer</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="578"/>
|
||||
<source>Speichern</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="579"/>
|
||||
<source>Aktualisieren</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="581"/>
|
||||
<source>Mail</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="582"/>
|
||||
<source>Tel</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="583"/>
|
||||
<source>Fach</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="589"/>
|
||||
<source>*</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="590"/>
|
||||
<source>Dokument hinzufügen</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="591"/>
|
||||
<source>Dokument öffnen</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="594"/>
|
||||
<source>Buchtitel</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="596"/>
|
||||
<source>Signatur</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="598"/>
|
||||
<source>Auflage</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="600"/>
|
||||
<source>Autor</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="602"/>
|
||||
<source>Link</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="603"/>
|
||||
<source> Medienliste</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="604"/>
|
||||
<source>gel. Medien anzeigen</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="605"/>
|
||||
<source>Medien hinzufügen</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="606"/>
|
||||
<source>Tab 1</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="607"/>
|
||||
<source>Tab 2</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="608"/>
|
||||
<source>Datei</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="609"/>
|
||||
<source>Einstellungen</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="Ui_semesterapparat_ui.py" line="610"/>
|
||||
<source>Beenden</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
71
src/ui/Ui_setupwizard.py
Normal file
71
src/ui/Ui_setupwizard.py
Normal file
@@ -0,0 +1,71 @@
|
||||
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\Semesterapparate\ui\setupwizard.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.3.1
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Wizard(object):
|
||||
def setupUi(self, Wizard):
|
||||
Wizard.setObjectName("Wizard")
|
||||
Wizard.resize(640, 480)
|
||||
Wizard.setMaximumSize(QtCore.QSize(640, 480))
|
||||
self.wizardPage1 = QtWidgets.QWizardPage()
|
||||
self.wizardPage1.setObjectName("wizardPage1")
|
||||
self.textBrowser = QtWidgets.QTextBrowser(self.wizardPage1)
|
||||
self.textBrowser.setGeometry(QtCore.QRect(200, 10, 256, 192))
|
||||
self.textBrowser.setObjectName("textBrowser")
|
||||
Wizard.addPage(self.wizardPage1)
|
||||
self.wizardPage2 = QtWidgets.QWizardPage()
|
||||
self.wizardPage2.setObjectName("wizardPage2")
|
||||
self.label = QtWidgets.QLabel(self.wizardPage2)
|
||||
self.label.setGeometry(QtCore.QRect(10, 0, 131, 16))
|
||||
self.label.setObjectName("label")
|
||||
self.label_2 = QtWidgets.QLabel(self.wizardPage2)
|
||||
self.label_2.setGeometry(QtCore.QRect(10, 40, 71, 16))
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.default_apps = QtWidgets.QCheckBox(self.wizardPage2)
|
||||
self.default_apps.setGeometry(QtCore.QRect(100, 40, 70, 17))
|
||||
self.default_apps.setText("")
|
||||
self.default_apps.setObjectName("default_apps")
|
||||
self.label_3 = QtWidgets.QLabel(self.wizardPage2)
|
||||
self.label_3.setGeometry(QtCore.QRect(10, 70, 61, 16))
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.custom_applications = QtWidgets.QFrame(self.wizardPage2)
|
||||
self.custom_applications.setGeometry(QtCore.QRect(280, 10, 331, 361))
|
||||
self.custom_applications.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel)
|
||||
self.custom_applications.setFrameShadow(QtWidgets.QFrame.Shadow.Raised)
|
||||
self.custom_applications.setObjectName("custom_applications")
|
||||
self.save_path = QtWidgets.QLineEdit(self.wizardPage2)
|
||||
self.save_path.setGeometry(QtCore.QRect(80, 70, 113, 20))
|
||||
self.save_path.setObjectName("save_path")
|
||||
self.btn_save_path_select = QtWidgets.QToolButton(self.wizardPage2)
|
||||
self.btn_save_path_select.setGeometry(QtCore.QRect(200, 70, 25, 19))
|
||||
self.btn_save_path_select.setObjectName("btn_save_path_select")
|
||||
Wizard.addPage(self.wizardPage2)
|
||||
|
||||
self.retranslateUi(Wizard)
|
||||
QtCore.QMetaObject.connectSlotsByName(Wizard)
|
||||
|
||||
def retranslateUi(self, Wizard):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Wizard.setWindowTitle(_translate("Wizard", "Wizard"))
|
||||
self.textBrowser.setHtml(_translate("Wizard", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
|
||||
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
|
||||
"p, li { white-space: pre-wrap; }\n"
|
||||
"</style></head><body style=\" font-family:\'MS Shell Dlg 2\'; font-size:8.25pt; font-weight:400; font-style:normal;\">\n"
|
||||
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Setup für das Semesterapparatsprogram.</p>\n"
|
||||
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><br /></p>\n"
|
||||
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Im Anschluss werden wichtige Einstellungen gesetzt, welche auch im späteren Verlauf verändert werden können.</p>\n"
|
||||
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><br /></p></body></html>"))
|
||||
self.label.setText(_translate("Wizard", "Grundeinstellungen"))
|
||||
self.label_2.setToolTip(_translate("Wizard", "Opens the downloaded files with the default applications set in the OS"))
|
||||
self.label_2.setText(_translate("Wizard", "Default Apps"))
|
||||
self.label_3.setToolTip(_translate("Wizard", "Path where the downloaded files are stored. Defaults to ~/Desktop/SemapFiles"))
|
||||
self.label_3.setText(_translate("Wizard", "Save Path"))
|
||||
self.save_path.setPlaceholderText(_translate("Wizard", "~/Desktop/SemapFiles"))
|
||||
self.btn_save_path_select.setText(_translate("Wizard", "..."))
|
||||
29
src/ui/__init__.py
Normal file
29
src/ui/__init__.py
Normal file
@@ -0,0 +1,29 @@
|
||||
import pathlib
|
||||
|
||||
from .dialogs import (
|
||||
App_Ext_Dialog,
|
||||
Mail_Dialog,
|
||||
Settings,
|
||||
edit_bookdata_ui,
|
||||
fileparser_ui,
|
||||
login_ui,
|
||||
medienadder_ui,
|
||||
parsed_titles_ui,
|
||||
popus_confirm,
|
||||
reminder_ui,
|
||||
settings_ui,
|
||||
new_subject_ui,
|
||||
)
|
||||
from .Ui_semesterapparat_ui import Ui_MainWindow as Ui_Semesterapparat
|
||||
from .Ui_setupwizard import Ui_Wizard as SetupWizard
|
||||
from .widgets import (
|
||||
FilePicker,
|
||||
GraphWidget,
|
||||
Message_Widget,
|
||||
StatusWidget,
|
||||
)
|
||||
|
||||
path = pathlib.Path(__file__).parent.absolute()
|
||||
# from .mainwindow import Ui_MainWindow as Ui_MainWindow
|
||||
# from .sap import Ui_MainWindow as MainWindow_SAP
|
||||
__all__ = ["mainwindow", "sap", "dialogs", "widgets"]
|
||||
157
src/ui/dialogs/Ui_edit_bookdata.py
Normal file
157
src/ui/dialogs/Ui_edit_bookdata.py
Normal file
@@ -0,0 +1,157 @@
|
||||
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\Semesterapparate\ui\dialogs\edit_bookdata.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.3.1
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
from src.logic.dataclass import BookData
|
||||
|
||||
|
||||
class Ui_Dialog(object):
|
||||
def setupUi(self, Dialog):
|
||||
Dialog.setObjectName("Metadaten")
|
||||
Dialog.resize(448, 572)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
|
||||
self.buttonBox.setGeometry(QtCore.QRect(260, 530, 161, 32))
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
||||
self.buttonBox.setStandardButtons(
|
||||
QtWidgets.QDialogButtonBox.StandardButton.Cancel
|
||||
| QtWidgets.QDialogButtonBox.StandardButton.Ok
|
||||
)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.gridLayoutWidget = QtWidgets.QWidget(Dialog)
|
||||
self.gridLayoutWidget.setGeometry(QtCore.QRect(0, 0, 441, 531))
|
||||
self.gridLayoutWidget.setObjectName("gridLayoutWidget")
|
||||
self.gridLayout = QtWidgets.QGridLayout(self.gridLayoutWidget)
|
||||
self.gridLayout.setSizeConstraint(
|
||||
QtWidgets.QLayout.SizeConstraint.SetDefaultConstraint
|
||||
)
|
||||
self.gridLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.label_10 = QtWidgets.QLabel(self.gridLayoutWidget)
|
||||
self.label_10.setObjectName("label_10")
|
||||
self.gridLayout.addWidget(self.label_10, 10, 1, 1, 1)
|
||||
self.label = QtWidgets.QLabel(self.gridLayoutWidget)
|
||||
self.label.setObjectName("label")
|
||||
self.gridLayout.addWidget(self.label, 0, 1, 1, 1)
|
||||
self.label_9 = QtWidgets.QLabel(self.gridLayoutWidget)
|
||||
self.label_9.setObjectName("label_9")
|
||||
self.gridLayout.addWidget(self.label_9, 9, 1, 1, 1)
|
||||
self.label_8 = QtWidgets.QLabel(self.gridLayoutWidget)
|
||||
self.label_8.setObjectName("label_8")
|
||||
self.gridLayout.addWidget(self.label_8, 8, 1, 1, 1)
|
||||
self.label_12 = QtWidgets.QLabel(self.gridLayoutWidget)
|
||||
self.label_12.setObjectName("label_12")
|
||||
self.gridLayout.addWidget(self.label_12, 6, 1, 1, 1)
|
||||
self.line_edition = QtWidgets.QLineEdit(self.gridLayoutWidget)
|
||||
self.line_edition.setObjectName("line_edition")
|
||||
self.gridLayout.addWidget(self.line_edition, 2, 2, 1, 1)
|
||||
self.label_3 = QtWidgets.QLabel(self.gridLayoutWidget)
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.gridLayout.addWidget(self.label_3, 2, 1, 1, 1)
|
||||
self.label_4 = QtWidgets.QLabel(self.gridLayoutWidget)
|
||||
self.label_4.setObjectName("label_4")
|
||||
self.gridLayout.addWidget(self.label_4, 3, 1, 1, 1)
|
||||
self.line_link = QtWidgets.QLineEdit(self.gridLayoutWidget)
|
||||
self.line_link.setCursor(QtGui.QCursor(QtCore.Qt.CursorShape.ArrowCursor))
|
||||
self.line_link.setReadOnly(True)
|
||||
self.line_link.setObjectName("line_link")
|
||||
self.gridLayout.addWidget(self.line_link, 6, 2, 1, 1)
|
||||
self.label_5 = QtWidgets.QLabel(self.gridLayoutWidget)
|
||||
self.label_5.setObjectName("label_5")
|
||||
self.gridLayout.addWidget(self.label_5, 4, 1, 1, 1)
|
||||
self.label_7 = QtWidgets.QLabel(self.gridLayoutWidget)
|
||||
self.label_7.setObjectName("label_7")
|
||||
self.gridLayout.addWidget(self.label_7, 7, 1, 1, 1)
|
||||
self.label_6 = QtWidgets.QLabel(self.gridLayoutWidget)
|
||||
self.label_6.setObjectName("label_6")
|
||||
self.gridLayout.addWidget(self.label_6, 5, 1, 1, 1)
|
||||
self.label_2 = QtWidgets.QLabel(self.gridLayoutWidget)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.gridLayout.addWidget(self.label_2, 1, 1, 1, 1)
|
||||
spacerItem = QtWidgets.QSpacerItem(
|
||||
5,
|
||||
20,
|
||||
QtWidgets.QSizePolicy.Policy.Fixed,
|
||||
QtWidgets.QSizePolicy.Policy.Minimum,
|
||||
)
|
||||
self.gridLayout.addItem(spacerItem, 8, 0, 1, 1)
|
||||
self.line_title = QtWidgets.QLineEdit(self.gridLayoutWidget)
|
||||
self.line_title.setObjectName("line_title")
|
||||
self.gridLayout.addWidget(self.line_title, 0, 2, 1, 1)
|
||||
self.line_signature = QtWidgets.QLineEdit(self.gridLayoutWidget)
|
||||
self.line_signature.setObjectName("line_signature")
|
||||
self.gridLayout.addWidget(self.line_signature, 1, 2, 1, 1)
|
||||
self.line_author = QtWidgets.QLineEdit(self.gridLayoutWidget)
|
||||
self.line_author.setObjectName("line_author")
|
||||
self.gridLayout.addWidget(self.line_author, 3, 2, 1, 1)
|
||||
self.line_lang = QtWidgets.QLineEdit(self.gridLayoutWidget)
|
||||
self.line_lang.setObjectName("line_lang")
|
||||
self.gridLayout.addWidget(self.line_lang, 8, 2, 1, 1)
|
||||
self.line_ppn = QtWidgets.QLineEdit(self.gridLayoutWidget)
|
||||
self.line_ppn.setObjectName("line_ppn")
|
||||
self.gridLayout.addWidget(self.line_ppn, 5, 2, 1, 1)
|
||||
self.line_isbn = QtWidgets.QLineEdit(self.gridLayoutWidget)
|
||||
self.line_isbn.setObjectName("line_isbn")
|
||||
self.gridLayout.addWidget(self.line_isbn, 7, 2, 1, 1)
|
||||
self.line_year = QtWidgets.QLineEdit(self.gridLayoutWidget)
|
||||
self.line_year.setObjectName("line_year")
|
||||
self.gridLayout.addWidget(self.line_year, 9, 2, 1, 1)
|
||||
self.line_pages = QtWidgets.QLineEdit(self.gridLayoutWidget)
|
||||
self.line_pages.setObjectName("line_pages")
|
||||
self.gridLayout.addWidget(self.line_pages, 10, 2, 1, 1)
|
||||
self.line_publisher = QtWidgets.QLineEdit(self.gridLayoutWidget)
|
||||
self.line_publisher.setObjectName("line_publisher")
|
||||
self.gridLayout.addWidget(self.line_publisher, 4, 2, 1, 1)
|
||||
|
||||
self.retranslateUi(Dialog)
|
||||
self.buttonBox.accepted.connect(Dialog.accept) # type: ignore
|
||||
self.buttonBox.rejected.connect(Dialog.reject) # type: ignore
|
||||
QtCore.QMetaObject.connectSlotsByName(Dialog)
|
||||
|
||||
def retranslateUi(self, Dialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Dialog.setWindowTitle(_translate("Dialog", "Dialog"))
|
||||
self.label_10.setText(_translate("Dialog", "Seiten"))
|
||||
self.label.setText(_translate("Dialog", "Titel"))
|
||||
self.label_9.setText(_translate("Dialog", "Jahr"))
|
||||
self.label_8.setText(_translate("Dialog", "Sprache"))
|
||||
self.label_12.setText(_translate("Dialog", "Link"))
|
||||
self.label_3.setText(_translate("Dialog", "Auflage"))
|
||||
self.label_4.setText(_translate("Dialog", "Autor"))
|
||||
self.label_5.setText(_translate("Dialog", "Herausgeber"))
|
||||
self.label_7.setText(_translate("Dialog", "ISBN(s)"))
|
||||
self.label_6.setText(_translate("Dialog", "PPN"))
|
||||
self.label_2.setText(_translate("Dialog", "Signatur"))
|
||||
|
||||
def populate_fields(self, data: BookData):
|
||||
self.line_author.setText(data.author)
|
||||
self.line_edition.setText(data.edition)
|
||||
self.line_isbn.setText(", ".join(data.isbn))
|
||||
self.line_lang.setText(data.language)
|
||||
self.line_link.setText(data.link)
|
||||
self.line_pages.setText(data.pages)
|
||||
self.line_ppn.setText(data.ppn)
|
||||
self.line_publisher.setText(data.publisher)
|
||||
self.line_signature.setText(data.signature)
|
||||
self.line_title.setText(data.title)
|
||||
self.line_year.setText(data.year)
|
||||
|
||||
def get_data(self) -> BookData:
|
||||
return BookData(
|
||||
ppn=self.line_ppn.text().strip(),
|
||||
title=self.line_title.text().strip(),
|
||||
signature=self.line_signature.text().strip(),
|
||||
edition=self.line_edition.text().strip(),
|
||||
link=self.line_link.text().strip(),
|
||||
isbn=self.line_isbn.text().split(","),
|
||||
author=self.line_author.text().strip(),
|
||||
language=self.line_lang.text().strip(),
|
||||
publisher=self.line_publisher.text().strip(),
|
||||
year=self.line_year.text().strip(),
|
||||
pages=self.line_pages.text().strip(),
|
||||
)
|
||||
109
src/ui/dialogs/Ui_fileparser.py
Normal file
109
src/ui/dialogs/Ui_fileparser.py
Normal file
@@ -0,0 +1,109 @@
|
||||
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\Semesterapparate\ui\dialogs\fileparser.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.3.1
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
from src.logic.webrequest import BibTextTransformer, WebRequest
|
||||
|
||||
|
||||
class Ui_Dialog(object):
|
||||
def setupUi(self, Dialog):
|
||||
Dialog.setObjectName("Dialog")
|
||||
Dialog.resize(402, 301)
|
||||
self.progressBar = QtWidgets.QProgressBar(Dialog)
|
||||
self.progressBar.setGeometry(QtCore.QRect(10, 60, 381, 23))
|
||||
self.progressBar.setProperty("value", 24)
|
||||
self.progressBar.setObjectName("progressBar")
|
||||
self.frame = QtWidgets.QFrame(Dialog)
|
||||
self.frame.setGeometry(QtCore.QRect(10, 10, 381, 41))
|
||||
self.frame.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel)
|
||||
self.frame.setFrameShadow(QtWidgets.QFrame.Shadow.Raised)
|
||||
self.frame.setObjectName("frame")
|
||||
self.horizontalLayoutWidget = QtWidgets.QWidget(self.frame)
|
||||
self.horizontalLayoutWidget.setGeometry(QtCore.QRect(0, 0, 381, 41))
|
||||
self.horizontalLayoutWidget.setObjectName("horizontalLayoutWidget")
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget)
|
||||
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.label = QtWidgets.QLabel(self.horizontalLayoutWidget)
|
||||
self.label.setObjectName("label")
|
||||
self.horizontalLayout.addWidget(self.label)
|
||||
self.count = QtWidgets.QLabel(self.horizontalLayoutWidget)
|
||||
font = QtGui.QFont()
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.count.setFont(font)
|
||||
self.count.setTextFormat(QtCore.Qt.TextFormat.PlainText)
|
||||
self.count.setObjectName("count")
|
||||
self.horizontalLayout.addWidget(self.count)
|
||||
self.label_2 = QtWidgets.QLabel(self.horizontalLayoutWidget)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.horizontalLayout.addWidget(self.label_2)
|
||||
spacerItem = QtWidgets.QSpacerItem(
|
||||
40,
|
||||
20,
|
||||
QtWidgets.QSizePolicy.Policy.Expanding,
|
||||
QtWidgets.QSizePolicy.Policy.Minimum,
|
||||
)
|
||||
self.horizontalLayout.addItem(spacerItem)
|
||||
self.frame_2 = QtWidgets.QFrame(Dialog)
|
||||
self.frame_2.setGeometry(QtCore.QRect(10, 100, 381, 201))
|
||||
self.frame_2.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel)
|
||||
self.frame_2.setFrameShadow(QtWidgets.QFrame.Shadow.Raised)
|
||||
self.frame_2.setObjectName("frame_2")
|
||||
self.listWidget = QtWidgets.QListWidget(self.frame_2)
|
||||
self.listWidget.setGeometry(QtCore.QRect(0, 0, 381, 191))
|
||||
self.listWidget.setObjectName("listWidget")
|
||||
self.signatures = []
|
||||
self.returned = []
|
||||
# self.data_gathering_complete = QtCore.pyqtSignal()
|
||||
self.retranslateUi(Dialog)
|
||||
QtCore.QMetaObject.connectSlotsByName(Dialog)
|
||||
|
||||
def retranslateUi(self, Dialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Dialog.setWindowTitle(_translate("Dialog", "Dialog"))
|
||||
self.label.setText(_translate("Dialog", "Es wurden"))
|
||||
self.count.setText(_translate("Dialog", "0"))
|
||||
self.label_2.setText(_translate("Dialog", "Signaturen gefunden."))
|
||||
|
||||
def moveToThread(self, thread):
|
||||
self.progressBar.moveToThread(thread)
|
||||
self.frame.moveToThread(thread)
|
||||
self.horizontalLayoutWidget.moveToThread(thread)
|
||||
self.horizontalLayout.moveToThread(thread)
|
||||
self.label.moveToThread(thread)
|
||||
self.count.moveToThread(thread)
|
||||
self.label_2.moveToThread(thread)
|
||||
self.frame_2.moveToThread(thread)
|
||||
self.listWidget.moveToThread(thread)
|
||||
|
||||
def run(self):
|
||||
for signature in self.signatures:
|
||||
self.count.setText(str(self.signatures.index(signature) + 1))
|
||||
self.listWidget.addItem(signature)
|
||||
webdata = WebRequest().get_ppn(signature).get_data()
|
||||
bookdata = BibTextTransformer("ARRAY").get_data(webdata).return_data()
|
||||
self.returned.append(bookdata)
|
||||
self.progressBar.setValue(self.signatures.index(signature) + 1)
|
||||
# self.data_gathering_complete.emit()
|
||||
|
||||
def deleteLater(self):
|
||||
self.progressBar.deleteLater()
|
||||
self.frame.deleteLater()
|
||||
self.horizontalLayoutWidget.deleteLater()
|
||||
self.horizontalLayout.deleteLater()
|
||||
self.label.deleteLater()
|
||||
self.count.deleteLater()
|
||||
self.label_2.deleteLater()
|
||||
self.frame_2.deleteLater()
|
||||
self.listWidget.deleteLater()
|
||||
self.signatures = []
|
||||
self.returned = []
|
||||
self.retranslateUi.deleteLater()
|
||||
super().deleteLater()
|
||||
113
src/ui/dialogs/Ui_login.py
Normal file
113
src/ui/dialogs/Ui_login.py
Normal file
@@ -0,0 +1,113 @@
|
||||
# Form implementation generated from reading ui file '/home/alexander/GitHub/Semesterapparate/ui/dialogs/login.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.5.3
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
import hashlib
|
||||
|
||||
from PyQt6 import QtCore, QtWidgets
|
||||
|
||||
from src.backend.database import Database
|
||||
from src.backend.admin_console import AdminCommands
|
||||
|
||||
class Ui_Dialog(object):
|
||||
def setupUi(self, Dialog):
|
||||
Dialog.setObjectName("Dialog")
|
||||
Dialog.resize(218, 190)
|
||||
self.dialog = Dialog
|
||||
self.login_button = QtWidgets.QPushButton(parent=Dialog)
|
||||
self.login_button.setGeometry(QtCore.QRect(30, 140, 76, 32))
|
||||
self.login_button.setObjectName("login_button")
|
||||
self.login_button.setText("Login")
|
||||
self.login_button.setFocusPolicy(QtCore.Qt.FocusPolicy.ClickFocus)
|
||||
self.cancel_button = QtWidgets.QPushButton(parent=Dialog)
|
||||
self.cancel_button.setGeometry(QtCore.QRect(120, 140, 76, 32))
|
||||
self.cancel_button.setObjectName("cancel_button")
|
||||
self.cancel_button.setText("Cancel")
|
||||
self.cancel_button.setFocusPolicy(QtCore.Qt.FocusPolicy.ClickFocus)
|
||||
self.cancel_button.clicked.connect(self.cancel_buttonfn)
|
||||
self.label = QtWidgets.QLabel(parent=Dialog)
|
||||
self.label.setGeometry(QtCore.QRect(20, 40, 71, 21))
|
||||
self.label.setObjectName("label")
|
||||
self.lineEdit = QtWidgets.QLineEdit(parent=Dialog)
|
||||
self.lineEdit.setGeometry(QtCore.QRect(80, 40, 113, 21))
|
||||
self.lineEdit.setObjectName("lineEdit")
|
||||
# set strong focus to lineEdit
|
||||
self.lineEdit.setFocusPolicy(QtCore.Qt.FocusPolicy.StrongFocus)
|
||||
self.label_2 = QtWidgets.QLabel(parent=Dialog)
|
||||
self.label_2.setGeometry(QtCore.QRect(20, 80, 71, 21))
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.lineEdit_2 = QtWidgets.QLineEdit(parent=Dialog)
|
||||
self.lineEdit_2.setGeometry(QtCore.QRect(80, 80, 113, 21))
|
||||
self.lineEdit_2.setInputMethodHints(QtCore.Qt.InputMethodHint.ImhSensitiveData)
|
||||
# set echo mode to password
|
||||
self.lineEdit_2.setEchoMode(QtWidgets.QLineEdit.EchoMode.Password)
|
||||
self.lineEdit_2.setClearButtonEnabled(True)
|
||||
self.lineEdit_2.setObjectName("lineEdit_2")
|
||||
|
||||
self.retranslateUi(Dialog)
|
||||
# if buttonbox accepted is clicked, launch login test
|
||||
self.login_button.clicked.connect(self.login)
|
||||
self.lresult = -1
|
||||
self.lusername = ""
|
||||
QtCore.QMetaObject.connectSlotsByName(Dialog)
|
||||
|
||||
def retranslateUi(self, Dialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Dialog.setWindowTitle(_translate("Dialog", "Dialog"))
|
||||
self.label.setText(_translate("Dialog", "Username"))
|
||||
self.label_2.setText(_translate("Dialog", "Password"))
|
||||
|
||||
def login(self):
|
||||
username = self.lineEdit.text()
|
||||
password = self.lineEdit_2.text()
|
||||
print(type(username), password)
|
||||
# Assuming 'Database' is a class to interact with your database
|
||||
db = Database()
|
||||
|
||||
hashed_password = hashlib.sha256(
|
||||
password.encode()
|
||||
).hexdigest()
|
||||
if len(db.get_users()) == 0:
|
||||
AdminCommands().create_admin()
|
||||
self.lresult = 1 # Indicate successful login
|
||||
self.lusername = username
|
||||
self.dialog.accept()
|
||||
if db.login(username, hashed_password):
|
||||
self.lresult = 1 # Indicate successful login
|
||||
self.lusername = username
|
||||
self.dialog.accept()
|
||||
db.close()
|
||||
else:
|
||||
# Credentials are invalid, display a warning
|
||||
if username == "" or password == "":
|
||||
warning_dialog = QtWidgets.QMessageBox()
|
||||
warning_dialog.setIcon(QtWidgets.QMessageBox.Icon.Warning)
|
||||
warning_dialog.setText("Please enter a username and password.")
|
||||
warning_dialog.setWindowTitle("Login Failed")
|
||||
warning_dialog.exec()
|
||||
else:
|
||||
warning_dialog = QtWidgets.QMessageBox()
|
||||
warning_dialog.setIcon(QtWidgets.QMessageBox.Icon.Warning)
|
||||
warning_dialog.setText(
|
||||
"Invalid username or password. Please try again."
|
||||
)
|
||||
warning_dialog.setWindowTitle("Login Failed")
|
||||
warning_dialog.exec()
|
||||
|
||||
def cancel_buttonfn(self):
|
||||
self.dialog.reject()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import sys
|
||||
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
Dialog = QtWidgets.QDialog()
|
||||
ui = Ui_Dialog()
|
||||
ui.setupUi(Dialog)
|
||||
Dialog.show()
|
||||
sys.exit(app.exec())
|
||||
240
src/ui/dialogs/Ui_medianadder.py
Normal file
240
src/ui/dialogs/Ui_medianadder.py
Normal file
@@ -0,0 +1,240 @@
|
||||
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\Semesterapparate\ui\dialogs\medianadder.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.3.1
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Dialog(object):
|
||||
def setupUi(self, Dialog):
|
||||
Dialog.setObjectName("Dialog")
|
||||
Dialog.resize(637, 491)
|
||||
self.label = QtWidgets.QLabel(Dialog)
|
||||
self.label.setGeometry(QtCore.QRect(20, 10, 47, 21))
|
||||
self.label.setObjectName("label")
|
||||
self.label_2 = QtWidgets.QLabel(Dialog)
|
||||
self.label_2.setGeometry(QtCore.QRect(20, 40, 47, 21))
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.comboBox = QtWidgets.QComboBox(Dialog)
|
||||
self.comboBox.setGeometry(QtCore.QRect(70, 40, 69, 22))
|
||||
self.comboBox.setObjectName("comboBox")
|
||||
self.comboBox.addItem("")
|
||||
self.comboBox.addItem("")
|
||||
self.comboBox.addItem("")
|
||||
self.comboBox.addItem("")
|
||||
self.lineEdit = QtWidgets.QLineEdit(Dialog)
|
||||
self.lineEdit.setGeometry(QtCore.QRect(70, 10, 113, 20))
|
||||
self.lineEdit.setObjectName("lineEdit")
|
||||
self.label_3 = QtWidgets.QLabel(Dialog)
|
||||
self.label_3.setGeometry(QtCore.QRect(20, 70, 47, 21))
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.widget = QtWidgets.QWidget(Dialog)
|
||||
self.widget.setGeometry(QtCore.QRect(330, 90, 301, 341))
|
||||
self.widget.setObjectName("widget")
|
||||
self.treeWidget = QtWidgets.QTreeWidget(self.widget)
|
||||
self.treeWidget.setEnabled(True)
|
||||
self.treeWidget.setGeometry(QtCore.QRect(0, 0, 301, 341))
|
||||
self.treeWidget.setAutoFillBackground(False)
|
||||
self.treeWidget.setLineWidth(0)
|
||||
self.treeWidget.setMidLineWidth(0)
|
||||
self.treeWidget.setVerticalScrollBarPolicy(
|
||||
QtCore.Qt.ScrollBarPolicy.ScrollBarAlwaysOff
|
||||
)
|
||||
self.treeWidget.setHorizontalScrollBarPolicy(
|
||||
QtCore.Qt.ScrollBarPolicy.ScrollBarAlwaysOff
|
||||
)
|
||||
self.treeWidget.setSizeAdjustPolicy(
|
||||
QtWidgets.QAbstractScrollArea.SizeAdjustPolicy.AdjustToContents
|
||||
)
|
||||
self.treeWidget.setEditTriggers(
|
||||
QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers
|
||||
)
|
||||
self.treeWidget.setAlternatingRowColors(True)
|
||||
self.treeWidget.setSelectionMode(
|
||||
QtWidgets.QAbstractItemView.SelectionMode.NoSelection
|
||||
)
|
||||
self.treeWidget.setTextElideMode(QtCore.Qt.TextElideMode.ElideMiddle)
|
||||
self.treeWidget.setUniformRowHeights(True)
|
||||
self.treeWidget.setItemsExpandable(False)
|
||||
self.treeWidget.setExpandsOnDoubleClick(False)
|
||||
self.treeWidget.setObjectName("treeWidget")
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(7)
|
||||
self.treeWidget.headerItem().setFont(0, font)
|
||||
item_0 = QtWidgets.QTreeWidgetItem(self.treeWidget)
|
||||
brush = QtGui.QBrush(QtGui.QColor(255, 0, 0))
|
||||
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
|
||||
item_0.setBackground(2, brush)
|
||||
item_0 = QtWidgets.QTreeWidgetItem(self.treeWidget)
|
||||
brush = QtGui.QBrush(QtGui.QColor(0, 255, 0))
|
||||
brush.setStyle(QtCore.Qt.BrushStyle.SolidPattern)
|
||||
item_0.setBackground(2, brush)
|
||||
item_0 = QtWidgets.QTreeWidgetItem(self.treeWidget)
|
||||
item_0 = QtWidgets.QTreeWidgetItem(self.treeWidget)
|
||||
item_0 = QtWidgets.QTreeWidgetItem(self.treeWidget)
|
||||
item_0 = QtWidgets.QTreeWidgetItem(self.treeWidget)
|
||||
item_0 = QtWidgets.QTreeWidgetItem(self.treeWidget)
|
||||
item_0 = QtWidgets.QTreeWidgetItem(self.treeWidget)
|
||||
item_0 = QtWidgets.QTreeWidgetItem(self.treeWidget)
|
||||
item_0 = QtWidgets.QTreeWidgetItem(self.treeWidget)
|
||||
item_0 = QtWidgets.QTreeWidgetItem(self.treeWidget)
|
||||
self.treeWidget.header().setCascadingSectionResizes(False)
|
||||
self.treeWidget.header().setDefaultSectionSize(60)
|
||||
self.treeWidget.header().setHighlightSections(False)
|
||||
self.treeWidget.header().setMinimumSectionSize(20)
|
||||
self.listWidget = QtWidgets.QListWidget(Dialog)
|
||||
self.listWidget.setGeometry(QtCore.QRect(10, 90, 281, 341))
|
||||
self.listWidget.setContextMenuPolicy(
|
||||
QtCore.Qt.ContextMenuPolicy.CustomContextMenu
|
||||
)
|
||||
self.listWidget.setObjectName("listWidget")
|
||||
self.label_4 = QtWidgets.QLabel(Dialog)
|
||||
self.label_4.setGeometry(QtCore.QRect(330, 50, 181, 21))
|
||||
self.label_4.setObjectName("label_4")
|
||||
self.label_5 = QtWidgets.QLabel(Dialog)
|
||||
self.label_5.setGeometry(QtCore.QRect(200, 70, 41, 21))
|
||||
self.label_5.setObjectName("label_5")
|
||||
self.list_amount = QtWidgets.QLabel(Dialog)
|
||||
self.list_amount.setGeometry(QtCore.QRect(240, 70, 47, 21))
|
||||
self.list_amount.setObjectName("list_amount")
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
|
||||
self.buttonBox.setGeometry(QtCore.QRect(10, 450, 156, 23))
|
||||
self.buttonBox.setStandardButtons(
|
||||
QtWidgets.QDialogButtonBox.StandardButton.Cancel
|
||||
| QtWidgets.QDialogButtonBox.StandardButton.Ok
|
||||
)
|
||||
self.buttonBox.setCenterButtons(False)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.buttonBox.setFocusPolicy(QtCore.Qt.FocusPolicy.ClickFocus)
|
||||
# self.buttonBox.accepted.disconnect()
|
||||
# set the activation action for the buttonBox to be shift enter
|
||||
self.buttonBox.setFocusPolicy(QtCore.Qt.FocusPolicy.StrongFocus)
|
||||
self.buttonBox.accepted.connect(Dialog.accept) # type: ignore
|
||||
self.buttonBox.rejected.connect(Dialog.reject) # type: ignore
|
||||
|
||||
self.lineEdit.returnPressed.connect(self.add_to_list)
|
||||
self.retranslateUi(Dialog)
|
||||
QtCore.QMetaObject.connectSlotsByName(Dialog)
|
||||
|
||||
def retranslateUi(self, Dialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Dialog.setWindowTitle(_translate("Dialog", "Dialog"))
|
||||
self.label.setText(_translate("Dialog", "Signatur"))
|
||||
self.label_2.setText(_translate("Dialog", "Modus"))
|
||||
self.comboBox.setItemText(0, _translate("Dialog", "ARRAY"))
|
||||
self.comboBox.setItemText(1, _translate("Dialog", "BibTeX"))
|
||||
self.comboBox.setItemText(2, _translate("Dialog", "COinS"))
|
||||
self.comboBox.setItemText(3, _translate("Dialog", "RIS"))
|
||||
self.lineEdit.setPlaceholderText(_translate("Dialog", "Signatur / ISBN"))
|
||||
self.label_3.setText(_translate("Dialog", "Queue"))
|
||||
self.treeWidget.headerItem().setText(
|
||||
0, _translate("Dialog", "Datensatz\\Metadata")
|
||||
)
|
||||
self.treeWidget.headerItem().setText(1, _translate("Dialog", "Array"))
|
||||
self.treeWidget.headerItem().setText(2, _translate("Dialog", "BibTeX"))
|
||||
self.treeWidget.headerItem().setText(3, _translate("Dialog", "COinS"))
|
||||
self.treeWidget.headerItem().setText(4, _translate("Dialog", "RIS"))
|
||||
__sortingEnabled = self.treeWidget.isSortingEnabled()
|
||||
self.treeWidget.setSortingEnabled(False)
|
||||
self.treeWidget.topLevelItem(0).setText(0, _translate("Dialog", "PPN"))
|
||||
self.treeWidget.topLevelItem(0).setText(1, _translate("Dialog", "1"))
|
||||
self.treeWidget.topLevelItem(0).setText(2, _translate("Dialog", "0"))
|
||||
self.treeWidget.topLevelItem(0).setText(3, _translate("Dialog", "1"))
|
||||
self.treeWidget.topLevelItem(0).setText(4, _translate("Dialog", "1"))
|
||||
self.treeWidget.topLevelItem(1).setText(0, _translate("Dialog", "Signatur"))
|
||||
self.treeWidget.topLevelItem(1).setText(1, _translate("Dialog", "1"))
|
||||
self.treeWidget.topLevelItem(1).setText(2, _translate("Dialog", "1"))
|
||||
self.treeWidget.topLevelItem(1).setText(3, _translate("Dialog", "0"))
|
||||
self.treeWidget.topLevelItem(1).setText(4, _translate("Dialog", "1"))
|
||||
self.treeWidget.topLevelItem(2).setText(0, _translate("Dialog", "Autor"))
|
||||
self.treeWidget.topLevelItem(2).setText(1, _translate("Dialog", "1"))
|
||||
self.treeWidget.topLevelItem(2).setText(2, _translate("Dialog", "1"))
|
||||
self.treeWidget.topLevelItem(2).setText(3, _translate("Dialog", "1"))
|
||||
self.treeWidget.topLevelItem(2).setText(4, _translate("Dialog", "1"))
|
||||
self.treeWidget.topLevelItem(3).setText(0, _translate("Dialog", "ISBN"))
|
||||
self.treeWidget.topLevelItem(3).setText(1, _translate("Dialog", "1"))
|
||||
self.treeWidget.topLevelItem(3).setText(2, _translate("Dialog", "1"))
|
||||
self.treeWidget.topLevelItem(3).setText(3, _translate("Dialog", "1"))
|
||||
self.treeWidget.topLevelItem(3).setText(4, _translate("Dialog", "1"))
|
||||
self.treeWidget.topLevelItem(4).setText(0, _translate("Dialog", "Jahr"))
|
||||
self.treeWidget.topLevelItem(4).setText(1, _translate("Dialog", "1"))
|
||||
self.treeWidget.topLevelItem(4).setText(2, _translate("Dialog", "1"))
|
||||
self.treeWidget.topLevelItem(4).setText(3, _translate("Dialog", "1"))
|
||||
self.treeWidget.topLevelItem(4).setText(4, _translate("Dialog", "1"))
|
||||
self.treeWidget.topLevelItem(5).setText(0, _translate("Dialog", "Auflage"))
|
||||
self.treeWidget.topLevelItem(5).setText(1, _translate("Dialog", "1"))
|
||||
self.treeWidget.topLevelItem(5).setText(2, _translate("Dialog", "1"))
|
||||
self.treeWidget.topLevelItem(5).setText(3, _translate("Dialog", "1"))
|
||||
self.treeWidget.topLevelItem(5).setText(4, _translate("Dialog", "1"))
|
||||
self.treeWidget.topLevelItem(6).setText(0, _translate("Dialog", "Sprache"))
|
||||
self.treeWidget.topLevelItem(6).setText(1, _translate("Dialog", "1"))
|
||||
self.treeWidget.topLevelItem(6).setText(2, _translate("Dialog", "1"))
|
||||
self.treeWidget.topLevelItem(6).setText(3, _translate("Dialog", "0"))
|
||||
self.treeWidget.topLevelItem(6).setText(4, _translate("Dialog", "1"))
|
||||
self.treeWidget.topLevelItem(7).setText(0, _translate("Dialog", "Herausgeber"))
|
||||
self.treeWidget.topLevelItem(7).setText(1, _translate("Dialog", "1"))
|
||||
self.treeWidget.topLevelItem(7).setText(2, _translate("Dialog", "1"))
|
||||
self.treeWidget.topLevelItem(7).setText(3, _translate("Dialog", "1"))
|
||||
self.treeWidget.topLevelItem(7).setText(4, _translate("Dialog", "1"))
|
||||
self.treeWidget.topLevelItem(8).setText(0, _translate("Dialog", "Seiten"))
|
||||
self.treeWidget.topLevelItem(8).setText(1, _translate("Dialog", "1"))
|
||||
self.treeWidget.topLevelItem(8).setText(2, _translate("Dialog", "1"))
|
||||
self.treeWidget.topLevelItem(8).setText(3, _translate("Dialog", "1"))
|
||||
self.treeWidget.topLevelItem(8).setText(4, _translate("Dialog", "1"))
|
||||
self.treeWidget.topLevelItem(9).setText(0, _translate("Dialog", "Titel"))
|
||||
self.treeWidget.topLevelItem(9).setText(1, _translate("Dialog", "1"))
|
||||
self.treeWidget.topLevelItem(9).setText(2, _translate("Dialog", "1"))
|
||||
self.treeWidget.topLevelItem(9).setText(3, _translate("Dialog", "1"))
|
||||
self.treeWidget.topLevelItem(9).setText(4, _translate("Dialog", "1"))
|
||||
self.treeWidget.topLevelItem(10).setText(0, _translate("Dialog", "Link"))
|
||||
self.treeWidget.topLevelItem(10).setText(1, _translate("Dialog", "1"))
|
||||
self.treeWidget.topLevelItem(10).setText(2, _translate("Dialog", "0"))
|
||||
self.treeWidget.topLevelItem(10).setText(3, _translate("Dialog", "1"))
|
||||
self.treeWidget.topLevelItem(10).setText(4, _translate("Dialog", "1"))
|
||||
self.treeWidget.setSortingEnabled(__sortingEnabled)
|
||||
self.label_4.setText(_translate("Dialog", "Belegbare Felder per Anbieter"))
|
||||
self.label_5.setText(_translate("Dialog", "Anzahl:"))
|
||||
self.list_amount.setText(_translate("Dialog", "0"))
|
||||
self.recolorize()
|
||||
self.listWidget.customContextMenuRequested.connect(self.custom_context_menu)
|
||||
|
||||
def add_to_list(self):
|
||||
text = self.lineEdit.text().strip()
|
||||
if text == "":
|
||||
return
|
||||
else:
|
||||
self.listWidget.addItem(text)
|
||||
self.list_amount.setText(str(self.listWidget.count()))
|
||||
self.lineEdit.clear()
|
||||
|
||||
def recolorize(self):
|
||||
# set the color of the cells of the treeWidget to red if the field is not supported by the provider
|
||||
# else set it to green
|
||||
for i in range(self.treeWidget.topLevelItemCount()):
|
||||
for j in range(1, self.treeWidget.columnCount()):
|
||||
if self.treeWidget.topLevelItem(i).text(j) == "0":
|
||||
self.treeWidget.topLevelItem(i).setBackground(
|
||||
j, QtGui.QColor(255, 0, 0)
|
||||
)
|
||||
else:
|
||||
self.treeWidget.topLevelItem(i).setBackground(
|
||||
j, QtGui.QColor(0, 255, 0)
|
||||
)
|
||||
# remove the text from the cells
|
||||
self.treeWidget.topLevelItem(i).setText(j, "")
|
||||
|
||||
def custom_context_menu(self):
|
||||
menu = QtWidgets.QMenu()
|
||||
menu.addAction("Remove")
|
||||
|
||||
action = menu.exec(QtGui.QCursor.pos())
|
||||
if action.text() == "Remove":
|
||||
self.remove_from_list()
|
||||
|
||||
def remove_from_list(self):
|
||||
self.listWidget.takeItem(self.listWidget.currentRow())
|
||||
self.list_amount.setText(str(self.listWidget.count()))
|
||||
4
src/ui/dialogs/Ui_medianadder.ts
Normal file
4
src/ui/dialogs/Ui_medianadder.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1">
|
||||
</TS>
|
||||
63
src/ui/dialogs/Ui_new_subject.py
Normal file
63
src/ui/dialogs/Ui_new_subject.py
Normal file
@@ -0,0 +1,63 @@
|
||||
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\Semesterapparate\ui\dialogs\new_subject.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.3.1
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt6 import QtCore, QtWidgets
|
||||
|
||||
|
||||
class Ui_Dialog(object):
|
||||
def setupUi(self, Dialog):
|
||||
Dialog.setObjectName("Dialog")
|
||||
Dialog.resize(448, 165)
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout(Dialog)
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout()
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.label = QtWidgets.QLabel(Dialog)
|
||||
self.label.setObjectName("label")
|
||||
self.verticalLayout.addWidget(self.label)
|
||||
self.gridLayout = QtWidgets.QGridLayout()
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
self.gridLayout.addItem(spacerItem, 0, 1, 1, 1)
|
||||
self.checkBox = QtWidgets.QCheckBox(Dialog)
|
||||
self.checkBox.setObjectName("checkBox")
|
||||
self.gridLayout.addWidget(self.checkBox, 0, 0, 1, 1)
|
||||
self.verticalLayout.addLayout(self.gridLayout)
|
||||
self.verticalLayout_2.addLayout(self.verticalLayout)
|
||||
self.frame = QtWidgets.QFrame(Dialog)
|
||||
self.frame.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel)
|
||||
self.frame.setFrameShadow(QtWidgets.QFrame.Shadow.Raised)
|
||||
self.frame.setObjectName("frame")
|
||||
self.label_2 = QtWidgets.QLabel(self.frame)
|
||||
self.label_2.setGeometry(QtCore.QRect(0, 10, 141, 16))
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.lineEdit = QtWidgets.QLineEdit(self.frame)
|
||||
self.lineEdit.setGeometry(QtCore.QRect(0, 30, 141, 20))
|
||||
self.lineEdit.setObjectName("lineEdit")
|
||||
self.verticalLayout_2.addWidget(self.frame)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.verticalLayout_2.addWidget(self.buttonBox)
|
||||
self.frame.setVisible(False)
|
||||
self.checkBox.stateChanged.connect(lambda: self.frame.setVisible(self.checkBox.isChecked()))
|
||||
|
||||
self.retranslateUi(Dialog)
|
||||
self.buttonBox.accepted.connect(Dialog.accept) # type: ignore
|
||||
self.buttonBox.rejected.connect(Dialog.reject) # type: ignore
|
||||
QtCore.QMetaObject.connectSlotsByName(Dialog)
|
||||
|
||||
def retranslateUi(self, Dialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Dialog.setWindowTitle(_translate("Dialog", "Dialog"))
|
||||
self.label.setText(_translate("Dialog", "Das eingegebene Fach wurde nicht in der Datenbank gefunden. Soll es angelegt werden?"))
|
||||
self.checkBox.setText(_translate("Dialog", "Ja"))
|
||||
self.label_2.setText(_translate("Dialog", "Name des Neuen Faches:"))
|
||||
def return_state(self):
|
||||
return self.lineEdit.text()
|
||||
158
src/ui/dialogs/Ui_parsed_titles.py
Normal file
158
src/ui/dialogs/Ui_parsed_titles.py
Normal file
@@ -0,0 +1,158 @@
|
||||
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\Semesterapparate\ui\dialogs\parsed_titles.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.3.1
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
from log import MyLogger
|
||||
from src.logic.threads import AutoAdder
|
||||
|
||||
logger = MyLogger("AutoTitleAdder")
|
||||
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
Form.setObjectName("Form")
|
||||
Form.resize(402, 316)
|
||||
self.frame = QtWidgets.QFrame(Form)
|
||||
self.frame.setGeometry(QtCore.QRect(10, 10, 381, 41))
|
||||
self.frame.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel)
|
||||
self.frame.setFrameShadow(QtWidgets.QFrame.Shadow.Raised)
|
||||
self.frame.setObjectName("frame")
|
||||
self.horizontalLayoutWidget = QtWidgets.QWidget(self.frame)
|
||||
self.horizontalLayoutWidget.setGeometry(QtCore.QRect(0, 0, 381, 41))
|
||||
self.horizontalLayoutWidget.setObjectName("horizontalLayoutWidget")
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget)
|
||||
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.label = QtWidgets.QLabel(self.horizontalLayoutWidget)
|
||||
self.label.setObjectName("label")
|
||||
self.horizontalLayout.addWidget(self.label)
|
||||
self.count = QtWidgets.QLabel(self.horizontalLayoutWidget)
|
||||
font = QtGui.QFont()
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.count.setFont(font)
|
||||
self.count.setTextFormat(QtCore.Qt.TextFormat.PlainText)
|
||||
self.count.setObjectName("count")
|
||||
self.horizontalLayout.addWidget(self.count)
|
||||
self.label_2 = QtWidgets.QLabel(self.horizontalLayoutWidget)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.horizontalLayout.addWidget(self.label_2)
|
||||
spacerItem = QtWidgets.QSpacerItem(
|
||||
40,
|
||||
20,
|
||||
QtWidgets.QSizePolicy.Policy.Expanding,
|
||||
QtWidgets.QSizePolicy.Policy.Minimum,
|
||||
)
|
||||
self.horizontalLayout.addItem(spacerItem)
|
||||
self.frame_2 = QtWidgets.QFrame(Form)
|
||||
self.frame_2.setGeometry(QtCore.QRect(10, 80, 381, 201))
|
||||
self.frame_2.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel)
|
||||
self.frame_2.setFrameShadow(QtWidgets.QFrame.Shadow.Raised)
|
||||
self.frame_2.setObjectName("frame_2")
|
||||
self.horizontalLayoutWidget_2 = QtWidgets.QWidget(self.frame_2)
|
||||
self.horizontalLayoutWidget_2.setGeometry(QtCore.QRect(0, 10, 381, 191))
|
||||
self.horizontalLayoutWidget_2.setObjectName("horizontalLayoutWidget_2")
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget_2)
|
||||
self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
self.listWidget = QtWidgets.QListWidget(self.horizontalLayoutWidget_2)
|
||||
self.listWidget.setObjectName("listWidget")
|
||||
self.horizontalLayout_2.addWidget(self.listWidget)
|
||||
self.listWidget_done = QtWidgets.QListWidget(self.horizontalLayoutWidget_2)
|
||||
self.listWidget_done.setObjectName("listWidget_done")
|
||||
self.horizontalLayout_2.addWidget(self.listWidget_done)
|
||||
self.progressBar = QtWidgets.QProgressBar(Form)
|
||||
self.progressBar.setGeometry(QtCore.QRect(10, 60, 381, 23))
|
||||
self.progressBar.setProperty("value", 24)
|
||||
self.progressBar.setObjectName("progressBar")
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(Form)
|
||||
self.buttonBox.setGeometry(QtCore.QRect(230, 290, 156, 23))
|
||||
self.buttonBox.setStandardButtons(
|
||||
QtWidgets.QDialogButtonBox.StandardButton.Cancel
|
||||
| QtWidgets.QDialogButtonBox.StandardButton.Ok
|
||||
)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.toolButton = QtWidgets.QToolButton(Form)
|
||||
self.toolButton.setGeometry(QtCore.QRect(20, 290, 25, 19))
|
||||
self.toolButton.setObjectName("toolButton")
|
||||
self.signatures = []
|
||||
self.prof_id = None
|
||||
self.app_id = None
|
||||
self.thread = QtCore.QThread()
|
||||
self.toolButton.hide()
|
||||
self.retranslateUi(Form)
|
||||
QtCore.QMetaObject.connectSlotsByName(Form)
|
||||
self.toolButton.clicked.connect(self.start)
|
||||
# if cancel is clicked, terminate the thread
|
||||
self.buttonBox.rejected.connect(self.thread_quit)
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Form.setWindowTitle(_translate("Form", "Form"))
|
||||
self.label.setText(_translate("Form", "Es wurden"))
|
||||
self.count.setText(_translate("Form", "0"))
|
||||
self.label_2.setText(_translate("Form", "Signaturen gefunden."))
|
||||
self.toolButton.setText(_translate("Form", "..."))
|
||||
|
||||
def populate_table(self):
|
||||
for i in range(len(self.signatures)):
|
||||
self.listWidget.addItem(QtWidgets.QListWidgetItem())
|
||||
self.listWidget.item(i).setText(self.signatures[i])
|
||||
self.listWidget.item(i).setToolTip("Daten werden gesammelt")
|
||||
|
||||
def update_progress_bar(self, value: int):
|
||||
self.progressBar.setValue(value)
|
||||
|
||||
def thread_quit(self):
|
||||
print("Terminating thread")
|
||||
self.thread.terminate()
|
||||
self.thread.quit()
|
||||
self.thread.deleteLater()
|
||||
self.thread = None
|
||||
|
||||
def start(self):
|
||||
logger.log_info("Starting AutoAdder")
|
||||
|
||||
self.thread = AutoAdder(
|
||||
data=self.signatures,
|
||||
app_id=self.app_id,
|
||||
prof_id=self.prof_id,
|
||||
)
|
||||
self.thread.finished.connect(self.on_completion)
|
||||
self.thread.updateSignal.connect(self.update_progress_bar)
|
||||
self.thread.setTextSignal.connect(self.update_lists)
|
||||
self.thread.progress.connect(self.determine_progress)
|
||||
self.thread.finished.connect(self.thread.quit)
|
||||
self.thread.finished.connect(self.thread.deleteLater)
|
||||
# self.thread.updateSignal.connect(self.update_progress_label)
|
||||
# worker.finished.connect(worker.deleteLater)
|
||||
|
||||
self.thread.start()
|
||||
|
||||
def on_completion(self):
|
||||
logger.log_info("AutoAdder finished")
|
||||
logger.log_info("Returning data")
|
||||
|
||||
# create a function that closes the dialog
|
||||
|
||||
def determine_progress(self, signal):
|
||||
# check length of listWidget
|
||||
length = self.listWidget.count()
|
||||
print(f"Length of listWidget: {length}")
|
||||
if length == 0:
|
||||
logger.log_info("AutoAdder finished")
|
||||
self.buttonBox.accepted.emit()
|
||||
|
||||
def update_lists(self, signal):
|
||||
# get text of first entry in listWidget
|
||||
text = self.listWidget.item(0).text()
|
||||
# remove first entry
|
||||
self.listWidget.takeItem(0)
|
||||
# add first entry to listWidget_done
|
||||
self.listWidget_done.addItem(text)
|
||||
52
src/ui/dialogs/Ui_reminder.py
Normal file
52
src/ui/dialogs/Ui_reminder.py
Normal file
@@ -0,0 +1,52 @@
|
||||
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\Semesterapparate\ui\dialogs\reminder.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.3.1
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt6 import QtCore, QtWidgets
|
||||
|
||||
|
||||
class Ui_Dialog(object):
|
||||
def setupUi(self, Dialog):
|
||||
Dialog.setObjectName("Dialog")
|
||||
Dialog.resize(369, 308)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
|
||||
self.buttonBox.setGeometry(QtCore.QRect(190, 270, 161, 32))
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
||||
self.buttonBox.setStandardButtons(
|
||||
QtWidgets.QDialogButtonBox.StandardButton.Cancel
|
||||
| QtWidgets.QDialogButtonBox.StandardButton.Ok
|
||||
)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.message_box = QtWidgets.QTextEdit(Dialog)
|
||||
self.message_box.setGeometry(QtCore.QRect(10, 60, 341, 201))
|
||||
self.message_box.setObjectName("message_box")
|
||||
self.label = QtWidgets.QLabel(Dialog)
|
||||
self.label.setGeometry(QtCore.QRect(10, 30, 61, 21))
|
||||
self.label.setObjectName("label")
|
||||
self.label_2 = QtWidgets.QLabel(Dialog)
|
||||
self.label_2.setGeometry(QtCore.QRect(150, 30, 81, 21))
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.dateEdit = QtWidgets.QDateEdit(Dialog)
|
||||
self.dateEdit.setGeometry(QtCore.QRect(240, 30, 110, 22))
|
||||
self.dateEdit.setObjectName("dateEdit")
|
||||
self.dateEdit.setDateTime(QtCore.QDateTime.currentDateTime())
|
||||
self.retranslateUi(Dialog)
|
||||
self.buttonBox.accepted.connect(Dialog.accept) # type: ignore
|
||||
self.buttonBox.rejected.connect(Dialog.reject) # type: ignore
|
||||
QtCore.QMetaObject.connectSlotsByName(Dialog)
|
||||
|
||||
def retranslateUi(self, Dialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Dialog.setWindowTitle(_translate("Dialog", "Dialog"))
|
||||
self.label.setText(_translate("Dialog", "Nachricht:"))
|
||||
self.label_2.setText(_translate("Dialog", "Erinnerung am:"))
|
||||
|
||||
def return_message(self) -> dict:
|
||||
return {
|
||||
"message": self.message_box.toPlainText(),
|
||||
"remind_at": self.dateEdit.date().toString("yyyy-MM-dd"),
|
||||
}
|
||||
202
src/ui/dialogs/Ui_settings.py
Normal file
202
src/ui/dialogs/Ui_settings.py
Normal file
@@ -0,0 +1,202 @@
|
||||
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\Semesterapparate\ui\dialogs\settings.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.3.1
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from omegaconf import OmegaConf
|
||||
from PyQt6 import QtCore, QtWidgets
|
||||
|
||||
config = OmegaConf.load("config.yaml")
|
||||
|
||||
|
||||
class Ui_Dialog(object):
|
||||
def setupUi(self, Dialog):
|
||||
Dialog.setObjectName("Dialog")
|
||||
Dialog.resize(743, 576)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
|
||||
self.buttonBox.setGeometry(QtCore.QRect(120, 540, 621, 32))
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
||||
self.buttonBox.setStandardButtons(
|
||||
QtWidgets.QDialogButtonBox.StandardButton.Cancel
|
||||
| QtWidgets.QDialogButtonBox.StandardButton.Ok
|
||||
)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.frame = QtWidgets.QFrame(Dialog)
|
||||
self.frame.setGeometry(QtCore.QRect(0, 0, 741, 541))
|
||||
self.frame.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel)
|
||||
self.frame.setFrameShadow(QtWidgets.QFrame.Shadow.Raised)
|
||||
self.frame.setObjectName("frame")
|
||||
self.label = QtWidgets.QLabel(self.frame)
|
||||
self.label.setGeometry(QtCore.QRect(400, 30, 161, 21))
|
||||
self.label.setObjectName("label")
|
||||
self.line = QtWidgets.QFrame(self.frame)
|
||||
self.line.setGeometry(QtCore.QRect(370, 0, 20, 541))
|
||||
self.line.setFrameShadow(QtWidgets.QFrame.Shadow.Plain)
|
||||
self.line.setLineWidth(1)
|
||||
self.line.setMidLineWidth(0)
|
||||
self.line.setFrameShape(QtWidgets.QFrame.Shape.VLine)
|
||||
self.line.setObjectName("line")
|
||||
self.textBrowser = QtWidgets.QTextBrowser(self.frame)
|
||||
self.textBrowser.setGeometry(QtCore.QRect(400, 50, 311, 51))
|
||||
self.textBrowser.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus)
|
||||
self.textBrowser.setInputMethodHints(QtCore.Qt.InputMethodHint.ImhNone)
|
||||
self.textBrowser.setObjectName("textBrowser")
|
||||
self.label_2 = QtWidgets.QLabel(self.frame)
|
||||
self.label_2.setGeometry(QtCore.QRect(10, 20, 161, 21))
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.os_apps = QtWidgets.QCheckBox(self.frame)
|
||||
self.os_apps.setGeometry(QtCore.QRect(410, 110, 161, 17))
|
||||
self.os_apps.setObjectName("os_apps")
|
||||
self.formLayoutWidget = QtWidgets.QWidget(self.frame)
|
||||
self.formLayoutWidget.setGeometry(QtCore.QRect(10, 50, 361, 491))
|
||||
self.formLayoutWidget.setObjectName("formLayoutWidget")
|
||||
self.gridLayout = QtWidgets.QGridLayout(self.formLayoutWidget)
|
||||
self.gridLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.label_3 = QtWidgets.QLabel(self.formLayoutWidget)
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.gridLayout.addWidget(self.label_3, 0, 0, 1, 1)
|
||||
self.label_5 = QtWidgets.QLabel(self.formLayoutWidget)
|
||||
self.label_5.setObjectName("label_5")
|
||||
self.gridLayout.addWidget(self.label_5, 2, 0, 1, 1)
|
||||
self.db_path = QtWidgets.QLineEdit(self.formLayoutWidget)
|
||||
self.db_path.setEnabled(False)
|
||||
self.db_path.setObjectName("db_path")
|
||||
self.gridLayout.addWidget(self.db_path, 1, 1, 1, 1)
|
||||
self.save_path = QtWidgets.QLineEdit(self.formLayoutWidget)
|
||||
self.save_path.setObjectName("save_path")
|
||||
self.gridLayout.addWidget(self.save_path, 2, 1, 1, 1)
|
||||
self.label_4 = QtWidgets.QLabel(self.formLayoutWidget)
|
||||
self.label_4.setObjectName("label_4")
|
||||
self.gridLayout.addWidget(self.label_4, 1, 0, 1, 1)
|
||||
self.db_name = QtWidgets.QLineEdit(self.formLayoutWidget)
|
||||
self.db_name.setObjectName("db_name")
|
||||
self.gridLayout.addWidget(self.db_name, 0, 1, 1, 1)
|
||||
self.tb_set_save_path = QtWidgets.QToolButton(self.formLayoutWidget)
|
||||
self.tb_set_save_path.setObjectName("tb_set_save_path")
|
||||
self.gridLayout.addWidget(self.tb_set_save_path, 2, 2, 1, 1)
|
||||
spacerItem = QtWidgets.QSpacerItem(
|
||||
20,
|
||||
40,
|
||||
QtWidgets.QSizePolicy.Policy.Minimum,
|
||||
QtWidgets.QSizePolicy.Policy.Expanding,
|
||||
)
|
||||
self.gridLayout.addItem(spacerItem, 3, 1, 1, 1)
|
||||
self.tb_select_db = QtWidgets.QToolButton(self.formLayoutWidget)
|
||||
self.tb_select_db.setObjectName("tb_select_db")
|
||||
self.gridLayout.addWidget(self.tb_select_db, 0, 2, 1, 1)
|
||||
self.scrollArea = QtWidgets.QScrollArea(self.frame)
|
||||
self.scrollArea.setGeometry(QtCore.QRect(400, 130, 331, 411))
|
||||
self.scrollArea.setWidgetResizable(True)
|
||||
self.scrollArea.setObjectName("scrollArea")
|
||||
self.scrollAreaWidgetContents = QtWidgets.QWidget()
|
||||
self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 329, 409))
|
||||
self.scrollAreaWidgetContents.setObjectName("scrollAreaWidgetContents")
|
||||
self.treeWidget = QtWidgets.QTreeWidget(self.scrollAreaWidgetContents)
|
||||
self.treeWidget.setGeometry(QtCore.QRect(0, 0, 331, 411))
|
||||
self.treeWidget.setObjectName("treeWidget")
|
||||
self.treeWidget.setContextMenuPolicy(
|
||||
QtCore.Qt.ContextMenuPolicy.ActionsContextMenu
|
||||
)
|
||||
self.scrollArea.setWidget(self.scrollAreaWidgetContents)
|
||||
self.label_3.setBuddy(self.db_name)
|
||||
self.label_5.setBuddy(self.save_path)
|
||||
self.label_4.setBuddy(self.db_path)
|
||||
self.tb_select_db.clicked.connect(self.select_db)
|
||||
self.tb_set_save_path.clicked.connect(self.set_save_path)
|
||||
self.retranslateUi(Dialog)
|
||||
self.buttonBox.accepted.connect(Dialog.accept) # type: ignore
|
||||
self.buttonBox.rejected.connect(Dialog.reject) # type: ignore
|
||||
QtCore.QMetaObject.connectSlotsByName(Dialog)
|
||||
Dialog.setTabOrder(self.db_name, self.db_path)
|
||||
Dialog.setTabOrder(self.db_path, self.save_path)
|
||||
Dialog.setTabOrder(self.save_path, self.os_apps)
|
||||
Dialog.setTabOrder(self.os_apps, self.textBrowser)
|
||||
|
||||
def retranslateUi(self, Dialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Dialog.setWindowTitle(_translate("Dialog", "Dialog"))
|
||||
self.label.setText(_translate("Dialog", "Dateispezifische Einstellungen"))
|
||||
self.textBrowser.setHtml(
|
||||
_translate(
|
||||
"Dialog",
|
||||
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">\n'
|
||||
'<html><head><meta name="qrichtext" content="1" /><style type="text/css">\n'
|
||||
"p, li { white-space: pre-wrap; }\n"
|
||||
"</style></head><body style=\" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;\">\n"
|
||||
'<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hier können Einstellungen f<>r bestehende Dateiformate geändert, oder neue Dateiformate eingefügt werden</p>\n'
|
||||
'<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html>',
|
||||
)
|
||||
)
|
||||
self.label_2.setText(_translate("Dialog", "Allgemeine Einstellungen"))
|
||||
self.os_apps.setToolTip(
|
||||
_translate(
|
||||
"Dialog",
|
||||
"Verwendet im Betriebssystem festgelegte Anwendungen um Dateien zu öffnen",
|
||||
)
|
||||
)
|
||||
self.os_apps.setText(_translate("Dialog", "Standard-Apps verwenden"))
|
||||
self.label_3.setToolTip(
|
||||
_translate(
|
||||
"Dialog",
|
||||
'<html><head/><body><p>Name der Datenbank, welche verwendet werden soll. <span style=" font-weight:600;">Muss</span> auf .db enden</p></body></html>',
|
||||
)
|
||||
)
|
||||
self.label_3.setText(_translate("Dialog", "Datenbankname"))
|
||||
self.label_5.setToolTip(
|
||||
_translate(
|
||||
"Dialog",
|
||||
"Pfad, an dem heruntergeladene Dateien gespeichert werden sollen",
|
||||
)
|
||||
)
|
||||
self.label_5.setText(_translate("Dialog", "Speicherpfad"))
|
||||
self.label_4.setText(_translate("Dialog", "Datenbankpfad"))
|
||||
self.db_name.setText(_translate("Dialog", "sap.db"))
|
||||
self.tb_set_save_path.setText(_translate("Dialog", "..."))
|
||||
self.tb_select_db.setText(_translate("Dialog", "..."))
|
||||
self.load_config()
|
||||
|
||||
def load_config(self):
|
||||
self.db_name.setText(config.database.name)
|
||||
self.db_path.setText(config.database.path)
|
||||
self.save_path.setText(config.save_path)
|
||||
self.os_apps.setChecked(config.default_apps)
|
||||
applications = config.custom_applications
|
||||
for application in applications:
|
||||
name = application.application
|
||||
file_type = application.extensions
|
||||
display_name = application.name
|
||||
print(name, file_type, display_name) #
|
||||
# create new item
|
||||
item = QtWidgets.QTreeWidgetItem(self.treeWidget)
|
||||
item.setText(0, display_name)
|
||||
|
||||
def select_db(self):
|
||||
# open file dialog, limit to .db files
|
||||
file_dialog = QtWidgets.QFileDialog()
|
||||
file_dialog.setFileMode(QtWidgets.QFileDialog.FileMode.AnyFile)
|
||||
file_dialog.setNameFilter("Datenbank (*.db)")
|
||||
file_dialog.setViewMode(QtWidgets.QFileDialog.ViewMode.Detail)
|
||||
if file_dialog.exec():
|
||||
self.db_name.setText(file_dialog.selectedFiles()[0].split("/")[-1])
|
||||
self.db_path.setText(
|
||||
file_dialog.selectedFiles()[0].split(self.db_name.text())[0]
|
||||
)
|
||||
|
||||
def set_save_path(self):
|
||||
# open file dialog, limit to .db files
|
||||
file_dialog = QtWidgets.QFileDialog()
|
||||
file_dialog.setFileMode(QtWidgets.QFileDialog.FileMode.Directory)
|
||||
file_dialog.setViewMode(QtWidgets.QFileDialog.ViewMode.Detail)
|
||||
if file_dialog.exec():
|
||||
self.save_path.setText(file_dialog.selectedFiles()[0])
|
||||
|
||||
def return_data(self):
|
||||
config.database.name = self.db_name.text()
|
||||
config.database.path = self.db_path.text()
|
||||
config.save_path = self.save_path.text()
|
||||
config.default_apps = self.os_apps.isChecked()
|
||||
return config
|
||||
4
src/ui/dialogs/Ui_settings.ts
Normal file
4
src/ui/dialogs/Ui_settings.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1">
|
||||
</TS>
|
||||
24
src/ui/dialogs/__init__.py
Normal file
24
src/ui/dialogs/__init__.py
Normal file
@@ -0,0 +1,24 @@
|
||||
from .app_ext import Ui_Dialog as App_Ext_Dialog
|
||||
from .ext_app import Ui_Frame as App_Ext_Window
|
||||
from .mail import Mail_Dialog
|
||||
from .popup_confirm import Ui_extend_confirm as popus_confirm
|
||||
from .settings import Settings
|
||||
from .Ui_edit_bookdata import Ui_Dialog as edit_bookdata_ui
|
||||
from .Ui_fileparser import Ui_Dialog as fileparser_ui
|
||||
from .Ui_login import Ui_Dialog as login_ui
|
||||
from .Ui_medianadder import Ui_Dialog as medienadder_ui
|
||||
from .Ui_parsed_titles import Ui_Form as parsed_titles_ui
|
||||
from .Ui_reminder import Ui_Dialog as reminder_ui
|
||||
from .Ui_settings import Ui_Dialog as settings_ui
|
||||
from .Ui_new_subject import Ui_Dialog as new_subject_ui
|
||||
|
||||
__all__ = [
|
||||
"ext_app",
|
||||
"app_ext",
|
||||
"Mail_Dialog",
|
||||
"medianadder_ui",
|
||||
"popup_confirm",
|
||||
"edit_bookdata_ui",
|
||||
"settings_ui",
|
||||
"parsed_titles_ui",
|
||||
]
|
||||
90
src/ui/dialogs/add_media.ui
Normal file
90
src/ui/dialogs/add_media.ui
Normal file
@@ -0,0 +1,90 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Dialog</class>
|
||||
<widget class="QDialog" name="Dialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>260</y>
|
||||
<width>341</width>
|
||||
<height>32</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QWidget" name="gridLayoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>10</y>
|
||||
<width>381</width>
|
||||
<height>241</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Signatur</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>Dialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>Dialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
114
src/ui/dialogs/app_ext.py
Normal file
114
src/ui/dialogs/app_ext.py
Normal file
@@ -0,0 +1,114 @@
|
||||
# Form implementation generated from reading ui file 'ui\dialogs\apparat_extend.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.3.1
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Dialog(object):
|
||||
def setupUi(self, Dialog):
|
||||
Dialog.setObjectName("Dialog")
|
||||
Dialog.resize(388, 103)
|
||||
sizePolicy = QtWidgets.QSizePolicy(
|
||||
QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed
|
||||
)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(Dialog.sizePolicy().hasHeightForWidth())
|
||||
Dialog.setSizePolicy(sizePolicy)
|
||||
Dialog.setMinimumSize(QtCore.QSize(388, 103))
|
||||
Dialog.setMaximumSize(QtCore.QSize(388, 103))
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
|
||||
self.buttonBox.setGeometry(QtCore.QRect(290, 30, 81, 241))
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Vertical)
|
||||
self.buttonBox.setStandardButtons(
|
||||
QtWidgets.QDialogButtonBox.StandardButton.Abort
|
||||
| QtWidgets.QDialogButtonBox.StandardButton.Save
|
||||
)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.label = QtWidgets.QLabel(Dialog)
|
||||
self.label.setGeometry(QtCore.QRect(10, 0, 281, 31))
|
||||
sizePolicy = QtWidgets.QSizePolicy(
|
||||
QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed
|
||||
)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth())
|
||||
self.label.setSizePolicy(sizePolicy)
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(10)
|
||||
self.label.setFont(font)
|
||||
self.label.setObjectName("label")
|
||||
self.frame = QtWidgets.QFrame(Dialog)
|
||||
self.frame.setGeometry(QtCore.QRect(10, 30, 241, 41))
|
||||
self.frame.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel)
|
||||
self.frame.setFrameShadow(QtWidgets.QFrame.Shadow.Raised)
|
||||
self.frame.setObjectName("frame")
|
||||
self.line = QtWidgets.QFrame(self.frame)
|
||||
self.line.setGeometry(QtCore.QRect(120, 0, 3, 61))
|
||||
self.line.setFrameShape(QtWidgets.QFrame.Shape.VLine)
|
||||
self.line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
|
||||
self.line.setObjectName("line")
|
||||
self.rad_sommer = QtWidgets.QRadioButton(self.frame)
|
||||
self.rad_sommer.setGeometry(QtCore.QRect(10, 10, 82, 21))
|
||||
self.rad_sommer.setObjectName("rad_sommer")
|
||||
self.rad_winter = QtWidgets.QRadioButton(self.frame)
|
||||
self.rad_winter.setGeometry(QtCore.QRect(140, 10, 82, 21))
|
||||
self.rad_winter.setObjectName("rad_winter")
|
||||
self.sem_year = QtWidgets.QLineEdit(Dialog)
|
||||
self.sem_year.setGeometry(QtCore.QRect(10, 70, 121, 20))
|
||||
self.sem_year.setObjectName("sem_year")
|
||||
self.dauerapp = QtWidgets.QCheckBox(Dialog)
|
||||
self.dauerapp.setGeometry(QtCore.QRect(150, 70, 91, 21))
|
||||
self.dauerapp.setObjectName("dauerapp")
|
||||
|
||||
self.retranslateUi(Dialog)
|
||||
self.buttonBox.accepted.connect(Dialog.accept) # type: ignore
|
||||
self.buttonBox.rejected.connect(Dialog.reject) # type: ignore
|
||||
QtCore.QMetaObject.connectSlotsByName(Dialog)
|
||||
|
||||
def retranslateUi(self, Dialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Dialog.setWindowTitle(_translate("Dialog", "Dialog"))
|
||||
self.label.setText(
|
||||
_translate("Dialog", "Bis wann soll der Apparat verlängert werden?")
|
||||
)
|
||||
self.rad_sommer.setText(_translate("Dialog", "Sommer"))
|
||||
self.rad_winter.setText(_translate("Dialog", "Winter"))
|
||||
self.sem_year.setPlaceholderText(_translate("Dialog", "2023"))
|
||||
self.dauerapp.setText(_translate("Dialog", "Dauerapparat"))
|
||||
|
||||
def get_data(self):
|
||||
# def __select_sem_state():
|
||||
# curr_month=QtCore.QDate.currentDate().month()
|
||||
# if curr_month>=4 and curr_month<=9:
|
||||
# return "SoSe"
|
||||
# else:
|
||||
# return "WiSe"
|
||||
# if __select_sem_state()=="SoSe":
|
||||
# self.rad_sommer.setChecked(True)
|
||||
# else:
|
||||
# self.rad_winter.setChecked(True)
|
||||
return {
|
||||
"semester": f"SoSe {int(self.sem_year.text()[-2:])}"
|
||||
if self.rad_sommer.isChecked()
|
||||
else f"WiSe {int(self.sem_year.text()[-2:])}/{int(self.sem_year.text()[-2:])+1}",
|
||||
"dauerapp": self.dauerapp.isChecked()
|
||||
if self.dauerapp.isChecked()
|
||||
else False,
|
||||
}
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import sys
|
||||
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
Dialog = QtWidgets.QDialog()
|
||||
ui = Ui_Dialog()
|
||||
ui.setupUi(Dialog)
|
||||
Dialog.show()
|
||||
sys.exit(app.exec())
|
||||
19
src/ui/dialogs/app_status.ui
Normal file
19
src/ui/dialogs/app_status.ui
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Form</class>
|
||||
<widget class="QWidget" name="Form">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>300</width>
|
||||
<height>500</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
191
src/ui/dialogs/apparat_extend.ui
Normal file
191
src/ui/dialogs/apparat_extend.ui
Normal file
@@ -0,0 +1,191 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Dialog</class>
|
||||
<widget class="QDialog" name="Dialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>388</width>
|
||||
<height>103</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>388</width>
|
||||
<height>103</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>388</width>
|
||||
<height>103</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>290</x>
|
||||
<y>30</y>
|
||||
<width>81</width>
|
||||
<height>241</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Abort|QDialogButtonBox::Save</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>0</y>
|
||||
<width>281</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Bis wann soll der Apparat verlängert werden?</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QFrame" name="frame">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>30</y>
|
||||
<width>241</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<widget class="Line" name="line">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>120</x>
|
||||
<y>0</y>
|
||||
<width>3</width>
|
||||
<height>61</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton" name="rad_sommer">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>10</y>
|
||||
<width>82</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Sommer</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton" name="rad_winter">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>140</x>
|
||||
<y>10</y>
|
||||
<width>82</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Winter</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="sem_year">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>70</y>
|
||||
<width>121</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>2023</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QCheckBox" name="dauerapp">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>150</x>
|
||||
<y>70</y>
|
||||
<width>91</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Dauerapparat</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>Dialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>Dialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
83
src/ui/dialogs/apparat_extend_ui.py
Normal file
83
src/ui/dialogs/apparat_extend_ui.py
Normal file
@@ -0,0 +1,83 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
################################################################################
|
||||
## Form generated from reading UI file 'apparat_extend.ui'
|
||||
##
|
||||
## Created by: Qt User Interface Compiler version 6.4.0
|
||||
##
|
||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
################################################################################
|
||||
|
||||
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
|
||||
QMetaObject, QObject, QPoint, QRect,
|
||||
QSize, QTime, QUrl, Qt)
|
||||
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
|
||||
QFont, QFontDatabase, QGradient, QIcon,
|
||||
QImage, QKeySequence, QLinearGradient, QPainter,
|
||||
QPalette, QPixmap, QRadialGradient, QTransform)
|
||||
from PySide6.QtWidgets import (QAbstractButton, QApplication, QCheckBox, QDialog,
|
||||
QDialogButtonBox, QFrame, QLabel, QLineEdit,
|
||||
QRadioButton, QSizePolicy, QWidget)
|
||||
|
||||
class Ui_Dialog(object):
|
||||
def setupUi(self, Dialog):
|
||||
if not Dialog.objectName():
|
||||
Dialog.setObjectName(u"Dialog")
|
||||
Dialog.resize(388, 103)
|
||||
sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(Dialog.sizePolicy().hasHeightForWidth())
|
||||
Dialog.setSizePolicy(sizePolicy)
|
||||
Dialog.setMinimumSize(QSize(388, 103))
|
||||
Dialog.setMaximumSize(QSize(388, 103))
|
||||
self.buttonBox = QDialogButtonBox(Dialog)
|
||||
self.buttonBox.setObjectName(u"buttonBox")
|
||||
self.buttonBox.setGeometry(QRect(290, 30, 81, 241))
|
||||
self.buttonBox.setOrientation(Qt.Vertical)
|
||||
self.buttonBox.setStandardButtons(QDialogButtonBox.Abort|QDialogButtonBox.Save)
|
||||
self.label = QLabel(Dialog)
|
||||
self.label.setObjectName(u"label")
|
||||
self.label.setGeometry(QRect(10, 0, 281, 31))
|
||||
font = QFont()
|
||||
font.setPointSize(10)
|
||||
self.label.setFont(font)
|
||||
self.frame = QFrame(Dialog)
|
||||
self.frame.setObjectName(u"frame")
|
||||
self.frame.setGeometry(QRect(10, 30, 241, 41))
|
||||
self.frame.setFrameShape(QFrame.StyledPanel)
|
||||
self.frame.setFrameShadow(QFrame.Raised)
|
||||
self.line = QFrame(self.frame)
|
||||
self.line.setObjectName(u"line")
|
||||
self.line.setGeometry(QRect(120, 0, 3, 61))
|
||||
self.line.setFrameShape(QFrame.VLine)
|
||||
self.line.setFrameShadow(QFrame.Sunken)
|
||||
self.rad_sommer = QRadioButton(self.frame)
|
||||
self.rad_sommer.setObjectName(u"rad_sommer")
|
||||
self.rad_sommer.setGeometry(QRect(10, 10, 82, 21))
|
||||
self.rad_winter = QRadioButton(self.frame)
|
||||
self.rad_winter.setObjectName(u"rad_winter")
|
||||
self.rad_winter.setGeometry(QRect(140, 10, 82, 21))
|
||||
self.sem_year = QLineEdit(Dialog)
|
||||
self.sem_year.setObjectName(u"sem_year")
|
||||
self.sem_year.setGeometry(QRect(10, 70, 121, 20))
|
||||
self.checkBox = QCheckBox(Dialog)
|
||||
self.checkBox.setObjectName(u"checkBox")
|
||||
self.checkBox.setGeometry(QRect(150, 70, 91, 21))
|
||||
|
||||
self.retranslateUi(Dialog)
|
||||
self.buttonBox.accepted.connect(Dialog.accept)
|
||||
self.buttonBox.rejected.connect(Dialog.reject)
|
||||
|
||||
QMetaObject.connectSlotsByName(Dialog)
|
||||
# setupUi
|
||||
|
||||
def retranslateUi(self, Dialog):
|
||||
Dialog.setWindowTitle(QCoreApplication.translate("Dialog", u"Dialog", None))
|
||||
self.label.setText(QCoreApplication.translate("Dialog", u"Bis wann soll der Apparat verl\u00e4ngert werden?", None))
|
||||
self.rad_sommer.setText(QCoreApplication.translate("Dialog", u"Sommer", None))
|
||||
self.rad_winter.setText(QCoreApplication.translate("Dialog", u"Winter", None))
|
||||
self.sem_year.setPlaceholderText(QCoreApplication.translate("Dialog", u"2023", None))
|
||||
self.checkBox.setText(QCoreApplication.translate("Dialog", u"Dauerapparat", None))
|
||||
# retranslateUi
|
||||
|
||||
78
src/ui/dialogs/confirm_extend.ui
Normal file
78
src/ui/dialogs/confirm_extend.ui
Normal file
@@ -0,0 +1,78 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>extend_confirm</class>
|
||||
<widget class="QDialog" name="extend_confirm">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>380</width>
|
||||
<height>97</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>290</x>
|
||||
<y>20</y>
|
||||
<width>81</width>
|
||||
<height>241</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QTextEdit" name="textEdit">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>10</y>
|
||||
<width>271</width>
|
||||
<height>81</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>extend_confirm</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>extend_confirm</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
45
src/ui/dialogs/confirm_extend_ui.py
Normal file
45
src/ui/dialogs/confirm_extend_ui.py
Normal file
@@ -0,0 +1,45 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
################################################################################
|
||||
## Form generated from reading UI file 'confirm_extend.ui'
|
||||
##
|
||||
## Created by: Qt User Interface Compiler version 6.4.0
|
||||
##
|
||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
################################################################################
|
||||
|
||||
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
|
||||
QMetaObject, QObject, QPoint, QRect,
|
||||
QSize, QTime, QUrl, Qt)
|
||||
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
|
||||
QFont, QFontDatabase, QGradient, QIcon,
|
||||
QImage, QKeySequence, QLinearGradient, QPainter,
|
||||
QPalette, QPixmap, QRadialGradient, QTransform)
|
||||
from PySide6.QtWidgets import (QAbstractButton, QApplication, QDialog, QDialogButtonBox,
|
||||
QSizePolicy, QTextEdit, QWidget)
|
||||
|
||||
class Ui_extend_confirm(object):
|
||||
def setupUi(self, extend_confirm):
|
||||
if not extend_confirm.objectName():
|
||||
extend_confirm.setObjectName(u"extend_confirm")
|
||||
extend_confirm.resize(380, 97)
|
||||
self.buttonBox = QDialogButtonBox(extend_confirm)
|
||||
self.buttonBox.setObjectName(u"buttonBox")
|
||||
self.buttonBox.setGeometry(QRect(290, 20, 81, 241))
|
||||
self.buttonBox.setOrientation(Qt.Vertical)
|
||||
self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel|QDialogButtonBox.Ok)
|
||||
self.textEdit = QTextEdit(extend_confirm)
|
||||
self.textEdit.setObjectName(u"textEdit")
|
||||
self.textEdit.setGeometry(QRect(10, 10, 271, 81))
|
||||
|
||||
self.retranslateUi(extend_confirm)
|
||||
self.buttonBox.accepted.connect(extend_confirm.accept)
|
||||
self.buttonBox.rejected.connect(extend_confirm.reject)
|
||||
|
||||
QMetaObject.connectSlotsByName(extend_confirm)
|
||||
# setupUi
|
||||
|
||||
def retranslateUi(self, extend_confirm):
|
||||
extend_confirm.setWindowTitle(QCoreApplication.translate("extend_confirm", u"Dialog", None))
|
||||
# retranslateUi
|
||||
|
||||
216
src/ui/dialogs/edit_bookdata.ui
Normal file
216
src/ui/dialogs/edit_bookdata.ui
Normal file
@@ -0,0 +1,216 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Dialog</class>
|
||||
<widget class="QDialog" name="Dialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>448</width>
|
||||
<height>572</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>260</x>
|
||||
<y>530</y>
|
||||
<width>161</width>
|
||||
<height>32</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QWidget" name="gridLayoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>441</width>
|
||||
<height>531</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetDefaultConstraint</enum>
|
||||
</property>
|
||||
<item row="10" column="1">
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="text">
|
||||
<string>Seiten</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Titel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string>Jahr</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>Sprache</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QLabel" name="label_12">
|
||||
<property name="text">
|
||||
<string>Link</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QLineEdit" name="line_edition"/>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Auflage</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Autor</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="2">
|
||||
<widget class="QLineEdit" name="line_link">
|
||||
<property name="cursor">
|
||||
<cursorShape>ArrowCursor</cursorShape>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Herausgeber</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>ISBN(s)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>PPN</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Signatur</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>5</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLineEdit" name="line_title"/>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QLineEdit" name="line_signature"/>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QLineEdit" name="line_author"/>
|
||||
</item>
|
||||
<item row="8" column="2">
|
||||
<widget class="QLineEdit" name="line_lang"/>
|
||||
</item>
|
||||
<item row="5" column="2">
|
||||
<widget class="QLineEdit" name="line_ppn"/>
|
||||
</item>
|
||||
<item row="7" column="2">
|
||||
<widget class="QLineEdit" name="line_isbn"/>
|
||||
</item>
|
||||
<item row="9" column="2">
|
||||
<widget class="QLineEdit" name="line_year"/>
|
||||
</item>
|
||||
<item row="10" column="2">
|
||||
<widget class="QLineEdit" name="line_pages"/>
|
||||
</item>
|
||||
<item row="4" column="2">
|
||||
<widget class="QLineEdit" name="line_publisher"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>Dialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>Dialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
51
src/ui/dialogs/ext_app.py
Normal file
51
src/ui/dialogs/ext_app.py
Normal file
@@ -0,0 +1,51 @@
|
||||
# Form implementation generated from reading ui file 'ui/dialogs/extend_apparat.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.3.1
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Frame(object):
|
||||
def setupUi(self, Frame):
|
||||
Frame.setObjectName("Frame")
|
||||
Frame.resize(317, 126)
|
||||
self.label = QtWidgets.QLabel(Frame)
|
||||
self.label.setGeometry(QtCore.QRect(60, 20, 231, 16))
|
||||
self.label.setObjectName("label")
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(Frame)
|
||||
self.buttonBox.setGeometry(QtCore.QRect(90, 90, 156, 23))
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.sem_winter = QtWidgets.QRadioButton(Frame)
|
||||
self.sem_winter.setGeometry(QtCore.QRect(60, 40, 82, 17))
|
||||
self.sem_winter.setObjectName("sem_winter")
|
||||
self.sem_sommer = QtWidgets.QRadioButton(Frame)
|
||||
self.sem_sommer.setGeometry(QtCore.QRect(60, 60, 82, 17))
|
||||
self.sem_sommer.setObjectName("sem_sommer")
|
||||
self.sem_year = QtWidgets.QLineEdit(Frame)
|
||||
self.sem_year.setGeometry(QtCore.QRect(160, 50, 113, 20))
|
||||
self.sem_year.setObjectName("sem_year")
|
||||
|
||||
self.retranslateUi(Frame)
|
||||
QtCore.QMetaObject.connectSlotsByName(Frame)
|
||||
|
||||
def retranslateUi(self, Frame):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Frame.setWindowTitle(_translate("Frame", "Frame"))
|
||||
self.label.setText(_translate("Frame", "Bis wann soll der Apparat verlängert werden?"))
|
||||
self.sem_winter.setText(_translate("Frame", "Winter"))
|
||||
self.sem_sommer.setText(_translate("Frame", "Sommer"))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import sys
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
Frame = QtWidgets.QFrame()
|
||||
ui = Ui_Frame()
|
||||
ui.setupUi(Frame)
|
||||
Frame.show()
|
||||
sys.exit(app.exec())
|
||||
81
src/ui/dialogs/extend_apparat.ui
Normal file
81
src/ui/dialogs/extend_apparat.ui
Normal file
@@ -0,0 +1,81 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Frame</class>
|
||||
<widget class="QFrame" name="Frame">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>317</width>
|
||||
<height>126</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Frame</string>
|
||||
</property>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>60</x>
|
||||
<y>20</y>
|
||||
<width>231</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Bis wann soll der Apparat verlängert werden?</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>90</x>
|
||||
<y>90</y>
|
||||
<width>156</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton" name="sem_winter">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>60</x>
|
||||
<y>40</y>
|
||||
<width>82</width>
|
||||
<height>17</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Winter</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton" name="sem_sommer">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>60</x>
|
||||
<y>60</y>
|
||||
<width>82</width>
|
||||
<height>17</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Sommer</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="sem_year">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>160</x>
|
||||
<y>50</y>
|
||||
<width>113</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
129
src/ui/dialogs/fileparser.ui
Normal file
129
src/ui/dialogs/fileparser.ui
Normal file
@@ -0,0 +1,129 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Dialog</class>
|
||||
<widget class="QDialog" name="Dialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>402</width>
|
||||
<height>301</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<widget class="QProgressBar" name="progressBar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>60</y>
|
||||
<width>381</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>24</number>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QFrame" name="frame">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>10</y>
|
||||
<width>381</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<widget class="QWidget" name="horizontalLayoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>381</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Es wurden</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="count">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>0</string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::PlainText</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Signaturen gefunden.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QFrame" name="frame_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>100</y>
|
||||
<width>381</width>
|
||||
<height>201</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<widget class="QListWidget" name="listWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>381</width>
|
||||
<height>191</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
120
src/ui/dialogs/login.ui
Normal file
120
src/ui/dialogs/login.ui
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Dialog</class>
|
||||
<widget class="QDialog" name="Dialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>218</width>
|
||||
<height>190</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>140</y>
|
||||
<width>161</width>
|
||||
<height>32</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>40</y>
|
||||
<width>71</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Username</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="lineEdit">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>80</x>
|
||||
<y>40</y>
|
||||
<width>113</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>80</y>
|
||||
<width>71</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Password</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="lineEdit_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>80</x>
|
||||
<y>80</y>
|
||||
<width>113</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="inputMethodHints">
|
||||
<set>Qt::ImhSensitiveData</set>
|
||||
</property>
|
||||
<property name="clearButtonEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>Dialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>Dialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
69
src/ui/dialogs/mail.py
Normal file
69
src/ui/dialogs/mail.py
Normal file
@@ -0,0 +1,69 @@
|
||||
import subprocess
|
||||
import tempfile
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
from src.ui.dialogs.mail_preview import Ui_Dialog
|
||||
|
||||
|
||||
class Mail_Dialog(QtWidgets.QDialog, Ui_Dialog):
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent)
|
||||
self.setupUi(self)
|
||||
self.appid = ""
|
||||
self.mail_data = ""
|
||||
self.data = None
|
||||
self.buttonBox.accepted.connect(self.save_mail)
|
||||
|
||||
def set_data(self, data: dict):
|
||||
self.prof_name.setText(data["prof_name"])
|
||||
self.mail_name.setText(data["mail_name"])
|
||||
# assign data["general"] to self.data
|
||||
self.data = data["general"]
|
||||
|
||||
def set_mail(self):
|
||||
email_template = self.comboBox.currentText()
|
||||
with open(f"mail_vorlagen/{email_template}", "r", encoding="utf-8") as f:
|
||||
mail_template = f.read()
|
||||
email_header = email_template.split(".eml")[0]
|
||||
if "{AppNr}" in email_template:
|
||||
email_header = email_template.split(".eml")[0].format(AppNr=self.appid)
|
||||
self.mail_header.setText(email_header)
|
||||
self.mail_data = mail_template.split("<html>")[0]
|
||||
mail_html = mail_template.split("<html>")[1]
|
||||
mail_html = "<html>" + mail_html
|
||||
print(self.data)
|
||||
Appname = self.data["Appname"]
|
||||
mail_html = mail_html.format(
|
||||
Profname=self.prof_name.text().split(" ")[-1], Appname=Appname
|
||||
)
|
||||
|
||||
self.mail_body.setHtml(mail_html)
|
||||
|
||||
def save_mail(self):
|
||||
# create a temporary file
|
||||
mail_header = self.mail_header.text()
|
||||
mail_body = self.mail_body.toHtml()
|
||||
mail = self.mail_data + mail_body
|
||||
mail = mail.replace("Subject:", f"Subject: {mail_header}")
|
||||
with tempfile.NamedTemporaryFile(
|
||||
mode="w", delete=False, suffix=".eml", encoding="utf-8", dir="mails"
|
||||
) as f:
|
||||
f.write(mail)
|
||||
self.mail_path = f.name
|
||||
print(self.mail_path)
|
||||
# open the file using thunderbird
|
||||
subprocess.Popen(["thunderbird", f"{self.mail_path}"])
|
||||
# delete the file
|
||||
# os.remove(self.mail_path)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import sys
|
||||
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
Dialog = QtWidgets.QDialog()
|
||||
ui = Mail_Dialog()
|
||||
ui.setupUi(Dialog)
|
||||
Dialog.show()
|
||||
sys.exit(app.exec())
|
||||
81
src/ui/dialogs/mail_preview.py
Normal file
81
src/ui/dialogs/mail_preview.py
Normal file
@@ -0,0 +1,81 @@
|
||||
# Form implementation generated from reading ui file 'ui\dialogs\mail_preview.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.3.1
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Dialog(object):
|
||||
def setupUi(self, Dialog):
|
||||
Dialog.setObjectName("Dialog")
|
||||
Dialog.resize(676, 676)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
|
||||
self.buttonBox.setGeometry(QtCore.QRect(310, 630, 341, 32))
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
||||
self.buttonBox.setStandardButtons(
|
||||
QtWidgets.QDialogButtonBox.StandardButton.Cancel
|
||||
| QtWidgets.QDialogButtonBox.StandardButton.Ok
|
||||
)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.gridLayoutWidget = QtWidgets.QWidget(Dialog)
|
||||
self.gridLayoutWidget.setGeometry(QtCore.QRect(10, 10, 661, 621))
|
||||
self.gridLayoutWidget.setObjectName("gridLayoutWidget")
|
||||
self.gridLayout = QtWidgets.QGridLayout(self.gridLayoutWidget)
|
||||
self.gridLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.prof_name = QtWidgets.QLineEdit(self.gridLayoutWidget)
|
||||
self.prof_name.setObjectName("prof_name")
|
||||
self.gridLayout.addWidget(self.prof_name, 2, 2, 1, 1)
|
||||
self.label_3 = QtWidgets.QLabel(self.gridLayoutWidget)
|
||||
self.label_3.setAlignment(
|
||||
QtCore.Qt.AlignmentFlag.AlignLeading
|
||||
| QtCore.Qt.AlignmentFlag.AlignLeft
|
||||
| QtCore.Qt.AlignmentFlag.AlignTop
|
||||
)
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.gridLayout.addWidget(self.label_3, 4, 0, 1, 1)
|
||||
self.label_2 = QtWidgets.QLabel(self.gridLayoutWidget)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.gridLayout.addWidget(self.label_2, 2, 0, 1, 1)
|
||||
self.label_4 = QtWidgets.QLabel(self.gridLayoutWidget)
|
||||
self.label_4.setObjectName("label_4")
|
||||
self.gridLayout.addWidget(self.label_4, 3, 0, 1, 1)
|
||||
self.mail_header = QtWidgets.QLineEdit(self.gridLayoutWidget)
|
||||
self.mail_header.setObjectName("mail_header")
|
||||
self.gridLayout.addWidget(self.mail_header, 3, 2, 1, 1)
|
||||
self.mail_name = QtWidgets.QLineEdit(self.gridLayoutWidget)
|
||||
self.mail_name.setObjectName("mail_name")
|
||||
self.gridLayout.addWidget(self.mail_name, 1, 2, 1, 1)
|
||||
self.mail_body = QtWidgets.QTextEdit(self.gridLayoutWidget)
|
||||
self.mail_body.setObjectName("mail_body")
|
||||
self.gridLayout.addWidget(self.mail_body, 4, 2, 1, 1)
|
||||
self.label = QtWidgets.QLabel(self.gridLayoutWidget)
|
||||
self.label.setObjectName("label")
|
||||
self.gridLayout.addWidget(self.label, 1, 0, 1, 1)
|
||||
self.comboBox = QtWidgets.QComboBox(self.gridLayoutWidget)
|
||||
self.comboBox.setObjectName("comboBox")
|
||||
self.gridLayout.addWidget(self.comboBox, 0, 2, 1, 1)
|
||||
self.label_5 = QtWidgets.QLabel(self.gridLayoutWidget)
|
||||
self.label_5.setObjectName("label_5")
|
||||
self.gridLayout.addWidget(self.label_5, 0, 0, 1, 1)
|
||||
# at selection change, load mail text
|
||||
|
||||
self.comboBox.currentIndexChanged.connect(self.set_mail)
|
||||
self.retranslateUi(Dialog)
|
||||
self.buttonBox.accepted.connect(Dialog.accept) # type: ignore
|
||||
self.buttonBox.rejected.connect(Dialog.reject) # type: ignore
|
||||
# if the dialog is accepted, save the mail and send it
|
||||
QtCore.QMetaObject.connectSlotsByName(Dialog)
|
||||
|
||||
def retranslateUi(self, Dialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Dialog.setWindowTitle(_translate("Dialog", "Dialog"))
|
||||
self.label_3.setText(_translate("Dialog", "Mail"))
|
||||
self.label_2.setText(_translate("Dialog", "Prof"))
|
||||
self.label_4.setText(_translate("Dialog", "Betreff"))
|
||||
self.label.setText(_translate("Dialog", "eMail"))
|
||||
self.label_5.setText(_translate("Dialog", "Art"))
|
||||
133
src/ui/dialogs/mail_preview.ui
Normal file
133
src/ui/dialogs/mail_preview.ui
Normal file
@@ -0,0 +1,133 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Dialog</class>
|
||||
<widget class="QDialog" name="Dialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>676</width>
|
||||
<height>676</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>310</x>
|
||||
<y>630</y>
|
||||
<width>341</width>
|
||||
<height>32</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QWidget" name="gridLayoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>10</y>
|
||||
<width>661</width>
|
||||
<height>621</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="2" column="2">
|
||||
<widget class="QLineEdit" name="prof_name"/>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Mail</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Prof</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Betreff</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QLineEdit" name="mail_header"/>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QLineEdit" name="mail_name"/>
|
||||
</item>
|
||||
<item row="4" column="2">
|
||||
<widget class="QTextEdit" name="mail_body"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>eMail</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QComboBox" name="comboBox"/>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Art</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>Dialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>Dialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
557
src/ui/dialogs/medianadder.ui
Normal file
557
src/ui/dialogs/medianadder.ui
Normal file
@@ -0,0 +1,557 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Dialog</class>
|
||||
<widget class="QDialog" name="Dialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>637</width>
|
||||
<height>491</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>10</y>
|
||||
<width>47</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Signatur</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>40</y>
|
||||
<width>47</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Modus</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QComboBox" name="comboBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>70</x>
|
||||
<y>40</y>
|
||||
<width>69</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>ARRAY</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>BibTeX</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>COinS</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>RIS</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="lineEdit">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>70</x>
|
||||
<y>10</y>
|
||||
<width>113</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>Signatur / ISBN</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>70</y>
|
||||
<width>47</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Queue</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QWidget" name="widget" native="true">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>330</x>
|
||||
<y>90</y>
|
||||
<width>301</width>
|
||||
<height>341</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QTreeWidget" name="treeWidget">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>301</width>
|
||||
<height>341</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="midLineWidth">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="verticalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||
</property>
|
||||
<property name="horizontalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||
</property>
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QAbstractScrollArea::AdjustToContents</enum>
|
||||
</property>
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::NoEditTriggers</set>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::NoSelection</enum>
|
||||
</property>
|
||||
<property name="textElideMode">
|
||||
<enum>Qt::ElideMiddle</enum>
|
||||
</property>
|
||||
<property name="uniformRowHeights">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="itemsExpandable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="expandsOnDoubleClick">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<attribute name="headerCascadingSectionResizes">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="headerDefaultSectionSize">
|
||||
<number>96</number>
|
||||
</attribute>
|
||||
<attribute name="headerHighlightSections">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="headerMinimumSectionSize">
|
||||
<number>20</number>
|
||||
</attribute>
|
||||
<attribute name="headerStretchLastSection">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Datensatz\Metadata</string>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>7</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Array</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>BibTeX</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>COinS</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>RIS</string>
|
||||
</property>
|
||||
</column>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>PPN</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>0</string>
|
||||
</property>
|
||||
<property name="background">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>255</red>
|
||||
<green>0</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Signatur</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
<property name="background">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>0</red>
|
||||
<green>255</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>0</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Autor</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>ISBN</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Jahr</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Auflage</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Sprache</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>0</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Herausgeber</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Seiten</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Titel</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Link</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>0</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QListWidget" name="listWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>90</y>
|
||||
<width>281</width>
|
||||
<height>341</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::CustomContextMenu</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>330</x>
|
||||
<y>50</y>
|
||||
<width>181</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Belegbare Felder per Anbieter</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>200</x>
|
||||
<y>70</y>
|
||||
<width>41</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Anzahl:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="list_amount">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>240</x>
|
||||
<y>70</y>
|
||||
<width>47</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>0</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>450</y>
|
||||
<width>156</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
<property name="centerButtons">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="l_add">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>190</x>
|
||||
<y>10</y>
|
||||
<width>21</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::ClickFocus</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Clicken oder Shift Enter drücken um den Eintrag hinzuzufügen</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<normaloff>:/information/icons/information.png</normaloff>:/information/icons/information.png</iconset>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Shift+Return</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>lineEdit</tabstop>
|
||||
<tabstop>comboBox</tabstop>
|
||||
<tabstop>listWidget</tabstop>
|
||||
<tabstop>treeWidget</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="../resources.qrc"/>
|
||||
</resources>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>Dialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>87</x>
|
||||
<y>461</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>318</x>
|
||||
<y>245</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>Dialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>87</x>
|
||||
<y>461</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>318</x>
|
||||
<y>245</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
47
src/ui/dialogs/medianadder_ui.ts
Normal file
47
src/ui/dialogs/medianadder_ui.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1">
|
||||
<context>
|
||||
<name>Dialog</name>
|
||||
<message>
|
||||
<location filename="medianadder_ui.py" line="60"/>
|
||||
<source>Dialog</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="medianadder_ui.py" line="61"/>
|
||||
<source>Signatur</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="medianadder_ui.py" line="62"/>
|
||||
<source>Modus</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="medianadder_ui.py" line="63"/>
|
||||
<source>ARRAY</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="medianadder_ui.py" line="64"/>
|
||||
<source>BibTeX</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="medianadder_ui.py" line="65"/>
|
||||
<source>COinS</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="medianadder_ui.py" line="66"/>
|
||||
<source>RIS</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="medianadder_ui.py" line="68"/>
|
||||
<source>Queue</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
82
src/ui/dialogs/medienadder.py
Normal file
82
src/ui/dialogs/medienadder.py
Normal file
@@ -0,0 +1,82 @@
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
from .Ui_medianadder import Ui_Dialog
|
||||
|
||||
|
||||
class MedienAdder(QtWidgets.QDialog):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.ui = Ui_Dialog()
|
||||
self.ui.setupUi(self)
|
||||
|
||||
# Connect signals and slots for your custom functionality
|
||||
self.ui.buttonBox.accepted.connect(self.accept)
|
||||
self.ui.buttonBox.rejected.connect(self.reject)
|
||||
self.ui.l_add.clicked.connect(self.add_to_list)
|
||||
self.ui.l_add.setShortcut("Shift+Return")
|
||||
# Initialize data variables to store the results
|
||||
self.result_data = []
|
||||
|
||||
self.recolorize()
|
||||
|
||||
def add_to_list(self):
|
||||
text = self.ui.lineEdit.text().strip()
|
||||
if text == "":
|
||||
return
|
||||
else:
|
||||
self.ui.listWidget.addItem(text)
|
||||
self.ui.list_amount.setText(str(self.ui.listWidget.count()))
|
||||
self.ui.lineEdit.clear()
|
||||
|
||||
def recolorize(self):
|
||||
# set the color of the cells of the treeWidget to red if the field is not supported by the provider
|
||||
# else set it to green
|
||||
for i in range(self.ui.treeWidget.topLevelItemCount()):
|
||||
for j in range(1, self.ui.treeWidget.columnCount()):
|
||||
if self.ui.treeWidget.topLevelItem(i).text(j) == "0":
|
||||
self.ui.treeWidget.topLevelItem(i).setBackground(
|
||||
j, QtGui.QColor(255, 0, 0)
|
||||
)
|
||||
else:
|
||||
self.ui.treeWidget.topLevelItem(i).setBackground(
|
||||
j, QtGui.QColor(0, 255, 0)
|
||||
)
|
||||
# remove the text from the cells
|
||||
self.ui.treeWidget.topLevelItem(i).setText(j, "")
|
||||
|
||||
def custom_context_menu(self):
|
||||
menu = QtWidgets.QMenu()
|
||||
menu.addAction("Remove")
|
||||
|
||||
action = menu.exec(QtGui.QCursor.pos())
|
||||
if action.text() == "Remove":
|
||||
self.remove_from_list()
|
||||
|
||||
def remove_from_list(self):
|
||||
self.ui.listWidget.takeItem(self.ui.listWidget.currentRow())
|
||||
self.ui.list_amount.setText(str(self.ui.listWidget.count()))
|
||||
|
||||
def add_to_list(self):
|
||||
text = self.ui.lineEdit.text().strip()
|
||||
if text:
|
||||
self.ui.listWidget.addItem(text)
|
||||
self.ui.list_amount.setText(str(self.ui.listWidget.count()))
|
||||
self.ui.lineEdit.clear()
|
||||
|
||||
def accept(self):
|
||||
# Gather and store the data you want to return
|
||||
self.result_data = [
|
||||
self.ui.listWidget.item(i).text() for i in range(self.ui.listWidget.count())
|
||||
]
|
||||
super().accept()
|
||||
|
||||
def keyPressEvent(self, event):
|
||||
if (
|
||||
event.key() == QtCore.Qt.Key.Key_Return
|
||||
or event.key() == QtCore.Qt.Key.Key_Enter
|
||||
):
|
||||
# Handle the Return key press as needed (e.g., add to list)
|
||||
self.add_to_list()
|
||||
event.accept()
|
||||
else:
|
||||
super().keyPressEvent(event)
|
||||
132
src/ui/dialogs/new_subject.ui
Normal file
132
src/ui/dialogs/new_subject.ui
Normal file
@@ -0,0 +1,132 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Dialog</class>
|
||||
<widget class="QDialog" name="Dialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>448</width>
|
||||
<height>165</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Das eingegebene Fach wurde nicht in der Datenbank gefunden. Soll es angelegt werden?</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="1">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="checkBox">
|
||||
<property name="text">
|
||||
<string>Ja</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="frame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>10</y>
|
||||
<width>141</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Name des Neuen Faches:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="lineEdit">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>30</y>
|
||||
<width>141</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>Dialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>Dialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
59
src/ui/dialogs/new_subject_ui.py
Normal file
59
src/ui/dialogs/new_subject_ui.py
Normal file
@@ -0,0 +1,59 @@
|
||||
# Form implementation generated from reading ui file '/home/alexander/GitHub/Semesterapparate/ui/dialogs/new_subject.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.5.3
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Dialog(object):
|
||||
def setupUi(self, Dialog):
|
||||
Dialog.setObjectName("Dialog")
|
||||
Dialog.resize(448, 165)
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout(Dialog)
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout()
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.label = QtWidgets.QLabel(parent=Dialog)
|
||||
self.label.setObjectName("label")
|
||||
self.verticalLayout.addWidget(self.label)
|
||||
self.gridLayout = QtWidgets.QGridLayout()
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
self.gridLayout.addItem(spacerItem, 0, 1, 1, 1)
|
||||
self.checkBox = QtWidgets.QCheckBox(parent=Dialog)
|
||||
self.checkBox.setObjectName("checkBox")
|
||||
self.gridLayout.addWidget(self.checkBox, 0, 0, 1, 1)
|
||||
self.verticalLayout.addLayout(self.gridLayout)
|
||||
self.verticalLayout_2.addLayout(self.verticalLayout)
|
||||
self.frame = QtWidgets.QFrame(parent=Dialog)
|
||||
self.frame.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel)
|
||||
self.frame.setFrameShadow(QtWidgets.QFrame.Shadow.Raised)
|
||||
self.frame.setObjectName("frame")
|
||||
self.label_2 = QtWidgets.QLabel(parent=self.frame)
|
||||
self.label_2.setGeometry(QtCore.QRect(0, 10, 141, 16))
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.lineEdit = QtWidgets.QLineEdit(parent=self.frame)
|
||||
self.lineEdit.setGeometry(QtCore.QRect(0, 30, 141, 20))
|
||||
self.lineEdit.setObjectName("lineEdit")
|
||||
self.verticalLayout_2.addWidget(self.frame)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(parent=Dialog)
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.verticalLayout_2.addWidget(self.buttonBox)
|
||||
|
||||
self.retranslateUi(Dialog)
|
||||
self.buttonBox.accepted.connect(Dialog.accept) # type: ignore
|
||||
self.buttonBox.rejected.connect(Dialog.reject) # type: ignore
|
||||
QtCore.QMetaObject.connectSlotsByName(Dialog)
|
||||
|
||||
def retranslateUi(self, Dialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Dialog.setWindowTitle(_translate("Dialog", "Dialog"))
|
||||
self.label.setText(_translate("Dialog", "Das eingegebene Fach wurde nicht in der Datenbank gefunden. Soll es angelegt werden?"))
|
||||
self.checkBox.setText(_translate("Dialog", "Ja"))
|
||||
self.label_2.setText(_translate("Dialog", "Name des Neuen Faches:"))
|
||||
163
src/ui/dialogs/parsed_titles.ui
Normal file
163
src/ui/dialogs/parsed_titles.ui
Normal file
@@ -0,0 +1,163 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Form</class>
|
||||
<widget class="QWidget" name="Form">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>402</width>
|
||||
<height>316</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<widget class="QFrame" name="frame">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>10</y>
|
||||
<width>381</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<widget class="QWidget" name="horizontalLayoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>381</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Es wurden</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="count">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>0</string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::PlainText</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Signaturen gefunden.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QFrame" name="frame_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>80</y>
|
||||
<width>381</width>
|
||||
<height>201</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<widget class="QWidget" name="horizontalLayoutWidget_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>10</y>
|
||||
<width>381</width>
|
||||
<height>191</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QListWidget" name="listWidget"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QListWidget" name="listWidget_done"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QProgressBar" name="progressBar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>60</y>
|
||||
<width>381</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>24</number>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>230</x>
|
||||
<y>290</y>
|
||||
<width>156</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QToolButton" name="toolButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>290</y>
|
||||
<width>25</width>
|
||||
<height>19</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
81
src/ui/dialogs/parsed_titles_ui.py
Normal file
81
src/ui/dialogs/parsed_titles_ui.py
Normal file
@@ -0,0 +1,81 @@
|
||||
# Form implementation generated from reading ui file '/home/alexander/GitHub/Semesterapparate/ui/dialogs/parsed_titles.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.5.3
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
Form.setObjectName("Form")
|
||||
Form.resize(402, 316)
|
||||
self.frame = QtWidgets.QFrame(parent=Form)
|
||||
self.frame.setGeometry(QtCore.QRect(10, 10, 381, 41))
|
||||
self.frame.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel)
|
||||
self.frame.setFrameShadow(QtWidgets.QFrame.Shadow.Raised)
|
||||
self.frame.setObjectName("frame")
|
||||
self.horizontalLayoutWidget = QtWidgets.QWidget(parent=self.frame)
|
||||
self.horizontalLayoutWidget.setGeometry(QtCore.QRect(0, 0, 381, 41))
|
||||
self.horizontalLayoutWidget.setObjectName("horizontalLayoutWidget")
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget)
|
||||
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.label = QtWidgets.QLabel(parent=self.horizontalLayoutWidget)
|
||||
self.label.setObjectName("label")
|
||||
self.horizontalLayout.addWidget(self.label)
|
||||
self.count = QtWidgets.QLabel(parent=self.horizontalLayoutWidget)
|
||||
font = QtGui.QFont()
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.count.setFont(font)
|
||||
self.count.setTextFormat(QtCore.Qt.TextFormat.PlainText)
|
||||
self.count.setObjectName("count")
|
||||
self.horizontalLayout.addWidget(self.count)
|
||||
self.label_2 = QtWidgets.QLabel(parent=self.horizontalLayoutWidget)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.horizontalLayout.addWidget(self.label_2)
|
||||
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
self.horizontalLayout.addItem(spacerItem)
|
||||
self.frame_2 = QtWidgets.QFrame(parent=Form)
|
||||
self.frame_2.setGeometry(QtCore.QRect(10, 80, 381, 201))
|
||||
self.frame_2.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel)
|
||||
self.frame_2.setFrameShadow(QtWidgets.QFrame.Shadow.Raised)
|
||||
self.frame_2.setObjectName("frame_2")
|
||||
self.horizontalLayoutWidget_2 = QtWidgets.QWidget(parent=self.frame_2)
|
||||
self.horizontalLayoutWidget_2.setGeometry(QtCore.QRect(0, 10, 381, 191))
|
||||
self.horizontalLayoutWidget_2.setObjectName("horizontalLayoutWidget_2")
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget_2)
|
||||
self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
self.listWidget = QtWidgets.QListWidget(parent=self.horizontalLayoutWidget_2)
|
||||
self.listWidget.setObjectName("listWidget")
|
||||
self.horizontalLayout_2.addWidget(self.listWidget)
|
||||
self.listWidget_done = QtWidgets.QListWidget(parent=self.horizontalLayoutWidget_2)
|
||||
self.listWidget_done.setObjectName("listWidget_done")
|
||||
self.horizontalLayout_2.addWidget(self.listWidget_done)
|
||||
self.progressBar = QtWidgets.QProgressBar(parent=Form)
|
||||
self.progressBar.setGeometry(QtCore.QRect(10, 60, 381, 23))
|
||||
self.progressBar.setProperty("value", 24)
|
||||
self.progressBar.setObjectName("progressBar")
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(parent=Form)
|
||||
self.buttonBox.setGeometry(QtCore.QRect(230, 290, 156, 23))
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.toolButton = QtWidgets.QToolButton(parent=Form)
|
||||
self.toolButton.setGeometry(QtCore.QRect(20, 290, 25, 19))
|
||||
self.toolButton.setObjectName("toolButton")
|
||||
|
||||
self.retranslateUi(Form)
|
||||
QtCore.QMetaObject.connectSlotsByName(Form)
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Form.setWindowTitle(_translate("Form", "Form"))
|
||||
self.label.setText(_translate("Form", "Es wurden"))
|
||||
self.count.setText(_translate("Form", "0"))
|
||||
self.label_2.setText(_translate("Form", "Signaturen gefunden."))
|
||||
self.toolButton.setText(_translate("Form", "..."))
|
||||
48
src/ui/dialogs/popup_confirm.py
Normal file
48
src/ui/dialogs/popup_confirm.py
Normal file
@@ -0,0 +1,48 @@
|
||||
# Form implementation generated from reading ui file 'ui\dialogs\confirm_extend.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.3.1
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_extend_confirm(object):
|
||||
def setupUi(self, extend_confirm):
|
||||
extend_confirm.setObjectName("extend_confirm")
|
||||
extend_confirm.resize(380, 97)
|
||||
# icon=QtGui.QIcon(f"ui/icons/{icon}.png")
|
||||
# extend_confirm.setWindowIcon(icon)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(extend_confirm)
|
||||
self.buttonBox.setGeometry(QtCore.QRect(290, 20, 81, 241))
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Vertical)
|
||||
self.buttonBox.setStandardButtons(
|
||||
QtWidgets.QDialogButtonBox.StandardButton.Cancel
|
||||
| QtWidgets.QDialogButtonBox.StandardButton.Ok
|
||||
)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.textEdit = QtWidgets.QTextEdit(extend_confirm)
|
||||
self.textEdit.setGeometry(QtCore.QRect(10, 10, 271, 81))
|
||||
self.textEdit.setObjectName("textEdit")
|
||||
|
||||
self.retranslateUi(extend_confirm)
|
||||
self.buttonBox.accepted.connect(extend_confirm.accept) # type: ignore
|
||||
self.buttonBox.rejected.connect(extend_confirm.reject) # type: ignore
|
||||
QtCore.QMetaObject.connectSlotsByName(extend_confirm)
|
||||
|
||||
def retranslateUi(self, extend_confirm):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
extend_confirm.setWindowTitle(_translate("extend_confirm", "Dialog"))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import sys
|
||||
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
extend_confirm = QtWidgets.QDialog()
|
||||
ui = Ui_extend_confirm()
|
||||
ui.setupUi(extend_confirm)
|
||||
extend_confirm.show()
|
||||
sys.exit(app.exec())
|
||||
114
src/ui/dialogs/reminder.ui
Normal file
114
src/ui/dialogs/reminder.ui
Normal file
@@ -0,0 +1,114 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Dialog</class>
|
||||
<widget class="QDialog" name="Dialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>369</width>
|
||||
<height>308</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>190</x>
|
||||
<y>270</y>
|
||||
<width>161</width>
|
||||
<height>32</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QTextEdit" name="message_box">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>60</y>
|
||||
<width>341</width>
|
||||
<height>201</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>30</y>
|
||||
<width>61</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Nachricht:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>150</x>
|
||||
<y>30</y>
|
||||
<width>81</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Erinnerung am:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QDateEdit" name="dateEdit">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>240</x>
|
||||
<y>30</y>
|
||||
<width>110</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>Dialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>Dialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
0
src/ui/dialogs/resources.qrc
Normal file
0
src/ui/dialogs/resources.qrc
Normal file
48
src/ui/dialogs/settings.py
Normal file
48
src/ui/dialogs/settings.py
Normal file
@@ -0,0 +1,48 @@
|
||||
from omegaconf import OmegaConf
|
||||
from PyQt6 import QtWidgets
|
||||
|
||||
from src.ui.dialogs.Ui_settings import Ui_Dialog as _settings
|
||||
|
||||
config = OmegaConf.load("config.yaml")
|
||||
|
||||
|
||||
class Settings(_settings):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.setupUi(self)
|
||||
self.retranslateUi(self)
|
||||
self.load_config()
|
||||
|
||||
def load_config(self):
|
||||
self.db_name.setText(config.database.name)
|
||||
self.db_path.setText(config.database.path)
|
||||
self.save_path.setText(config.save_path)
|
||||
self.os_apps.setChecked(config.default_apps)
|
||||
|
||||
def select_db(self):
|
||||
# open file dialog, limit to .db files
|
||||
file_dialog = QtWidgets.QFileDialog()
|
||||
file_dialog.setFileMode(QtWidgets.QFileDialog.FileMode.AnyFile)
|
||||
file_dialog.setNameFilter("Datenbank (*.db)")
|
||||
file_dialog.setViewMode(QtWidgets.QFileDialog.ViewMode.Detail)
|
||||
if file_dialog.exec():
|
||||
self.db_name.setText(file_dialog.selectedFiles()[0].split("/")[-1])
|
||||
self.db_path.setText(
|
||||
file_dialog.selectedFiles()[0].split(self.db_name.text())[0]
|
||||
)
|
||||
|
||||
def set_save_path(self):
|
||||
# open file dialog, limit to .db files
|
||||
file_dialog = QtWidgets.QFileDialog()
|
||||
file_dialog.setFileMode(QtWidgets.QFileDialog.FileMode.Directory)
|
||||
file_dialog.setViewMode(QtWidgets.QFileDialog.ViewMode.Detail)
|
||||
if file_dialog.exec():
|
||||
self.save_path.setText(file_dialog.selectedFiles()[0])
|
||||
|
||||
def return_data(self):
|
||||
config.database.name = self.db_name.text()
|
||||
config.database.path = self.db_path.text()
|
||||
config.save_path = self.save_path.text()
|
||||
config.default_apps = self.os_apps.isChecked()
|
||||
|
||||
return config
|
||||
308
src/ui/dialogs/settings.ui
Normal file
308
src/ui/dialogs/settings.ui
Normal file
@@ -0,0 +1,308 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Dialog</class>
|
||||
<widget class="QDialog" name="Dialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>743</width>
|
||||
<height>576</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>120</x>
|
||||
<y>540</y>
|
||||
<width>621</width>
|
||||
<height>32</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QFrame" name="frame">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>741</width>
|
||||
<height>541</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>400</x>
|
||||
<y>30</y>
|
||||
<width>161</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Dateispezifische Einstellungen</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="Line" name="line">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>370</x>
|
||||
<y>0</y>
|
||||
<width>20</width>
|
||||
<height>541</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="midLineWidth">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QTextBrowser" name="textBrowser">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>400</x>
|
||||
<y>50</y>
|
||||
<width>311</width>
|
||||
<height>51</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="inputMethodHints">
|
||||
<set>Qt::ImhNone</set>
|
||||
</property>
|
||||
<property name="html">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hier können Einstellungen für bestehende Dateiformate geändert, oder neue Dateiformate eingefügt werden.</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>20</y>
|
||||
<width>161</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Allgemeine Einstellungen</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QCheckBox" name="os_apps">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>410</x>
|
||||
<y>110</y>
|
||||
<width>161</width>
|
||||
<height>17</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Verwendet im Betriebssystem festgelegte Anwendungen um Dateien zu öffnen</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Standard-Apps verwenden</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QWidget" name="formLayoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>50</y>
|
||||
<width>361</width>
|
||||
<height>491</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Name der Datenbank, welche verwendet werden soll. <span style=" font-weight:600;">Muss</span> auf .db enden</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Datenbankname</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>db_name</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="toolTip">
|
||||
<string>Pfad, an dem heruntergeladene Dateien gespeichert werden sollen</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Speicherpfad</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>save_path</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="db_path">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="save_path"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Datenbankpfad</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>db_path</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="db_name">
|
||||
<property name="text">
|
||||
<string>sap.db</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QToolButton" name="tb_set_save_path">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QToolButton" name="tb_select_db">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QScrollArea" name="scrollArea">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>400</x>
|
||||
<y>130</y>
|
||||
<width>331</width>
|
||||
<height>381</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="scrollAreaWidgetContents">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>329</width>
|
||||
<height>379</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QTreeWidget" name="treeWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>331</width>
|
||||
<height>381</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::ActionsContextMenu</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>db_name</tabstop>
|
||||
<tabstop>db_path</tabstop>
|
||||
<tabstop>save_path</tabstop>
|
||||
<tabstop>os_apps</tabstop>
|
||||
<tabstop>textBrowser</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="../resources.qrc"/>
|
||||
</resources>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>Dialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>358</x>
|
||||
<y>540</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>Dialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>426</x>
|
||||
<y>540</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
0
src/ui/extensions/__init__.py
Normal file
0
src/ui/extensions/__init__.py
Normal file
BIN
src/ui/icons/critical.png
Normal file
BIN
src/ui/icons/critical.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 252 B |
BIN
src/ui/icons/information.png
Normal file
BIN
src/ui/icons/information.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 245 B |
BIN
src/ui/icons/logo_SAP.ico
Normal file
BIN
src/ui/icons/logo_SAP.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 126 KiB |
BIN
src/ui/icons/logo_SAP.png
Normal file
BIN
src/ui/icons/logo_SAP.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 273 KiB |
BIN
src/ui/icons/question.png
Normal file
BIN
src/ui/icons/question.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 252 B |
BIN
src/ui/icons/warning.png
Normal file
BIN
src/ui/icons/warning.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 222 B |
360
src/ui/mainwindow.py
Normal file
360
src/ui/mainwindow.py
Normal file
@@ -0,0 +1,360 @@
|
||||
# Form implementation generated from reading ui file 'untitled.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.3.1
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_MainWindow(object):
|
||||
def setupUi(self, MainWindow):
|
||||
MainWindow.setObjectName("MainWindow")
|
||||
MainWindow.resize(1280, 720)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth())
|
||||
MainWindow.setSizePolicy(sizePolicy)
|
||||
self.centralwidget = QtWidgets.QWidget(MainWindow)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.centralwidget.sizePolicy().hasHeightForWidth())
|
||||
self.centralwidget.setSizePolicy(sizePolicy)
|
||||
self.centralwidget.setObjectName("centralwidget")
|
||||
self.verticalLayoutWidget = QtWidgets.QWidget(self.centralwidget)
|
||||
self.verticalLayoutWidget.setGeometry(QtCore.QRect(0, 0, 1271, 671))
|
||||
self.verticalLayoutWidget.setObjectName("verticalLayoutWidget")
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(self.verticalLayoutWidget)
|
||||
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.gridLayout = QtWidgets.QGridLayout()
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.tabWidget = QtWidgets.QTabWidget(self.verticalLayoutWidget)
|
||||
self.tabWidget.setObjectName("tabWidget")
|
||||
self.tab = QtWidgets.QWidget()
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.tab.sizePolicy().hasHeightForWidth())
|
||||
self.tab.setSizePolicy(sizePolicy)
|
||||
self.tab.setObjectName("tab")
|
||||
self.horizontalLayoutWidget_2 = QtWidgets.QWidget(self.tab)
|
||||
self.horizontalLayoutWidget_2.setGeometry(QtCore.QRect(0, 0, 1261, 161))
|
||||
self.horizontalLayoutWidget_2.setObjectName("horizontalLayoutWidget_2")
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget_2)
|
||||
self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
self.formLayout = QtWidgets.QFormLayout()
|
||||
self.formLayout.setObjectName("formLayout")
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout()
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
self.verticalLayout_2.addItem(spacerItem)
|
||||
self.load_app = QtWidgets.QPushButton(self.horizontalLayoutWidget_2)
|
||||
self.load_app.setObjectName("load_app")
|
||||
self.verticalLayout_2.addWidget(self.load_app)
|
||||
self.create_new_app = QtWidgets.QPushButton(self.horizontalLayoutWidget_2)
|
||||
self.create_new_app.setObjectName("create_new_app")
|
||||
self.verticalLayout_2.addWidget(self.create_new_app)
|
||||
spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
self.verticalLayout_2.addItem(spacerItem1)
|
||||
self.formLayout.setLayout(0, QtWidgets.QFormLayout.ItemRole.LabelRole, self.verticalLayout_2)
|
||||
self.tableWidget_apparate = QtWidgets.QTableWidget(self.horizontalLayoutWidget_2)
|
||||
self.tableWidget_apparate.setObjectName("tableWidget_apparate")
|
||||
self.tableWidget_apparate.setColumnCount(4)
|
||||
self.tableWidget_apparate.setRowCount(0)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.tableWidget_apparate.setHorizontalHeaderItem(0, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.tableWidget_apparate.setHorizontalHeaderItem(1, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.tableWidget_apparate.setHorizontalHeaderItem(2, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.tableWidget_apparate.setHorizontalHeaderItem(3, item)
|
||||
self.formLayout.setWidget(0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.tableWidget_apparate)
|
||||
self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
|
||||
self.formLayout.setLayout(2, QtWidgets.QFormLayout.ItemRole.LabelRole, self.horizontalLayout_3)
|
||||
self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
|
||||
self.formLayout.setLayout(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.horizontalLayout_4)
|
||||
self.horizontalLayout_2.addLayout(self.formLayout)
|
||||
self.line = QtWidgets.QFrame(self.tab)
|
||||
self.line.setGeometry(QtCore.QRect(0, 160, 1261, 21))
|
||||
self.line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
|
||||
self.line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
|
||||
self.line.setObjectName("line")
|
||||
self.gridLayoutWidget_2 = QtWidgets.QWidget(self.tab)
|
||||
self.gridLayoutWidget_2.setGeometry(QtCore.QRect(0, 180, 1261, 461))
|
||||
self.gridLayoutWidget_2.setObjectName("gridLayoutWidget_2")
|
||||
self.gridLayout_2 = QtWidgets.QGridLayout(self.gridLayoutWidget_2)
|
||||
self.gridLayout_2.setContentsMargins(0, 0, 0, 0)
|
||||
self.gridLayout_2.setObjectName("gridLayout_2")
|
||||
self.tableWidget_apparat_media = QtWidgets.QTableWidget(self.gridLayoutWidget_2)
|
||||
self.tableWidget_apparat_media.setObjectName("tableWidget_apparat_media")
|
||||
self.tableWidget_apparat_media.setColumnCount(4)
|
||||
self.tableWidget_apparat_media.setRowCount(0)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.tableWidget_apparat_media.setHorizontalHeaderItem(0, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.tableWidget_apparat_media.setHorizontalHeaderItem(1, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.tableWidget_apparat_media.setHorizontalHeaderItem(2, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.tableWidget_apparat_media.setHorizontalHeaderItem(3, item)
|
||||
self.gridLayout_2.addWidget(self.tableWidget_apparat_media, 3, 0, 1, 1)
|
||||
self.label = QtWidgets.QLabel(self.gridLayoutWidget_2)
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(11)
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.label.setFont(font)
|
||||
self.label.setObjectName("label")
|
||||
self.gridLayout_2.addWidget(self.label, 1, 0, 1, 1)
|
||||
self.app_group_box = QtWidgets.QGroupBox(self.gridLayoutWidget_2)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.app_group_box.sizePolicy().hasHeightForWidth())
|
||||
self.app_group_box.setSizePolicy(sizePolicy)
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(12)
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.app_group_box.setFont(font)
|
||||
self.app_group_box.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeading|QtCore.Qt.AlignmentFlag.AlignLeft|QtCore.Qt.AlignmentFlag.AlignVCenter)
|
||||
self.app_group_box.setCheckable(False)
|
||||
self.app_group_box.setObjectName("app_group_box")
|
||||
self.tableWidget = QtWidgets.QTableWidget(self.app_group_box)
|
||||
self.tableWidget.setGeometry(QtCore.QRect(820, 20, 256, 192))
|
||||
self.tableWidget.setObjectName("tableWidget")
|
||||
self.tableWidget.setColumnCount(2)
|
||||
self.tableWidget.setRowCount(0)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.tableWidget.setHorizontalHeaderItem(0, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.tableWidget.setHorizontalHeaderItem(1, item)
|
||||
self.frame = QtWidgets.QFrame(self.app_group_box)
|
||||
self.frame.setGeometry(QtCore.QRect(10, 30, 731, 151))
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.frame.sizePolicy().hasHeightForWidth())
|
||||
self.frame.setSizePolicy(sizePolicy)
|
||||
self.frame.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel)
|
||||
self.frame.setFrameShadow(QtWidgets.QFrame.Shadow.Raised)
|
||||
self.frame.setObjectName("frame")
|
||||
self.drpdwn_prof_title = QtWidgets.QComboBox(self.frame)
|
||||
self.drpdwn_prof_title.setGeometry(QtCore.QRect(110, 50, 69, 22))
|
||||
self.drpdwn_prof_title.setObjectName("drpdwn_prof_title")
|
||||
self.label_5 = QtWidgets.QLabel(self.frame)
|
||||
self.label_5.setGeometry(QtCore.QRect(250, 20, 91, 21))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.label_5.setFont(font)
|
||||
self.label_5.setObjectName("label_5")
|
||||
self.lineEdit = QtWidgets.QLineEdit(self.frame)
|
||||
self.lineEdit.setGeometry(QtCore.QRect(110, 80, 121, 20))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.lineEdit.setFont(font)
|
||||
self.lineEdit.setObjectName("lineEdit")
|
||||
self.sem_winter = QtWidgets.QRadioButton(self.frame)
|
||||
self.sem_winter.setGeometry(QtCore.QRect(340, 50, 82, 17))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.sem_winter.setFont(font)
|
||||
self.sem_winter.setObjectName("sem_winter")
|
||||
self.label_4 = QtWidgets.QLabel(self.frame)
|
||||
self.label_4.setGeometry(QtCore.QRect(10, 80, 71, 21))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.label_4.setFont(font)
|
||||
self.label_4.setObjectName("label_4")
|
||||
self.drpdwn_app_nr = QtWidgets.QComboBox(self.frame)
|
||||
self.drpdwn_app_nr.setGeometry(QtCore.QRect(110, 20, 69, 22))
|
||||
self.drpdwn_app_nr.setObjectName("drpdwn_app_nr")
|
||||
self.app_name = QtWidgets.QLineEdit(self.frame)
|
||||
self.app_name.setGeometry(QtCore.QRect(340, 20, 113, 20))
|
||||
self.app_name.setObjectName("app_name")
|
||||
self.sem_sommer = QtWidgets.QRadioButton(self.frame)
|
||||
self.sem_sommer.setGeometry(QtCore.QRect(340, 70, 82, 17))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.sem_sommer.setFont(font)
|
||||
self.sem_sommer.setObjectName("sem_sommer")
|
||||
self.label_3 = QtWidgets.QLabel(self.frame)
|
||||
self.label_3.setGeometry(QtCore.QRect(10, 50, 61, 20))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.label_3.setFont(font)
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.label_6 = QtWidgets.QLabel(self.frame)
|
||||
self.label_6.setGeometry(QtCore.QRect(270, 60, 51, 21))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.label_6.setFont(font)
|
||||
self.label_6.setObjectName("label_6")
|
||||
self.sem_year = QtWidgets.QLineEdit(self.frame)
|
||||
self.sem_year.setGeometry(QtCore.QRect(410, 60, 113, 20))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.sem_year.setFont(font)
|
||||
self.sem_year.setObjectName("sem_year")
|
||||
self.label_2 = QtWidgets.QLabel(self.frame)
|
||||
self.label_2.setGeometry(QtCore.QRect(10, 20, 101, 21))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.label_2.setFont(font)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.btn_apparat_save = QtWidgets.QPushButton(self.frame)
|
||||
self.btn_apparat_save.setGeometry(QtCore.QRect(260, 120, 75, 23))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.btn_apparat_save.setFont(font)
|
||||
self.btn_apparat_save.setObjectName("btn_apparat_save")
|
||||
self.btn_apparat_apply = QtWidgets.QPushButton(self.frame)
|
||||
self.btn_apparat_apply.setGeometry(QtCore.QRect(350, 120, 75, 23))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.btn_apparat_apply.setFont(font)
|
||||
self.btn_apparat_apply.setObjectName("btn_apparat_apply")
|
||||
self.checkBox = QtWidgets.QCheckBox(self.frame)
|
||||
self.checkBox.setGeometry(QtCore.QRect(340, 90, 101, 17))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.checkBox.setFont(font)
|
||||
self.checkBox.setObjectName("checkBox")
|
||||
self.btn_add_document = QtWidgets.QPushButton(self.app_group_box)
|
||||
self.btn_add_document.setGeometry(QtCore.QRect(1100, 40, 131, 25))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.btn_add_document.setFont(font)
|
||||
self.btn_add_document.setObjectName("btn_add_document")
|
||||
self.btn_open_document = QtWidgets.QPushButton(self.app_group_box)
|
||||
self.btn_open_document.setGeometry(QtCore.QRect(1100, 80, 131, 25))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.btn_open_document.setFont(font)
|
||||
self.btn_open_document.setObjectName("btn_open_document")
|
||||
self.toolButton = QtWidgets.QToolButton(self.app_group_box)
|
||||
self.toolButton.setGeometry(QtCore.QRect(1110, 110, 25, 19))
|
||||
self.toolButton.setObjectName("toolButton")
|
||||
self.gridLayout_2.addWidget(self.app_group_box, 2, 0, 1, 1)
|
||||
self.tabWidget.addTab(self.tab, "")
|
||||
self.tab_2 = QtWidgets.QWidget()
|
||||
self.tab_2.setObjectName("tab_2")
|
||||
self.tabWidget.addTab(self.tab_2, "")
|
||||
self.gridLayout.addWidget(self.tabWidget, 0, 0, 1, 1)
|
||||
self.horizontalLayout.addLayout(self.gridLayout)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout)
|
||||
MainWindow.setCentralWidget(self.centralwidget)
|
||||
self.menubar = QtWidgets.QMenuBar(MainWindow)
|
||||
self.menubar.setGeometry(QtCore.QRect(0, 0, 1280, 21))
|
||||
self.menubar.setObjectName("menubar")
|
||||
self.menuDatei = QtWidgets.QMenu(self.menubar)
|
||||
self.menuDatei.setObjectName("menuDatei")
|
||||
self.menuEinstellungen = QtWidgets.QMenu(self.menubar)
|
||||
self.menuEinstellungen.setObjectName("menuEinstellungen")
|
||||
MainWindow.setMenuBar(self.menubar)
|
||||
self.statusbar = QtWidgets.QStatusBar(MainWindow)
|
||||
self.statusbar.setObjectName("statusbar")
|
||||
MainWindow.setStatusBar(self.statusbar)
|
||||
self.menubar.addAction(self.menuDatei.menuAction())
|
||||
self.menubar.addAction(self.menuEinstellungen.menuAction())
|
||||
|
||||
self.retranslateUi(MainWindow)
|
||||
self.tabWidget.setCurrentIndex(0)
|
||||
QtCore.QMetaObject.connectSlotsByName(MainWindow)
|
||||
|
||||
def retranslateUi(self, MainWindow):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
|
||||
self.load_app.setToolTip(_translate("MainWindow", "Load the Semesterapparate from the database"))
|
||||
self.load_app.setText(_translate("MainWindow", "App. Laden"))
|
||||
self.create_new_app.setText(_translate("MainWindow", "neu. App anlegen"))
|
||||
item = self.tableWidget_apparate.horizontalHeaderItem(0)
|
||||
item.setText(_translate("MainWindow", "AppNr"))
|
||||
item = self.tableWidget_apparate.horizontalHeaderItem(1)
|
||||
item.setText(_translate("MainWindow", "App Name"))
|
||||
item = self.tableWidget_apparate.horizontalHeaderItem(2)
|
||||
item.setText(_translate("MainWindow", "Professor"))
|
||||
item = self.tableWidget_apparate.horizontalHeaderItem(3)
|
||||
item.setText(_translate("MainWindow", "Dauerapparat"))
|
||||
item = self.tableWidget_apparat_media.horizontalHeaderItem(0)
|
||||
item.setText(_translate("MainWindow", "Buchtitel"))
|
||||
item = self.tableWidget_apparat_media.horizontalHeaderItem(1)
|
||||
item.setText(_translate("MainWindow", "Autor"))
|
||||
item = self.tableWidget_apparat_media.horizontalHeaderItem(2)
|
||||
item.setText(_translate("MainWindow", "Auflage"))
|
||||
item = self.tableWidget_apparat_media.horizontalHeaderItem(3)
|
||||
item.setText(_translate("MainWindow", "Signatur"))
|
||||
self.label.setText(_translate("MainWindow", "Medienliste"))
|
||||
self.app_group_box.setTitle(_translate("MainWindow", "Apparatsdetails"))
|
||||
item = self.tableWidget.horizontalHeaderItem(0)
|
||||
item.setText(_translate("MainWindow", "Dokumentname"))
|
||||
item = self.tableWidget.horizontalHeaderItem(1)
|
||||
item.setText(_translate("MainWindow", "Typ"))
|
||||
self.label_5.setText(_translate("MainWindow", "Apparatsname"))
|
||||
self.lineEdit.setPlaceholderText(_translate("MainWindow", "Nachname, Vorname"))
|
||||
self.sem_winter.setText(_translate("MainWindow", "Winter"))
|
||||
self.label_4.setText(_translate("MainWindow", "Prof. Name"))
|
||||
self.sem_sommer.setText(_translate("MainWindow", "Sommer"))
|
||||
self.label_3.setText(_translate("MainWindow", "Prof. Titel"))
|
||||
self.label_6.setText(_translate("MainWindow", "Semester"))
|
||||
self.sem_year.setPlaceholderText(_translate("MainWindow", "2023"))
|
||||
self.label_2.setText(_translate("MainWindow", "Apparatsnummer"))
|
||||
self.btn_apparat_save.setText(_translate("MainWindow", "Speichern"))
|
||||
self.btn_apparat_apply.setText(_translate("MainWindow", "Aktualisieren"))
|
||||
self.checkBox.setText(_translate("MainWindow", "Dauerapparat"))
|
||||
self.btn_add_document.setText(_translate("MainWindow", "Dokument hinzufügen"))
|
||||
self.btn_open_document.setText(_translate("MainWindow", "Dokument öffnen"))
|
||||
self.toolButton.setText(_translate("MainWindow", "..."))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), _translate("MainWindow", "Tab 1"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), _translate("MainWindow", "Tab 2"))
|
||||
self.menuDatei.setTitle(_translate("MainWindow", "Datei"))
|
||||
self.menuEinstellungen.setTitle(_translate("MainWindow", "Einstellungen"))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import sys
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
MainWindow = QtWidgets.QMainWindow()
|
||||
ui = Ui_MainWindow()
|
||||
ui.setupUi(MainWindow)
|
||||
MainWindow.show()
|
||||
sys.exit(app.exec())
|
||||
64
src/ui/plotdata.ui
Normal file
64
src/ui/plotdata.ui
Normal file
@@ -0,0 +1,64 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>640</width>
|
||||
<height>480</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<widget class="QGraphicsView" name="graphicsView">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>330</x>
|
||||
<y>10</y>
|
||||
<width>256</width>
|
||||
<height>192</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QWidget" name="widget" native="true">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>0</y>
|
||||
<width>251</width>
|
||||
<height>271</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QStackedWidget" name="stackedWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>300</x>
|
||||
<y>220</y>
|
||||
<width>291</width>
|
||||
<height>201</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QWidget" name="page"/>
|
||||
<widget class="QWidget" name="page_2"/>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>640</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
47
src/ui/plotdata_ui.py
Normal file
47
src/ui/plotdata_ui.py
Normal file
@@ -0,0 +1,47 @@
|
||||
# Form implementation generated from reading ui file '/home/alexander/GitHub/Semesterapparate/ui/plotdata.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.5.3
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_MainWindow(object):
|
||||
def setupUi(self, MainWindow):
|
||||
MainWindow.setObjectName("MainWindow")
|
||||
MainWindow.resize(640, 480)
|
||||
self.centralwidget = QtWidgets.QWidget(parent=MainWindow)
|
||||
self.centralwidget.setObjectName("centralwidget")
|
||||
self.graphicsView = QtWidgets.QGraphicsView(parent=self.centralwidget)
|
||||
self.graphicsView.setGeometry(QtCore.QRect(330, 10, 256, 192))
|
||||
self.graphicsView.setObjectName("graphicsView")
|
||||
self.widget = QtWidgets.QWidget(parent=self.centralwidget)
|
||||
self.widget.setGeometry(QtCore.QRect(10, 0, 251, 271))
|
||||
self.widget.setObjectName("widget")
|
||||
self.stackedWidget = QtWidgets.QStackedWidget(parent=self.centralwidget)
|
||||
self.stackedWidget.setGeometry(QtCore.QRect(300, 220, 291, 201))
|
||||
self.stackedWidget.setObjectName("stackedWidget")
|
||||
self.page = QtWidgets.QWidget()
|
||||
self.page.setObjectName("page")
|
||||
self.stackedWidget.addWidget(self.page)
|
||||
self.page_2 = QtWidgets.QWidget()
|
||||
self.page_2.setObjectName("page_2")
|
||||
self.stackedWidget.addWidget(self.page_2)
|
||||
MainWindow.setCentralWidget(self.centralwidget)
|
||||
self.menubar = QtWidgets.QMenuBar(parent=MainWindow)
|
||||
self.menubar.setGeometry(QtCore.QRect(0, 0, 640, 21))
|
||||
self.menubar.setObjectName("menubar")
|
||||
MainWindow.setMenuBar(self.menubar)
|
||||
self.statusbar = QtWidgets.QStatusBar(parent=MainWindow)
|
||||
self.statusbar.setObjectName("statusbar")
|
||||
MainWindow.setStatusBar(self.statusbar)
|
||||
|
||||
self.retranslateUi(MainWindow)
|
||||
QtCore.QMetaObject.connectSlotsByName(MainWindow)
|
||||
|
||||
def retranslateUi(self, MainWindow):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
|
||||
14
src/ui/resources.qrc
Normal file
14
src/ui/resources.qrc
Normal file
@@ -0,0 +1,14 @@
|
||||
<RCC>
|
||||
<qresource prefix="warn_image">
|
||||
<file>icons/warning.png</file>
|
||||
</qresource>
|
||||
<qresource prefix="critical">
|
||||
<file>icons/critical.png</file>
|
||||
</qresource>
|
||||
<qresource prefix="information">
|
||||
<file>icons/information.png</file>
|
||||
</qresource>
|
||||
<qresource prefix="question">
|
||||
<file>icons/question.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
512
src/ui/sap.py
Normal file
512
src/ui/sap.py
Normal file
@@ -0,0 +1,512 @@
|
||||
# Form implementation generated from reading ui file 'ui/semesterapparat_ui.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.3.1
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_MainWindow(object):
|
||||
def setupUi(self, MainWindow):
|
||||
MainWindow.setObjectName("MainWindow")
|
||||
MainWindow.resize(1280, 747)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth())
|
||||
MainWindow.setSizePolicy(sizePolicy)
|
||||
self.centralwidget = QtWidgets.QWidget(MainWindow)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.centralwidget.sizePolicy().hasHeightForWidth())
|
||||
self.centralwidget.setSizePolicy(sizePolicy)
|
||||
self.centralwidget.setObjectName("centralwidget")
|
||||
self.verticalLayoutWidget = QtWidgets.QWidget(self.centralwidget)
|
||||
self.verticalLayoutWidget.setGeometry(QtCore.QRect(0, 0, 1271, 691))
|
||||
self.verticalLayoutWidget.setObjectName("verticalLayoutWidget")
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(self.verticalLayoutWidget)
|
||||
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.gridLayout = QtWidgets.QGridLayout()
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.tabWidget = QtWidgets.QTabWidget(self.verticalLayoutWidget)
|
||||
self.tabWidget.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus)
|
||||
self.tabWidget.setObjectName("tabWidget")
|
||||
self.tab = QtWidgets.QWidget()
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.tab.sizePolicy().hasHeightForWidth())
|
||||
self.tab.setSizePolicy(sizePolicy)
|
||||
self.tab.setObjectName("tab")
|
||||
self.horizontalLayoutWidget_2 = QtWidgets.QWidget(self.tab)
|
||||
self.horizontalLayoutWidget_2.setGeometry(QtCore.QRect(0, 0, 1261, 161))
|
||||
self.horizontalLayoutWidget_2.setObjectName("horizontalLayoutWidget_2")
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget_2)
|
||||
self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
self.formLayout = QtWidgets.QFormLayout()
|
||||
self.formLayout.setObjectName("formLayout")
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout()
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
self.verticalLayout_2.addItem(spacerItem)
|
||||
self.load_app = QtWidgets.QPushButton(self.horizontalLayoutWidget_2)
|
||||
self.load_app.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus)
|
||||
self.load_app.setObjectName("load_app")
|
||||
self.verticalLayout_2.addWidget(self.load_app)
|
||||
self.create_new_app = QtWidgets.QPushButton(self.horizontalLayoutWidget_2)
|
||||
self.create_new_app.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus)
|
||||
self.create_new_app.setObjectName("create_new_app")
|
||||
self.verticalLayout_2.addWidget(self.create_new_app)
|
||||
spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
self.verticalLayout_2.addItem(spacerItem1)
|
||||
self.formLayout.setLayout(0, QtWidgets.QFormLayout.ItemRole.LabelRole, self.verticalLayout_2)
|
||||
self.tableWidget_apparate = QtWidgets.QTableWidget(self.horizontalLayoutWidget_2)
|
||||
self.tableWidget_apparate.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus)
|
||||
self.tableWidget_apparate.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers)
|
||||
self.tableWidget_apparate.setObjectName("tableWidget_apparate")
|
||||
self.tableWidget_apparate.setColumnCount(4)
|
||||
self.tableWidget_apparate.setRowCount(0)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.tableWidget_apparate.setHorizontalHeaderItem(0, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.tableWidget_apparate.setHorizontalHeaderItem(1, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.tableWidget_apparate.setHorizontalHeaderItem(2, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.tableWidget_apparate.setHorizontalHeaderItem(3, item)
|
||||
self.formLayout.setWidget(0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.tableWidget_apparate)
|
||||
self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
|
||||
self.formLayout.setLayout(2, QtWidgets.QFormLayout.ItemRole.LabelRole, self.horizontalLayout_3)
|
||||
self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
|
||||
self.formLayout.setLayout(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.horizontalLayout_4)
|
||||
self.horizontalLayout_2.addLayout(self.formLayout)
|
||||
self.line = QtWidgets.QFrame(self.tab)
|
||||
self.line.setGeometry(QtCore.QRect(0, 160, 1261, 21))
|
||||
self.line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
|
||||
self.line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
|
||||
self.line.setObjectName("line")
|
||||
self.gridLayoutWidget_2 = QtWidgets.QWidget(self.tab)
|
||||
self.gridLayoutWidget_2.setGeometry(QtCore.QRect(0, 180, 1261, 461))
|
||||
self.gridLayoutWidget_2.setObjectName("gridLayoutWidget_2")
|
||||
self.gridLayout_2 = QtWidgets.QGridLayout(self.gridLayoutWidget_2)
|
||||
self.gridLayout_2.setContentsMargins(0, 0, 0, 0)
|
||||
self.gridLayout_2.setObjectName("gridLayout_2")
|
||||
self.app_group_box = QtWidgets.QGroupBox(self.gridLayoutWidget_2)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.app_group_box.sizePolicy().hasHeightForWidth())
|
||||
self.app_group_box.setSizePolicy(sizePolicy)
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(12)
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.app_group_box.setFont(font)
|
||||
self.app_group_box.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeading|QtCore.Qt.AlignmentFlag.AlignLeft|QtCore.Qt.AlignmentFlag.AlignVCenter)
|
||||
self.app_group_box.setCheckable(False)
|
||||
self.app_group_box.setObjectName("app_group_box")
|
||||
self.dokument_list = QtWidgets.QTableWidget(self.app_group_box)
|
||||
self.dokument_list.setGeometry(QtCore.QRect(830, 20, 256, 192))
|
||||
font = QtGui.QFont()
|
||||
font.setKerning(False)
|
||||
self.dokument_list.setFont(font)
|
||||
self.dokument_list.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus)
|
||||
self.dokument_list.setSelectionMode(QtWidgets.QAbstractItemView.SelectionMode.SingleSelection)
|
||||
self.dokument_list.setObjectName("dokument_list")
|
||||
self.dokument_list.setColumnCount(4)
|
||||
self.dokument_list.setRowCount(0)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Arial")
|
||||
font.setPointSize(8)
|
||||
item.setFont(font)
|
||||
self.dokument_list.setHorizontalHeaderItem(0, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Arial")
|
||||
font.setPointSize(8)
|
||||
item.setFont(font)
|
||||
self.dokument_list.setHorizontalHeaderItem(1, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Arial")
|
||||
font.setPointSize(8)
|
||||
item.setFont(font)
|
||||
self.dokument_list.setHorizontalHeaderItem(2, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.dokument_list.setHorizontalHeaderItem(3, item)
|
||||
self.frame = QtWidgets.QFrame(self.app_group_box)
|
||||
self.frame.setEnabled(True)
|
||||
self.frame.setGeometry(QtCore.QRect(10, 30, 731, 151))
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.frame.sizePolicy().hasHeightForWidth())
|
||||
self.frame.setSizePolicy(sizePolicy)
|
||||
self.frame.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel)
|
||||
self.frame.setFrameShadow(QtWidgets.QFrame.Shadow.Raised)
|
||||
self.frame.setObjectName("frame")
|
||||
self.drpdwn_prof_title = QtWidgets.QComboBox(self.frame)
|
||||
self.drpdwn_prof_title.setGeometry(QtCore.QRect(110, 50, 69, 22))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.drpdwn_prof_title.setFont(font)
|
||||
self.drpdwn_prof_title.setEditable(True)
|
||||
self.drpdwn_prof_title.setObjectName("drpdwn_prof_title")
|
||||
self.label_5 = QtWidgets.QLabel(self.frame)
|
||||
self.label_5.setGeometry(QtCore.QRect(250, 20, 91, 21))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.label_5.setFont(font)
|
||||
self.label_5.setObjectName("label_5")
|
||||
self.sem_winter = QtWidgets.QRadioButton(self.frame)
|
||||
self.sem_winter.setGeometry(QtCore.QRect(340, 50, 82, 17))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.sem_winter.setFont(font)
|
||||
self.sem_winter.setObjectName("sem_winter")
|
||||
self.label_4 = QtWidgets.QLabel(self.frame)
|
||||
self.label_4.setGeometry(QtCore.QRect(10, 80, 71, 21))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.label_4.setFont(font)
|
||||
self.label_4.setObjectName("label_4")
|
||||
self.drpdwn_app_nr = QtWidgets.QComboBox(self.frame)
|
||||
self.drpdwn_app_nr.setGeometry(QtCore.QRect(110, 20, 69, 22))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.drpdwn_app_nr.setFont(font)
|
||||
self.drpdwn_app_nr.setEditable(True)
|
||||
self.drpdwn_app_nr.setObjectName("drpdwn_app_nr")
|
||||
self.app_name = QtWidgets.QLineEdit(self.frame)
|
||||
self.app_name.setGeometry(QtCore.QRect(340, 20, 113, 20))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.app_name.setFont(font)
|
||||
self.app_name.setObjectName("app_name")
|
||||
self.sem_sommer = QtWidgets.QRadioButton(self.frame)
|
||||
self.sem_sommer.setGeometry(QtCore.QRect(340, 70, 82, 17))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.sem_sommer.setFont(font)
|
||||
self.sem_sommer.setObjectName("sem_sommer")
|
||||
self.label_3 = QtWidgets.QLabel(self.frame)
|
||||
self.label_3.setGeometry(QtCore.QRect(10, 50, 61, 20))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.label_3.setFont(font)
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.label_6 = QtWidgets.QLabel(self.frame)
|
||||
self.label_6.setGeometry(QtCore.QRect(270, 60, 51, 21))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.label_6.setFont(font)
|
||||
self.label_6.setObjectName("label_6")
|
||||
self.sem_year = QtWidgets.QLineEdit(self.frame)
|
||||
self.sem_year.setGeometry(QtCore.QRect(410, 60, 113, 20))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.sem_year.setFont(font)
|
||||
self.sem_year.setMaxLength(4)
|
||||
self.sem_year.setObjectName("sem_year")
|
||||
self.label_2 = QtWidgets.QLabel(self.frame)
|
||||
self.label_2.setGeometry(QtCore.QRect(10, 20, 101, 21))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.label_2.setFont(font)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.btn_apparat_save = QtWidgets.QPushButton(self.frame)
|
||||
self.btn_apparat_save.setGeometry(QtCore.QRect(260, 120, 75, 23))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.btn_apparat_save.setFont(font)
|
||||
self.btn_apparat_save.setObjectName("btn_apparat_save")
|
||||
self.btn_apparat_apply = QtWidgets.QPushButton(self.frame)
|
||||
self.btn_apparat_apply.setGeometry(QtCore.QRect(350, 120, 75, 23))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.btn_apparat_apply.setFont(font)
|
||||
self.btn_apparat_apply.setObjectName("btn_apparat_apply")
|
||||
self.check_eternal_app = QtWidgets.QCheckBox(self.frame)
|
||||
self.check_eternal_app.setGeometry(QtCore.QRect(340, 90, 101, 17))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.check_eternal_app.setFont(font)
|
||||
self.check_eternal_app.setObjectName("check_eternal_app")
|
||||
self.label_8 = QtWidgets.QLabel(self.frame)
|
||||
self.label_8.setGeometry(QtCore.QRect(10, 110, 71, 21))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.label_8.setFont(font)
|
||||
self.label_8.setObjectName("label_8")
|
||||
self.prof_mail = QtWidgets.QLineEdit(self.frame)
|
||||
self.prof_mail.setGeometry(QtCore.QRect(110, 110, 121, 20))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.prof_mail.setFont(font)
|
||||
self.prof_mail.setPlaceholderText("")
|
||||
self.prof_mail.setObjectName("prof_mail")
|
||||
self.label_9 = QtWidgets.QLabel(self.frame)
|
||||
self.label_9.setGeometry(QtCore.QRect(10, 130, 71, 21))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.label_9.setFont(font)
|
||||
self.label_9.setObjectName("label_9")
|
||||
self.prof_tel_nr = QtWidgets.QLineEdit(self.frame)
|
||||
self.prof_tel_nr.setGeometry(QtCore.QRect(110, 130, 121, 20))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.prof_tel_nr.setFont(font)
|
||||
self.prof_tel_nr.setPlaceholderText("")
|
||||
self.prof_tel_nr.setObjectName("prof_tel_nr")
|
||||
self.label_10 = QtWidgets.QLabel(self.frame)
|
||||
self.label_10.setGeometry(QtCore.QRect(470, 20, 51, 21))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.label_10.setFont(font)
|
||||
self.label_10.setObjectName("label_10")
|
||||
self.app_fach = QtWidgets.QLineEdit(self.frame)
|
||||
self.app_fach.setGeometry(QtCore.QRect(510, 20, 113, 20))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.app_fach.setFont(font)
|
||||
self.app_fach.setObjectName("app_fach")
|
||||
self.drpdwn_prof_name = QtWidgets.QComboBox(self.frame)
|
||||
self.drpdwn_prof_name.setGeometry(QtCore.QRect(110, 80, 121, 22))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(8)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.drpdwn_prof_name.setFont(font)
|
||||
self.drpdwn_prof_name.setFocusPolicy(QtCore.Qt.FocusPolicy.StrongFocus)
|
||||
self.drpdwn_prof_name.setEditable(True)
|
||||
self.drpdwn_prof_name.setCurrentText("")
|
||||
self.drpdwn_prof_name.setInsertPolicy(QtWidgets.QComboBox.InsertPolicy.InsertAlphabetically)
|
||||
self.drpdwn_prof_name.setFrame(True)
|
||||
self.drpdwn_prof_name.setObjectName("drpdwn_prof_name")
|
||||
self.btn_add_document = QtWidgets.QPushButton(self.app_group_box)
|
||||
self.btn_add_document.setGeometry(QtCore.QRect(1100, 40, 131, 25))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.btn_add_document.setFont(font)
|
||||
self.btn_add_document.setObjectName("btn_add_document")
|
||||
self.btn_open_document = QtWidgets.QPushButton(self.app_group_box)
|
||||
self.btn_open_document.setGeometry(QtCore.QRect(1100, 80, 131, 25))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.btn_open_document.setFont(font)
|
||||
self.btn_open_document.setObjectName("btn_open_document")
|
||||
self.toolButton = QtWidgets.QToolButton(self.app_group_box)
|
||||
self.toolButton.setGeometry(QtCore.QRect(1110, 110, 25, 19))
|
||||
self.toolButton.setObjectName("toolButton")
|
||||
self.label_7 = QtWidgets.QLabel(self.app_group_box)
|
||||
self.label_7.setGeometry(QtCore.QRect(20, 200, 47, 21))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.label_7.setFont(font)
|
||||
self.label_7.setObjectName("label_7")
|
||||
self.search_media = QtWidgets.QLineEdit(self.app_group_box)
|
||||
self.search_media.setGeometry(QtCore.QRect(80, 200, 211, 20))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.search_media.setFont(font)
|
||||
self.search_media.setObjectName("search_media")
|
||||
self.label = QtWidgets.QLabel(self.app_group_box)
|
||||
self.label.setGeometry(QtCore.QRect(10, 180, 1259, 18))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(11)
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.label.setFont(font)
|
||||
self.label.setObjectName("label")
|
||||
self.gridLayout_2.addWidget(self.app_group_box, 1, 0, 1, 1)
|
||||
self.tableWidget_apparat_media = QtWidgets.QTableWidget(self.gridLayoutWidget_2)
|
||||
self.tableWidget_apparat_media.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus)
|
||||
self.tableWidget_apparat_media.setObjectName("tableWidget_apparat_media")
|
||||
self.tableWidget_apparat_media.setColumnCount(4)
|
||||
self.tableWidget_apparat_media.setRowCount(0)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.tableWidget_apparat_media.setHorizontalHeaderItem(0, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.tableWidget_apparat_media.setHorizontalHeaderItem(1, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.tableWidget_apparat_media.setHorizontalHeaderItem(2, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.tableWidget_apparat_media.setHorizontalHeaderItem(3, item)
|
||||
self.gridLayout_2.addWidget(self.tableWidget_apparat_media, 2, 0, 1, 1)
|
||||
self.search = QtWidgets.QPushButton(self.tab)
|
||||
self.search.setGeometry(QtCore.QRect(130, 640, 75, 20))
|
||||
self.search.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus)
|
||||
self.search.setObjectName("search")
|
||||
self.add_medium = QtWidgets.QPushButton(self.tab)
|
||||
self.add_medium.setGeometry(QtCore.QRect(10, 640, 111, 20))
|
||||
self.add_medium.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus)
|
||||
self.add_medium.setObjectName("add_medium")
|
||||
self.tabWidget.addTab(self.tab, "")
|
||||
self.tab_2 = QtWidgets.QWidget()
|
||||
self.tab_2.setObjectName("tab_2")
|
||||
self.tabWidget.addTab(self.tab_2, "")
|
||||
self.gridLayout.addWidget(self.tabWidget, 0, 0, 1, 1)
|
||||
self.horizontalLayout.addLayout(self.gridLayout)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout)
|
||||
MainWindow.setCentralWidget(self.centralwidget)
|
||||
self.menubar = QtWidgets.QMenuBar(MainWindow)
|
||||
self.menubar.setGeometry(QtCore.QRect(0, 0, 1280, 21))
|
||||
self.menubar.setObjectName("menubar")
|
||||
self.menuDatei = QtWidgets.QMenu(self.menubar)
|
||||
self.menuDatei.setObjectName("menuDatei")
|
||||
self.menuEinstellungen = QtWidgets.QMenu(self.menubar)
|
||||
self.menuEinstellungen.setObjectName("menuEinstellungen")
|
||||
MainWindow.setMenuBar(self.menubar)
|
||||
self.statusbar = QtWidgets.QStatusBar(MainWindow)
|
||||
self.statusbar.setObjectName("statusbar")
|
||||
MainWindow.setStatusBar(self.statusbar)
|
||||
self.menubar.addAction(self.menuDatei.menuAction())
|
||||
self.menubar.addAction(self.menuEinstellungen.menuAction())
|
||||
|
||||
self.retranslateUi(MainWindow)
|
||||
self.tabWidget.setCurrentIndex(0)
|
||||
QtCore.QMetaObject.connectSlotsByName(MainWindow)
|
||||
MainWindow.setTabOrder(self.drpdwn_app_nr, self.drpdwn_prof_title)
|
||||
MainWindow.setTabOrder(self.drpdwn_prof_title, self.drpdwn_prof_name)
|
||||
MainWindow.setTabOrder(self.drpdwn_prof_name, self.prof_mail)
|
||||
MainWindow.setTabOrder(self.prof_mail, self.prof_tel_nr)
|
||||
MainWindow.setTabOrder(self.prof_tel_nr, self.app_name)
|
||||
MainWindow.setTabOrder(self.app_name, self.app_fach)
|
||||
MainWindow.setTabOrder(self.app_fach, self.sem_winter)
|
||||
MainWindow.setTabOrder(self.sem_winter, self.sem_sommer)
|
||||
MainWindow.setTabOrder(self.sem_sommer, self.sem_year)
|
||||
MainWindow.setTabOrder(self.sem_year, self.check_eternal_app)
|
||||
MainWindow.setTabOrder(self.check_eternal_app, self.btn_add_document)
|
||||
MainWindow.setTabOrder(self.btn_add_document, self.btn_open_document)
|
||||
MainWindow.setTabOrder(self.btn_open_document, self.toolButton)
|
||||
MainWindow.setTabOrder(self.toolButton, self.btn_apparat_save)
|
||||
MainWindow.setTabOrder(self.btn_apparat_save, self.btn_apparat_apply)
|
||||
MainWindow.setTabOrder(self.btn_apparat_apply, self.search_media)
|
||||
|
||||
def retranslateUi(self, MainWindow):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
|
||||
self.load_app.setToolTip(_translate("MainWindow", "Load the Semesterapparate from the database"))
|
||||
self.load_app.setText(_translate("MainWindow", "App. aufrufen"))
|
||||
self.create_new_app.setText(_translate("MainWindow", "neu. App anlegen"))
|
||||
item = self.tableWidget_apparate.horizontalHeaderItem(0)
|
||||
item.setText(_translate("MainWindow", "AppNr"))
|
||||
item = self.tableWidget_apparate.horizontalHeaderItem(1)
|
||||
item.setText(_translate("MainWindow", "App Name"))
|
||||
item = self.tableWidget_apparate.horizontalHeaderItem(2)
|
||||
item.setText(_translate("MainWindow", "Professor"))
|
||||
item = self.tableWidget_apparate.horizontalHeaderItem(3)
|
||||
item.setText(_translate("MainWindow", "Dauerapparat"))
|
||||
self.app_group_box.setTitle(_translate("MainWindow", "Apparatsdetails"))
|
||||
item = self.dokument_list.horizontalHeaderItem(0)
|
||||
item.setText(_translate("MainWindow", "Dokumentname"))
|
||||
item = self.dokument_list.horizontalHeaderItem(1)
|
||||
item.setText(_translate("MainWindow", "Dateityp"))
|
||||
item = self.dokument_list.horizontalHeaderItem(2)
|
||||
item.setText(_translate("MainWindow", "Neu?"))
|
||||
item = self.dokument_list.horizontalHeaderItem(3)
|
||||
item.setText(_translate("MainWindow", "path"))
|
||||
self.label_5.setText(_translate("MainWindow", "Apparatsname"))
|
||||
self.sem_winter.setText(_translate("MainWindow", "Winter"))
|
||||
self.label_4.setText(_translate("MainWindow", "Prof. Name"))
|
||||
self.sem_sommer.setText(_translate("MainWindow", "Sommer"))
|
||||
self.label_3.setText(_translate("MainWindow", "Prof. Titel"))
|
||||
self.label_6.setText(_translate("MainWindow", "Semester"))
|
||||
self.sem_year.setPlaceholderText(_translate("MainWindow", "2023"))
|
||||
self.label_2.setText(_translate("MainWindow", "Apparatsnummer"))
|
||||
self.btn_apparat_save.setText(_translate("MainWindow", "Speichern"))
|
||||
self.btn_apparat_apply.setText(_translate("MainWindow", "Aktualisieren"))
|
||||
self.check_eternal_app.setText(_translate("MainWindow", "Dauerapparat"))
|
||||
self.label_8.setText(_translate("MainWindow", "Mail"))
|
||||
self.label_9.setText(_translate("MainWindow", "Tel"))
|
||||
self.label_10.setText(_translate("MainWindow", "Fach"))
|
||||
self.btn_add_document.setText(_translate("MainWindow", "Dokument hinzufügen"))
|
||||
self.btn_open_document.setText(_translate("MainWindow", "Dokument öffnen"))
|
||||
self.toolButton.setText(_translate("MainWindow", "..."))
|
||||
self.label_7.setText(_translate("MainWindow", "Suche"))
|
||||
self.search_media.setPlaceholderText(_translate("MainWindow", "Buch oder Signatur"))
|
||||
self.label.setText(_translate("MainWindow", "Medienliste"))
|
||||
item = self.tableWidget_apparat_media.horizontalHeaderItem(0)
|
||||
item.setText(_translate("MainWindow", "Buchtitel"))
|
||||
item = self.tableWidget_apparat_media.horizontalHeaderItem(1)
|
||||
item.setText(_translate("MainWindow", "Autor"))
|
||||
item = self.tableWidget_apparat_media.horizontalHeaderItem(2)
|
||||
item.setText(_translate("MainWindow", "Auflage"))
|
||||
item = self.tableWidget_apparat_media.horizontalHeaderItem(3)
|
||||
item.setText(_translate("MainWindow", "Signatur"))
|
||||
self.search.setToolTip(_translate("MainWindow", "Sucht im Katalog nach allen Medien, die die Apparatsnummer enthalten"))
|
||||
self.search.setText(_translate("MainWindow", "Suche"))
|
||||
self.add_medium.setText(_translate("MainWindow", "Medium hinzufügen"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), _translate("MainWindow", "Tab 1"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), _translate("MainWindow", "Tab 2"))
|
||||
self.menuDatei.setTitle(_translate("MainWindow", "Datei"))
|
||||
self.menuEinstellungen.setTitle(_translate("MainWindow", "Einstellungen"))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import sys
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
MainWindow = QtWidgets.QMainWindow()
|
||||
ui = Ui_MainWindow()
|
||||
ui.setupUi(MainWindow)
|
||||
MainWindow.show()
|
||||
sys.exit(app.exec())
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user