diff --git a/.gitignore b/.gitignore index c511fc3..04a73a4 100644 --- a/.gitignore +++ b/.gitignore @@ -227,4 +227,4 @@ output config.yaml **/tempCodeRunnerFile.py uv.lock -uv.lock +logs/ \ No newline at end of file diff --git a/README.md b/README.md index 27a67a7..fc6e6f7 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,27 @@ -# Semesterapparate +# SemesterapparatsManager -this repo will be used to create a GUI application to manage the semesterapparate of the PH Freiburg. \ No newline at end of file +SemesterapparatsManager is a graphical tool for managing semester apparatuses in the University of Education Freiburg. It allows the users to manage the semester apparatuses in a user-friendly way. It's functions include management of physical and digital semester apparatuses, as well as creating the citations for the digital files of the digital semester apparatuses. For that it uses Zotero, an open source reference management software. The semester apparatuses are stored in a SQLite database, which is created and managed by the SemesterapparatsManager. The SemesterapparatsManager is written in Python and uses the PyQt6 library for the graphical user interface + + +## Features +- Manage physical semester apparatuses + - Add semester apparatuses + - Edit semester apparatuses + - Delete semester apparatuses + - Extend semester apparatuses + - Notify professors about semester apparatuses creation or deletion + - Add messages to all semester apparatuses, or an individual semester apparatus +- Manage digital semester apparatuses + - Use text parsing to extract information from the submitted form and create the scans + - if a book is used multiple parts of a book are used, it can be split into the parts + - Create the matching citations for the files +- Statistics and Search + - Search semester apparatuses by various criteria + - Show statistics about the semester apparatuses creation and deletion +- Edit user data + + +## Images + +![Main Window](docs/images/mainUI.png) +![Statistics](docs/images/statistics.png) \ No newline at end of file diff --git a/__main__.py b/__main__.py deleted file mode 100644 index 0d482fe..0000000 --- a/__main__.py +++ /dev/null @@ -1,4 +0,0 @@ -from src.ui.userInterface import launch_gui as UI - -if __name__ == "__main__": - UI() #:des diff --git a/build.app.json b/build.app.json deleted file mode 100644 index dc3c383..0000000 --- a/build.app.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "version": "auto-py-to-exe-configuration_v1", - "pyinstallerOptions": [ - { - "optionDest": "noconfirm", - "value": true - }, - { - "optionDest": "filenames", - "value": "C:/Users/aky547/GitHub/SemesterapparatsManager/__main__.py" - }, - { - "optionDest": "onefile", - "value": false - }, - { - "optionDest": "console", - "value": false - }, - { - "optionDest": "icon_file", - "value": "C:/Users/aky547/Downloads/VZjRNn1k.ico" - }, - { - "optionDest": "name", - "value": "SemesterAppMan" - }, - { - "optionDest": "clean_build", - "value": true - }, - { - "optionDest": "strip", - "value": false - }, - { - "optionDest": "noupx", - "value": false - }, - { - "optionDest": "disable_windowed_traceback", - "value": false - }, - { - "optionDest": "uac_admin", - "value": false - }, - { - "optionDest": "uac_uiaccess", - "value": false - }, - { - "optionDest": "argv_emulation", - "value": false - }, - { - "optionDest": "bootloader_ignore_signals", - "value": false - }, - { - "optionDest": "datas", - "value": "C:/Users/aky547/GitHub/SemesterapparatsManager/config.yaml;." - } - ], - "nonPyinstallerOptions": { - "increaseRecursionLimit": true, - "manualArguments": "" - } -} \ No newline at end of file diff --git a/config/config.py b/config/config.py index a5d982e..8619b2a 100644 --- a/config/config.py +++ b/config/config.py @@ -37,6 +37,7 @@ class Mail: sender: str password: str use_user_name: bool + printer_mail: str user_name: str signature: str | None = None empty_signature = """ diff --git a/docs/images/statistics.png b/docs/images/statistics.png new file mode 100644 index 0000000..55dea3f Binary files /dev/null and b/docs/images/statistics.png differ diff --git a/icons/db_search.svg b/icons/db_search.svg new file mode 100644 index 0000000..66f0c63 --- /dev/null +++ b/icons/db_search.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/icons/icons.yaml b/icons/icons.yaml deleted file mode 100644 index e69de29..0000000 diff --git a/icons/print.svg b/icons/print.svg new file mode 100644 index 0000000..fefb7f0 --- /dev/null +++ b/icons/print.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/mail_vorlagen/Information bezüglich der Auflösung des Semesterapparates {AppNr} - Alexander Kirchner (alexander.kirchner@ph-freiburg.de).eml b/mail_vorlagen/Information bezüglich der Auflösung des Semesterapparates {AppNr} - Alexander Kirchner (alexander.kirchner@ph-freiburg.de).eml new file mode 100644 index 0000000..9bc91f4 --- /dev/null +++ b/mail_vorlagen/Information bezüglich der Auflösung des Semesterapparates {AppNr} - Alexander Kirchner (alexander.kirchner@ph-freiburg.de).eml @@ -0,0 +1,54 @@ +Message-ID: <987b46cf-2d8b-4a27-acb3-c50f61d3d85d@ph-freiburg.de> +Date: Tue, 31 Oct 2023 11:38:34 +0100 +MIME-Version: 1.0 +User-Agent: Mozilla Thunderbird +From: Alexander Kirchner +Subject: =?UTF-8?Q?Information_bez=C3=BCglich_der_Aufl=C3=B6sung_des_Semeste?= + =?UTF-8?Q?rapparates_=7BAppNr=7D?= +Content-Language: de-DE +X-Mozilla-Draft-Info: internal/draft; vcard=0; receipt=0; DSN=0; uuencode=0; + attachmentreminder=0; deliveryformat=0 +X-Identity-Key: id1 +Fcc: imap://aky547@imap.ph-freiburg.de/INBOX/Sent +Content-Type: text/html; charset=UTF-8 +Content-Transfer-Encoding: 8bit + + + + + + + +

Sehr geehrte/r {Profname},
+

+


+

+ auf die E-Mail bezüglich der Auflösung oder Verlängerung der + Semesterapparate haben wir von Ihnen keine Rückmeldung erhalten. + Deshalb gehen wir davon aus, dass der Apparat aufgelöst werden kann. + Die Medien, die im Apparat aufgestellt waren, werden nun wieder + regulär ausleihbar und sind dann an ihren Standorten bei den Fächern + zu finden.
+
+ Falls Sie den Apparat erneut, oder einen neuen Apparat anlegen + wollen, können Sie mir das ausgefüllte Formular zur Einrichtung des + Apparates (https://www.ph-freiburg.de/bibliothek/lernen/semesterapparate/info-lehrende-sem.html) + zukommen lassen. Im Falle einer Verlängerung des Apparates reicht + eine Antwort auf diese Mail. +


+

+

Bei Fragen können Sie sich jederzeit an mich wenden.
+

+


+

+
-- 
+Freundliche Grüße
+
+Alexander Kirchner
+
+
+Bibliothek der Pädagogischen Hochschule Freiburg
+Tel. 0761/682-778
+ + diff --git a/mail_vorlagen/Information zur Auflösung des Semesterapparates.eml b/mail_vorlagen/Information zur Auflösung des Semesterapparates.eml new file mode 100644 index 0000000..45ca60f --- /dev/null +++ b/mail_vorlagen/Information zur Auflösung des Semesterapparates.eml @@ -0,0 +1,18 @@ +Subject: Information zur Auflösung des Semesterapparates {AppNr} - {Appname} +MIME-Version: 1.0 +Content-Type: text/html; charset="UTF-8" +Content-Transfer-Encoding: 8bit + + + + + + +

{greeting}

+


+

Ihr Semesterapparat "{Appname} ({AppNr})" wurde wie besprochen aufgelöst.

+

Die Medien sind von nun an wieder in den Regalen zu finden.

+


+

-- 

+

{signature}

+

\ No newline at end of file diff --git a/src/__init__.py b/src/__init__.py index b1a49c8..2661405 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -1,10 +1,11 @@ -import sys +__all__ = ["__version__", "__author__", "Icon", "settings"] from config import Config import os -from loguru import logger as log -from datetime import datetime + settings = Config("config/config.yaml") +if not os.path.exists(settings.database.temp): + os.mkdir(settings.database.temp) from .utils.icon import Icon __version__ = "0.2.1" @@ -14,14 +15,3 @@ __author__ = "Alexander Kirchner" if not os.path.exists("logs"): os.mkdir("logs") # open and close the file to create it -logger = log -logger.remove() -logger.add("logs/application.log", rotation="1 week", enqueue=True) -log.add( - f"logs/{datetime.now().strftime('%Y-%m-%d')}.log", - rotation="1 day", - compression="zip", -) - -# logger.add(sys.stderr, format="{time} {level} {message}", level="INFO") -logger.add(sys.stdout) diff --git a/src/backend/__init__.py b/src/backend/__init__.py index 8604bf4..8c548c9 100644 --- a/src/backend/__init__.py +++ b/src/backend/__init__.py @@ -1,7 +1,8 @@ -from .database import Database from .semester import Semester +from .database import Database from .admin_console import AdminCommands from .thread_bookgrabber import BookGrabber from .threads_availchecker import AvailChecker from .threads_autoadder import AutoAdder -from .documentation_thread import DocumentationThread \ No newline at end of file +from .documentation_thread import DocumentationThread +from .create_file import recreateFile, recreateElsaFile diff --git a/src/backend/create_file.py b/src/backend/create_file.py index ceeff20..b19e1e0 100644 --- a/src/backend/create_file.py +++ b/src/backend/create_file.py @@ -4,10 +4,18 @@ from pathlib import Path from src.backend.database import Database +import loguru +import sys + +log = loguru.logger +log.remove() +log.add(sys.stdout) +log.add("logs/application.log", rotation="1 MB", retention="10 days") + + db = Database() - -def recreateFile(name, app_id, filetype, open=True) -> Path: +def recreateFile(name: str, app_id: int, filetype: str, open: bool = True) -> Path: """ recreateFile creates a file from the database and opens it in the respective program, if the open parameter is set to True. @@ -24,6 +32,7 @@ def recreateFile(name, app_id, filetype, open=True) -> Path: """ path = db.recreateFile(name, app_id, filetype=filetype) path = Path(path) + log.info(f"File created: {path}") if open: if os.getenv("OS") == "Windows_NT": path = path.resolve() diff --git a/src/backend/database.py b/src/backend/database.py index de43c0c..0dfcbaf 100644 --- a/src/backend/database.py +++ b/src/backend/database.py @@ -5,13 +5,13 @@ from pathlib import Path from src import settings from typing import Any, List, Optional, Tuple, Union import datetime -from src import logger +import json +from dataclasses import asdict from src.backend.db import ( CREATE_ELSA_FILES_TABLE, CREATE_ELSA_MEDIA_TABLE, CREATE_ELSA_TABLE, CREATE_TABLE_APPARAT, - CREATE_TABLE_APPKONTOS, CREATE_TABLE_FILES, CREATE_TABLE_MEDIA, CREATE_TABLE_MESSAGES, @@ -22,9 +22,16 @@ from src.backend.db import ( from src.errors import AppPresentError, NoResultError from src.logic import ApparatData, BookData, Prof, Apparat, ELSA from src.logic.constants import SEMAP_MEDIA_ACCOUNTS -from src.utils import create_blob, dump_pickle, load_pickle from .semester import Semester from string import ascii_lowercase as lower, digits, punctuation +import loguru +import sys + +log = loguru.logger +log.remove() +log.add(sys.stdout) +log.add("logs/application.log", rotation="1 MB", retention="10 days") + ascii_lowercase = lower + digits + punctuation @@ -47,6 +54,7 @@ class Database: if db_path is None: self.db_path = self.database.path + self.database.name self.db_path = self.db_path.replace("~", str(Path.home())) + log.debug(self.db_path) else: self.db_path = db_path self.checkDatabaseStatus() @@ -54,14 +62,13 @@ class Database: def checkDatabaseStatus(self): path = self.database.path path = path.replace("~", str(Path.home())) - # print(path) path = os.path.abspath(path) if not os.path.exists(path): # create path - # print(path) + # log.debug(path) os.makedirs(path) if self.get_db_contents() == []: - logger.critical("Database does not exist, creating tables") + log.critical("Database does not exist, creating tables") self.create_tables() self.insertSubjects() @@ -124,7 +131,6 @@ class Database: cursor.execute(CREATE_TABLE_APPARAT) cursor.execute(CREATE_TABLE_MESSAGES) cursor.execute(CREATE_TABLE_MEDIA) - cursor.execute(CREATE_TABLE_APPKONTOS) cursor.execute(CREATE_TABLE_FILES) cursor.execute(CREATE_TABLE_PROF) cursor.execute(CREATE_TABLE_USER) @@ -145,15 +151,18 @@ class Database: """ conn = self.connect() cursor = conn.cursor() - logger.debug(f"Inserting {params} into database with query {query}") + log.debug(f"Inserting {params} into database with query {query}") cursor.execute(query, params) conn.commit() self.close_connection(conn) - @logger.catch + @log.catch def query_db( - self, query: str, args: Tuple = (), one: bool = False - ) -> Union[Tuple, List[Tuple]]: + self, + query: str, + args: Tuple[Any, Any] = (), # type:ignore + one: bool = False, # type:ignore + ) -> Union[Tuple[Any, Any], List[Tuple[Any, Any]]]: """ Query the Database for the sent query. @@ -168,6 +177,7 @@ class Database: conn = self.connect() cursor = conn.cursor() logs_query = query + logs_args = args if "fileblob" in query: # set fileblob arg in logger to "too long" @@ -181,14 +191,15 @@ class Database: # log_message = f"Querying database with query {query}" if "INTO user" in query: log_message = f"Querying database with query {query}" - logger.debug(log_message) + # log.debug(f"DB Query: {log_message}") + log.debug(log_message) try: cursor.execute(query, args) rv = cursor.fetchall() conn.commit() self.close_connection(conn) except sql.OperationalError as e: - logger.error(f"Error in query: {e}") + log.error(f"Error in query: {e}") return None return (rv[0] if rv else None) if one else rv @@ -204,6 +215,7 @@ class Database: app_id (str): The apparat id where the book should be added to prof_id (str): The id of the professor where the book should be added to. """ + log.info(f"Adding book {bookdata.signature} to database") if app_id is None or prof_id is None: raise ValueError("Apparate ID or Prof ID is None") conn = self.connect() @@ -211,22 +223,26 @@ class Database: t_query = ( f"SELECT bookdata FROM media WHERE app_id={app_id} AND prof_id={prof_id}" ) - logger.debug(t_query) - # # print(t_query) + log.debug(t_query) + # # log.debug(t_query) result = cursor.execute(t_query).fetchall() - result = [load_pickle(i[0]) for i in result] + result = [BookData().from_string(i[0]) for i in result] if bookdata in result: - # print("Bookdata already in database") + # log.debug("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, dump_pickle(bookdata)) + params = (app_id, prof_id, json.dumps(asdict(bookdata), ensure_ascii=False)) result = cursor.execute(query, params).fetchone() if result[0] == 1: - # print("Book was deleted, updating bookdata") + # log.debug("Book was deleted, updating bookdata") query = "UPDATE media SET deleted=0 WHERE app_id=? AND prof_id=? AND bookdata=?" - params = (app_id, prof_id, dump_pickle(bookdata)) + params = ( + app_id, + prof_id, + json.dumps(asdict(bookdata), ensure_ascii=False), + ) cursor.execute(query, params) conn.commit() return @@ -234,11 +250,11 @@ class Database: query = ( "INSERT INTO media (bookdata, app_id, prof_id,deleted) VALUES (?, ?, ?,?)" ) - converted = dump_pickle(bookdata) + converted = json.dumps(asdict(bookdata), ensure_ascii=False) params = (converted, app_id, prof_id, 0) cursor.execute(query, params) logMessage = f"Added book with signature {bookdata.signature} to database, data: {converted}" - logger.info(logMessage) + log.info(logMessage) conn.commit() self.close_connection(conn) @@ -260,7 +276,7 @@ class Database: "SELECT bookdata, id FROM media WHERE app_id=? AND prof_id=?", (app_id, prof_id), ) - books = [(load_pickle(i[0]), i[1]) for i in result] + books = [(BookData().from_string(i[0]), i[1]) for i in result] book = [i for i in books if i[0].signature == signature][0][1] return book @@ -281,7 +297,7 @@ class Database: result = self.query_db( "SELECT bookdata FROM media WHERE app_id=? AND prof_id=?", (app_id, prof_id) ) - books: list[BookData] = [load_pickle(i[0]) for i in result] + books: list[BookData] = [BookData().from_string(i[0]) for i in result] book = [i for i in books if i.signature == signature][0] return book @@ -307,7 +323,7 @@ class Database: list[tuple[BookData, int]]: A list of tuples containing the wrapped Metadata and the id of the book """ rdata = self.query_db("SELECT * FROM media WHERE deleted=0") - # logger.debug(rdata, len(rdata)) + # log.debug(rdata, len(rdata)) mode = 0 if len(data) == 1: if "signature" in data.keys(): @@ -320,7 +336,7 @@ class Database: return None ret = [] for book in rdata: - bookdata = load_pickle(book[1]) + bookdata = BookData().from_string(book[1]) app_id = book[2] prof_id = book[3] if mode == 1: @@ -335,7 +351,7 @@ class Database: and data["title"] in bookdata.title ): ret.append((bookdata, app_id, prof_id)) - # logger.debug(ret) + # log.debug(ret) return ret def setAvailability(self, book_id: str, available: str): @@ -379,15 +395,15 @@ class Database: Returns: BookData: The metadata of the book wrapped in a BookData object """ - return load_pickle( + return BookData().from_string( self.query_db( "SELECT bookdata FROM media WHERE id=?", (book_id,), one=True )[0] ) def getBooks( - self, app_id: Union[str, int], prof_id: Union[str, int], deleted=0 - ) -> list[dict[int, BookData, int]]: + self, app_id: Union[str, int], prof_id: Union[str, int], deleted: int = 0 + ) -> list[dict[str, Union[BookData, int]]]: """ Get the Books based on the apparat id and the professor id @@ -406,14 +422,14 @@ class Database: if qdata is None: return [] for result_a in qdata: - data = {"id": int, "bookdata": BookData, "available": int} + data: dict[str, Any] = {"id": int, "bookdata": BookData, "available": int} data["id"] = result_a[0] - data["bookdata"] = load_pickle(result_a[1]) + data["bookdata"] = BookData().from_string(result_a[1]) data["available"] = result_a[2] ret_result.append(data) return ret_result - def updateBookdata(self, book_id, bookdata: BookData): + def updateBookdata(self, book_id: int, bookdata: BookData): """ Update the bookdata in the database @@ -422,10 +438,10 @@ class Database: bookdata (BookData): The new metadata of the book """ query = "UPDATE media SET bookdata= ? WHERE id=?" - book = dump_pickle(bookdata) + book = bookdata.to_dict self.query_db(query, (book, book_id)) - def deleteBook(self, book_id): + def deleteBook(self, book_id: int): """ Delete a book from the database @@ -435,7 +451,7 @@ class Database: self.query_db("UPDATE media SET deleted=1 WHERE id=?", (book_id,)) # File Interactions - def getBlob(self, filename, app_id: Union[str, int]): + def getBlob(self, filename: str, app_id: Union[str, int]) -> bytes: """ Get a blob from the database @@ -487,7 +503,7 @@ class Database: str: The filename of the recreated file """ blob = self.getBlob(filename, app_id) - tempdir = self.database.tempdir + tempdir = self.database.temp tempdir = tempdir.replace("~", str(Path.home())) tempdir_path = Path(tempdir) if not os.path.exists(tempdir_path): @@ -496,7 +512,7 @@ class Database: delete=False, dir=tempdir_path, mode="wb", suffix=f".{filetype}" ) file.write(blob) - # print("file created") + # log.debug("file created") return file.name def getFiles(self, app_id: Union[str, int], prof_id: int) -> list[tuple]: @@ -524,7 +540,7 @@ class Database: return [i[0] for i in data] def insertSubjects(self): - # print("Inserting subjects") + # log.debug("Inserting subjects") subjects = [ "Biologie", "Chemie", @@ -640,7 +656,7 @@ class Database: Args: message_id (str): the id of the message """ - logger.debug(f"Deleting message with id {message_id}") + log.debug(f"Deleting message with id {message_id}") self.query_db("DELETE FROM messages WHERE id=?", (message_id,)) # Prof data @@ -693,6 +709,18 @@ class Database: query += " FROM prof WHERE id=?" return self.query_db(query, (prof_id,), one=True)[0] + def getProfById(self, prof_id: Union[str, int]) -> Prof: + """Get a professor based on the id + + Args: + prof_id (Union[str,int]): the id of the professor + + Returns: + Prof: a Prof object containing the data of the professor + """ + data = self.query_db("SELECT * FROM prof WHERE id=?", (prof_id,), one=True) + return Prof().from_tuple(data) + def getProfData(self, profname: str): """Get mail, telephone number and title of a professor based on the name @@ -795,7 +823,7 @@ class Database: ) numbers = [i[0] for i in numbers] numbers.sort() - logger.info(f"Currently used apparat numbers: {numbers}") + log.info(f"Currently used apparat numbers: {numbers}") return numbers def setNewSemesterDate(self, app_id: Union[str, int], newDate, dauerapp=False): @@ -816,7 +844,7 @@ class Database: ) else: self.query_db( - "UPDATE semesterapparat SET verlängerung_bis=?, verlängerung_am=? WHERE appnr=?", + "UPDATE semesterapparat SET verlängerung_bis=?, verlängert_am=? WHERE appnr=?", (newDate, today, app_id), ) @@ -849,26 +877,26 @@ class Database: Returns: Optional[int]: the id of the apparat """ - logger.debug(apparat) + log.debug(apparat) app = apparat.apparat prof = apparat.prof present_prof = self.getProfByName(prof.name()) prof_id = present_prof.id - logger.debug(present_prof) + log.debug(present_prof) app_id = self.getApparatId(app.name) if app_id: return AppPresentError(app_id) if not prof_id: - logger.debug("prof id not present, creating prof with data", prof) + log.debug("prof id not present, creating prof with data", prof) prof_id = self.createProf(prof) - logger.debug(prof_id) + log.debug(prof_id) query = f"INSERT OR IGNORE INTO semesterapparat (appnr, name, erstellsemester, dauer, prof_id, fach,deletion_status,konto) VALUES ('{app.appnr}', '{app.name}', '{app.created_semester}', '{app.eternal}', {prof_id}, '{app.subject}', '{0}', '{SEMAP_MEDIA_ACCOUNTS[app.appnr]}')" - logger.debug(query) + log.debug(query) self.query_db(query) return None - def getApparatsByProf(self, prof_id: Union[str, int]) -> list[tuple]: + def getApparatsByProf(self, prof_id: Union[str, int]) -> list[Apparat]: """Get all apparats based on the professor id Args: @@ -882,7 +910,7 @@ class Database: ) ret = [] for i in data: - print(i) + log.debug(i) ret.append(Apparat().from_tuple(i)) return ret @@ -964,11 +992,15 @@ class Database: app_id (Union[str, int]): the id of the apparat semester (str): the semester the apparat should be deleted from """ - logger.info(f"Deleting apparat with id {app_id} in semester {semester}") + log.info(f"Deleting apparat with id {app_id} in semester {semester}") self.query_db( "UPDATE semesterapparat SET deletion_status=1, deleted_date=? WHERE appnr=?", (semester, app_id), ) + self.query_db( + "UPDATE media SET deleted=1 WHERE app_id=?", + (app_id,), + ) def isEternal(self, id): """check if the apparat is eternal (dauerapparat) @@ -993,11 +1025,14 @@ class Database: Returns: str: the name of the apparat """ - return self.query_db( + result = self.query_db( "SELECT name FROM semesterapparat WHERE appnr=? AND prof_id=?", (app_id, prof_id), one=True, - )[0] + ) + if result: + return result[0] + return None def updateApparat(self, apparat_data: ApparatData): """Update an apparat in the database @@ -1015,7 +1050,7 @@ class Database: apparat_data.apparat.apparat_id_adis, apparat_data.apparat.appnr, ) - logger.debug(f"Updating apparat with query {query} and params {params}") + log.debug(f"Updating apparat with query {query} and params {params}") self.query_db(query, params) def checkApparatExists(self, app_name: str): @@ -1067,7 +1102,7 @@ class Database: Returns: list: the result of the query """ - logger.debug(f"Query: {query}") + log.debug(f"Query: {query}") conn = self.connect() cursor = conn.cursor() result = cursor.execute(query).fetchall() @@ -1080,7 +1115,7 @@ class Database: result_a = tuple(result_a) result[result.index(orig_value)] = result_a self.close_connection(conn) - logger.debug(f"Query result: {result}") + log.debug(f"Query result: {result}") return result if "deletable" in kwargs.keys(): @@ -1095,9 +1130,9 @@ class Database: 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) + # log.debug(key, value) query += f"{key}='{value}' AND " - # print(query) + # log.debug(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( @@ -1113,24 +1148,24 @@ class Database: query = query.replace( f"endsemester='{kwargs['endsemester']}' AND ", "xyz" ) - # print("replaced") + # log.debug("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 - logger.info(f"Query before: {query}") + log.info(f"Query before: {query}") query = query.strip() query = query[:-4] - logger.info(f"Query after: {query}") + log.info(f"Query after: {query}") # check if query ends with lowercase letter or a '. if not, remove last symbol and try again while query[-1] not in ascii_lowercase and query[-1] != "'": query = query[:-1] query = query.strip() - # print(query) + # log.debug(query) res = __query(query) - # print(res) + # log.debug(res) return res # Admin data @@ -1183,7 +1218,7 @@ class Database: "UPDATE user SET password=? WHERE username=?", (new_password, user) ) - def getRole(self, user): + def getRole(self, user: str) -> str: """get the role of the user Args: @@ -1299,15 +1334,15 @@ class Database: """ return self.query_db("SELECT titel, fname,lname,mail,telnr,fullname FROM prof") - def restoreApparat(self, app_id: Union[str, int]): + def restoreApparat(self, app_id: Union[str, int], app_name: str): """restore an apparat from the database Args: app_id (Union[str, int]): the id of the apparat """ return self.query_db( - "UPDATE semesterapparat SET deletion_status=0, deleted_date=NULL WHERE appnr=?", - (app_id,), + "UPDATE semesterapparat SET deletion_status=0, deleted_date=NULL WHERE appnr=? and name=?", + (app_id, app_name), ) # ELSA @@ -1418,8 +1453,8 @@ class Database: blob = self.query_db( "SELECT fileblob FROM elsa_files WHERE filename=?", (filename,), one=True )[0] - # print(blob) - tempdir = self.database.tempdir + # log.debug(blob) + tempdir = self.database.temp tempdir = tempdir.replace("~", str(Path.home())) tempdir_path = Path(tempdir) if not os.path.exists(tempdir_path): @@ -1428,7 +1463,7 @@ class Database: delete=False, dir=tempdir_path, mode="wb", suffix=f".{filetype}" ) file.write(blob) - # print("file created") + # log.debug("file created") return file.name def getElsaApparats(self) -> ELSA: @@ -1437,9 +1472,11 @@ class Database: Returns: list[tuple]: a list of tuples containing the ELSA apparats """ - return self.query_db("SELECT * FROM elsa") + return self.query_db( + "SELECT * FROM elsa ORDER BY substr(date, 7, 4) || '-' || substr(date, 4, 2) || '-' || substr(date, 1, 2)" + ) - def getElsaId(self, prof_id, semester, date): + def getElsaId(self, prof_id: int, semester: str, date: str) -> int: """get the id of an ELSA apparat based on the professor, semester and date Args: @@ -1476,7 +1513,7 @@ class Database: ### def createProf(self, profdata: Prof): - logger.debug(profdata) + log.debug(profdata) conn = self.connect() cursor = conn.cursor() fname = profdata.firstname @@ -1487,7 +1524,7 @@ class Database: title = profdata.title query = f"INSERT INTO prof (fname, lname, fullname, mail, telnr,titel) VALUES ('{fname}','{lname}','{fullname}','{mail}','{telnr}','{title}')" - logger.debug(query) + log.debug(query) cursor.execute(query) conn.commit() @@ -1510,7 +1547,7 @@ class Database: else: return [] - def getProfId(self, profdata: dict | Prof): + def getProfId(self, profdata: dict[str, Any] | Prof): """Get the prof ID based on the profdata Args: @@ -1521,9 +1558,7 @@ class Database: """ conn = self.connect() cursor = conn.cursor() - if isinstance(profdata, Prof): - fullname = profdata.name() - else: + if isinstance(profdata, dict): name = profdata["profname"] if "," in name: fname = name.split(", ")[1].strip() @@ -1531,8 +1566,10 @@ class Database: fullname = f"{lname} {fname}" else: fullname = profdata["profname"] + else: + fullname = profdata.name() query = f"SELECT id FROM prof WHERE fullname = '{fullname}'" - logger.debug(query) + log.debug(query) cursor.execute(query) result = cursor.fetchone() @@ -1550,7 +1587,7 @@ class Database: conn = self.connect() cursor = conn.cursor() query = f"SELECT * FROM prof WHERE fullname = '{fullname}'" - logger.debug(query) + log.debug(query) result = cursor.execute(query).fetchone() if result: @@ -1571,7 +1608,7 @@ class Database: query = f"SELECT prof_id from semesterapparat WHERE appnr = '{apprarat_id}' and deletion_status = 0" data = self.query_db(query) if data: - logger.info("Prof ID: " + str(data[0][0])) + log.info("Prof ID: " + str(data[0][0])) return data[0][0] else: return None @@ -1619,3 +1656,11 @@ class Database: return data[0][0] else: return None + + def fetch_one(self, query: str, args: tuple[Any, ...] = ()) -> tuple[Any, ...]: + connection = self.connect() + cursor = connection.cursor() + cursor.execute(query, args) + result = cursor.fetchone() + connection.close() + return result \ No newline at end of file diff --git a/src/backend/db.py b/src/backend/db.py index 16cb35c..0ee03fb 100644 --- a/src/backend/db.py +++ b/src/backend/db.py @@ -12,12 +12,12 @@ CREATE_TABLE_APPARAT = """CREATE TABLE semesterapparat ( deleted_date TEXT, apparat_id_adis INTEGER, prof_id_adis INTEGER, - konto INTEGER REFERENCES app_kontos (id), + konto INTEGER, FOREIGN KEY (prof_id) REFERENCES prof (id) )""" CREATE_TABLE_MEDIA = """CREATE TABLE media ( id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - bookdata BLOB, + bookdata TEXT, app_id INTEGER, prof_id INTEGER, deleted INTEGER DEFAULT (0), @@ -26,13 +26,7 @@ CREATE_TABLE_MEDIA = """CREATE TABLE media ( FOREIGN KEY (prof_id) REFERENCES prof (id), FOREIGN KEY (app_id) REFERENCES semesterapparat (id) )""" -CREATE_TABLE_APPKONTOS = """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) - )""" + CREATE_TABLE_FILES = """CREATE TABLE files ( id INTEGER PRIMARY KEY, filename TEXT, diff --git a/src/backend/semester.py b/src/backend/semester.py index 7fcee86..d2fb51e 100644 --- a/src/backend/semester.py +++ b/src/backend/semester.py @@ -1,16 +1,27 @@ import datetime -from src import logger + from dataclasses import dataclass +import loguru +import sys + +log = loguru.logger +log.remove() +log.add(sys.stdout) +log.add("logs/application.log", rotation="1 MB", retention="10 days") + @dataclass class Semester: - logger.debug("Semester class loaded") + log.debug("Semester class loaded") _year: int | None = str(datetime.datetime.now().year)[2:] _semester: str | None = None _month: int | None = datetime.datetime.now().month value: str = None + log.debug( + f"Initialized Semester class with values: month: {_month}, semester: {_semester}, year {_year}" + ) def __post_init__(self): if isinstance(self._year, str): @@ -27,23 +38,24 @@ class Semester: return self.value def generateSemester(self): - if self._month < 4 or self._month < 9: + if self._month <= 3 or self._month > 9: self._semester = "WiSe" else: self._semester = "SoSe" - @logger.catch + @log.catch def computeValue(self): # year is only last two digits year = self._year + valueyear = str(year) if self._semester == "WiSe": if self._month < 4: valueyear = str(year - 1) + "/" + str(year) - else: - valueyear = str(year) + else: + valueyear = str(year) + "/" + str(year + 1) self.value = f"{self._semester} {valueyear}" - @logger.catch + @log.catch def offset(self, value: int) -> str: """Generate a new Semester object by offsetting the current semester by a given value @@ -105,10 +117,16 @@ class Semester: return True return False - def from_string(self, val): - self.value = val - self._year = int(val[-2:]) - self._semester = val[:4] + def from_string(self, val: str): + if " " in val: + values = val.split(" ") + if len(values) != 2: + raise ValueError("Invalid semester format") + self._semester = values[0] + if len(values[1]) == 4: + self._year = int(values[1][2:]) + # self._year = int(values[1]) + self.computeValue() return self @property diff --git a/src/backend/thread_bookgrabber.py b/src/backend/thread_bookgrabber.py index 356b305..5d5ab49 100644 --- a/src/backend/thread_bookgrabber.py +++ b/src/backend/thread_bookgrabber.py @@ -1,55 +1,66 @@ -import sqlite3 - from PyQt6.QtCore import QThread from PyQt6.QtCore import pyqtSignal as Signal from src.backend import Database from src.logic.webrequest import BibTextTransformer, WebRequest +import loguru +import sys + +log = loguru.logger +log.remove() +log.add(sys.stdout) +log.add("logs/application.log", rotation="1 MB", retention="10 days") + + +# logger.add(sys.stderr, format="{time} {level} {message}", level="INFO") +log.add(sys.stdout) class BookGrabber(QThread): updateSignal = Signal(int, int) done = Signal() - def __init__(self, appnr): + def __init__(self): super(BookGrabber, self).__init__(parent=None) self.is_Running = True - logger.info("Starting worker thread") - self.data = None + log.info("Starting worker thread") + self.data = [] self.app_id = None self.prof_id = None self.mode = None self.book_id = None self.use_any = False self.use_exact = False - self.appnr = appnr + self.app_id = None self.tstate = (self.app_id, self.prof_id, self.mode, self.data) + self.request = WebRequest() - def add_values(self, app_id, prof_id, mode, data, any_book=False, exact=False): + def add_values( + self, app_id: int, prof_id: int, mode: str, data, any_book=False, exact=False + ): self.app_id = app_id self.prof_id = prof_id self.mode = mode - self.data = data + self.data: list[str] = data self.use_any = any_book self.use_exact = exact - logger.info(f"Working on {len(self.data)} entries") + log.info(f"Working on {len(self.data)} entries") self.tstate = (self.app_id, self.prof_id, self.mode, self.data) - logger.debug("State: " + str(self.tstate)) - # print(self.tstate) + log.debug("State: " + str(self.tstate)) + self.request.set_apparat(self.app_id) + # log.debug(self.tstate) def run(self): self.db = Database() item = 0 iterdata = self.data - # print(iterdata) - if self.prof_id is None: - self.prof_id = self.db.getProfNameByApparat(self.app_id) - for entry in iterdata: - # print(entry) - signature = str(entry) - logger.info("Processing entry: " + signature) + # log.debug(iterdata) - webdata = WebRequest().set_apparat(self.appnr).get_ppn(entry) + for entry in iterdata: + # log.debug(entry) + log.info("Processing entry: {}", entry) + + webdata = self.request.get_ppn(entry) if self.use_any: webdata = webdata.use_any_book webdata = webdata.get_data() @@ -58,12 +69,12 @@ class BookGrabber(QThread): continue bd = BibTextTransformer(self.mode) - print(webdata) + log.debug(webdata) if self.mode == "ARRAY": if self.use_exact: bd = bd.use_signature(entry) bd = bd.get_data(webdata).return_data() - print(bd) + log.debug(bd) if bd is None: # bd = BookData continue @@ -76,25 +87,29 @@ class BookGrabber(QThread): self.db.addBookToDatabase(bd, self.app_id, self.prof_id) # get latest book id self.book_id = self.db.getLastBookId() - logger.info("Added book to database") + log.info("Added book to database") state = 0 for result in transformer.RDS_DATA: - # print(result.RDS_LOCATION) + # log.debug(result.RDS_LOCATION) if str(self.app_id) in result.RDS_LOCATION: state = 1 break - logger.info(f"State of {signature}: {state}") - # print("updating availability of " + str(self.book_id) + " to " + str(state)) + log.info(f"State of {entry}: {state}") + log.debug( + "updating availability of " + str(self.book_id) + " to " + str(state) + ) try: self.db.setAvailability(self.book_id, state) - except sqlite3.OperationalError as e: - logger.error(f"Failed to update availability: {e}") + log.debug("Added book to database") + except Exception as e: + log.error(f"Failed to update availability: {e}") + log.debug("Failed to update availability: " + str(e)) # time.sleep(5) item += 1 self.updateSignal.emit(item, len(self.data)) - logger.info("Worker thread finished") + log.info("Worker thread finished") # self.done.emit() self.quit() @@ -102,87 +117,89 @@ class BookGrabber(QThread): self.is_Running = False -# class BookGrabber(object): -# updateSignal = Signal(int, int) -# done = Signal() +class BookGrabberTest(QThread): + updateSignal = Signal(int, int) + done = Signal() -# def __init__(self, app_id, prof_id, mode, data, parent=None): -# super(BookGrabber, self).__init__(parent=None) -# self.is_Running = True -# logger = MyLogger("Worker") -# logger.info("Starting worker thread") -# self.data = data -# logger.info(f"Working on {len(self.data)} entries") -# self.app_id = app_id -# self.prof_id = prof_id -# self.mode = mode -# self.book_id = None -# self.state = (self.app_id, self.prof_id, self.mode, self.data) -# # print(self.state) -# logger.info("state: " + str(self.state)) -# # time.sleep(2) + def __init__(self, appnr: int): + super(BookGrabberTest, self).__init__(parent=None) + self.is_Running = True + log.info("Starting worker thread") + self.data = None + self.app_id = None + self.prof_id = None + self.mode = None + self.book_id = None + self.use_any = False + self.use_exact = False + self.app_id = appnr + self.tstate = (self.app_id, self.prof_id, self.mode, self.data) + self.results = [] -# def resetValues(self): -# self.app_id = None -# self.prof_id = None -# self.mode = None -# self.data = None -# self.book_id = None + def add_values( + self, app_id: int, prof_id: int, mode: str, data, any_book=False, exact=False + ): + self.app_id = app_id + self.prof_id = prof_id + self.mode = mode + self.data = data + self.use_any = any_book + self.use_exact = exact + log.info(f"Working on {len(self.data)} entries") + self.tstate = (self.app_id, self.prof_id, self.mode, self.data) + log.debug("State: " + str(self.tstate)) + # log.debug(self.tstate) -# def run(self): -# while self.is_Running: -# self.db = Database() -# item = 0 -# iterdata = self.data -# # print(iterdata) -# for entry in iterdata: -# # print(entry) -# signature = str(entry) -# logger.info("Processing entry: " + signature) + def run(self): + item = 0 + iterdata = self.data + # log.debug(iterdata) + for entry in iterdata: + # log.debug(entry) + signature = str(entry) + 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 -# # confirm lock is acquired -# self.db.addBookToDatabase(bd, self.app_id, self.prof_id) -# # get latest book id -# self.book_id = self.db.getLastBookId() -# logger.info("Added book to database") -# state = 0 -# # print(len(rds.items)) -# for rds_item in rds.items: -# sign = rds_item.superlocation -# loc = rds_item.location -# # logger.debug(sign, loc) -# # logger.debug(rds_item) -# if self.app_id in sign or self.app_id in loc: -# state = 1 -# break + webdata = WebRequest().set_apparat(self.app_id).get_ppn(entry) + if self.use_any: + webdata = webdata.use_any_book + webdata = webdata.get_data() -# logger.info(f"State of {signature}: {state}") -# # print( -# "updating availability of " -# + str(self.book_id) -# + " to " -# + str(state) -# ) -# try: -# self.db.setAvailability(self.book_id, state) -# except sqlite3.OperationalError as e: -# logger.error(f"Failed to update availability: {e}") + if webdata == "error": + continue -# # time.sleep(5) -# item += 1 -# self.updateSignal.emit(item, len(self.data)) -# logger.info("Worker thread finished") -# # self.done.emit() -# self.stop() -# if not self.is_Running: -# break + bd = BibTextTransformer(self.mode) + if self.mode == "ARRAY": + if self.use_exact: + bd = bd.use_signature(entry) + bd = bd.get_data(webdata).return_data() + if bd is None: + # bd = BookData + continue + bd.signature = entry + transformer = ( + BibTextTransformer("RDS").get_data(webdata).return_data("rds_data") + ) -# def stop(self): -# self.is_Running = False + # confirm lock is acquired + # get latest book id + log.info("Added book to database") + state = 0 + for result in transformer.RDS_DATA: + # log.debug(result.RDS_LOCATION) + if str(self.app_id) in result.RDS_LOCATION: + state = 1 + break + + log.info(f"State of {signature}: {state}") + # log.debug("updating availability of " + str(self.book_id) + " to " + str(state)) + self.results.append(bd) + + # time.sleep(5) + item += 1 + self.updateSignal.emit(item, len(self.data)) + log.info("Worker thread finished") + # self.done.emit() + self.quit() + + def stop(self): + self.is_Running = False diff --git a/src/backend/threads_autoadder.py b/src/backend/threads_autoadder.py index ab1f31c..2ceec0e 100644 --- a/src/backend/threads_autoadder.py +++ b/src/backend/threads_autoadder.py @@ -5,6 +5,13 @@ from PyQt6.QtCore import QThread from PyQt6.QtCore import pyqtSignal as Signal from src.backend import Database +import loguru +import sys + +log = loguru.logger +log.remove() +log.add(sys.stdout) +log.add("logs/application.log", rotation="1 MB", retention="10 days") # from src.transformers import RDS_AVAIL_DATA @@ -28,7 +35,7 @@ class AutoAdder(QThread): def run(self): self.db = Database() # show the dialog, start the thread to gather data and dynamically update progressbar and listwidget - logger.info("Starting worker thread") + log.info("Starting worker thread") item = 0 for entry in self.data: try: @@ -40,11 +47,11 @@ class AutoAdder(QThread): except Exception as e: # print(e) - logger.exception( + log.exception( f"The query failed with message {e} for signature {entry}" ) continue if item == len(self.data): - logger.info("Worker thread finished") + log.info("Worker thread finished") # teminate thread self.finished.emit() diff --git a/src/backend/threads_availchecker.py b/src/backend/threads_availchecker.py index bc981e9..5aebb4f 100644 --- a/src/backend/threads_availchecker.py +++ b/src/backend/threads_availchecker.py @@ -9,6 +9,14 @@ from src.backend.database import Database from src.logic.webrequest import BibTextTransformer, WebRequest # from src.transformers import RDS_AVAIL_DATA +import loguru +import sys + +log = loguru.logger +log.remove() +log.add(sys.stdout) +log.add("logs/application.log", rotation="1 MB", retention="10 days") + class AvailChecker(QThread): @@ -21,8 +29,8 @@ class AvailChecker(QThread): if links is None: links = [] super().__init__(parent) - logger.info("Starting worker thread") - logger.info( + log.info("Starting worker thread") + log.info( "Checking availability for " + str(links) + " with appnumber " @@ -32,7 +40,7 @@ class AvailChecker(QThread): self.links = links self.appnumber = appnumber self.books = books - logger.info( + log.info( f"Started worker with appnumber: {self.appnumber} and links: {self.links} and {len(self.books)} books..." ) time.sleep(2) @@ -42,7 +50,7 @@ class AvailChecker(QThread): state = 0 count = 0 for link in self.links: - logger.info("Processing entry: " + str(link)) + log.info("Processing entry: " + str(link)) data = WebRequest().set_apparat(self.appnumber).get_ppn(link).get_data() transformer = BibTextTransformer("RDS") rds = transformer.get_data(data).return_data("rds_availability") @@ -59,14 +67,14 @@ class AvailChecker(QThread): if book["bookdata"].signature == link: book_id = book["id"] break - logger.info(f"State of {link}: " + str(state)) + log.info(f"State of {link}: " + str(state)) # print("Updating availability of " + str(book_id) + " to " + str(state)) self.db.setAvailability(book_id, state) count += 1 self.updateProgress.emit(count, len(self.links)) self.updateSignal.emit(item.callnumber, state) - logger.info("Worker thread finished") + log.info("Worker thread finished") # teminate thread self.quit() diff --git a/src/logic/__init__.py b/src/logic/__init__.py index f139252..dc21d7a 100644 --- a/src/logic/__init__.py +++ b/src/logic/__init__.py @@ -2,5 +2,5 @@ from .dataclass import ApparatData, BookData, Prof, Apparat, ELSA from .c_sort import custom_sort, sort_semesters_list from .constants import APP_NRS, PROF_TITLES, SEMAP_MEDIA_ACCOUNTS from .csvparser import csv_to_list -from .wordparser import elsa_word_to_csv, word_docx_to_csv +from .wordparser import elsa_word_to_csv, word_docx_to_csv, word_to_semap, SemapDocument from .zotero import ZoteroController diff --git a/src/logic/dataclass.py b/src/logic/dataclass.py index a5a26d1..a807f87 100644 --- a/src/logic/dataclass.py +++ b/src/logic/dataclass.py @@ -1,8 +1,8 @@ -import re + from dataclasses import dataclass, field from enum import Enum - +import json @dataclass class Prof: @@ -77,23 +77,19 @@ class BookData: for key, value in data.items(): setattr(self, key, value) + @property def to_dict(self): - return self.__dict__ + """Convert the dataclass to a dictionary.""" + return json.dumps(self.__dict__, ensure_ascii=False) 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 + data = json.loads(data) + + return BookData(**data) @dataclass diff --git a/src/logic/log.py b/src/logic/log.py deleted file mode 100644 index 021c265..0000000 --- a/src/logic/log.py +++ /dev/null @@ -1,92 +0,0 @@ -import logging -import logging.handlers -import os - -from loguru import logger as log -import sys - - -if not os.path.exists("logs"): - os.mkdir("logs") - # open and close the file to create it -logger = log -logger.remove() -logger.add("logs/application.log", rotation="50MB") -# logger.add(sys.stderr, format="{time} {level} {message}", level="INFO") -logger.add( - sys.stdout, - colorize=True, - format="{time} {message}", - level="WARNING", -) - - -log_filesize = 10 * 1024**2 # 10MB -backups = 5 -# Create a common file handler for all loggers -common_file_handler = logging.handlers.RotatingFileHandler( - "logs/application.log", - mode="a", - encoding="utf-8", - maxBytes=log_filesize, - backupCount=backups, -) - -common_file_handler.setLevel(logging.DEBUG) -formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s") -common_file_handler.setFormatter(formatter) - - -# set max file size to 10MB, if exceeded, create a new file - - -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: - logger1.log_exception("An exception occurred in Logger1") - logger2.log_exception("An exception occurred in Logger2") diff --git a/src/logic/webrequest.py b/src/logic/webrequest.py index 4a90e71..5626ccf 100644 --- a/src/logic/webrequest.py +++ b/src/logic/webrequest.py @@ -1,13 +1,23 @@ import requests from bs4 import BeautifulSoup -from src import logger + # import sleep_and_retry decorator to retry requests from ratelimit import limits, sleep_and_retry - +from typing import Union, Any, Optional from src.logic.dataclass import BookData from src.transformers import ARRAYData, BibTeXData, COinSData, RDSData, RISData +from src.transformers.transformers import RDS_AVAIL_DATA, RDS_GENERIC_DATA +import loguru +import sys +log = loguru.logger +log.remove() +log.add(sys.stdout) +log.add("logs/application.log", rotation="1 MB", retention="10 days") + +# logger.add(sys.stderr, format="{time} {level} {message}", level="INFO") + API_URL = "https://rds.ibs-bw.de/phfreiburg/opac/RDSIndexrecord/{}/" @@ -38,23 +48,23 @@ class WebRequest: self.ppn = None self.data = None self.timeout = 5 - logger.info("Initialized WebRequest") + log.info("Initialized WebRequest") @property def use_any_book(self): """use any book that matches the search term""" self.use_any = True - logger.info("Using any book") + log.info("Using any book") return self - def set_apparat(self, apparat): + def set_apparat(self, apparat: int): self.apparat = apparat if int(self.apparat) < 10: self.apparat = f"0{self.apparat}" - logger.info(f"Set apparat to {self.apparat}") + log.info(f"Set apparat to {self.apparat}") return self - def get_ppn(self, signature): + def get_ppn(self, signature: str): self.signature = signature if "+" in signature: signature = signature.replace("+", "%2B") @@ -65,15 +75,15 @@ class WebRequest: @sleep_and_retry @limits(calls=RATE_LIMIT, period=RATE_PERIOD) - def search_book(self, searchterm: str): + def search_book(self, searchterm: str) -> str: response = requests.get(PPN_URL.format(searchterm), timeout=self.timeout) return response.text - def get_book_links(self, searchterm: str): - response = self.search_book(searchterm) + def get_book_links(self, searchterm: str) -> list[str]: + response: str = self.search_book(searchterm) # type:ignore soup = BeautifulSoup(response, "html.parser") links = soup.find_all("a", class_="title getFull") - res = [] + res: list[str] = [] for link in links: res.append(BASE + link["href"]) return res @@ -85,13 +95,15 @@ class WebRequest: response = requests.get(link, timeout=self.timeout) return response.text except requests.exceptions.RequestException as e: - logger.error(f"Request failed: {e}") + log.error(f"Request failed: {e}") return None - def get_data(self): + def get_data(self) -> Union[list[str], None]: links = self.get_book_links(self.ppn) + log.debug(f"Links: {links}") + return_data: list[str] = [] for link in links: - result = self.search(link) + result: str = self.search(link) # type:ignore # in result search for class col-xs-12 rds-dl RDS_LOCATION # if found, return text of href soup = BeautifulSoup(result, "html.parser") @@ -101,18 +113,18 @@ class WebRequest: item_location = location.find( "div", class_="col-xs-12 col-md-7 col-lg-8 rds-dl-panel" ).text.strip() + log.debug(f"Item location: {item_location}") if self.use_any: pre_tag = soup.find_all("pre") - return_data = [] if pre_tag: for tag in pre_tag: data = tag.text.strip() return_data.append(data) return return_data else: - logger.error("No
 tag found")
+                            log.error("No 
 tag found")
                             raise ValueError("No 
 tag found")
-                    if f"Semesterapparat-{self.apparat}" in item_location:
+                    elif f"Semesterapparat-{self.apparat}" in item_location:
                         pre_tag = soup.find_all("pre")
                         return_data = []
                         if pre_tag:
@@ -121,8 +133,15 @@ class WebRequest:
                                 return_data.append(data)
                             return return_data
                         else:
-                            logger.error("No 
 tag found")
+                            log.error("No 
 tag found")
                             return return_data
+                    else:
+                        log.error(
+                            f"Signature {self.signature} not found in {item_location}"
+                        )
+                        # return_data = []
+
+        return return_data
 
     def get_data_elsa(self):
         links = self.get_book_links(self.ppn)
@@ -142,7 +161,7 @@ class WebRequest:
                             return_data.append(data)
                         return return_data
                     else:
-                        logger.error("No 
 tag found")
+                        log.error("No 
 tag found")
                         return return_data
 
 
@@ -160,7 +179,7 @@ class BibTextTransformer:
         self.field = None
         self.signature = None
         if mode not in self.valid_modes:
-            logger.error(f"Mode {mode} not valid")
+            log.error(f"Mode {mode} not valid")
             raise ValueError(f"Mode {mode} not valid")
         self.data = None
         # self.bookdata = BookData(**self.data)
@@ -170,7 +189,7 @@ class BibTextTransformer:
         self.signature = signature
         return self
 
-    def get_data(self, data: list):
+    def get_data(self, data: Union[list[str]] = None) -> "BibTextTransformer":
         RIS_IDENT = "TY  -"
         ARRAY_IDENT = "[kid]"
         COinS_IDENT = "ctx_ver"
@@ -203,7 +222,15 @@ class BibTextTransformer:
                     self.data = line
         return self
 
-    def return_data(self, option=None) -> BookData:
+    def return_data(
+        self, option: Any = None
+    ) -> Union[
+        Optional[BookData],
+        Optional[RDS_GENERIC_DATA],
+        Optional[RDS_AVAIL_DATA],
+        None,
+        dict[str, Union[RDS_AVAIL_DATA, RDS_GENERIC_DATA]],
+    ]:
         """Return Data to caller.
 
         Args:
@@ -225,7 +252,7 @@ class BibTextTransformer:
                 return RISData().transform(self.data)
             case "RDS":
                 return RDSData().transform(self.data).return_data(option)
-            case None:
+            case _:
                 return None
 
         # if self.mode == "ARRAY":
@@ -242,7 +269,7 @@ class BibTextTransformer:
 
 def cover(isbn):
     test_url = f"https://www.buchhandel.de/cover/{isbn}/{isbn}-cover-m.jpg"
-    # print(test_url)
+    # log.debug(test_url)
     data = requests.get(test_url, stream=True)
     return data.content
 
@@ -252,8 +279,8 @@ def get_content(soup, css_class):
 
 
 if __name__ == "__main__":
-    # print("main")
+    # log.debug("main")
     link = "CU 8500 K64"
     data = WebRequest(71).get_ppn(link).get_data()
     bib = BibTextTransformer("ARRAY").get_data().return_data()
-    print(bib)
+    log.debug(bib)
diff --git a/src/logic/wordparser.py b/src/logic/wordparser.py
index d160ccf..c0ad35a 100644
--- a/src/logic/wordparser.py
+++ b/src/logic/wordparser.py
@@ -1,13 +1,106 @@
 import pandas as pd
 from docx import Document
+from dataclasses import dataclass
+from src.backend import Semester
+from typing import Union, Any
+
+import loguru
+import sys
+
+log = loguru.logger
+log.remove()
+log.add(sys.stdout)
+log.add("logs/application.log", rotation="1 MB", retention="10 days")
+
+
 
 letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
 
 
-def word_docx_to_csv(path) -> pd.DataFrame:
+@dataclass
+class Book:
+    author: str = None
+    year: str = None
+    edition: str = None
+    title: str = None
+    location: str = None
+    publisher: str = None
+    signature: str = None
+    internal_notes: str = None
+
+    @property
+    def has_signature(self) -> bool:
+        return self.signature is not None and self.signature != ""
+
+    @property
+    def is_empty(self) -> bool:
+        return all(
+            [
+                self.author == "",
+                self.year == "",
+                self.edition == "",
+                self.title == "",
+                self.location == "",
+                self.publisher == "",
+                self.signature == "",
+                self.internal_notes == "",
+            ]
+        )
+
+    def from_dict(self, data: dict[str, Any]):
+        for key, value in data.items():
+            value = value.strip()
+            if value == "\u2002\u2002\u2002\u2002\u2002":
+                value = ""
+
+            if key == "Autorenname(n):Nachname, Vorname":
+                self.author = value
+            elif key == "Jahr/Auflage":
+                self.year = value.split("/")[0] if "/" in value else value
+                self.edition = value.split("/")[1] if "/" in value else ""
+            elif key == "Titel":
+                self.title = value
+            elif key == "Ort und Verlag":
+                self.location = value.split(",")[0] if "," in value else value
+                self.publisher = value.split(",")[1] if "," in value else ""
+            elif key == "Standnummer":
+                self.signature = value.strip()
+            elif key == "Interne Vermerke":
+                self.internal_notes = value
+
+
+@dataclass
+class SemapDocument:
+    subject: str = None
+    phoneNumber: int = None
+    mail: str = None
+    title: str = None
+    semester: Union[str, Semester] = None
+    books: list[Book] = None
+    eternal: bool = False
+    personName: str = None
+    personTitle: str = None
+
+    @property
+    def renameSemester(self) -> None:
+        if ", Dauer" in self.semester:
+            self.semester = self.semester.split(",")[0]
+            self.eternal = True
+            self.semester = Semester().from_string(self.semester)
+        else:
+            logger.warning("Semester {} is not valid", self.semester)
+            self.semester = None
+
+    @property
+    def signatures(self) -> list[str]:
+        if self.books is not None:
+            return [book.signature for book in self.books if book.has_signature]
+        return []
+
+
+def word_docx_to_csv(path: str) -> list[pd.DataFrame]:
     doc = Document(path)
     tables = doc.tables
-
     m_data = []
     for table in tables:
         data = []
@@ -24,8 +117,9 @@ def word_docx_to_csv(path) -> pd.DataFrame:
 
         m_data.append(df)
 
-    df = m_data[2]
-    return df
+    # for df[0, 1]: merge i and i+1 as key, value
+
+    return m_data
 
 
 def makeDict():
@@ -87,7 +181,7 @@ def tuple_to_dict(tlist: tuple, type: str) -> dict:
     return ret
 
 
-def elsa_word_to_csv(path):
+def elsa_word_to_csv(path: str):
     doc = Document(path)
     # # print all lines in doc
     doctype = [para.text for para in doc.paragraphs if para.text != ""][-1]
@@ -98,18 +192,18 @@ def elsa_word_to_csv(path):
     }
     tables = doc.tables
 
-    m_data = []
+    m_data: list[pd.DataFrame] = []
     for table in tables:
-        data = []
+        data: list[list[str]] = []
         for row in table.rows:
-            row_data = []
+            row_data: list[str] = []
             for cell in row.cells:
                 text = cell.text
                 text = text.replace("\n", "")
                 text = text.replace("\u2002", "")
                 row_data.append(text)
             data.append(row_data)
-            df = pd.DataFrame(data)
+        df = pd.DataFrame(data)
         df.columns = df.iloc[0]
         df = df.iloc[1:]
         m_data.append(df)
@@ -118,10 +212,54 @@ def elsa_word_to_csv(path):
     data = [
         row for row in df.itertuples(index=False, name=None) if row != tuples[doctype]
     ]
-    # print(data)
+    # log.debug(data)
     return tuple_to_dict(data, doctype), doctype
 
 
+def word_to_semap(word_path: str) -> SemapDocument:
+    log.info("Parsing Word Document {}", word_path)
+    semap = SemapDocument()
+    df = word_docx_to_csv(word_path)
+    apparatdata = df[0]
+    apparatdata = apparatdata.to_dict()
+
+    keys = list(apparatdata.keys())
+
+    appdata = {keys[i]: keys[i + 1] for i in range(0, len(keys), 2)}
+    semap.phoneNumber = appdata["Telefon:"]
+    semap.subject = appdata["Ihr Fach:"]
+    semap.mail = appdata["Mailadresse:"]
+    semap.personName = ",".join(appdata["Ihr Name und Titel:"].split(",")[:-1])
+    semap.personTitle = ",".join(appdata["Ihr Name und Titel:"].split(",")[-1:]).strip()
+    apparatdata = df[1]
+    apparatdata = apparatdata.to_dict()
+    keys = list(apparatdata.keys())
+    appdata = {keys[i]: keys[i + 1] for i in range(0, len(keys), 2)}
+    semap.title = appdata["Veranstaltung:"]
+    semap.semester = appdata["Semester:"]
+    semap.renameSemester
+    books = df[2]
+    booklist = []
+    for i in range(len(books)):
+        if books.iloc[i].isnull().all():
+            continue
+        data = books.iloc[i].to_dict()
+        book = Book()
+        book.from_dict(data)
+        if book.is_empty:
+            continue
+        elif not book.has_signature:
+            continue
+        else:
+            booklist.append(book)
+    log.info("Found {} books", len(booklist))
+    semap.books = booklist
+
+    return semap
+
+
 if __name__ == "__main__":
-    else_df = elsa_word_to_csv("C:/Users/aky547/Desktop/Antrag ELSA Schweitzer.docx")
-    # print(else_df)
+    else_df = elsa_word_to_csv(
+        "C:/Users/aky547/Desktop/ELSA_Bestellung Scann Der Westen und der Rest.docx"
+    )
+    print(else_df)
diff --git a/src/transformers/transformers.py b/src/transformers/transformers.py
index 5f8aa48..98d5758 100644
--- a/src/transformers/transformers.py
+++ b/src/transformers/transformers.py
@@ -7,8 +7,14 @@ from dataclasses import field as dataclass_field
 from typing import Any, List
 
 
-
 from src.logic.dataclass import BookData
+import loguru
+import sys
+
+log = loguru.logger
+log.remove()
+log.add(sys.stdout)
+log.add("logs/application.log", rotation="1 MB", retention="10 days")
 
 
 ###Pydatnic models
@@ -131,8 +137,8 @@ class ARRAYData:
                 return data
 
             except Exception:
-                # # print(f"ARRAYData.transform failed, {source}, {search}")
-                logger.exception(f"ARRAYData.transform failed, no string {search}")
+                # # log.debug(f"ARRAYData.transform failed, {source}, {search}")
+                log.exception(f"ARRAYData.transform failed, no string {search}")
                 return ""
 
         def _get_list_entry(source: str, search: str, entry: str) -> str:
@@ -509,4 +515,4 @@ if __name__ == "__main__":
 
     ret = RDSData().transform(data)
     data = ret.return_data("rds_availability")
-    # print(data)
+    # log.debug(data)
diff --git a/src/ui/Ui_switchtest.py b/src/ui/Ui_switchtest.py
deleted file mode 100644
index 91b035a..0000000
--- a/src/ui/Ui_switchtest.py
+++ /dev/null
@@ -1,52 +0,0 @@
-# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\switchtest.ui'
-#
-# Created by: PyQt6 UI code generator 6.6.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.setWindowModality(QtCore.Qt.WindowModality.WindowModal)
-        MainWindow.resize(800, 600)
-        self.centralwidget = QtWidgets.QWidget(parent=MainWindow)
-        self.centralwidget.setObjectName("centralwidget")
-        self.verticalLayout = QtWidgets.QVBoxLayout(self.centralwidget)
-        self.verticalLayout.setObjectName("verticalLayout")
-        self.select_action_box = QtWidgets.QComboBox(parent=self.centralwidget)
-        self.select_action_box.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus)
-        self.select_action_box.setObjectName("select_action_box")
-        self.select_action_box.addItem("")
-        self.select_action_box.addItem("")
-        self.select_action_box.addItem("")
-        self.select_action_box.addItem("")
-        self.verticalLayout.addWidget(self.select_action_box)
-        self.localwidget = QtWidgets.QWidget(parent=self.centralwidget)
-        self.localwidget.setObjectName("localwidget")
-        self.verticalLayout.addWidget(self.localwidget)
-        MainWindow.setCentralWidget(self.centralwidget)
-        self.menubar = QtWidgets.QMenuBar(parent=MainWindow)
-        self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 22))
-        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"))
-        self.select_action_box.setItemText(
-            0, _translate("MainWindow", "Aktion auswählen")
-        )
-        self.select_action_box.setItemText(1, _translate("MainWindow", "edit_prof"))
-        self.select_action_box.setItemText(2, _translate("MainWindow", "add_user"))
-        self.select_action_box.setItemText(3, _translate("MainWindow", "edit_user"))
diff --git a/src/ui/__init__.py b/src/ui/__init__.py
index 620967d..0867516 100644
--- a/src/ui/__init__.py
+++ b/src/ui/__init__.py
@@ -1,6 +1,6 @@
 import pathlib
 
-from .Ui_semesterapparat_ui import Ui_MainWindow as Ui_Semesterapparat
+from .semesterapparat_ui_ui import Ui_MainWindow as Ui_Semesterapparat
 
 # from .dialogs import (
 #     ApparatExtendDialog,
diff --git a/src/ui/dialogs/Ui_edit_bookdata.py b/src/ui/dialogs/Ui_edit_bookdata.py
new file mode 100644
index 0000000..728cd17
--- /dev/null
+++ b/src/ui/dialogs/Ui_edit_bookdata.py
@@ -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(),
+        )
diff --git a/src/ui/dialogs/Ui_fileparser.py b/src/ui/dialogs/Ui_fileparser.py
new file mode 100644
index 0000000..05459bd
--- /dev/null
+++ b/src/ui/dialogs/Ui_fileparser.py
@@ -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()
diff --git a/src/ui/dialogs/Ui_login.py b/src/ui/dialogs/Ui_login.py
new file mode 100644
index 0000000..3e570af
--- /dev/null
+++ b/src/ui/dialogs/Ui_login.py
@@ -0,0 +1,112 @@
+# 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.getUsers()) == 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()
+        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())
diff --git a/src/ui/dialogs/Ui_mail_preview.py b/src/ui/dialogs/Ui_mail_preview.py
new file mode 100644
index 0000000..4b95e50
--- /dev/null
+++ b/src/ui/dialogs/Ui_mail_preview.py
@@ -0,0 +1,183 @@
+# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\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
+import subprocess
+import tempfile
+import os
+import re
+from omegaconf import OmegaConf
+
+config = OmegaConf.load("config.yaml")
+
+class Ui_eMailPreview(object):
+
+    def setupUi(
+        self,
+        eMailPreview,
+        app_id="",
+        app_name="",
+        app_subject="",
+        prof_name="",
+        data=None,
+    ):
+        eMailPreview.setObjectName("eMailPreview")
+        eMailPreview.resize(676, 676)
+        self.buttonBox = QtWidgets.QDialogButtonBox(eMailPreview)
+        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(eMailPreview)
+        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.label_5 = QtWidgets.QLabel(self.gridLayoutWidget)
+        self.label_5.setObjectName("label_5")
+        self.gridLayout.addWidget(self.label_5, 0, 0, 1, 1)
+        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, 5, 0, 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.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.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.mail_body = QtWidgets.QTextEdit(self.gridLayoutWidget)
+        self.mail_body.setObjectName("mail_body")
+        self.gridLayout.addWidget(self.mail_body, 5, 2, 1, 1)
+        self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
+        self.horizontalLayout_3.setObjectName("horizontalLayout_3")
+        self.gender_male = QtWidgets.QRadioButton(self.gridLayoutWidget)
+        self.gender_male.setObjectName("gender_male")
+        self.horizontalLayout_3.addWidget(self.gender_male)
+        self.gender_female = QtWidgets.QRadioButton(self.gridLayoutWidget)
+        self.gender_female.setObjectName("gender_female")
+        self.horizontalLayout_3.addWidget(self.gender_female)
+        self.gender_non = QtWidgets.QRadioButton(self.gridLayoutWidget)
+        self.gender_non.setObjectName("gender_non")
+        self.horizontalLayout_3.addWidget(self.gender_non)
+        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
+        self.horizontalLayout_3.addItem(spacerItem)
+        self.gridLayout.addLayout(self.horizontalLayout_3, 4, 2, 1, 1)
+        self.label_6 = QtWidgets.QLabel(self.gridLayoutWidget)
+        self.label_6.setObjectName("label_6")
+        self.gridLayout.addWidget(self.label_6, 4, 0, 1, 1)
+
+        self.retranslateUi(eMailPreview)
+        self.buttonBox.accepted.connect(eMailPreview.accept) # type: ignore
+        self.buttonBox.rejected.connect(eMailPreview.reject) # type: ignore
+        QtCore.QMetaObject.connectSlotsByName(eMailPreview)
+        self._appid = app_id
+        self._appname = app_name
+        self._subject = app_subject
+        self.prof_name.setText(prof_name)
+        self._mail_data = ""
+        self._data = data
+        self.load_mail_templates()
+        self.comboBox.addItem("")
+        self.comboBox.setCurrentText("")
+        self.buttonBox.accepted.connect(self.save_mail)
+        self.comboBox.currentIndexChanged.connect(self.set_mail)
+        self.gender_female.clicked.connect(self.set_mail)
+        self.gender_male.clicked.connect(self.set_mail)
+        self.gender_non.clicked.connect(self.set_mail)
+
+    def retranslateUi(self, eMailPreview):
+        _translate = QtCore.QCoreApplication.translate
+        eMailPreview.setWindowTitle(_translate("eMailPreview", "Dialog"))
+        self.label_5.setText(_translate("eMailPreview", "Art"))
+        self.label_3.setText(_translate("eMailPreview", "Mail"))
+        self.label_2.setText(_translate("eMailPreview", "Prof"))
+        self.label_4.setText(_translate("eMailPreview", "Betreff"))
+        self.label.setText(_translate("eMailPreview", "eMail"))
+        self.gender_male.setText(_translate("eMailPreview", "M"))
+        self.gender_female.setText(_translate("eMailPreview", "W"))
+        self.gender_non.setText(_translate("eMailPreview", "Divers"))
+        self.label_6.setText(_translate("eMailPreview", "Geschlecht"))
+
+    def get_greeting(self):
+        if self.gender_male.isChecked():
+            return "Sehr geehrter Herr"
+        elif self.gender_female.isChecked():
+            return "Sehr geehrte Frau"
+        elif self.gender_non.isChecked():
+            return "Guten Tag"
+            
+
+    def set_mail(self):
+        email_template = self.comboBox.currentText()
+        if email_template == "":
+            return
+        with open(f"mail_vorlagen/{email_template}", "r", encoding="utf-8") as f:
+            mail_template = f.read()
+        header = re.findall(r"Subject: (.*)", mail_template)
+        if header:
+            email_header = header[0]
+        else:
+            email_header = email_template.split(".eml")[0]
+        self.mail_header.setText(email_header)
+        self.mail_data = mail_template.split("")[0]
+        mail_html = mail_template.split("")[1]
+        mail_html = "" + mail_html
+        mail_html = mail_html.format(
+            Profname=self.prof_name.text().split(" ")[1], Appname=self._appname, AppNr=self._appid, AppSubject = self._subject,greeting = self.get_greeting()
+        )
+
+        self.mail_body.setHtml(mail_html)
+    def load_mail_templates(self):
+        mail_templates = os.listdir("mail_vorlagen")
+        mail_templates = [f for f in mail_templates if f.endswith(".eml")]
+        print(mail_templates)
+        self.comboBox.addItems(mail_templates)
+
+    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}")
+        directory = config["database"]["tempdir"]
+        directory = directory.replace("~", str(os.path.expanduser("~")))
+        with tempfile.NamedTemporaryFile(
+            mode="w", delete=False, suffix=".eml", encoding="utf-8", dir=directory
+        ) as f:
+            f.write(mail)
+            self.mail_path = f.name
+        print(self.mail_path)
+        # open the file using thunderbird
+        subprocess.Popen([f"{self.mail_path}"])
+        # delete the file
+        # os.remove(self.mail_path)
+
+def launch():
+    app = QtWidgets.QApplication([])
+    eMailPreview = QtWidgets.QDialog()
+    ui = Ui_eMailPreview()
+    ui.setupUi(eMailPreview, "1","Test","Biologie","Kirchner, Alexander")
+    eMailPreview.show()
+    app.exec()
\ No newline at end of file
diff --git a/src/ui/dialogs/Ui_medianadder.py b/src/ui/dialogs/Ui_medianadder.py
new file mode 100644
index 0000000..3578bab
--- /dev/null
+++ b/src/ui/dialogs/Ui_medianadder.py
@@ -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()))
diff --git a/src/ui/dialogs/Ui_medianadder.ts b/src/ui/dialogs/Ui_medianadder.ts
new file mode 100644
index 0000000..6401616
--- /dev/null
+++ b/src/ui/dialogs/Ui_medianadder.ts
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/src/ui/dialogs/new_subject_ui.py b/src/ui/dialogs/Ui_new_subject.py
similarity index 62%
rename from src/ui/dialogs/new_subject_ui.py
rename to src/ui/dialogs/Ui_new_subject.py
index 8b6a757..213eb1c 100644
--- a/src/ui/dialogs/new_subject_ui.py
+++ b/src/ui/dialogs/Ui_new_subject.py
@@ -1,6 +1,6 @@
-# Form implementation generated from reading ui file '/home/alexander/GitHub/Semesterapparate/ui/dialogs/new_subject.ui'
+# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\Semesterapparate\ui\dialogs\new_subject.ui'
 #
-# Created by: PyQt6 UI code generator 6.5.3
+# 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.
@@ -17,56 +17,47 @@ class Ui_Dialog(object):
         self.verticalLayout_2.setObjectName("verticalLayout_2")
         self.verticalLayout = QtWidgets.QVBoxLayout()
         self.verticalLayout.setObjectName("verticalLayout")
-        self.label = QtWidgets.QLabel(parent=Dialog)
+        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,
-        )
+        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 = 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(parent=Dialog)
+        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(parent=self.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(parent=self.frame)
+        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(parent=Dialog)
+        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.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
+        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.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()
\ No newline at end of file
diff --git a/src/ui/dialogs/Ui_parsed_titles.py b/src/ui/dialogs/Ui_parsed_titles.py
new file mode 100644
index 0000000..786c176
--- /dev/null
+++ b/src/ui/dialogs/Ui_parsed_titles.py
@@ -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 src.logic.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)
diff --git a/src/ui/dialogs/Ui_reminder.py b/src/ui/dialogs/Ui_reminder.py
new file mode 100644
index 0000000..f4dbc8f
--- /dev/null
+++ b/src/ui/dialogs/Ui_reminder.py
@@ -0,0 +1,52 @@
+# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\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, QtGui, QtWidgets
+
+
+class Ui_Dialog(object):
+    def setupUi(self, Erinnerung):
+        Erinnerung.setObjectName("Erinnerung")
+        Erinnerung.resize(369, 308)
+        self.buttonBox = QtWidgets.QDialogButtonBox(Erinnerung)
+        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(Erinnerung)
+        self.message_box.setGeometry(QtCore.QRect(10, 60, 341, 201))
+        self.message_box.setObjectName("message_box")
+        self.label = QtWidgets.QLabel(Erinnerung)
+        self.label.setGeometry(QtCore.QRect(10, 30, 61, 21))
+        self.label.setObjectName("label")
+        self.label_2 = QtWidgets.QLabel(Erinnerung)
+        self.label_2.setGeometry(QtCore.QRect(150, 30, 81, 21))
+        self.label_2.setObjectName("label_2")
+        self.dateEdit = QtWidgets.QDateEdit(Erinnerung)
+        self.dateEdit.setGeometry(QtCore.QRect(240, 30, 110, 22))
+        self.dateEdit.setObjectName("dateEdit")
+        self.dateEdit.setDate(QtCore.QDate.currentDate())
+        self.retranslateUi(Erinnerung)
+        self.buttonBox.accepted.connect(Erinnerung.accept)  # type: ignore
+        self.buttonBox.rejected.connect(Erinnerung.reject)  # type: ignore
+        QtCore.QMetaObject.connectSlotsByName(Erinnerung)
+
+    def retranslateUi(self, Erinnerung):
+        _translate = QtCore.QCoreApplication.translate
+        Erinnerung.setWindowTitle(_translate("Erinnerung", "Dialog"))
+        self.label.setText(_translate("Erinnerung", "Nachricht:"))
+        self.label_2.setText(_translate("Erinnerung", "Erinnerung am:"))
+
+    def return_message(self) -> dict:
+        return {
+            "message": self.message_box.toPlainText(),
+            "remind_at": self.dateEdit.date().toString("yyyy-MM-dd"),
+        }
diff --git a/src/ui/dialogs/Ui_settings.py b/src/ui/dialogs/Ui_settings.py
new file mode 100644
index 0000000..bc50dfe
--- /dev/null
+++ b/src/ui/dialogs/Ui_settings.py
@@ -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",
+                '\n'
+                '\n"
+                '

Hier können Einstellungen f�r bestehende Dateiformate geändert, oder neue Dateiformate eingefügt werden

\n' + '


', + ) + ) + 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", + '

Name der Datenbank, welche verwendet werden soll. Muss auf .db enden

', + ) + ) + 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 diff --git a/src/ui/dialogs/Ui_settings.ts b/src/ui/dialogs/Ui_settings.ts new file mode 100644 index 0000000..6401616 --- /dev/null +++ b/src/ui/dialogs/Ui_settings.ts @@ -0,0 +1,4 @@ + + + + diff --git a/src/ui/dialogs/__init__.py b/src/ui/dialogs/__init__.py index e917784..1940b77 100644 --- a/src/ui/dialogs/__init__.py +++ b/src/ui/dialogs/__init__.py @@ -1,30 +1,31 @@ __all__ = [ - "add_bookdata_ui", - "edit_bookdata_ui", - "login_ui", + "BookDataUI", + "LoginDialog", "Mail_Dialog", "MailTemplateDialog", - "medienadder_ui", - "parsed_titles_ui", + "MedienAdder", + "ParsedTitles", "popus_confirm", - "reminder_ui", - "Settings", + "ReminderDialog", "About", "ElsaGenConfirm", "ElsaAddEntry", "ApparatExtendDialog", + "DocumentPrintDialog", + "Settings", ] -from .bookdata import BookDataUI as edit_bookdata_ui -from .login import LoginDialog as login_ui +from .bookdata import BookDataUI +from .login import LoginDialog from .mail import Mail_Dialog from .mailTemplate import MailTemplateDialog -from .medienadder import MedienAdder as medienadder_ui -from .parsed_titles import ParsedTitles as parsed_titles_ui +from .medienadder import MedienAdder +from .parsed_titles import ParsedTitles from .popup_confirm import ConfirmDialog as popus_confirm -from .reminder import ReminderDialog as reminder_ui +from .reminder import ReminderDialog from .about import About from .elsa_gen_confirm import ElsaGenConfirm from .elsa_add_entry import ElsaAddEntry from .app_ext import ApparatExtendDialog +from .docuprint import DocumentPrintDialog from .settings import Settings diff --git a/src/ui/dialogs/confirm_extend_ui.py b/src/ui/dialogs/confirm_extend_ui.py new file mode 100644 index 0000000..5c7a0ed --- /dev/null +++ b/src/ui/dialogs/confirm_extend_ui.py @@ -0,0 +1,32 @@ +# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\dialogs\confirm_extend.ui' +# +# Created by: PyQt6 UI code generator 6.8.0 +# +# 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) + self.buttonBox = QtWidgets.QDialogButtonBox(parent=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(parent=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")) diff --git a/src/ui/dialogs/dialog_sources/Ui_settings.py b/src/ui/dialogs/dialog_sources/Ui_settings.py index 8037f20..8ee3c85 100644 --- a/src/ui/dialogs/dialog_sources/Ui_settings.py +++ b/src/ui/dialogs/dialog_sources/Ui_settings.py @@ -14,10 +14,7 @@ class Ui_Dialog(object): Dialog.setObjectName("Dialog") Dialog.setWindowModality(QtCore.Qt.WindowModality.NonModal) Dialog.resize(651, 679) - sizePolicy = QtWidgets.QSizePolicy( - QtWidgets.QSizePolicy.Policy.MinimumExpanding, - QtWidgets.QSizePolicy.Policy.MinimumExpanding, - ) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, QtWidgets.QSizePolicy.Policy.MinimumExpanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(Dialog.sizePolicy().hasHeightForWidth()) @@ -25,10 +22,7 @@ class Ui_Dialog(object): self.verticalLayout = QtWidgets.QVBoxLayout(Dialog) self.verticalLayout.setObjectName("verticalLayout") self.toolBox = QtWidgets.QToolBox(parent=Dialog) - sizePolicy = QtWidgets.QSizePolicy( - QtWidgets.QSizePolicy.Policy.MinimumExpanding, - QtWidgets.QSizePolicy.Policy.MinimumExpanding, - ) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, QtWidgets.QSizePolicy.Policy.MinimumExpanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.toolBox.sizePolicy().hasHeightForWidth()) @@ -37,10 +31,7 @@ class Ui_Dialog(object): self.toolBox.setObjectName("toolBox") self.page_1 = QtWidgets.QWidget() self.page_1.setGeometry(QtCore.QRect(0, 0, 633, 511)) - sizePolicy = QtWidgets.QSizePolicy( - QtWidgets.QSizePolicy.Policy.MinimumExpanding, - QtWidgets.QSizePolicy.Policy.MinimumExpanding, - ) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, QtWidgets.QSizePolicy.Policy.MinimumExpanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.page_1.sizePolicy().hasHeightForWidth()) @@ -73,12 +64,7 @@ class Ui_Dialog(object): self.save_path = QtWidgets.QLineEdit(parent=self.page_1) self.save_path.setObjectName("save_path") self.gridLayout_3.addWidget(self.save_path, 2, 1, 1, 1) - spacerItem = QtWidgets.QSpacerItem( - 20, - 40, - QtWidgets.QSizePolicy.Policy.Minimum, - QtWidgets.QSizePolicy.Policy.Expanding, - ) + spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) self.gridLayout_3.addItem(spacerItem, 3, 1, 1, 1) self.toolBox.addItem(self.page_1, "") self.page_2 = QtWidgets.QWidget() @@ -99,10 +85,7 @@ class Ui_Dialog(object): self.label_3.setObjectName("label_3") self.gridLayout.addWidget(self.label_3, 1, 0, 1, 1) self.zotero_api_key = QtWidgets.QLineEdit(parent=self.page_2) - self.zotero_api_key.setInputMethodHints( - QtCore.Qt.InputMethodHint.ImhHiddenText - | QtCore.Qt.InputMethodHint.ImhSensitiveData - ) + self.zotero_api_key.setInputMethodHints(QtCore.Qt.InputMethodHint.ImhHiddenText|QtCore.Qt.InputMethodHint.ImhSensitiveData) self.zotero_api_key.setObjectName("zotero_api_key") self.gridLayout.addWidget(self.zotero_api_key, 0, 2, 1, 1) self.label_2 = QtWidgets.QLabel(parent=self.page_2) @@ -112,12 +95,7 @@ class Ui_Dialog(object): self.toggle_api_visibility.setText("") self.toggle_api_visibility.setObjectName("toggle_api_visibility") self.gridLayout.addWidget(self.toggle_api_visibility, 0, 3, 1, 1) - spacerItem1 = QtWidgets.QSpacerItem( - 20, - 40, - QtWidgets.QSizePolicy.Policy.Minimum, - QtWidgets.QSizePolicy.Policy.Expanding, - ) + spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) self.gridLayout.addItem(spacerItem1, 3, 2, 1, 1) self.toolBox.addItem(self.page_2, "") self.page_3 = QtWidgets.QWidget() @@ -133,67 +111,63 @@ class Ui_Dialog(object): self.horizontalLayout_4.setObjectName("horizontalLayout_4") self.gridLayout_2 = QtWidgets.QGridLayout() self.gridLayout_2.setObjectName("gridLayout_2") - self.smtp_address = QtWidgets.QLineEdit(parent=self.email_settingsPage1_2) - self.smtp_address.setClearButtonEnabled(True) - self.smtp_address.setObjectName("smtp_address") - self.gridLayout_2.addWidget(self.smtp_address, 0, 1, 1, 1) - self.label_8 = QtWidgets.QLabel(parent=self.email_settingsPage1_2) - self.label_8.setObjectName("label_8") - self.gridLayout_2.addWidget(self.label_8, 3, 0, 1, 1) - self.use_username_smtp_login = QtWidgets.QCheckBox( - parent=self.email_settingsPage1_2 - ) + self.use_username_smtp_login = QtWidgets.QCheckBox(parent=self.email_settingsPage1_2) self.use_username_smtp_login.setTristate(False) self.use_username_smtp_login.setObjectName("use_username_smtp_login") self.gridLayout_2.addWidget(self.use_username_smtp_login, 4, 1, 1, 1) + self.label_6 = QtWidgets.QLabel(parent=self.email_settingsPage1_2) + self.label_6.setObjectName("label_6") + self.gridLayout_2.addWidget(self.label_6, 1, 0, 1, 1) + self.smtp_port = QtWidgets.QLineEdit(parent=self.email_settingsPage1_2) + self.smtp_port.setInputMethodHints(QtCore.Qt.InputMethodHint.ImhDigitsOnly|QtCore.Qt.InputMethodHint.ImhPreferNumbers) + self.smtp_port.setClearButtonEnabled(True) + self.smtp_port.setObjectName("smtp_port") + self.gridLayout_2.addWidget(self.smtp_port, 1, 1, 1, 1) + self.label_7 = QtWidgets.QLabel(parent=self.email_settingsPage1_2) + self.label_7.setObjectName("label_7") + self.gridLayout_2.addWidget(self.label_7, 2, 0, 1, 1) + self.sender_email = QtWidgets.QLineEdit(parent=self.email_settingsPage1_2) + self.sender_email.setInputMethodHints(QtCore.Qt.InputMethodHint.ImhEmailCharactersOnly) + self.sender_email.setClearButtonEnabled(True) + self.sender_email.setObjectName("sender_email") + self.gridLayout_2.addWidget(self.sender_email, 2, 1, 1, 1) self.mail_username = QtWidgets.QLineEdit(parent=self.email_settingsPage1_2) self.mail_username.setClearButtonEnabled(True) self.mail_username.setObjectName("mail_username") self.gridLayout_2.addWidget(self.mail_username, 3, 1, 1, 1) - self.smtp_port = QtWidgets.QLineEdit(parent=self.email_settingsPage1_2) - self.smtp_port.setInputMethodHints( - QtCore.Qt.InputMethodHint.ImhDigitsOnly - | QtCore.Qt.InputMethodHint.ImhPreferNumbers - ) - self.smtp_port.setClearButtonEnabled(True) - self.smtp_port.setObjectName("smtp_port") - self.gridLayout_2.addWidget(self.smtp_port, 1, 1, 1, 1) - self.label_10 = QtWidgets.QLabel(parent=self.email_settingsPage1_2) - self.label_10.setObjectName("label_10") - self.gridLayout_2.addWidget(self.label_10, 5, 0, 1, 1) - self.label_7 = QtWidgets.QLabel(parent=self.email_settingsPage1_2) - self.label_7.setObjectName("label_7") - self.gridLayout_2.addWidget(self.label_7, 2, 0, 1, 1) self.label_9 = QtWidgets.QLabel(parent=self.email_settingsPage1_2) self.label_9.setText("") self.label_9.setObjectName("label_9") - self.gridLayout_2.addWidget(self.label_9, 6, 0, 1, 1) - self.sender_email = QtWidgets.QLineEdit(parent=self.email_settingsPage1_2) - self.sender_email.setInputMethodHints( - QtCore.Qt.InputMethodHint.ImhEmailCharactersOnly - ) - self.sender_email.setClearButtonEnabled(True) - self.sender_email.setObjectName("sender_email") - self.gridLayout_2.addWidget(self.sender_email, 2, 1, 1, 1) - self.label = QtWidgets.QLabel(parent=self.email_settingsPage1_2) - self.label.setObjectName("label") - self.gridLayout_2.addWidget(self.label, 0, 0, 1, 1) + self.gridLayout_2.addWidget(self.label_9, 7, 0, 1, 1) self.password = QtWidgets.QLineEdit(parent=self.email_settingsPage1_2) - self.password.setInputMethodHints( - QtCore.Qt.InputMethodHint.ImhHiddenText - | QtCore.Qt.InputMethodHint.ImhSensitiveData - ) + self.password.setInputMethodHints(QtCore.Qt.InputMethodHint.ImhHiddenText|QtCore.Qt.InputMethodHint.ImhSensitiveData) self.password.setClearButtonEnabled(True) self.password.setObjectName("password") self.gridLayout_2.addWidget(self.password, 5, 1, 1, 1) - self.label_6 = QtWidgets.QLabel(parent=self.email_settingsPage1_2) - self.label_6.setObjectName("label_6") - self.gridLayout_2.addWidget(self.label_6, 1, 0, 1, 1) + self.smtp_address = QtWidgets.QLineEdit(parent=self.email_settingsPage1_2) + self.smtp_address.setClearButtonEnabled(True) + self.smtp_address.setObjectName("smtp_address") + self.gridLayout_2.addWidget(self.smtp_address, 0, 1, 1, 1) + self.label = QtWidgets.QLabel(parent=self.email_settingsPage1_2) + self.label.setObjectName("label") + self.gridLayout_2.addWidget(self.label, 0, 0, 1, 1) + self.label_10 = QtWidgets.QLabel(parent=self.email_settingsPage1_2) + self.label_10.setObjectName("label_10") + self.gridLayout_2.addWidget(self.label_10, 5, 0, 1, 1) self.togglePassword = QtWidgets.QPushButton(parent=self.email_settingsPage1_2) self.togglePassword.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) self.togglePassword.setText("") self.togglePassword.setObjectName("togglePassword") self.gridLayout_2.addWidget(self.togglePassword, 5, 2, 1, 1) + self.label_8 = QtWidgets.QLabel(parent=self.email_settingsPage1_2) + self.label_8.setObjectName("label_8") + self.gridLayout_2.addWidget(self.label_8, 3, 0, 1, 1) + self.label_13 = QtWidgets.QLabel(parent=self.email_settingsPage1_2) + self.label_13.setObjectName("label_13") + self.gridLayout_2.addWidget(self.label_13, 6, 0, 1, 1) + self.printermail = QtWidgets.QLineEdit(parent=self.email_settingsPage1_2) + self.printermail.setObjectName("printermail") + self.gridLayout_2.addWidget(self.printermail, 6, 1, 1, 1) self.horizontalLayout_4.addLayout(self.gridLayout_2) self.email_settings.addTab(self.email_settingsPage1_2, "") self.email_settingsPage2_2 = QtWidgets.QWidget() @@ -204,12 +178,7 @@ class Ui_Dialog(object): self.verticalLayout_2.setObjectName("verticalLayout_2") self.horizontalLayout_3 = QtWidgets.QHBoxLayout() self.horizontalLayout_3.setObjectName("horizontalLayout_3") - spacerItem2 = QtWidgets.QSpacerItem( - 40, - 20, - QtWidgets.QSizePolicy.Policy.Expanding, - QtWidgets.QSizePolicy.Policy.Minimum, - ) + spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) self.horizontalLayout_3.addItem(spacerItem2) self.bold = QtWidgets.QPushButton(parent=self.email_settingsPage2_2) self.bold.setCheckable(True) @@ -223,12 +192,7 @@ class Ui_Dialog(object): self.underscore.setCheckable(True) self.underscore.setObjectName("underscore") self.horizontalLayout_3.addWidget(self.underscore) - spacerItem3 = QtWidgets.QSpacerItem( - 40, - 20, - QtWidgets.QSizePolicy.Policy.Expanding, - QtWidgets.QSizePolicy.Policy.Minimum, - ) + spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) self.horizontalLayout_3.addItem(spacerItem3) self.verticalLayout_2.addLayout(self.horizontalLayout_3) self.horizontalLayout = QtWidgets.QHBoxLayout() @@ -254,12 +218,7 @@ class Ui_Dialog(object): self.font_size.addItem("") self.font_size.addItem("") self.horizontalLayout.addWidget(self.font_size) - spacerItem4 = QtWidgets.QSpacerItem( - 40, - 20, - QtWidgets.QSizePolicy.Policy.Expanding, - QtWidgets.QSizePolicy.Policy.Minimum, - ) + spacerItem4 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) self.horizontalLayout.addItem(spacerItem4) self.verticalLayout_2.addLayout(self.horizontalLayout) self.verticalLayout_3.addLayout(self.verticalLayout_2) @@ -316,10 +275,7 @@ class Ui_Dialog(object): self.verticalLayout.addWidget(self.toolBox) 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.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok) self.buttonBox.setObjectName("buttonBox") self.verticalLayout.addWidget(self.buttonBox) self.label_5.setBuddy(self.db_name) @@ -327,63 +283,39 @@ class Ui_Dialog(object): self.label_11.setBuddy(self.db_path) self.retranslateUi(Dialog) - self.toolBox.setCurrentIndex(3) + self.toolBox.setCurrentIndex(2) self.email_settings.setCurrentIndex(0) - self.buttonBox.accepted.connect(Dialog.accept) # type: ignore - self.buttonBox.rejected.connect(Dialog.reject) # type: ignore + 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.db_name.setText(_translate("Dialog", "sap.db")) - self.label_5.setToolTip( - _translate( - "Dialog", - '

Name der Datenbank, welche verwendet werden soll. Muss auf .db enden

', - ) - ) + self.label_5.setToolTip(_translate("Dialog", "

Name der Datenbank, welche verwendet werden soll. Muss auf .db enden

")) self.label_5.setText(_translate("Dialog", "Datenbankname")) - self.label_12.setToolTip( - _translate( - "Dialog", - "Pfad, an dem heruntergeladene Dateien gespeichert werden sollen", - ) - ) + self.label_12.setToolTip(_translate("Dialog", "Pfad, an dem heruntergeladene Dateien gespeichert werden sollen")) self.label_12.setText(_translate("Dialog", "Temporäre Dateien")) self.label_11.setText(_translate("Dialog", "Datenbankpfad")) self.tb_set_save_path.setText(_translate("Dialog", "...")) self.tb_select_db.setText(_translate("Dialog", "...")) - self.toolBox.setItemText( - self.toolBox.indexOf(self.page_1), _translate("Dialog", "Datenbank") - ) + self.toolBox.setItemText(self.toolBox.indexOf(self.page_1), _translate("Dialog", "Datenbank")) self.label_4.setText(_translate("Dialog", "Bibliothekstyp")) self.label_3.setText(_translate("Dialog", "Bibliotheks-ID")) self.label_2.setText(_translate("Dialog", "API Key")) - self.toolBox.setItemText( - self.toolBox.indexOf(self.page_2), _translate("Dialog", "Zotero") - ) - self.label_8.setText(_translate("Dialog", "Nutzername")) - self.use_username_smtp_login.setStatusTip( - _translate( - "Dialog", - "Anklicken, wenn Nutzername benötigt wird, um sich beim Server anzumelden", - ) - ) - self.use_username_smtp_login.setText( - _translate("Dialog", "Nutzername zum\n Anmelden verwenden") - ) - self.mail_username.setStatusTip( - _translate("Dialog", "Kürzel, von der Hochschule vergeben, bsp: Aky547") - ) - self.label_10.setText(_translate("Dialog", "Passwort")) - self.label_7.setText(_translate("Dialog", "Sender-eMail")) - self.label.setText(_translate("Dialog", "SMTP-Server")) + self.toolBox.setItemText(self.toolBox.indexOf(self.page_2), _translate("Dialog", "Zotero")) + self.use_username_smtp_login.setStatusTip(_translate("Dialog", "Anklicken, wenn Nutzername benötigt wird, um sich beim Server anzumelden")) + self.use_username_smtp_login.setText(_translate("Dialog", "Nutzername zum\n" +" Anmelden verwenden")) self.label_6.setText(_translate("Dialog", "Port")) - self.email_settings.setTabText( - self.email_settings.indexOf(self.email_settingsPage1_2), - _translate("Dialog", "Allgemeines"), - ) + self.label_7.setText(_translate("Dialog", "Sender-eMail")) + self.mail_username.setStatusTip(_translate("Dialog", "Kürzel, von der Hochschule vergeben, bsp: Aky547")) + self.label.setText(_translate("Dialog", "SMTP-Server")) + self.label_10.setText(_translate("Dialog", "Passwort")) + self.label_8.setText(_translate("Dialog", "Nutzername")) + self.label_13.setText(_translate("Dialog", "Printmail")) + self.email_settings.setTabText(self.email_settings.indexOf(self.email_settingsPage1_2), _translate("Dialog", "Allgemeines")) self.bold.setText(_translate("Dialog", "Fett")) self.italic.setText(_translate("Dialog", "Kursiv")) self.underscore.setText(_translate("Dialog", "Unterstrichen")) @@ -403,14 +335,7 @@ class Ui_Dialog(object): self.font_size.setItemText(13, _translate("Dialog", "48")) self.font_size.setItemText(14, _translate("Dialog", "72")) self.debug.setText(_translate("Dialog", "Debug")) - self.email_settings.setTabText( - self.email_settings.indexOf(self.email_settingsPage2_2), - _translate("Dialog", "Signatur"), - ) - self.toolBox.setItemText( - self.toolBox.indexOf(self.page_3), _translate("Dialog", "e-Mail") - ) + self.email_settings.setTabText(self.email_settings.indexOf(self.email_settingsPage2_2), _translate("Dialog", "Signatur")) + self.toolBox.setItemText(self.toolBox.indexOf(self.page_3), _translate("Dialog", "e-Mail")) self.groupBox.setTitle(_translate("Dialog", "Farben")) - self.toolBox.setItemText( - self.toolBox.indexOf(self.page_4), _translate("Dialog", "Icons") - ) + self.toolBox.setItemText(self.toolBox.indexOf(self.page_4), _translate("Dialog", "Icons")) diff --git a/src/ui/dialogs/dialog_sources/about_ui.py b/src/ui/dialogs/dialog_sources/about_ui.py new file mode 100644 index 0000000..1a7c657 --- /dev/null +++ b/src/ui/dialogs/dialog_sources/about_ui.py @@ -0,0 +1,38 @@ +# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\dialogs\dialog_sources\about.ui' +# +# Created by: PyQt6 UI code generator 6.8.0 +# +# 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_about(object): + def setupUi(self, about): + about.setObjectName("about") + about.resize(301, 313) + self.verticalLayout = QtWidgets.QVBoxLayout(about) + self.verticalLayout.setObjectName("verticalLayout") + self.version = QtWidgets.QLabel(parent=about) + font = QtGui.QFont() + font.setPointSize(12) + font.setBold(True) + self.version.setFont(font) + self.version.setScaledContents(False) + self.version.setObjectName("version") + self.verticalLayout.addWidget(self.version) + self.description = QtWidgets.QTextEdit(parent=about) + self.description.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.description.setReadOnly(True) + self.description.setObjectName("description") + self.verticalLayout.addWidget(self.description) + + self.retranslateUi(about) + QtCore.QMetaObject.connectSlotsByName(about) + + def retranslateUi(self, about): + _translate = QtCore.QCoreApplication.translate + about.setWindowTitle(_translate("about", "Dialog")) + self.version.setText(_translate("about", "SemesterapparatsManagement")) diff --git a/src/ui/dialogs/dialog_sources/app_status_ui.py b/src/ui/dialogs/dialog_sources/app_status_ui.py new file mode 100644 index 0000000..423eb50 --- /dev/null +++ b/src/ui/dialogs/dialog_sources/app_status_ui.py @@ -0,0 +1,22 @@ +# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\dialogs\dialog_sources\app_status.ui' +# +# Created by: PyQt6 UI code generator 6.8.0 +# +# 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(300, 500) + + self.retranslateUi(Form) + QtCore.QMetaObject.connectSlotsByName(Form) + + def retranslateUi(self, Form): + _translate = QtCore.QCoreApplication.translate + Form.setWindowTitle(_translate("Form", "Form")) diff --git a/src/ui/dialogs/dialog_sources/apparat_extend_ui.py b/src/ui/dialogs/dialog_sources/apparat_extend_ui.py new file mode 100644 index 0000000..a9a9a81 --- /dev/null +++ b/src/ui/dialogs/dialog_sources/apparat_extend_ui.py @@ -0,0 +1,74 @@ +# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\dialogs\dialog_sources\apparat_extend.ui' +# +# Created by: PyQt6 UI code generator 6.8.0 +# +# 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(parent=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(parent=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(parent=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(parent=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(parent=self.frame) + self.rad_sommer.setGeometry(QtCore.QRect(10, 10, 82, 21)) + self.rad_sommer.setObjectName("rad_sommer") + self.rad_winter = QtWidgets.QRadioButton(parent=self.frame) + self.rad_winter.setGeometry(QtCore.QRect(140, 10, 82, 21)) + self.rad_winter.setObjectName("rad_winter") + self.sem_year = QtWidgets.QLineEdit(parent=Dialog) + self.sem_year.setGeometry(QtCore.QRect(10, 70, 121, 20)) + self.sem_year.setObjectName("sem_year") + self.dauerapp = QtWidgets.QCheckBox(parent=Dialog) + self.dauerapp.setGeometry(QtCore.QRect(150, 70, 111, 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")) diff --git a/src/ui/dialogs/dialog_sources/confirm_extend_ui.py b/src/ui/dialogs/dialog_sources/confirm_extend_ui.py new file mode 100644 index 0000000..1fe54b9 --- /dev/null +++ b/src/ui/dialogs/dialog_sources/confirm_extend_ui.py @@ -0,0 +1,34 @@ +# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\dialogs\dialog_sources\confirm_extend.ui' +# +# Created by: PyQt6 UI code generator 6.8.0 +# +# 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) + self.horizontalLayout = QtWidgets.QHBoxLayout(extend_confirm) + self.horizontalLayout.setObjectName("horizontalLayout") + self.textEdit = QtWidgets.QTextEdit(parent=extend_confirm) + self.textEdit.setObjectName("textEdit") + self.horizontalLayout.addWidget(self.textEdit) + self.buttonBox = QtWidgets.QDialogButtonBox(parent=extend_confirm) + self.buttonBox.setOrientation(QtCore.Qt.Orientation.Vertical) + self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok) + self.buttonBox.setObjectName("buttonBox") + self.horizontalLayout.addWidget(self.buttonBox) + + 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")) diff --git a/src/ui/dialogs/dialog_sources/documentprint.ui b/src/ui/dialogs/dialog_sources/documentprint.ui new file mode 100644 index 0000000..dd8db13 --- /dev/null +++ b/src/ui/dialogs/dialog_sources/documentprint.ui @@ -0,0 +1,232 @@ + + + Dialog + + + + 0 + 0 + 725 + 623 + + + + Dialog + + + + + + + true + + + + 1 + + + + + 0 + 0 + 707 + 545 + + + + Semesterapparatsübersicht + + + + + + + false + + + + Mit dem Klick auf Okay wird eine Übersicht aller aktiven Semesterapparate erstellt und an den FollowME Drucker gesendet. Es kann bis zu 5 Minuten dauern, bis das Dokument im Drucker angezeigt wird. + + + true + + + 5 + + + + + + + Dokument erstellen und drucken + + + + + + + + + 0 + 0 + 707 + 545 + + + + Semesterapparatsschilder + + + + + + + + + false + + + + Hier kann das Dokument für die Semesterapparatsschilder erstellt werden. Hierfür müssen die entsprechenden Apparate ausgewählt werden. Mithilfe dieser wird das Dokument erstellt. + + + true + + + + + + + + + Dokument erstellen und drucken + + + + + + + Aktuelle Apparate laden + + + + + + + Expertenmodus + + + + + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + 0 + 0 + + + + false + + + <!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" /><meta charset="utf-8" /><style type="text/css"> +p, li { white-space: pre-wrap; } +hr { height: 1px; border-width: 0; } +li.unchecked::marker { content: "\2610"; } +li.checked::marker { content: "\2612"; } +</style></head><body style=" font-family:'Segoe UI'; font-size:9pt; font-weight:700; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">SELECT</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> prof.lname || ' (' || semesterapparat.name || ')' AS formatted_result</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">from</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> semesterapparat</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> INNER JOIN prof ON semesterapparat.prof_id = prof.id</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">WHERE</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> (erstellsemester = 'SoSe 25'</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> OR erstellsemester = 'WiSe 24/25')</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> and semesterapparat.deletion_status = 0</p></body></html> + + + + + + + Anfragen und anzeigen + + + + + + + + + + + + + false + + + + QAbstractItemView::NoEditTriggers + + + true + + + true + + + + + + + AlignLeading|AlignVCenter + + + + + Name + + + + + + + + + + + + + diff --git a/src/ui/dialogs/dialog_sources/documentprint_ui.py b/src/ui/dialogs/dialog_sources/documentprint_ui.py new file mode 100644 index 0000000..030e9c5 --- /dev/null +++ b/src/ui/dialogs/dialog_sources/documentprint_ui.py @@ -0,0 +1,142 @@ +# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\dialogs\dialog_sources\documentprint.ui' +# +# Created by: PyQt6 UI code generator 6.9.0 +# +# 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(725, 623) + self.verticalLayout = QtWidgets.QVBoxLayout(Dialog) + self.verticalLayout.setObjectName("verticalLayout") + self.toolBox = QtWidgets.QToolBox(parent=Dialog) + font = QtGui.QFont() + font.setBold(True) + self.toolBox.setFont(font) + self.toolBox.setObjectName("toolBox") + self.page = QtWidgets.QWidget() + self.page.setGeometry(QtCore.QRect(0, 0, 707, 545)) + self.page.setObjectName("page") + self.horizontalLayout = QtWidgets.QHBoxLayout(self.page) + self.horizontalLayout.setObjectName("horizontalLayout") + self.label = QtWidgets.QLabel(parent=self.page) + font = QtGui.QFont() + font.setBold(False) + self.label.setFont(font) + self.label.setWordWrap(True) + self.label.setObjectName("label") + self.horizontalLayout.addWidget(self.label) + self.pushButton = QtWidgets.QPushButton(parent=self.page) + self.pushButton.setObjectName("pushButton") + self.horizontalLayout.addWidget(self.pushButton) + self.toolBox.addItem(self.page, "") + self.page_2 = QtWidgets.QWidget() + self.page_2.setGeometry(QtCore.QRect(0, 0, 707, 545)) + self.page_2.setObjectName("page_2") + self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.page_2) + self.verticalLayout_2.setObjectName("verticalLayout_2") + self.horizontalLayout_2 = QtWidgets.QHBoxLayout() + self.horizontalLayout_2.setObjectName("horizontalLayout_2") + self.label_2 = QtWidgets.QLabel(parent=self.page_2) + font = QtGui.QFont() + font.setBold(False) + self.label_2.setFont(font) + self.label_2.setWordWrap(True) + self.label_2.setObjectName("label_2") + self.horizontalLayout_2.addWidget(self.label_2) + self.verticalLayout_3 = QtWidgets.QVBoxLayout() + self.verticalLayout_3.setObjectName("verticalLayout_3") + self.pushButton_2 = QtWidgets.QPushButton(parent=self.page_2) + self.pushButton_2.setObjectName("pushButton_2") + self.verticalLayout_3.addWidget(self.pushButton_2) + self.btn_load_current_apparats = QtWidgets.QPushButton(parent=self.page_2) + self.btn_load_current_apparats.setObjectName("btn_load_current_apparats") + self.verticalLayout_3.addWidget(self.btn_load_current_apparats) + self.expertMode = QtWidgets.QCheckBox(parent=self.page_2) + self.expertMode.setObjectName("expertMode") + self.verticalLayout_3.addWidget(self.expertMode) + self.horizontalLayout_2.addLayout(self.verticalLayout_3) + self.verticalLayout_2.addLayout(self.horizontalLayout_2) + self.frame = QtWidgets.QFrame(parent=self.page_2) + self.frame.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel) + self.frame.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) + self.frame.setObjectName("frame") + self.horizontalLayout_3 = QtWidgets.QHBoxLayout(self.frame) + self.horizontalLayout_3.setContentsMargins(0, 0, 0, 0) + self.horizontalLayout_3.setSpacing(0) + self.horizontalLayout_3.setObjectName("horizontalLayout_3") + self.verticalLayout_4 = QtWidgets.QVBoxLayout() + self.verticalLayout_4.setObjectName("verticalLayout_4") + self.textBrowser = QtWidgets.QTextBrowser(parent=self.frame) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, QtWidgets.QSizePolicy.Policy.MinimumExpanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.textBrowser.sizePolicy().hasHeightForWidth()) + self.textBrowser.setSizePolicy(sizePolicy) + self.textBrowser.setReadOnly(False) + self.textBrowser.setObjectName("textBrowser") + self.verticalLayout_4.addWidget(self.textBrowser) + self.manualCheck = QtWidgets.QPushButton(parent=self.frame) + self.manualCheck.setObjectName("manualCheck") + self.verticalLayout_4.addWidget(self.manualCheck) + self.horizontalLayout_3.addLayout(self.verticalLayout_4) + self.verticalLayout_2.addWidget(self.frame) + self.tableWidget = QtWidgets.QTableWidget(parent=self.page_2) + font = QtGui.QFont() + font.setBold(False) + self.tableWidget.setFont(font) + self.tableWidget.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers) + self.tableWidget.setObjectName("tableWidget") + self.tableWidget.setColumnCount(2) + self.tableWidget.setRowCount(0) + item = QtWidgets.QTableWidgetItem() + item.setTextAlignment(QtCore.Qt.AlignmentFlag.AlignLeading|QtCore.Qt.AlignmentFlag.AlignVCenter) + self.tableWidget.setHorizontalHeaderItem(0, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setHorizontalHeaderItem(1, item) + self.tableWidget.horizontalHeader().setSortIndicatorShown(True) + self.tableWidget.horizontalHeader().setStretchLastSection(True) + self.verticalLayout_2.addWidget(self.tableWidget) + self.toolBox.addItem(self.page_2, "") + self.verticalLayout.addWidget(self.toolBox) + + self.retranslateUi(Dialog) + self.toolBox.setCurrentIndex(1) + QtCore.QMetaObject.connectSlotsByName(Dialog) + + def retranslateUi(self, Dialog): + _translate = QtCore.QCoreApplication.translate + Dialog.setWindowTitle(_translate("Dialog", "Dialog")) + self.label.setText(_translate("Dialog", "Mit dem Klick auf Okay wird eine Übersicht aller aktiven Semesterapparate erstellt und an den FollowME Drucker gesendet. Es kann bis zu 5 Minuten dauern, bis das Dokument im Drucker angezeigt wird.")) + self.pushButton.setText(_translate("Dialog", "Dokument erstellen und drucken")) + self.toolBox.setItemText(self.toolBox.indexOf(self.page), _translate("Dialog", "Semesterapparatsübersicht")) + self.label_2.setText(_translate("Dialog", "Hier kann das Dokument für die Semesterapparatsschilder erstellt werden. Hierfür müssen die entsprechenden Apparate ausgewählt werden. Mithilfe dieser wird das Dokument erstellt.")) + self.pushButton_2.setText(_translate("Dialog", "Dokument erstellen und drucken")) + self.btn_load_current_apparats.setText(_translate("Dialog", "Aktuelle Apparate laden")) + self.expertMode.setText(_translate("Dialog", "Expertenmodus")) + self.textBrowser.setHtml(_translate("Dialog", "\n" +"\n" +"

SELECT

\n" +"

prof.lname || \' (\' || semesterapparat.name || \')\' AS formatted_result

\n" +"

from

\n" +"

semesterapparat

\n" +"

INNER JOIN prof ON semesterapparat.prof_id = prof.id

\n" +"

WHERE

\n" +"

(erstellsemester = \'SoSe 25\'

\n" +"

OR erstellsemester = \'WiSe 24/25\')

\n" +"

and semesterapparat.deletion_status = 0

")) + self.manualCheck.setText(_translate("Dialog", "Anfragen und anzeigen")) + item = self.tableWidget.horizontalHeaderItem(1) + item.setText(_translate("Dialog", "Name")) + self.toolBox.setItemText(self.toolBox.indexOf(self.page_2), _translate("Dialog", "Semesterapparatsschilder")) diff --git a/src/ui/dialogs/dialog_sources/edit_bookdata_ui.py b/src/ui/dialogs/dialog_sources/edit_bookdata_ui.py new file mode 100644 index 0000000..89e4ce0 --- /dev/null +++ b/src/ui/dialogs/dialog_sources/edit_bookdata_ui.py @@ -0,0 +1,117 @@ +# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\dialogs\dialog_sources\edit_bookdata.ui' +# +# Created by: PyQt6 UI code generator 6.8.0 +# +# 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, 572) + self.buttonBox = QtWidgets.QDialogButtonBox(parent=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(parent=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(parent=self.gridLayoutWidget) + self.label_10.setObjectName("label_10") + self.gridLayout.addWidget(self.label_10, 10, 1, 1, 1) + self.label = QtWidgets.QLabel(parent=self.gridLayoutWidget) + self.label.setObjectName("label") + self.gridLayout.addWidget(self.label, 0, 1, 1, 1) + self.label_9 = QtWidgets.QLabel(parent=self.gridLayoutWidget) + self.label_9.setObjectName("label_9") + self.gridLayout.addWidget(self.label_9, 9, 1, 1, 1) + self.label_8 = QtWidgets.QLabel(parent=self.gridLayoutWidget) + self.label_8.setObjectName("label_8") + self.gridLayout.addWidget(self.label_8, 8, 1, 1, 1) + self.label_12 = QtWidgets.QLabel(parent=self.gridLayoutWidget) + self.label_12.setObjectName("label_12") + self.gridLayout.addWidget(self.label_12, 6, 1, 1, 1) + self.line_edition = QtWidgets.QLineEdit(parent=self.gridLayoutWidget) + self.line_edition.setObjectName("line_edition") + self.gridLayout.addWidget(self.line_edition, 2, 2, 1, 1) + self.label_3 = QtWidgets.QLabel(parent=self.gridLayoutWidget) + self.label_3.setObjectName("label_3") + self.gridLayout.addWidget(self.label_3, 2, 1, 1, 1) + self.label_4 = QtWidgets.QLabel(parent=self.gridLayoutWidget) + self.label_4.setObjectName("label_4") + self.gridLayout.addWidget(self.label_4, 3, 1, 1, 1) + self.line_link = QtWidgets.QLineEdit(parent=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(parent=self.gridLayoutWidget) + self.label_5.setObjectName("label_5") + self.gridLayout.addWidget(self.label_5, 4, 1, 1, 1) + self.label_7 = QtWidgets.QLabel(parent=self.gridLayoutWidget) + self.label_7.setObjectName("label_7") + self.gridLayout.addWidget(self.label_7, 7, 1, 1, 1) + self.label_6 = QtWidgets.QLabel(parent=self.gridLayoutWidget) + self.label_6.setObjectName("label_6") + self.gridLayout.addWidget(self.label_6, 5, 1, 1, 1) + self.label_2 = QtWidgets.QLabel(parent=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(parent=self.gridLayoutWidget) + self.line_title.setObjectName("line_title") + self.gridLayout.addWidget(self.line_title, 0, 2, 1, 1) + self.line_signature = QtWidgets.QLineEdit(parent=self.gridLayoutWidget) + self.line_signature.setObjectName("line_signature") + self.gridLayout.addWidget(self.line_signature, 1, 2, 1, 1) + self.line_author = QtWidgets.QLineEdit(parent=self.gridLayoutWidget) + self.line_author.setObjectName("line_author") + self.gridLayout.addWidget(self.line_author, 3, 2, 1, 1) + self.line_lang = QtWidgets.QLineEdit(parent=self.gridLayoutWidget) + self.line_lang.setObjectName("line_lang") + self.gridLayout.addWidget(self.line_lang, 8, 2, 1, 1) + self.line_ppn = QtWidgets.QLineEdit(parent=self.gridLayoutWidget) + self.line_ppn.setObjectName("line_ppn") + self.gridLayout.addWidget(self.line_ppn, 5, 2, 1, 1) + self.line_isbn = QtWidgets.QLineEdit(parent=self.gridLayoutWidget) + self.line_isbn.setObjectName("line_isbn") + self.gridLayout.addWidget(self.line_isbn, 7, 2, 1, 1) + self.line_year = QtWidgets.QLineEdit(parent=self.gridLayoutWidget) + self.line_year.setObjectName("line_year") + self.gridLayout.addWidget(self.line_year, 9, 2, 1, 1) + self.line_pages = QtWidgets.QLineEdit(parent=self.gridLayoutWidget) + self.line_pages.setObjectName("line_pages") + self.gridLayout.addWidget(self.line_pages, 10, 2, 1, 1) + self.line_publisher = QtWidgets.QLineEdit(parent=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")) diff --git a/src/ui/dialogs/dialog_sources/elsa_add_table_entry_ui.py b/src/ui/dialogs/dialog_sources/elsa_add_table_entry_ui.py new file mode 100644 index 0000000..de48dbb --- /dev/null +++ b/src/ui/dialogs/dialog_sources/elsa_add_table_entry_ui.py @@ -0,0 +1,411 @@ +# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\dialogs\dialog_sources\elsa_add_table_entry.ui' +# +# Created by: PyQt6 UI code generator 6.8.0 +# +# 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(529, 482) + self.verticalLayout = QtWidgets.QVBoxLayout(Dialog) + self.verticalLayout.setObjectName("verticalLayout") + self.groupBox = QtWidgets.QGroupBox(parent=Dialog) + self.groupBox.setFlat(True) + self.groupBox.setCheckable(False) + self.groupBox.setObjectName("groupBox") + self.gridLayout_4 = QtWidgets.QGridLayout(self.groupBox) + self.gridLayout_4.setObjectName("gridLayout_4") + spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) + self.gridLayout_4.addItem(spacerItem, 0, 3, 1, 1) + self.btn_mono = QtWidgets.QRadioButton(parent=self.groupBox) + self.btn_mono.setChecked(False) + self.btn_mono.setObjectName("btn_mono") + self.gridLayout_4.addWidget(self.btn_mono, 0, 0, 1, 1) + self.btn_zs = QtWidgets.QRadioButton(parent=self.groupBox) + self.btn_zs.setObjectName("btn_zs") + self.gridLayout_4.addWidget(self.btn_zs, 0, 2, 1, 1) + self.btn_hg = QtWidgets.QRadioButton(parent=self.groupBox) + self.btn_hg.setObjectName("btn_hg") + self.gridLayout_4.addWidget(self.btn_hg, 0, 1, 1, 1) + self.verticalLayout.addWidget(self.groupBox) + self.horizontalLayout_2 = QtWidgets.QHBoxLayout() + self.horizontalLayout_2.setObjectName("horizontalLayout_2") + self.label_2 = QtWidgets.QLabel(parent=Dialog) + self.label_2.setObjectName("label_2") + self.horizontalLayout_2.addWidget(self.label_2) + self.searchIdent = QtWidgets.QLineEdit(parent=Dialog) + self.searchIdent.setObjectName("searchIdent") + self.horizontalLayout_2.addWidget(self.searchIdent) + self.btn_search = QtWidgets.QPushButton(parent=Dialog) + self.btn_search.setObjectName("btn_search") + self.horizontalLayout_2.addWidget(self.btn_search) + spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) + self.horizontalLayout_2.addItem(spacerItem1) + self.make_quote = QtWidgets.QPushButton(parent=Dialog) + self.make_quote.setObjectName("make_quote") + self.horizontalLayout_2.addWidget(self.make_quote) + self.verticalLayout.addLayout(self.horizontalLayout_2) + self.stackedWidget = QtWidgets.QStackedWidget(parent=Dialog) + self.stackedWidget.setObjectName("stackedWidget") + self.mono = QtWidgets.QWidget() + self.mono.setObjectName("mono") + self.gridLayout_2 = QtWidgets.QGridLayout(self.mono) + self.gridLayout_2.setObjectName("gridLayout_2") + self.label = QtWidgets.QLabel(parent=self.mono) + self.label.setObjectName("label") + self.gridLayout_2.addWidget(self.label, 0, 0, 1, 1) + self.book_author = QtWidgets.QLineEdit(parent=self.mono) + self.book_author.setObjectName("book_author") + self.gridLayout_2.addWidget(self.book_author, 0, 1, 1, 1) + self.label_3 = QtWidgets.QLabel(parent=self.mono) + self.label_3.setObjectName("label_3") + self.gridLayout_2.addWidget(self.label_3, 1, 0, 1, 1) + self.book_year = QtWidgets.QLineEdit(parent=self.mono) + self.book_year.setObjectName("book_year") + self.gridLayout_2.addWidget(self.book_year, 1, 1, 1, 1) + self.label_4 = QtWidgets.QLabel(parent=self.mono) + self.label_4.setObjectName("label_4") + self.gridLayout_2.addWidget(self.label_4, 2, 0, 1, 1) + self.book_edition = QtWidgets.QLineEdit(parent=self.mono) + self.book_edition.setObjectName("book_edition") + self.gridLayout_2.addWidget(self.book_edition, 2, 1, 1, 1) + self.label_5 = QtWidgets.QLabel(parent=self.mono) + self.label_5.setObjectName("label_5") + self.gridLayout_2.addWidget(self.label_5, 3, 0, 1, 1) + self.book_title = QtWidgets.QLineEdit(parent=self.mono) + self.book_title.setObjectName("book_title") + self.gridLayout_2.addWidget(self.book_title, 3, 1, 1, 1) + self.label_6 = QtWidgets.QLabel(parent=self.mono) + self.label_6.setObjectName("label_6") + self.gridLayout_2.addWidget(self.label_6, 4, 0, 1, 1) + self.book_place = QtWidgets.QLineEdit(parent=self.mono) + self.book_place.setObjectName("book_place") + self.gridLayout_2.addWidget(self.book_place, 4, 1, 1, 1) + self.label_7 = QtWidgets.QLabel(parent=self.mono) + self.label_7.setObjectName("label_7") + self.gridLayout_2.addWidget(self.label_7, 5, 0, 1, 1) + self.book_publisher = QtWidgets.QLineEdit(parent=self.mono) + self.book_publisher.setObjectName("book_publisher") + self.gridLayout_2.addWidget(self.book_publisher, 5, 1, 1, 1) + self.label_8 = QtWidgets.QLabel(parent=self.mono) + self.label_8.setObjectName("label_8") + self.gridLayout_2.addWidget(self.label_8, 6, 0, 1, 1) + self.book_signature = QtWidgets.QLineEdit(parent=self.mono) + self.book_signature.setObjectName("book_signature") + self.gridLayout_2.addWidget(self.book_signature, 6, 1, 1, 1) + self.label_9 = QtWidgets.QLabel(parent=self.mono) + self.label_9.setObjectName("label_9") + self.gridLayout_2.addWidget(self.label_9, 7, 0, 1, 1) + self.book_pages = QtWidgets.QLineEdit(parent=self.mono) + self.book_pages.setObjectName("book_pages") + self.gridLayout_2.addWidget(self.book_pages, 7, 1, 1, 1) + self.page_warn_2 = QtWidgets.QToolButton(parent=self.mono) + self.page_warn_2.setText("") + self.page_warn_2.setAutoRaise(True) + self.page_warn_2.setObjectName("page_warn_2") + self.gridLayout_2.addWidget(self.page_warn_2, 7, 2, 1, 1) + self.label_29 = QtWidgets.QLabel(parent=self.mono) + self.label_29.setObjectName("label_29") + self.gridLayout_2.addWidget(self.label_29, 8, 0, 1, 1) + self.book_isbn = QtWidgets.QLineEdit(parent=self.mono) + self.book_isbn.setObjectName("book_isbn") + self.gridLayout_2.addWidget(self.book_isbn, 8, 1, 1, 1) + self.stackedWidget.addWidget(self.mono) + self.hg = QtWidgets.QWidget() + self.hg.setObjectName("hg") + self.gridLayout_3 = QtWidgets.QGridLayout(self.hg) + self.gridLayout_3.setObjectName("gridLayout_3") + self.hg_editor = QtWidgets.QLineEdit(parent=self.hg) + self.hg_editor.setObjectName("hg_editor") + self.gridLayout_3.addWidget(self.hg_editor, 4, 1, 1, 1) + self.label_26 = QtWidgets.QLabel(parent=self.hg) + self.label_26.setObjectName("label_26") + self.gridLayout_3.addWidget(self.label_26, 7, 0, 1, 1) + self.hg_edition = QtWidgets.QLineEdit(parent=self.hg) + self.hg_edition.setObjectName("hg_edition") + self.gridLayout_3.addWidget(self.hg_edition, 2, 1, 1, 1) + self.label_20 = QtWidgets.QLabel(parent=self.hg) + self.label_20.setObjectName("label_20") + self.gridLayout_3.addWidget(self.label_20, 1, 0, 1, 1) + self.label_24 = QtWidgets.QLabel(parent=self.hg) + self.label_24.setObjectName("label_24") + self.gridLayout_3.addWidget(self.label_24, 3, 0, 1, 1) + self.label_27 = QtWidgets.QLabel(parent=self.hg) + self.label_27.setObjectName("label_27") + self.gridLayout_3.addWidget(self.label_27, 8, 0, 1, 1) + self.label_28 = QtWidgets.QLabel(parent=self.hg) + self.label_28.setObjectName("label_28") + self.gridLayout_3.addWidget(self.label_28, 9, 0, 1, 1) + self.label_23 = QtWidgets.QLabel(parent=self.hg) + self.label_23.setObjectName("label_23") + self.gridLayout_3.addWidget(self.label_23, 5, 0, 1, 1) + self.label_21 = QtWidgets.QLabel(parent=self.hg) + self.label_21.setObjectName("label_21") + self.gridLayout_3.addWidget(self.label_21, 2, 0, 1, 1) + self.hg_pages = QtWidgets.QLineEdit(parent=self.hg) + self.hg_pages.setObjectName("hg_pages") + self.gridLayout_3.addWidget(self.hg_pages, 8, 1, 1, 1) + self.label_19 = QtWidgets.QLabel(parent=self.hg) + self.label_19.setObjectName("label_19") + self.gridLayout_3.addWidget(self.label_19, 0, 0, 1, 1) + self.hg_signature = QtWidgets.QLineEdit(parent=self.hg) + self.hg_signature.setObjectName("hg_signature") + self.gridLayout_3.addWidget(self.hg_signature, 9, 1, 1, 1) + self.label_30 = QtWidgets.QLabel(parent=self.hg) + self.label_30.setObjectName("label_30") + self.gridLayout_3.addWidget(self.label_30, 10, 0, 1, 1) + self.label_25 = QtWidgets.QLabel(parent=self.hg) + self.label_25.setObjectName("label_25") + self.gridLayout_3.addWidget(self.label_25, 6, 0, 1, 1) + self.hg_year = QtWidgets.QLineEdit(parent=self.hg) + self.hg_year.setObjectName("hg_year") + self.gridLayout_3.addWidget(self.hg_year, 1, 1, 1, 1) + self.label_22 = QtWidgets.QLabel(parent=self.hg) + self.label_22.setObjectName("label_22") + self.gridLayout_3.addWidget(self.label_22, 4, 0, 1, 1) + self.hg_title = QtWidgets.QLineEdit(parent=self.hg) + self.hg_title.setObjectName("hg_title") + self.gridLayout_3.addWidget(self.hg_title, 5, 1, 1, 1) + self.hg_chaptertitle = QtWidgets.QLineEdit(parent=self.hg) + self.hg_chaptertitle.setObjectName("hg_chaptertitle") + self.gridLayout_3.addWidget(self.hg_chaptertitle, 3, 1, 1, 1) + self.hg_author = QtWidgets.QLineEdit(parent=self.hg) + self.hg_author.setObjectName("hg_author") + self.gridLayout_3.addWidget(self.hg_author, 0, 1, 1, 1) + self.hg_isbn = QtWidgets.QLineEdit(parent=self.hg) + self.hg_isbn.setObjectName("hg_isbn") + self.gridLayout_3.addWidget(self.hg_isbn, 10, 1, 1, 1) + self.hg_publisher = QtWidgets.QLineEdit(parent=self.hg) + self.hg_publisher.setObjectName("hg_publisher") + self.gridLayout_3.addWidget(self.hg_publisher, 7, 1, 1, 1) + self.hg_place = QtWidgets.QLineEdit(parent=self.hg) + self.hg_place.setObjectName("hg_place") + self.gridLayout_3.addWidget(self.hg_place, 6, 1, 1, 1) + self.page_warn_3 = QtWidgets.QToolButton(parent=self.hg) + self.page_warn_3.setText("") + self.page_warn_3.setAutoRaise(True) + self.page_warn_3.setObjectName("page_warn_3") + self.gridLayout_3.addWidget(self.page_warn_3, 8, 2, 1, 1) + self.stackedWidget.addWidget(self.hg) + self.zs = QtWidgets.QWidget() + self.zs.setObjectName("zs") + self.gridLayout = QtWidgets.QGridLayout(self.zs) + self.gridLayout.setObjectName("gridLayout") + self.label_10 = QtWidgets.QLabel(parent=self.zs) + self.label_10.setObjectName("label_10") + self.gridLayout.addWidget(self.label_10, 0, 0, 1, 1) + self.zs_publisher = QtWidgets.QLineEdit(parent=self.zs) + self.zs_publisher.setObjectName("zs_publisher") + self.gridLayout.addWidget(self.zs_publisher, 6, 1, 1, 1) + self.zs_place = QtWidgets.QLineEdit(parent=self.zs) + self.zs_place.setObjectName("zs_place") + self.gridLayout.addWidget(self.zs_place, 5, 1, 1, 1) + self.label_14 = QtWidgets.QLabel(parent=self.zs) + self.label_14.setObjectName("label_14") + self.gridLayout.addWidget(self.label_14, 4, 0, 1, 1) + self.label_11 = QtWidgets.QLabel(parent=self.zs) + self.label_11.setObjectName("label_11") + self.gridLayout.addWidget(self.label_11, 1, 0, 1, 1) + self.zs_year = QtWidgets.QLineEdit(parent=self.zs) + self.zs_year.setObjectName("zs_year") + self.gridLayout.addWidget(self.zs_year, 1, 1, 1, 1) + self.label_17 = QtWidgets.QLabel(parent=self.zs) + self.label_17.setObjectName("label_17") + self.gridLayout.addWidget(self.label_17, 7, 0, 1, 1) + self.label_16 = QtWidgets.QLabel(parent=self.zs) + self.label_16.setObjectName("label_16") + self.gridLayout.addWidget(self.label_16, 6, 0, 1, 1) + self.zs_issue = QtWidgets.QLineEdit(parent=self.zs) + self.zs_issue.setObjectName("zs_issue") + self.gridLayout.addWidget(self.zs_issue, 2, 1, 1, 1) + self.zs_chapter_title = QtWidgets.QLineEdit(parent=self.zs) + self.zs_chapter_title.setObjectName("zs_chapter_title") + self.gridLayout.addWidget(self.zs_chapter_title, 3, 1, 1, 1) + self.zs_isbn = QtWidgets.QLineEdit(parent=self.zs) + self.zs_isbn.setObjectName("zs_isbn") + self.gridLayout.addWidget(self.zs_isbn, 9, 1, 1, 1) + self.label_12 = QtWidgets.QLabel(parent=self.zs) + self.label_12.setObjectName("label_12") + self.gridLayout.addWidget(self.label_12, 2, 0, 1, 1) + self.label_31 = QtWidgets.QLabel(parent=self.zs) + self.label_31.setObjectName("label_31") + self.gridLayout.addWidget(self.label_31, 9, 0, 1, 1) + self.label_15 = QtWidgets.QLabel(parent=self.zs) + self.label_15.setObjectName("label_15") + self.gridLayout.addWidget(self.label_15, 5, 0, 1, 1) + self.zs_signature = QtWidgets.QLineEdit(parent=self.zs) + self.zs_signature.setObjectName("zs_signature") + self.gridLayout.addWidget(self.zs_signature, 8, 1, 1, 1) + self.zs_pages = QtWidgets.QLineEdit(parent=self.zs) + self.zs_pages.setObjectName("zs_pages") + self.gridLayout.addWidget(self.zs_pages, 7, 1, 1, 1) + self.label_13 = QtWidgets.QLabel(parent=self.zs) + self.label_13.setObjectName("label_13") + self.gridLayout.addWidget(self.label_13, 3, 0, 1, 1) + self.label_18 = QtWidgets.QLabel(parent=self.zs) + self.label_18.setObjectName("label_18") + self.gridLayout.addWidget(self.label_18, 8, 0, 1, 1) + self.zs_author = QtWidgets.QLineEdit(parent=self.zs) + self.zs_author.setObjectName("zs_author") + self.gridLayout.addWidget(self.zs_author, 0, 1, 1, 1) + self.zs_title = QtWidgets.QLineEdit(parent=self.zs) + self.zs_title.setObjectName("zs_title") + self.gridLayout.addWidget(self.zs_title, 4, 1, 1, 1) + self.page_warn = QtWidgets.QToolButton(parent=self.zs) + self.page_warn.setText("") + self.page_warn.setAutoRaise(True) + self.page_warn.setObjectName("page_warn") + self.gridLayout.addWidget(self.page_warn, 7, 2, 1, 1) + self.stackedWidget.addWidget(self.zs) + self.page = QtWidgets.QWidget() + self.page.setLayoutDirection(QtCore.Qt.LayoutDirection.LeftToRight) + self.page.setObjectName("page") + self.gridLayout_5 = QtWidgets.QGridLayout(self.page) + self.gridLayout_5.setObjectName("gridLayout_5") + self.label_32 = QtWidgets.QLabel(parent=self.page) + self.label_32.setObjectName("label_32") + self.gridLayout_5.addWidget(self.label_32, 0, 0, 1, 1) + spacerItem2 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) + self.gridLayout_5.addItem(spacerItem2, 7, 0, 1, 1) + self.file_desc_edit = QtWidgets.QTextEdit(parent=self.page) + self.file_desc_edit.setReadOnly(True) + self.file_desc_edit.setObjectName("file_desc_edit") + self.gridLayout_5.addWidget(self.file_desc_edit, 6, 0, 1, 1) + self.label_34 = QtWidgets.QLabel(parent=self.page) + self.label_34.setObjectName("label_34") + self.gridLayout_5.addWidget(self.label_34, 3, 0, 1, 1) + self.filename_edit = QtWidgets.QTextEdit(parent=self.page) + self.filename_edit.setReadOnly(True) + self.filename_edit.setObjectName("filename_edit") + self.gridLayout_5.addWidget(self.filename_edit, 1, 0, 1, 1) + self.label_33 = QtWidgets.QLabel(parent=self.page) + self.label_33.setObjectName("label_33") + self.gridLayout_5.addWidget(self.label_33, 5, 0, 1, 1) + self.ilias_filename = QtWidgets.QTextEdit(parent=self.page) + self.ilias_filename.setReadOnly(True) + self.ilias_filename.setObjectName("ilias_filename") + self.gridLayout_5.addWidget(self.ilias_filename, 4, 0, 1, 1) + self.verticalLayout_2 = QtWidgets.QVBoxLayout() + self.verticalLayout_2.setObjectName("verticalLayout_2") + spacerItem3 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) + self.verticalLayout_2.addItem(spacerItem3) + self.copy_filename = QtWidgets.QToolButton(parent=self.page) + self.copy_filename.setLayoutDirection(QtCore.Qt.LayoutDirection.LeftToRight) + self.copy_filename.setAutoFillBackground(False) + self.copy_filename.setObjectName("copy_filename") + self.verticalLayout_2.addWidget(self.copy_filename) + self.filename_edit_label = QtWidgets.QLabel(parent=self.page) + self.filename_edit_label.setText("") + self.filename_edit_label.setObjectName("filename_edit_label") + self.verticalLayout_2.addWidget(self.filename_edit_label) + spacerItem4 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) + self.verticalLayout_2.addItem(spacerItem4) + self.gridLayout_5.addLayout(self.verticalLayout_2, 1, 1, 1, 1) + self.verticalLayout_3 = QtWidgets.QVBoxLayout() + self.verticalLayout_3.setObjectName("verticalLayout_3") + spacerItem5 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) + self.verticalLayout_3.addItem(spacerItem5) + self.copy_ilias_filename = QtWidgets.QToolButton(parent=self.page) + self.copy_ilias_filename.setObjectName("copy_ilias_filename") + self.verticalLayout_3.addWidget(self.copy_ilias_filename) + self.ilias_filename_label = QtWidgets.QLabel(parent=self.page) + self.ilias_filename_label.setText("") + self.ilias_filename_label.setObjectName("ilias_filename_label") + self.verticalLayout_3.addWidget(self.ilias_filename_label) + spacerItem6 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) + self.verticalLayout_3.addItem(spacerItem6) + self.gridLayout_5.addLayout(self.verticalLayout_3, 4, 1, 1, 1) + self.verticalLayout_4 = QtWidgets.QVBoxLayout() + self.verticalLayout_4.setObjectName("verticalLayout_4") + spacerItem7 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) + self.verticalLayout_4.addItem(spacerItem7) + self.copy_qoute = QtWidgets.QToolButton(parent=self.page) + self.copy_qoute.setObjectName("copy_qoute") + self.verticalLayout_4.addWidget(self.copy_qoute) + self.file_desc_edit_label = QtWidgets.QLabel(parent=self.page) + self.file_desc_edit_label.setText("") + self.file_desc_edit_label.setObjectName("file_desc_edit_label") + self.verticalLayout_4.addWidget(self.file_desc_edit_label) + spacerItem8 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) + self.verticalLayout_4.addItem(spacerItem8) + self.gridLayout_5.addLayout(self.verticalLayout_4, 6, 1, 1, 1) + self.stackedWidget.addWidget(self.page) + self.verticalLayout.addWidget(self.stackedWidget) + self.horizontalLayout = QtWidgets.QHBoxLayout() + self.horizontalLayout.setObjectName("horizontalLayout") + self.buttonBox = QtWidgets.QDialogButtonBox(parent=Dialog) + self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Discard|QtWidgets.QDialogButtonBox.StandardButton.Ok) + self.buttonBox.setObjectName("buttonBox") + self.horizontalLayout.addWidget(self.buttonBox) + self.retryButton = QtWidgets.QPushButton(parent=Dialog) + self.retryButton.setObjectName("retryButton") + self.horizontalLayout.addWidget(self.retryButton) + self.verticalLayout.addLayout(self.horizontalLayout) + + self.retranslateUi(Dialog) + self.stackedWidget.setCurrentIndex(3) + QtCore.QMetaObject.connectSlotsByName(Dialog) + + def retranslateUi(self, Dialog): + _translate = QtCore.QCoreApplication.translate + Dialog.setWindowTitle(_translate("Dialog", "Dialog")) + self.groupBox.setTitle(_translate("Dialog", "Medientyp?")) + self.btn_mono.setText(_translate("Dialog", "Monografie")) + self.btn_zs.setText(_translate("Dialog", "Zeitschrift")) + self.btn_hg.setText(_translate("Dialog", "Herausgeberwerk")) + self.label_2.setText(_translate("Dialog", "Identifikator")) + self.btn_search.setText(_translate("Dialog", "Suchen")) + self.make_quote.setToolTip(_translate("Dialog", "Zuerst die Seitenzahl anpassen")) + self.make_quote.setText(_translate("Dialog", "Zitat erstellen")) + self.label.setText(_translate("Dialog", "Autor(en)\n" +" Nachname, Vorname")) + self.book_author.setToolTip(_translate("Dialog", "Bei mehreren Autoren mit ; trennen")) + self.label_3.setText(_translate("Dialog", "Jahr")) + self.label_4.setText(_translate("Dialog", "Auflage")) + self.label_5.setText(_translate("Dialog", "Titel")) + self.label_6.setText(_translate("Dialog", "Ort")) + self.label_7.setText(_translate("Dialog", "Verlag")) + self.label_8.setText(_translate("Dialog", "Signatur")) + self.label_9.setText(_translate("Dialog", "Seiten")) + self.book_pages.setPlaceholderText(_translate("Dialog", "Seitenanzahl des Mediums, zum zitieren ändern!")) + self.label_29.setText(_translate("Dialog", "ISBN")) + self.hg_editor.setToolTip(_translate("Dialog", "Bei mehreren Autoren mit ; trennen")) + self.label_26.setText(_translate("Dialog", "Verlag")) + self.label_20.setText(_translate("Dialog", "Jahr")) + self.label_24.setText(_translate("Dialog", "Beitragstitel")) + self.label_27.setText(_translate("Dialog", "Seiten")) + self.label_28.setText(_translate("Dialog", "Signatur")) + self.label_23.setText(_translate("Dialog", "Titel des Werkes")) + self.label_21.setText(_translate("Dialog", "Auflage")) + self.label_19.setText(_translate("Dialog", "Autor(en)\n" +"Nachname, Vorname")) + self.label_30.setText(_translate("Dialog", "ISBN")) + self.label_25.setText(_translate("Dialog", "Ort")) + self.label_22.setText(_translate("Dialog", "Herausgebername(n)\n" +"Nachname, Vorname")) + self.hg_author.setToolTip(_translate("Dialog", "Bei mehreren Autoren mit ; trennen")) + self.label_10.setText(_translate("Dialog", "Autor(en)\n" +"Nachname, Vorname")) + self.label_14.setText(_translate("Dialog", "Name der Zeitschrift")) + self.label_11.setText(_translate("Dialog", "Jahr")) + self.label_17.setText(_translate("Dialog", "Seiten")) + self.label_16.setText(_translate("Dialog", "Verlag")) + self.label_12.setText(_translate("Dialog", "Heft")) + self.label_31.setText(_translate("Dialog", "ISSN")) + self.label_15.setText(_translate("Dialog", "Ort")) + self.label_13.setText(_translate("Dialog", "Artikeltitel")) + self.label_18.setText(_translate("Dialog", "Signatur")) + self.zs_author.setToolTip(_translate("Dialog", "Bei mehreren Autoren mit ; trennen")) + self.label_32.setText(_translate("Dialog", "Dateiname")) + self.label_34.setText(_translate("Dialog", "ILIAS Name")) + self.label_33.setText(_translate("Dialog", "ILIAS Dateibeschreibung")) + self.copy_filename.setText(_translate("Dialog", "Kopieren")) + self.copy_ilias_filename.setText(_translate("Dialog", "Kopieren")) + self.copy_qoute.setText(_translate("Dialog", "Kopieren")) + self.retryButton.setText(_translate("Dialog", "Wiederholen")) diff --git a/src/ui/dialogs/dialog_sources/elsa_generate_citation_ui.py b/src/ui/dialogs/dialog_sources/elsa_generate_citation_ui.py new file mode 100644 index 0000000..dbed3f6 --- /dev/null +++ b/src/ui/dialogs/dialog_sources/elsa_generate_citation_ui.py @@ -0,0 +1,76 @@ +# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\dialogs\dialog_sources\elsa_generate_citation.ui' +# +# Created by: PyQt6 UI code generator 6.8.0 +# +# 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(564, 517) + self.verticalLayout_2 = QtWidgets.QVBoxLayout(Dialog) + self.verticalLayout_2.setObjectName("verticalLayout_2") + self.select_type = QtWidgets.QFrame(parent=Dialog) + self.select_type.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel) + self.select_type.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) + self.select_type.setObjectName("select_type") + self.verticalLayout = QtWidgets.QVBoxLayout(self.select_type) + self.verticalLayout.setObjectName("verticalLayout") + self.radio_mono = QtWidgets.QRadioButton(parent=self.select_type) + self.radio_mono.setObjectName("radio_mono") + self.verticalLayout.addWidget(self.radio_mono) + self.radio_zs = QtWidgets.QRadioButton(parent=self.select_type) + self.radio_zs.setObjectName("radio_zs") + self.verticalLayout.addWidget(self.radio_zs) + self.radio_hg = QtWidgets.QRadioButton(parent=self.select_type) + self.radio_hg.setObjectName("radio_hg") + self.verticalLayout.addWidget(self.radio_hg) + spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) + self.verticalLayout.addItem(spacerItem) + self.verticalLayout_2.addWidget(self.select_type) + self.check = QtWidgets.QGroupBox(parent=Dialog) + font = QtGui.QFont() + font.setBold(True) + self.check.setFont(font) + self.check.setObjectName("check") + self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.check) + self.verticalLayout_3.setObjectName("verticalLayout_3") + self.citation_style_result = QtWidgets.QStackedWidget(parent=self.check) + font = QtGui.QFont() + font.setBold(False) + self.citation_style_result.setFont(font) + self.citation_style_result.setObjectName("citation_style_result") + self.monografie = QtWidgets.QWidget() + self.monografie.setObjectName("monografie") + self.citation_style_result.addWidget(self.monografie) + self.zsaufsatz = QtWidgets.QWidget() + self.zsaufsatz.setObjectName("zsaufsatz") + self.citation_style_result.addWidget(self.zsaufsatz) + self.herausgeberwerk = QtWidgets.QWidget() + self.herausgeberwerk.setObjectName("herausgeberwerk") + self.citation_style_result.addWidget(self.herausgeberwerk) + self.verticalLayout_3.addWidget(self.citation_style_result) + self.pushButton = QtWidgets.QPushButton(parent=self.check) + self.pushButton.setObjectName("pushButton") + self.verticalLayout_3.addWidget(self.pushButton, 0, QtCore.Qt.AlignmentFlag.AlignRight) + self.verticalLayout_2.addWidget(self.check) + self.verticalLayout_2.setStretch(0, 20) + self.verticalLayout_2.setStretch(1, 80) + + self.retranslateUi(Dialog) + self.citation_style_result.setCurrentIndex(2) + QtCore.QMetaObject.connectSlotsByName(Dialog) + + def retranslateUi(self, Dialog): + _translate = QtCore.QCoreApplication.translate + Dialog.setWindowTitle(_translate("Dialog", "Dialog")) + self.radio_mono.setText(_translate("Dialog", "Monografie")) + self.radio_zs.setText(_translate("Dialog", "Zeitschriftenaufsatz")) + self.radio_hg.setText(_translate("Dialog", "Herausgeberwerk")) + self.check.setTitle(_translate("Dialog", "Daten")) + self.pushButton.setText(_translate("Dialog", "Bestätigen")) diff --git a/src/ui/dialogs/dialog_sources/elsa_generator_confirm_ui.py b/src/ui/dialogs/dialog_sources/elsa_generator_confirm_ui.py new file mode 100644 index 0000000..fcd4a4b --- /dev/null +++ b/src/ui/dialogs/dialog_sources/elsa_generator_confirm_ui.py @@ -0,0 +1,120 @@ +# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\dialogs\dialog_sources\elsa_generator_confirm.ui' +# +# Created by: PyQt6 UI code generator 6.8.0 +# +# 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(530, 210) + 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.setMaximumSize(QtCore.QSize(530, 210)) + self.horizontalLayout = QtWidgets.QHBoxLayout(Dialog) + self.horizontalLayout.setObjectName("horizontalLayout") + self.groupBox = QtWidgets.QGroupBox(parent=Dialog) + font = QtGui.QFont() + font.setBold(True) + self.groupBox.setFont(font) + self.groupBox.setObjectName("groupBox") + self.gridLayout = QtWidgets.QGridLayout(self.groupBox) + self.gridLayout.setObjectName("gridLayout") + self.label = QtWidgets.QLabel(parent=self.groupBox) + font = QtGui.QFont() + font.setBold(False) + self.label.setFont(font) + self.label.setObjectName("label") + self.gridLayout.addWidget(self.label, 1, 0, 1, 1) + self.bookauthor = QtWidgets.QLineEdit(parent=self.groupBox) + font = QtGui.QFont() + font.setBold(False) + self.bookauthor.setFont(font) + self.bookauthor.setObjectName("bookauthor") + self.gridLayout.addWidget(self.bookauthor, 5, 1, 1, 1) + self.book_title = QtWidgets.QLineEdit(parent=self.groupBox) + font = QtGui.QFont() + font.setBold(False) + self.book_title.setFont(font) + self.book_title.setObjectName("book_title") + self.gridLayout.addWidget(self.book_title, 3, 1, 1, 1) + self.label_5 = QtWidgets.QLabel(parent=self.groupBox) + font = QtGui.QFont() + font.setBold(False) + self.label_5.setFont(font) + self.label_5.setObjectName("label_5") + self.gridLayout.addWidget(self.label_5, 5, 0, 1, 1) + self.pages = QtWidgets.QLineEdit(parent=self.groupBox) + font = QtGui.QFont() + font.setBold(False) + self.pages.setFont(font) + self.pages.setObjectName("pages") + self.gridLayout.addWidget(self.pages, 4, 1, 1, 1) + self.label_2 = QtWidgets.QLabel(parent=self.groupBox) + font = QtGui.QFont() + font.setBold(False) + self.label_2.setFont(font) + self.label_2.setObjectName("label_2") + self.gridLayout.addWidget(self.label_2, 2, 0, 1, 1) + self.label_3 = QtWidgets.QLabel(parent=self.groupBox) + font = QtGui.QFont() + font.setBold(False) + self.label_3.setFont(font) + self.label_3.setObjectName("label_3") + self.gridLayout.addWidget(self.label_3, 3, 0, 1, 1) + self.label_4 = QtWidgets.QLabel(parent=self.groupBox) + font = QtGui.QFont() + font.setBold(False) + self.label_4.setFont(font) + self.label_4.setObjectName("label_4") + self.gridLayout.addWidget(self.label_4, 4, 0, 1, 1) + self.chapter_title = QtWidgets.QLineEdit(parent=self.groupBox) + font = QtGui.QFont() + font.setBold(False) + self.chapter_title.setFont(font) + self.chapter_title.setObjectName("chapter_title") + self.gridLayout.addWidget(self.chapter_title, 1, 1, 1, 1) + self.chapter_authors = QtWidgets.QLineEdit(parent=self.groupBox) + font = QtGui.QFont() + font.setBold(False) + self.chapter_authors.setFont(font) + self.chapter_authors.setObjectName("chapter_authors") + self.gridLayout.addWidget(self.chapter_authors, 2, 1, 1, 1) + self.label_6 = QtWidgets.QLabel(parent=self.groupBox) + font = QtGui.QFont() + font.setBold(False) + self.label_6.setFont(font) + self.label_6.setObjectName("label_6") + self.gridLayout.addWidget(self.label_6, 0, 1, 1, 1) + self.horizontalLayout.addWidget(self.groupBox) + self.buttonBox = QtWidgets.QDialogButtonBox(parent=Dialog) + self.buttonBox.setLayoutDirection(QtCore.Qt.LayoutDirection.LeftToRight) + self.buttonBox.setOrientation(QtCore.Qt.Orientation.Vertical) + self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok) + self.buttonBox.setCenterButtons(False) + self.buttonBox.setObjectName("buttonBox") + self.horizontalLayout.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.groupBox.setTitle(_translate("Dialog", "Angaben korrekt?")) + self.label.setText(_translate("Dialog", "Kapiteltitel")) + self.label_5.setText(_translate("Dialog", "Herausgebername")) + self.label_2.setText(_translate("Dialog", "Autor(en)")) + self.label_3.setText(_translate("Dialog", "Buchtitel")) + self.label_4.setText(_translate("Dialog", "Seite(n)")) + self.label_6.setText(_translate("Dialog", "Hier können fehlerhafte / fehlende Daten geändert werden")) diff --git a/src/ui/dialogs/dialog_sources/login_ui.py b/src/ui/dialogs/dialog_sources/login_ui.py new file mode 100644 index 0000000..c3ee6d5 --- /dev/null +++ b/src/ui/dialogs/dialog_sources/login_ui.py @@ -0,0 +1,49 @@ +# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\dialogs\dialog_sources\login.ui' +# +# Created by: PyQt6 UI code generator 6.8.0 +# +# 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(218, 190) + icon = QtGui.QIcon() + icon.addPixmap(QtGui.QPixmap(":/icons/resources/1f510.svg"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) + Dialog.setWindowIcon(icon) + 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") + 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) + self.lineEdit_2.setClearButtonEnabled(True) + self.lineEdit_2.setObjectName("lineEdit_2") + self.login_button = QtWidgets.QPushButton(parent=Dialog) + self.login_button.setGeometry(QtCore.QRect(30, 140, 76, 32)) + self.login_button.setObjectName("login_button") + self.cancel_button = QtWidgets.QPushButton(parent=Dialog) + self.cancel_button.setGeometry(QtCore.QRect(120, 140, 76, 32)) + self.cancel_button.setObjectName("cancel_button") + + self.retranslateUi(Dialog) + QtCore.QMetaObject.connectSlotsByName(Dialog) + + def retranslateUi(self, Dialog): + _translate = QtCore.QCoreApplication.translate + Dialog.setWindowTitle(_translate("Dialog", "Login")) + self.label.setText(_translate("Dialog", "Username")) + self.label_2.setText(_translate("Dialog", "Password")) + self.login_button.setText(_translate("Dialog", "Login")) + self.cancel_button.setText(_translate("Dialog", "Cancel")) diff --git a/src/ui/dialogs/dialog_sources/mail_preview_ui.py b/src/ui/dialogs/dialog_sources/mail_preview_ui.py new file mode 100644 index 0000000..37109b2 --- /dev/null +++ b/src/ui/dialogs/dialog_sources/mail_preview_ui.py @@ -0,0 +1,115 @@ +# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\dialogs\dialog_sources\mail_preview.ui' +# +# Created by: PyQt6 UI code generator 6.8.0 +# +# 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_eMailPreview(object): + def setupUi(self, eMailPreview): + eMailPreview.setObjectName("eMailPreview") + eMailPreview.resize(700, 668) + icon = QtGui.QIcon() + icon.addPixmap(QtGui.QPixmap("c:\\Users\\aky547\\GitHub\\SemesterapparatsManager\\src\\ui\\dialogs\\dialog_sources\\../../../../../../icons/email.svg"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) + eMailPreview.setWindowIcon(icon) + self.gridLayout_2 = QtWidgets.QGridLayout(eMailPreview) + self.gridLayout_2.setObjectName("gridLayout_2") + self.gridLayout = QtWidgets.QGridLayout() + self.gridLayout.setObjectName("gridLayout") + self.prof_name = QtWidgets.QLineEdit(parent=eMailPreview) + self.prof_name.setObjectName("prof_name") + self.gridLayout.addWidget(self.prof_name, 2, 2, 1, 1) + self.newTemplate = QtWidgets.QPushButton(parent=eMailPreview) + self.newTemplate.setAutoFillBackground(False) + self.newTemplate.setText("") + self.newTemplate.setIconSize(QtCore.QSize(24, 24)) + self.newTemplate.setAutoDefault(True) + self.newTemplate.setDefault(False) + self.newTemplate.setFlat(False) + self.newTemplate.setObjectName("newTemplate") + self.gridLayout.addWidget(self.newTemplate, 0, 3, 1, 1) + self.comboBox = QtWidgets.QComboBox(parent=eMailPreview) + self.comboBox.setObjectName("comboBox") + self.gridLayout.addWidget(self.comboBox, 0, 2, 1, 1) + self.mail_header = QtWidgets.QLineEdit(parent=eMailPreview) + self.mail_header.setObjectName("mail_header") + self.gridLayout.addWidget(self.mail_header, 3, 2, 1, 1) + self.label_6 = QtWidgets.QLabel(parent=eMailPreview) + self.label_6.setObjectName("label_6") + self.gridLayout.addWidget(self.label_6, 4, 0, 1, 1) + self.mail_body = QtWidgets.QTextEdit(parent=eMailPreview) + self.mail_body.setObjectName("mail_body") + self.gridLayout.addWidget(self.mail_body, 5, 2, 1, 1) + self.label_2 = QtWidgets.QLabel(parent=eMailPreview) + self.label_2.setObjectName("label_2") + self.gridLayout.addWidget(self.label_2, 2, 0, 1, 1) + self.mail_name = QtWidgets.QLineEdit(parent=eMailPreview) + self.mail_name.setObjectName("mail_name") + self.gridLayout.addWidget(self.mail_name, 1, 2, 1, 1) + self.label_5 = QtWidgets.QLabel(parent=eMailPreview) + self.label_5.setObjectName("label_5") + self.gridLayout.addWidget(self.label_5, 0, 0, 1, 1) + self.label_4 = QtWidgets.QLabel(parent=eMailPreview) + self.label_4.setObjectName("label_4") + self.gridLayout.addWidget(self.label_4, 3, 0, 1, 1) + self.horizontalLayout_3 = QtWidgets.QHBoxLayout() + self.horizontalLayout_3.setObjectName("horizontalLayout_3") + self.gender_male = QtWidgets.QRadioButton(parent=eMailPreview) + self.gender_male.setObjectName("gender_male") + self.horizontalLayout_3.addWidget(self.gender_male) + self.gender_female = QtWidgets.QRadioButton(parent=eMailPreview) + self.gender_female.setObjectName("gender_female") + self.horizontalLayout_3.addWidget(self.gender_female) + self.gender_non = QtWidgets.QRadioButton(parent=eMailPreview) + self.gender_non.setObjectName("gender_non") + self.horizontalLayout_3.addWidget(self.gender_non) + spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) + self.horizontalLayout_3.addItem(spacerItem) + self.gridLayout.addLayout(self.horizontalLayout_3, 4, 2, 1, 1) + self.label_3 = QtWidgets.QLabel(parent=eMailPreview) + 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, 5, 0, 1, 1) + self.label = QtWidgets.QLabel(parent=eMailPreview) + self.label.setObjectName("label") + self.gridLayout.addWidget(self.label, 1, 0, 1, 1) + self.horizontalLayout_2 = QtWidgets.QHBoxLayout() + self.horizontalLayout_2.setObjectName("horizontalLayout_2") + spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) + self.horizontalLayout_2.addItem(spacerItem1) + self.btn_okay = QtWidgets.QPushButton(parent=eMailPreview) + self.btn_okay.setStatusTip("") + self.btn_okay.setObjectName("btn_okay") + self.horizontalLayout_2.addWidget(self.btn_okay) + self.buttonBox = QtWidgets.QDialogButtonBox(parent=eMailPreview) + self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal) + self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel) + self.buttonBox.setCenterButtons(True) + self.buttonBox.setObjectName("buttonBox") + self.horizontalLayout_2.addWidget(self.buttonBox) + self.gridLayout.addLayout(self.horizontalLayout_2, 6, 2, 1, 1) + self.gridLayout_2.addLayout(self.gridLayout, 0, 0, 1, 1) + + self.retranslateUi(eMailPreview) + self.buttonBox.accepted.connect(eMailPreview.accept) # type: ignore + self.buttonBox.rejected.connect(eMailPreview.reject) # type: ignore + QtCore.QMetaObject.connectSlotsByName(eMailPreview) + + def retranslateUi(self, eMailPreview): + _translate = QtCore.QCoreApplication.translate + eMailPreview.setWindowTitle(_translate("eMailPreview", "eMail Voransicht")) + self.label_6.setText(_translate("eMailPreview", "Anrede")) + self.label_2.setText(_translate("eMailPreview", "Prof")) + self.label_5.setText(_translate("eMailPreview", "Art")) + self.label_4.setText(_translate("eMailPreview", "Betreff")) + self.gender_male.setText(_translate("eMailPreview", "M")) + self.gender_female.setText(_translate("eMailPreview", "W")) + self.gender_non.setText(_translate("eMailPreview", "Divers")) + self.label_3.setText(_translate("eMailPreview", "Mail")) + self.label.setText(_translate("eMailPreview", "eMail")) + self.btn_okay.setWhatsThis(_translate("eMailPreview", "test")) + self.btn_okay.setText(_translate("eMailPreview", "Senden")) diff --git a/src/ui/dialogs/dialog_sources/medianadder_ui.py b/src/ui/dialogs/dialog_sources/medianadder_ui.py new file mode 100644 index 0000000..adf8edd --- /dev/null +++ b/src/ui/dialogs/dialog_sources/medianadder_ui.py @@ -0,0 +1,360 @@ +# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\dialogs\dialog_sources\medianadder.ui' +# +# Created by: PyQt6 UI code generator 6.8.0 +# +# 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(620, 481) + icon = QtGui.QIcon() + icon.addPixmap(QtGui.QPixmap(":/icons/resources/2795.svg"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) + Dialog.setWindowIcon(icon) + self.label = QtWidgets.QLabel(parent=Dialog) + self.label.setGeometry(QtCore.QRect(20, 10, 47, 21)) + self.label.setObjectName("label") + self.label_2 = QtWidgets.QLabel(parent=Dialog) + self.label_2.setGeometry(QtCore.QRect(20, 40, 47, 21)) + self.label_2.setObjectName("label_2") + self.comboBox = QtWidgets.QComboBox(parent=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(parent=Dialog) + self.lineEdit.setGeometry(QtCore.QRect(70, 10, 113, 20)) + self.lineEdit.setObjectName("lineEdit") + self.label_3 = QtWidgets.QLabel(parent=Dialog) + self.label_3.setGeometry(QtCore.QRect(20, 90, 47, 21)) + self.label_3.setObjectName("label_3") + self.widget = QtWidgets.QWidget(parent=Dialog) + self.widget.setGeometry(QtCore.QRect(330, 90, 281, 381)) + self.widget.setObjectName("widget") + self.horizontalLayout = QtWidgets.QHBoxLayout(self.widget) + self.horizontalLayout.setContentsMargins(0, 0, 0, 0) + self.horizontalLayout.setObjectName("horizontalLayout") + self.tableWidget = QtWidgets.QTableWidget(parent=self.widget) + self.tableWidget.setEnabled(True) + self.tableWidget.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.tableWidget.setAutoFillBackground(False) + self.tableWidget.setLineWidth(0) + self.tableWidget.setMidLineWidth(0) + self.tableWidget.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarPolicy.ScrollBarAlwaysOff) + self.tableWidget.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarPolicy.ScrollBarAlwaysOff) + self.tableWidget.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.SizeAdjustPolicy.AdjustToContents) + self.tableWidget.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers) + self.tableWidget.setAlternatingRowColors(True) + self.tableWidget.setSelectionMode(QtWidgets.QAbstractItemView.SelectionMode.NoSelection) + self.tableWidget.setTextElideMode(QtCore.Qt.TextElideMode.ElideMiddle) + self.tableWidget.setObjectName("tableWidget") + self.tableWidget.setColumnCount(4) + self.tableWidget.setRowCount(11) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setVerticalHeaderItem(0, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setVerticalHeaderItem(1, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setVerticalHeaderItem(2, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setVerticalHeaderItem(3, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setVerticalHeaderItem(4, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setVerticalHeaderItem(5, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setVerticalHeaderItem(6, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setVerticalHeaderItem(7, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setVerticalHeaderItem(8, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setVerticalHeaderItem(9, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setVerticalHeaderItem(10, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setHorizontalHeaderItem(0, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setHorizontalHeaderItem(1, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setHorizontalHeaderItem(2, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setHorizontalHeaderItem(3, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setItem(0, 0, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setItem(0, 1, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setItem(0, 2, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setItem(0, 3, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setItem(1, 0, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setItem(1, 1, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setItem(1, 2, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setItem(1, 3, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setItem(2, 0, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setItem(2, 1, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setItem(2, 2, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setItem(2, 3, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setItem(3, 0, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setItem(3, 1, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setItem(3, 2, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setItem(3, 3, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setItem(4, 0, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setItem(4, 1, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setItem(4, 2, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setItem(4, 3, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setItem(5, 0, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setItem(5, 1, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setItem(5, 2, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setItem(5, 3, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setItem(6, 0, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setItem(6, 1, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setItem(6, 2, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setItem(6, 3, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setItem(7, 0, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setItem(7, 1, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setItem(7, 2, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setItem(7, 3, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setItem(8, 0, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setItem(8, 1, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setItem(8, 2, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setItem(8, 3, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setItem(9, 0, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setItem(9, 1, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setItem(9, 2, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setItem(9, 3, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setItem(10, 0, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setItem(10, 1, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setItem(10, 2, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setItem(10, 3, item) + self.tableWidget.horizontalHeader().setDefaultSectionSize(45) + self.horizontalLayout.addWidget(self.tableWidget) + self.listWidget = QtWidgets.QListWidget(parent=Dialog) + self.listWidget.setGeometry(QtCore.QRect(10, 110, 281, 321)) + self.listWidget.setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.CustomContextMenu) + self.listWidget.setObjectName("listWidget") + self.label_4 = QtWidgets.QLabel(parent=Dialog) + self.label_4.setGeometry(QtCore.QRect(330, 50, 181, 21)) + self.label_4.setObjectName("label_4") + self.label_5 = QtWidgets.QLabel(parent=Dialog) + self.label_5.setGeometry(QtCore.QRect(200, 90, 41, 21)) + self.label_5.setObjectName("label_5") + self.list_amount = QtWidgets.QLabel(parent=Dialog) + self.list_amount.setGeometry(QtCore.QRect(240, 90, 47, 21)) + self.list_amount.setObjectName("list_amount") + self.horizontalLayoutWidget = QtWidgets.QWidget(parent=Dialog) + self.horizontalLayoutWidget.setGeometry(QtCore.QRect(10, 440, 160, 31)) + self.horizontalLayoutWidget.setObjectName("horizontalLayoutWidget") + self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget) + self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0) + self.horizontalLayout_2.setObjectName("horizontalLayout_2") + self.btn_save = QtWidgets.QPushButton(parent=self.horizontalLayoutWidget) + self.btn_save.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.btn_save.setObjectName("btn_save") + self.horizontalLayout_2.addWidget(self.btn_save) + self.btn_cancel = QtWidgets.QPushButton(parent=self.horizontalLayoutWidget) + self.btn_cancel.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.btn_cancel.setObjectName("btn_cancel") + self.horizontalLayout_2.addWidget(self.btn_cancel) + self.check_use_any_book = QtWidgets.QCheckBox(parent=Dialog) + self.check_use_any_book.setGeometry(QtCore.QRect(20, 70, 141, 20)) + self.check_use_any_book.setObjectName("check_use_any_book") + self.check_use_exact_signature = QtWidgets.QCheckBox(parent=Dialog) + self.check_use_exact_signature.setGeometry(QtCore.QRect(165, 70, 121, 20)) + self.check_use_exact_signature.setObjectName("check_use_exact_signature") + + self.retranslateUi(Dialog) + QtCore.QMetaObject.connectSlotsByName(Dialog) + Dialog.setTabOrder(self.lineEdit, self.comboBox) + Dialog.setTabOrder(self.comboBox, self.listWidget) + Dialog.setTabOrder(self.listWidget, self.tableWidget) + + def retranslateUi(self, Dialog): + _translate = QtCore.QCoreApplication.translate + Dialog.setWindowTitle(_translate("Dialog", "Medien")) + 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")) + item = self.tableWidget.verticalHeaderItem(0) + item.setText(_translate("Dialog", "PPN")) + item = self.tableWidget.verticalHeaderItem(1) + item.setText(_translate("Dialog", "Signatur")) + item = self.tableWidget.verticalHeaderItem(2) + item.setText(_translate("Dialog", "Autor")) + item = self.tableWidget.verticalHeaderItem(3) + item.setText(_translate("Dialog", "ISBN")) + item = self.tableWidget.verticalHeaderItem(4) + item.setText(_translate("Dialog", "Jahr")) + item = self.tableWidget.verticalHeaderItem(5) + item.setText(_translate("Dialog", "Auflage")) + item = self.tableWidget.verticalHeaderItem(6) + item.setText(_translate("Dialog", "Sprache")) + item = self.tableWidget.verticalHeaderItem(7) + item.setText(_translate("Dialog", "Herausgeber")) + item = self.tableWidget.verticalHeaderItem(8) + item.setText(_translate("Dialog", "Seiten")) + item = self.tableWidget.verticalHeaderItem(9) + item.setText(_translate("Dialog", "Titel")) + item = self.tableWidget.verticalHeaderItem(10) + item.setText(_translate("Dialog", "Link")) + item = self.tableWidget.horizontalHeaderItem(0) + item.setText(_translate("Dialog", "Array")) + item = self.tableWidget.horizontalHeaderItem(1) + item.setText(_translate("Dialog", "BibTeX")) + item = self.tableWidget.horizontalHeaderItem(2) + item.setText(_translate("Dialog", "COinS")) + item = self.tableWidget.horizontalHeaderItem(3) + item.setText(_translate("Dialog", "RIS")) + __sortingEnabled = self.tableWidget.isSortingEnabled() + self.tableWidget.setSortingEnabled(False) + item = self.tableWidget.item(0, 0) + item.setText(_translate("Dialog", "1")) + item = self.tableWidget.item(0, 1) + item.setText(_translate("Dialog", "0")) + item = self.tableWidget.item(0, 2) + item.setText(_translate("Dialog", "1")) + item = self.tableWidget.item(0, 3) + item.setText(_translate("Dialog", "1")) + item = self.tableWidget.item(1, 0) + item.setText(_translate("Dialog", "1")) + item = self.tableWidget.item(1, 1) + item.setText(_translate("Dialog", "1")) + item = self.tableWidget.item(1, 2) + item.setText(_translate("Dialog", "0")) + item = self.tableWidget.item(1, 3) + item.setText(_translate("Dialog", "1")) + item = self.tableWidget.item(2, 0) + item.setText(_translate("Dialog", "1")) + item = self.tableWidget.item(2, 1) + item.setText(_translate("Dialog", "1")) + item = self.tableWidget.item(2, 2) + item.setText(_translate("Dialog", "1")) + item = self.tableWidget.item(2, 3) + item.setText(_translate("Dialog", "1")) + item = self.tableWidget.item(3, 0) + item.setText(_translate("Dialog", "1")) + item = self.tableWidget.item(3, 1) + item.setText(_translate("Dialog", "1")) + item = self.tableWidget.item(3, 2) + item.setText(_translate("Dialog", "1")) + item = self.tableWidget.item(3, 3) + item.setText(_translate("Dialog", "1")) + item = self.tableWidget.item(4, 0) + item.setText(_translate("Dialog", "1")) + item = self.tableWidget.item(4, 1) + item.setText(_translate("Dialog", "1")) + item = self.tableWidget.item(4, 2) + item.setText(_translate("Dialog", "1")) + item = self.tableWidget.item(4, 3) + item.setText(_translate("Dialog", "1")) + item = self.tableWidget.item(5, 0) + item.setText(_translate("Dialog", "1")) + item = self.tableWidget.item(5, 1) + item.setText(_translate("Dialog", "1")) + item = self.tableWidget.item(5, 2) + item.setText(_translate("Dialog", "1")) + item = self.tableWidget.item(5, 3) + item.setText(_translate("Dialog", "1")) + item = self.tableWidget.item(6, 0) + item.setText(_translate("Dialog", "1")) + item = self.tableWidget.item(6, 1) + item.setText(_translate("Dialog", "1")) + item = self.tableWidget.item(6, 2) + item.setText(_translate("Dialog", "0")) + item = self.tableWidget.item(6, 3) + item.setText(_translate("Dialog", "1")) + item = self.tableWidget.item(7, 0) + item.setText(_translate("Dialog", "1")) + item = self.tableWidget.item(7, 1) + item.setText(_translate("Dialog", "1")) + item = self.tableWidget.item(7, 2) + item.setText(_translate("Dialog", "1")) + item = self.tableWidget.item(7, 3) + item.setText(_translate("Dialog", "1")) + item = self.tableWidget.item(8, 0) + item.setText(_translate("Dialog", "1")) + item = self.tableWidget.item(8, 1) + item.setText(_translate("Dialog", "1")) + item = self.tableWidget.item(8, 2) + item.setText(_translate("Dialog", "1")) + item = self.tableWidget.item(8, 3) + item.setText(_translate("Dialog", "1")) + item = self.tableWidget.item(9, 0) + item.setText(_translate("Dialog", "1")) + item = self.tableWidget.item(9, 1) + item.setText(_translate("Dialog", "1")) + item = self.tableWidget.item(9, 2) + item.setText(_translate("Dialog", "1")) + item = self.tableWidget.item(9, 3) + item.setText(_translate("Dialog", "1")) + item = self.tableWidget.item(10, 0) + item.setText(_translate("Dialog", "1")) + item = self.tableWidget.item(10, 1) + item.setText(_translate("Dialog", "0")) + item = self.tableWidget.item(10, 2) + item.setText(_translate("Dialog", "1")) + item = self.tableWidget.item(10, 3) + item.setText(_translate("Dialog", "1")) + self.tableWidget.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.btn_save.setText(_translate("Dialog", "Ok")) + self.btn_cancel.setText(_translate("Dialog", "Abbrechen")) + self.check_use_any_book.setToolTip(_translate("Dialog", "Verwendet ein zufälliges Buch des Datensatzes, nützlich wenn das Buch noch nicht im Apparat ist")) + self.check_use_any_book.setText(_translate("Dialog", "Jedes Buch verwenden")) + self.check_use_exact_signature.setToolTip(_translate("Dialog", "Verwendet die eingegebene Signatur für die Suche von Daten")) + self.check_use_exact_signature.setText(_translate("Dialog", "Exakte Signatur")) diff --git a/src/ui/dialogs/dialog_sources/newMailTemplateDesigner_ui.py b/src/ui/dialogs/dialog_sources/newMailTemplateDesigner_ui.py new file mode 100644 index 0000000..4ad337a --- /dev/null +++ b/src/ui/dialogs/dialog_sources/newMailTemplateDesigner_ui.py @@ -0,0 +1,163 @@ +# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\dialogs\dialog_sources\newMailTemplateDesigner.ui' +# +# Created by: PyQt6 UI code generator 6.8.0 +# +# 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(689, 572) + self.verticalLayout_2 = QtWidgets.QVBoxLayout(Dialog) + self.verticalLayout_2.setObjectName("verticalLayout_2") + self.verticalLayout = QtWidgets.QVBoxLayout() + self.verticalLayout.setObjectName("verticalLayout") + self.horizontalLayout_2 = QtWidgets.QHBoxLayout() + self.horizontalLayout_2.setObjectName("horizontalLayout_2") + self.bold = QtWidgets.QPushButton(parent=Dialog) + self.bold.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.bold.setCheckable(True) + self.bold.setObjectName("bold") + self.horizontalLayout_2.addWidget(self.bold) + self.italic = QtWidgets.QPushButton(parent=Dialog) + self.italic.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.italic.setCheckable(True) + self.italic.setObjectName("italic") + self.horizontalLayout_2.addWidget(self.italic) + self.underlined = QtWidgets.QPushButton(parent=Dialog) + self.underlined.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.underlined.setCheckable(True) + self.underlined.setObjectName("underlined") + self.horizontalLayout_2.addWidget(self.underlined) + self.fontBox = QtWidgets.QFontComboBox(parent=Dialog) + self.fontBox.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.fontBox.setObjectName("fontBox") + self.horizontalLayout_2.addWidget(self.fontBox) + self.fontSize = QtWidgets.QComboBox(parent=Dialog) + self.fontSize.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.fontSize.setObjectName("fontSize") + self.fontSize.addItem("") + self.fontSize.addItem("") + self.fontSize.addItem("") + self.fontSize.addItem("") + self.fontSize.addItem("") + self.fontSize.addItem("") + self.fontSize.addItem("") + self.fontSize.addItem("") + self.fontSize.addItem("") + self.fontSize.addItem("") + self.fontSize.addItem("") + self.fontSize.addItem("") + self.fontSize.addItem("") + self.fontSize.addItem("") + self.fontSize.addItem("") + self.horizontalLayout_2.addWidget(self.fontSize) + spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) + self.horizontalLayout_2.addItem(spacerItem) + self.verticalLayout.addLayout(self.horizontalLayout_2) + self.horizontalLayout_4 = QtWidgets.QHBoxLayout() + self.horizontalLayout_4.setObjectName("horizontalLayout_4") + self.verticalLayout.addLayout(self.horizontalLayout_4) + self.gridLayout = QtWidgets.QGridLayout() + self.gridLayout.setObjectName("gridLayout") + self.label = QtWidgets.QLabel(parent=Dialog) + self.label.setObjectName("label") + self.gridLayout.addWidget(self.label, 0, 0, 1, 1) + self.placeholder_list = QtWidgets.QComboBox(parent=Dialog) + self.placeholder_list.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.placeholder_list.setSizeAdjustPolicy(QtWidgets.QComboBox.SizeAdjustPolicy.AdjustToContents) + self.placeholder_list.setObjectName("placeholder_list") + self.placeholder_list.addItem("") + self.placeholder_list.addItem("") + self.placeholder_list.addItem("") + self.placeholder_list.addItem("") + self.placeholder_list.addItem("") + self.placeholder_list.addItem("") + self.gridLayout.addWidget(self.placeholder_list, 1, 0, 1, 1) + self.label_2 = QtWidgets.QLabel(parent=Dialog) + self.label_2.setObjectName("label_2") + self.gridLayout.addWidget(self.label_2, 0, 1, 1, 1) + self.lineEdit = QtWidgets.QLineEdit(parent=Dialog) + self.lineEdit.setEnabled(True) + self.lineEdit.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.lineEdit.setFrame(False) + self.lineEdit.setReadOnly(True) + self.lineEdit.setObjectName("lineEdit") + self.gridLayout.addWidget(self.lineEdit, 1, 1, 1, 1) + self.insertPlaceholder = QtWidgets.QPushButton(parent=Dialog) + self.insertPlaceholder.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.insertPlaceholder.setObjectName("insertPlaceholder") + self.gridLayout.addWidget(self.insertPlaceholder, 1, 2, 1, 1) + self.verticalLayout.addLayout(self.gridLayout) + self.label_3 = QtWidgets.QLabel(parent=Dialog) + self.label_3.setObjectName("label_3") + self.verticalLayout.addWidget(self.label_3) + self.subject = QtWidgets.QLineEdit(parent=Dialog) + self.subject.setObjectName("subject") + self.verticalLayout.addWidget(self.subject) + self.templateEdit = QtWidgets.QTextEdit(parent=Dialog) + self.templateEdit.setObjectName("templateEdit") + self.verticalLayout.addWidget(self.templateEdit) + self.horizontalLayout_3 = QtWidgets.QHBoxLayout() + self.horizontalLayout_3.setObjectName("horizontalLayout_3") + self.testTemplate = QtWidgets.QPushButton(parent=Dialog) + self.testTemplate.setObjectName("testTemplate") + self.horizontalLayout_3.addWidget(self.testTemplate) + spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) + self.horizontalLayout_3.addItem(spacerItem1) + self.verticalLayout.addLayout(self.horizontalLayout_3) + self.verticalLayout_2.addLayout(self.verticalLayout) + self.buttonBox = QtWidgets.QDialogButtonBox(parent=Dialog) + self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal) + self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Discard|QtWidgets.QDialogButtonBox.StandardButton.Save) + self.buttonBox.setObjectName("buttonBox") + self.verticalLayout_2.addWidget(self.buttonBox) + + self.retranslateUi(Dialog) + self.fontSize.setCurrentIndex(1) + QtCore.QMetaObject.connectSlotsByName(Dialog) + Dialog.setTabOrder(self.subject, self.templateEdit) + Dialog.setTabOrder(self.templateEdit, self.testTemplate) + Dialog.setTabOrder(self.testTemplate, self.insertPlaceholder) + Dialog.setTabOrder(self.insertPlaceholder, self.lineEdit) + Dialog.setTabOrder(self.lineEdit, self.fontSize) + Dialog.setTabOrder(self.fontSize, self.placeholder_list) + Dialog.setTabOrder(self.placeholder_list, self.fontBox) + + def retranslateUi(self, Dialog): + _translate = QtCore.QCoreApplication.translate + Dialog.setWindowTitle(_translate("Dialog", "Dialog")) + self.bold.setText(_translate("Dialog", "Fett")) + self.italic.setText(_translate("Dialog", "Kursiv")) + self.underlined.setText(_translate("Dialog", "Unterstrichen")) + self.fontSize.setItemText(0, _translate("Dialog", "8")) + self.fontSize.setItemText(1, _translate("Dialog", "9")) + self.fontSize.setItemText(2, _translate("Dialog", "11")) + self.fontSize.setItemText(3, _translate("Dialog", "12")) + self.fontSize.setItemText(4, _translate("Dialog", "14")) + self.fontSize.setItemText(5, _translate("Dialog", "16")) + self.fontSize.setItemText(6, _translate("Dialog", "18")) + self.fontSize.setItemText(7, _translate("Dialog", "20")) + self.fontSize.setItemText(8, _translate("Dialog", "22")) + self.fontSize.setItemText(9, _translate("Dialog", "24")) + self.fontSize.setItemText(10, _translate("Dialog", "26")) + self.fontSize.setItemText(11, _translate("Dialog", "28")) + self.fontSize.setItemText(12, _translate("Dialog", "36")) + self.fontSize.setItemText(13, _translate("Dialog", "48")) + self.fontSize.setItemText(14, _translate("Dialog", "76")) + self.label.setText(_translate("Dialog", "Platzhalter")) + self.placeholder_list.setItemText(0, _translate("Dialog", "«Anrede»")) + self.placeholder_list.setItemText(1, _translate("Dialog", "«ApparatsName»")) + self.placeholder_list.setItemText(2, _translate("Dialog", "«ApparatsFach»")) + self.placeholder_list.setItemText(3, _translate("Dialog", "«ApparatsNummer»")) + self.placeholder_list.setItemText(4, _translate("Dialog", "«DozentName»")) + self.placeholder_list.setItemText(5, _translate("Dialog", "«Signatur»")) + self.label_2.setText(_translate("Dialog", "Beschreibung")) + self.insertPlaceholder.setText(_translate("Dialog", "An aktiver Position einfügen")) + self.label_3.setText(_translate("Dialog", "Betreff")) + self.testTemplate.setText(_translate("Dialog", "Template testen")) diff --git a/src/ui/dialogs/dialog_sources/parsed_titles_ui.py b/src/ui/dialogs/dialog_sources/parsed_titles_ui.py new file mode 100644 index 0000000..c99e92d --- /dev/null +++ b/src/ui/dialogs/dialog_sources/parsed_titles_ui.py @@ -0,0 +1,81 @@ +# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\dialogs\dialog_sources\parsed_titles.ui' +# +# Created by: PyQt6 UI code generator 6.8.0 +# +# 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", "...")) diff --git a/src/ui/dialogs/dialog_sources/reminder_ui.py b/src/ui/dialogs/dialog_sources/reminder_ui.py new file mode 100644 index 0000000..6ae8f4a --- /dev/null +++ b/src/ui/dialogs/dialog_sources/reminder_ui.py @@ -0,0 +1,43 @@ +# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\dialogs\dialog_sources\reminder.ui' +# +# Created by: PyQt6 UI code generator 6.8.0 +# +# 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_Erinnerung(object): + def setupUi(self, Erinnerung): + Erinnerung.setObjectName("Erinnerung") + Erinnerung.resize(358, 308) + self.buttonBox = QtWidgets.QDialogButtonBox(parent=Erinnerung) + 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(parent=Erinnerung) + self.message_box.setGeometry(QtCore.QRect(10, 60, 341, 201)) + self.message_box.setObjectName("message_box") + self.label = QtWidgets.QLabel(parent=Erinnerung) + self.label.setGeometry(QtCore.QRect(10, 30, 61, 21)) + self.label.setObjectName("label") + self.label_2 = QtWidgets.QLabel(parent=Erinnerung) + self.label_2.setGeometry(QtCore.QRect(120, 30, 81, 21)) + self.label_2.setObjectName("label_2") + self.dateEdit = QtWidgets.QDateEdit(parent=Erinnerung) + self.dateEdit.setGeometry(QtCore.QRect(210, 30, 141, 22)) + self.dateEdit.setObjectName("dateEdit") + + self.retranslateUi(Erinnerung) + self.buttonBox.accepted.connect(Erinnerung.accept) # type: ignore + self.buttonBox.rejected.connect(Erinnerung.reject) # type: ignore + QtCore.QMetaObject.connectSlotsByName(Erinnerung) + + def retranslateUi(self, Erinnerung): + _translate = QtCore.QCoreApplication.translate + Erinnerung.setWindowTitle(_translate("Erinnerung", "Dialog")) + self.label.setText(_translate("Erinnerung", "Nachricht:")) + self.label_2.setText(_translate("Erinnerung", "Erinnerung am:")) diff --git a/src/ui/dialogs/dialog_sources/settings.ui b/src/ui/dialogs/dialog_sources/settings.ui index fc357eb..81faa04 100644 --- a/src/ui/dialogs/dialog_sources/settings.ui +++ b/src/ui/dialogs/dialog_sources/settings.ui @@ -35,7 +35,7 @@ Qt::ImhNone - 3 + 2 @@ -232,20 +232,6 @@ - - - - true - - - - - - - Nutzername - - - @@ -260,13 +246,10 @@ - - - - Kürzel, von der Hochschule vergeben, bsp: Aky547 - - - true + + + + Port @@ -280,13 +263,6 @@ - - - - Passwort - - - @@ -294,13 +270,6 @@ - - - - - - - @@ -311,10 +280,20 @@ - - + + + + Kürzel, von der Hochschule vergeben, bsp: Aky547 + + + true + + + + + - SMTP-Server + @@ -328,10 +307,24 @@ - - + + + + true + + + + + - Port + SMTP-Server + + + + + + + Passwort @@ -345,6 +338,23 @@ + + + + Nutzername + + + + + + + Printmail + + + + + + diff --git a/src/ui/dialogs/dialog_sources/settings_ui.py b/src/ui/dialogs/dialog_sources/settings_ui.py index c2c3e1d..288c9ff 100644 --- a/src/ui/dialogs/dialog_sources/settings_ui.py +++ b/src/ui/dialogs/dialog_sources/settings_ui.py @@ -1,188 +1,206 @@ -# Form implementation generated from reading ui file '/home/alexander/GitHub/SemesterapparatsManager/src/ui/dialogs/dialog_sources/settings.ui' +# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\dialogs\dialog_sources\settings.ui' # -# Created by: PyQt6 UI code generator 6.6.1 +# Created by: PyQt6 UI code generator 6.8.0 # # 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 +from PyQt6 import QtCore, QtGui, QtWidgets class Ui_Dialog(object): def setupUi(self, Dialog): - # Dialog.setObjectName("Dialog") - Dialog.resize(743, 576) - - self.buttonBox = QtWidgets.QDialogButtonBox(parent=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(parent=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_2 = QtWidgets.QLabel(parent=self.frame) - self.label_2.setGeometry(QtCore.QRect(10, 20, 161, 21)) - self.label_2.setObjectName("label_2") - self.formLayoutWidget = QtWidgets.QWidget(parent=self.frame) - self.formLayoutWidget.setGeometry(QtCore.QRect(10, 40, 361, 491)) - self.formLayoutWidget.setObjectName("formLayoutWidget") - self.gridLayout = QtWidgets.QGridLayout(self.formLayoutWidget) - self.gridLayout.setContentsMargins(0, 0, 0, 0) - self.gridLayout.setObjectName("gridLayout") - self.tb_select_db = QtWidgets.QToolButton(parent=self.formLayoutWidget) - self.tb_select_db.setObjectName("tb_select_db") - self.gridLayout.addWidget(self.tb_select_db, 0, 2, 1, 1) - self.db_path = QtWidgets.QLineEdit(parent=self.formLayoutWidget) + Dialog.setObjectName("Dialog") + Dialog.setWindowModality(QtCore.Qt.WindowModality.NonModal) + Dialog.resize(651, 679) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, QtWidgets.QSizePolicy.Policy.MinimumExpanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(Dialog.sizePolicy().hasHeightForWidth()) + Dialog.setSizePolicy(sizePolicy) + self.verticalLayout = QtWidgets.QVBoxLayout(Dialog) + self.verticalLayout.setObjectName("verticalLayout") + self.toolBox = QtWidgets.QToolBox(parent=Dialog) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, QtWidgets.QSizePolicy.Policy.MinimumExpanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.toolBox.sizePolicy().hasHeightForWidth()) + self.toolBox.setSizePolicy(sizePolicy) + self.toolBox.setInputMethodHints(QtCore.Qt.InputMethodHint.ImhNone) + self.toolBox.setObjectName("toolBox") + self.page_1 = QtWidgets.QWidget() + self.page_1.setGeometry(QtCore.QRect(0, 0, 633, 511)) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, QtWidgets.QSizePolicy.Policy.MinimumExpanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.page_1.sizePolicy().hasHeightForWidth()) + self.page_1.setSizePolicy(sizePolicy) + self.page_1.setObjectName("page_1") + self.gridLayout_3 = QtWidgets.QGridLayout(self.page_1) + self.gridLayout_3.setObjectName("gridLayout_3") + self.db_name = QtWidgets.QLineEdit(parent=self.page_1) + self.db_name.setObjectName("db_name") + self.gridLayout_3.addWidget(self.db_name, 0, 1, 1, 1) + self.label_5 = QtWidgets.QLabel(parent=self.page_1) + self.label_5.setObjectName("label_5") + self.gridLayout_3.addWidget(self.label_5, 0, 0, 1, 1) + self.db_path = QtWidgets.QLineEdit(parent=self.page_1) self.db_path.setEnabled(False) self.db_path.setObjectName("db_path") - self.gridLayout.addWidget(self.db_path, 1, 1, 1, 1) - self.label_3 = QtWidgets.QLabel(parent=self.formLayoutWidget) - self.label_3.setObjectName("label_3") - self.gridLayout.addWidget(self.label_3, 0, 0, 1, 1) - self.db_name = QtWidgets.QLineEdit(parent=self.formLayoutWidget) - self.db_name.setObjectName("db_name") - self.gridLayout.addWidget(self.db_name, 0, 1, 1, 1) - self.label_4 = QtWidgets.QLabel(parent=self.formLayoutWidget) - self.label_4.setObjectName("label_4") - self.gridLayout.addWidget(self.label_4, 1, 0, 1, 1) - self.save_path = QtWidgets.QLineEdit(parent=self.formLayoutWidget) - self.save_path.setObjectName("save_path") - self.gridLayout.addWidget(self.save_path, 2, 1, 1, 1) - self.tb_set_save_path = QtWidgets.QToolButton(parent=self.formLayoutWidget) + self.gridLayout_3.addWidget(self.db_path, 1, 1, 1, 1) + self.label_12 = QtWidgets.QLabel(parent=self.page_1) + self.label_12.setObjectName("label_12") + self.gridLayout_3.addWidget(self.label_12, 2, 0, 1, 1) + self.label_11 = QtWidgets.QLabel(parent=self.page_1) + self.label_11.setObjectName("label_11") + self.gridLayout_3.addWidget(self.label_11, 1, 0, 1, 1) + self.tb_set_save_path = QtWidgets.QToolButton(parent=self.page_1) 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.label_5 = QtWidgets.QLabel(parent=self.formLayoutWidget) - self.label_5.setObjectName("label_5") - self.gridLayout.addWidget(self.label_5, 2, 0, 1, 1) - self.email_settings = QtWidgets.QTabWidget(parent=self.frame) - self.email_settings.setGeometry(QtCore.QRect(390, 40, 341, 491)) + self.gridLayout_3.addWidget(self.tb_set_save_path, 2, 2, 1, 1) + self.tb_select_db = QtWidgets.QToolButton(parent=self.page_1) + self.tb_select_db.setObjectName("tb_select_db") + self.gridLayout_3.addWidget(self.tb_select_db, 0, 2, 1, 1) + self.save_path = QtWidgets.QLineEdit(parent=self.page_1) + self.save_path.setObjectName("save_path") + self.gridLayout_3.addWidget(self.save_path, 2, 1, 1, 1) + spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) + self.gridLayout_3.addItem(spacerItem, 3, 1, 1, 1) + self.toolBox.addItem(self.page_1, "") + self.page_2 = QtWidgets.QWidget() + self.page_2.setGeometry(QtCore.QRect(0, 0, 633, 511)) + self.page_2.setObjectName("page_2") + self.gridLayout = QtWidgets.QGridLayout(self.page_2) + self.gridLayout.setObjectName("gridLayout") + self.zotero_library_type = QtWidgets.QLineEdit(parent=self.page_2) + self.zotero_library_type.setObjectName("zotero_library_type") + self.gridLayout.addWidget(self.zotero_library_type, 2, 2, 1, 1) + self.zotero_library_id = QtWidgets.QLineEdit(parent=self.page_2) + self.zotero_library_id.setObjectName("zotero_library_id") + self.gridLayout.addWidget(self.zotero_library_id, 1, 2, 1, 1) + self.label_4 = QtWidgets.QLabel(parent=self.page_2) + self.label_4.setObjectName("label_4") + self.gridLayout.addWidget(self.label_4, 2, 0, 1, 1) + self.label_3 = QtWidgets.QLabel(parent=self.page_2) + self.label_3.setObjectName("label_3") + self.gridLayout.addWidget(self.label_3, 1, 0, 1, 1) + self.zotero_api_key = QtWidgets.QLineEdit(parent=self.page_2) + self.zotero_api_key.setInputMethodHints(QtCore.Qt.InputMethodHint.ImhHiddenText|QtCore.Qt.InputMethodHint.ImhSensitiveData) + self.zotero_api_key.setObjectName("zotero_api_key") + self.gridLayout.addWidget(self.zotero_api_key, 0, 2, 1, 1) + self.label_2 = QtWidgets.QLabel(parent=self.page_2) + self.label_2.setObjectName("label_2") + self.gridLayout.addWidget(self.label_2, 0, 0, 1, 1) + self.toggle_api_visibility = QtWidgets.QToolButton(parent=self.page_2) + self.toggle_api_visibility.setText("") + self.toggle_api_visibility.setObjectName("toggle_api_visibility") + self.gridLayout.addWidget(self.toggle_api_visibility, 0, 3, 1, 1) + spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) + self.gridLayout.addItem(spacerItem1, 3, 2, 1, 1) + self.toolBox.addItem(self.page_2, "") + self.page_3 = QtWidgets.QWidget() + self.page_3.setGeometry(QtCore.QRect(0, 0, 633, 511)) + self.page_3.setObjectName("page_3") + self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.page_3) + self.horizontalLayout_2.setObjectName("horizontalLayout_2") + self.email_settings = QtWidgets.QTabWidget(parent=self.page_3) self.email_settings.setObjectName("email_settings") self.email_settingsPage1_2 = QtWidgets.QWidget() self.email_settingsPage1_2.setObjectName("email_settingsPage1_2") - self.formLayoutWidget_2 = QtWidgets.QWidget(parent=self.email_settingsPage1_2) - self.formLayoutWidget_2.setGeometry(QtCore.QRect(10, 30, 321, 381)) - self.formLayoutWidget_2.setObjectName("formLayoutWidget_2") - self.gridLayout_2 = QtWidgets.QGridLayout(self.formLayoutWidget_2) - self.gridLayout_2.setContentsMargins(0, 0, 0, 0) + self.horizontalLayout_4 = QtWidgets.QHBoxLayout(self.email_settingsPage1_2) + self.horizontalLayout_4.setObjectName("horizontalLayout_4") + self.gridLayout_2 = QtWidgets.QGridLayout() self.gridLayout_2.setObjectName("gridLayout_2") - self.smtp_address = QtWidgets.QLineEdit(parent=self.formLayoutWidget_2) - self.smtp_address.setClearButtonEnabled(True) - self.smtp_address.setObjectName("smtp_address") - self.gridLayout_2.addWidget(self.smtp_address, 0, 1, 1, 1) - self.label_8 = QtWidgets.QLabel(parent=self.formLayoutWidget_2) - self.label_8.setObjectName("label_8") - self.gridLayout_2.addWidget(self.label_8, 3, 0, 1, 1) - self.use_username_smtp_login = QtWidgets.QCheckBox( - parent=self.formLayoutWidget_2 - ) + self.use_username_smtp_login = QtWidgets.QCheckBox(parent=self.email_settingsPage1_2) self.use_username_smtp_login.setTristate(False) self.use_username_smtp_login.setObjectName("use_username_smtp_login") self.gridLayout_2.addWidget(self.use_username_smtp_login, 4, 1, 1, 1) - self.mail_username = QtWidgets.QLineEdit(parent=self.formLayoutWidget_2) - self.mail_username.setClearButtonEnabled(True) - self.mail_username.setObjectName("mail_username") - self.gridLayout_2.addWidget(self.mail_username, 3, 1, 1, 1) - self.smtp_port = QtWidgets.QLineEdit(parent=self.formLayoutWidget_2) - self.smtp_port.setInputMethodHints( - QtCore.Qt.InputMethodHint.ImhDigitsOnly - | QtCore.Qt.InputMethodHint.ImhPreferNumbers - ) + self.label_6 = QtWidgets.QLabel(parent=self.email_settingsPage1_2) + self.label_6.setObjectName("label_6") + self.gridLayout_2.addWidget(self.label_6, 1, 0, 1, 1) + self.smtp_port = QtWidgets.QLineEdit(parent=self.email_settingsPage1_2) + self.smtp_port.setInputMethodHints(QtCore.Qt.InputMethodHint.ImhDigitsOnly|QtCore.Qt.InputMethodHint.ImhPreferNumbers) self.smtp_port.setClearButtonEnabled(True) self.smtp_port.setObjectName("smtp_port") self.gridLayout_2.addWidget(self.smtp_port, 1, 1, 1, 1) - self.label_10 = QtWidgets.QLabel(parent=self.formLayoutWidget_2) - self.label_10.setObjectName("label_10") - self.gridLayout_2.addWidget(self.label_10, 5, 0, 1, 1) - self.label_7 = QtWidgets.QLabel(parent=self.formLayoutWidget_2) + self.label_7 = QtWidgets.QLabel(parent=self.email_settingsPage1_2) self.label_7.setObjectName("label_7") self.gridLayout_2.addWidget(self.label_7, 2, 0, 1, 1) - self.label_9 = QtWidgets.QLabel(parent=self.formLayoutWidget_2) - self.label_9.setText("") - self.label_9.setObjectName("label_9") - self.gridLayout_2.addWidget(self.label_9, 6, 0, 1, 1) - self.sender_email = QtWidgets.QLineEdit(parent=self.formLayoutWidget_2) - self.sender_email.setInputMethodHints( - QtCore.Qt.InputMethodHint.ImhEmailCharactersOnly - ) + self.sender_email = QtWidgets.QLineEdit(parent=self.email_settingsPage1_2) + self.sender_email.setInputMethodHints(QtCore.Qt.InputMethodHint.ImhEmailCharactersOnly) self.sender_email.setClearButtonEnabled(True) self.sender_email.setObjectName("sender_email") self.gridLayout_2.addWidget(self.sender_email, 2, 1, 1, 1) - self.label = QtWidgets.QLabel(parent=self.formLayoutWidget_2) - self.label.setObjectName("label") - self.gridLayout_2.addWidget(self.label, 0, 0, 1, 1) - self.password = QtWidgets.QLineEdit(parent=self.formLayoutWidget_2) - self.password.setInputMethodHints( - QtCore.Qt.InputMethodHint.ImhHiddenText - | QtCore.Qt.InputMethodHint.ImhSensitiveData - ) + self.mail_username = QtWidgets.QLineEdit(parent=self.email_settingsPage1_2) + self.mail_username.setClearButtonEnabled(True) + self.mail_username.setObjectName("mail_username") + self.gridLayout_2.addWidget(self.mail_username, 3, 1, 1, 1) + self.label_9 = QtWidgets.QLabel(parent=self.email_settingsPage1_2) + self.label_9.setText("") + self.label_9.setObjectName("label_9") + self.gridLayout_2.addWidget(self.label_9, 7, 0, 1, 1) + self.password = QtWidgets.QLineEdit(parent=self.email_settingsPage1_2) + self.password.setInputMethodHints(QtCore.Qt.InputMethodHint.ImhHiddenText|QtCore.Qt.InputMethodHint.ImhSensitiveData) self.password.setClearButtonEnabled(True) self.password.setObjectName("password") self.gridLayout_2.addWidget(self.password, 5, 1, 1, 1) - self.label_6 = QtWidgets.QLabel(parent=self.formLayoutWidget_2) - self.label_6.setObjectName("label_6") - self.gridLayout_2.addWidget(self.label_6, 1, 0, 1, 1) - self.togglePassword = QtWidgets.QPushButton(parent=self.formLayoutWidget_2) + self.smtp_address = QtWidgets.QLineEdit(parent=self.email_settingsPage1_2) + self.smtp_address.setClearButtonEnabled(True) + self.smtp_address.setObjectName("smtp_address") + self.gridLayout_2.addWidget(self.smtp_address, 0, 1, 1, 1) + self.label = QtWidgets.QLabel(parent=self.email_settingsPage1_2) + self.label.setObjectName("label") + self.gridLayout_2.addWidget(self.label, 0, 0, 1, 1) + self.label_10 = QtWidgets.QLabel(parent=self.email_settingsPage1_2) + self.label_10.setObjectName("label_10") + self.gridLayout_2.addWidget(self.label_10, 5, 0, 1, 1) + self.togglePassword = QtWidgets.QPushButton(parent=self.email_settingsPage1_2) + self.togglePassword.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) self.togglePassword.setText("") self.togglePassword.setObjectName("togglePassword") self.gridLayout_2.addWidget(self.togglePassword, 5, 2, 1, 1) + self.label_8 = QtWidgets.QLabel(parent=self.email_settingsPage1_2) + self.label_8.setObjectName("label_8") + self.gridLayout_2.addWidget(self.label_8, 3, 0, 1, 1) + self.label_13 = QtWidgets.QLabel(parent=self.email_settingsPage1_2) + self.label_13.setObjectName("label_13") + self.gridLayout_2.addWidget(self.label_13, 6, 0, 1, 1) + self.printermail = QtWidgets.QLineEdit(parent=self.email_settingsPage1_2) + self.printermail.setObjectName("printermail") + self.gridLayout_2.addWidget(self.printermail, 6, 1, 1, 1) + self.horizontalLayout_4.addLayout(self.gridLayout_2) self.email_settings.addTab(self.email_settingsPage1_2, "") self.email_settingsPage2_2 = QtWidgets.QWidget() self.email_settingsPage2_2.setObjectName("email_settingsPage2_2") - self.verticalLayoutWidget = QtWidgets.QWidget(parent=self.email_settingsPage2_2) - self.verticalLayoutWidget.setGeometry(QtCore.QRect(0, 0, 401, 71)) - self.verticalLayoutWidget.setObjectName("verticalLayoutWidget") - self.verticalLayout = QtWidgets.QVBoxLayout(self.verticalLayoutWidget) - self.verticalLayout.setContentsMargins(0, 0, 0, 0) - self.verticalLayout.setObjectName("verticalLayout") + self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.email_settingsPage2_2) + self.verticalLayout_3.setObjectName("verticalLayout_3") + self.verticalLayout_2 = QtWidgets.QVBoxLayout() + self.verticalLayout_2.setObjectName("verticalLayout_2") self.horizontalLayout_3 = QtWidgets.QHBoxLayout() self.horizontalLayout_3.setObjectName("horizontalLayout_3") - spacerItem1 = QtWidgets.QSpacerItem( - 40, - 20, - QtWidgets.QSizePolicy.Policy.Expanding, - QtWidgets.QSizePolicy.Policy.Minimum, - ) - self.horizontalLayout_3.addItem(spacerItem1) - self.bold = QtWidgets.QPushButton(parent=self.verticalLayoutWidget) + spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) + self.horizontalLayout_3.addItem(spacerItem2) + self.bold = QtWidgets.QPushButton(parent=self.email_settingsPage2_2) self.bold.setCheckable(True) self.bold.setObjectName("bold") self.horizontalLayout_3.addWidget(self.bold) - self.italic = QtWidgets.QPushButton(parent=self.verticalLayoutWidget) + self.italic = QtWidgets.QPushButton(parent=self.email_settingsPage2_2) self.italic.setCheckable(True) self.italic.setObjectName("italic") self.horizontalLayout_3.addWidget(self.italic) - self.underscore = QtWidgets.QPushButton(parent=self.verticalLayoutWidget) + self.underscore = QtWidgets.QPushButton(parent=self.email_settingsPage2_2) self.underscore.setCheckable(True) self.underscore.setObjectName("underscore") self.horizontalLayout_3.addWidget(self.underscore) - spacerItem2 = QtWidgets.QSpacerItem( - 40, - 20, - QtWidgets.QSizePolicy.Policy.Expanding, - QtWidgets.QSizePolicy.Policy.Minimum, - ) - self.horizontalLayout_3.addItem(spacerItem2) - self.verticalLayout.addLayout(self.horizontalLayout_3) + spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) + self.horizontalLayout_3.addItem(spacerItem3) + self.verticalLayout_2.addLayout(self.horizontalLayout_3) self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") - self.fontComboBox = QtWidgets.QFontComboBox(parent=self.verticalLayoutWidget) + self.fontComboBox = QtWidgets.QFontComboBox(parent=self.email_settingsPage2_2) self.fontComboBox.setObjectName("fontComboBox") self.horizontalLayout.addWidget(self.fontComboBox) - self.font_size = QtWidgets.QComboBox(parent=self.verticalLayoutWidget) + self.font_size = QtWidgets.QComboBox(parent=self.email_settingsPage2_2) self.font_size.setObjectName("font_size") self.font_size.addItem("") self.font_size.addItem("") @@ -200,76 +218,104 @@ class Ui_Dialog(object): self.font_size.addItem("") self.font_size.addItem("") self.horizontalLayout.addWidget(self.font_size) - spacerItem3 = QtWidgets.QSpacerItem( - 40, - 20, - QtWidgets.QSizePolicy.Policy.Expanding, - QtWidgets.QSizePolicy.Policy.Minimum, - ) - self.horizontalLayout.addItem(spacerItem3) - self.verticalLayout.addLayout(self.horizontalLayout) + spacerItem4 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) + self.horizontalLayout.addItem(spacerItem4) + self.verticalLayout_2.addLayout(self.horizontalLayout) + self.verticalLayout_3.addLayout(self.verticalLayout_2) self.editSignature = QtWidgets.QTextEdit(parent=self.email_settingsPage2_2) - self.editSignature.setGeometry(QtCore.QRect(10, 80, 321, 301)) self.editSignature.setObjectName("editSignature") + self.verticalLayout_3.addWidget(self.editSignature) self.debug = QtWidgets.QPushButton(parent=self.email_settingsPage2_2) - self.debug.setGeometry(QtCore.QRect(30, 430, 75, 24)) self.debug.setObjectName("debug") + self.verticalLayout_3.addWidget(self.debug) self.email_settings.addTab(self.email_settingsPage2_2, "") - self.label_3.setBuddy(self.db_name) - self.label_4.setBuddy(self.db_path) - self.label_5.setBuddy(self.save_path) + self.horizontalLayout_2.addWidget(self.email_settings) + self.toolBox.addItem(self.page_3, "") + self.page_4 = QtWidgets.QWidget() + self.page_4.setGeometry(QtCore.QRect(0, 0, 633, 511)) + self.page_4.setObjectName("page_4") + self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.page_4) + self.verticalLayout_4.setObjectName("verticalLayout_4") + self.groupBox = QtWidgets.QGroupBox(parent=self.page_4) + font = QtGui.QFont() + font.setPointSize(12) + font.setBold(True) + self.groupBox.setFont(font) + self.groupBox.setObjectName("groupBox") + self.verticalLayout_5 = QtWidgets.QVBoxLayout(self.groupBox) + self.verticalLayout_5.setObjectName("verticalLayout_5") + self.scrollArea_3 = QtWidgets.QScrollArea(parent=self.groupBox) + self.scrollArea_3.setWidgetResizable(True) + self.scrollArea_3.setObjectName("scrollArea_3") + self.scrollAreaWidgetContents_3 = QtWidgets.QWidget() + self.scrollAreaWidgetContents_3.setGeometry(QtCore.QRect(0, 0, 593, 201)) + self.scrollAreaWidgetContents_3.setObjectName("scrollAreaWidgetContents_3") + self.verticalLayout_7 = QtWidgets.QVBoxLayout(self.scrollAreaWidgetContents_3) + self.verticalLayout_7.setObjectName("verticalLayout_7") + self.gridLayout_4 = QtWidgets.QGridLayout() + self.gridLayout_4.setObjectName("gridLayout_4") + self.verticalLayout_7.addLayout(self.gridLayout_4) + self.scrollArea_3.setWidget(self.scrollAreaWidgetContents_3) + self.verticalLayout_5.addWidget(self.scrollArea_3) + self.verticalLayout_4.addWidget(self.groupBox) + self.scrollArea_2 = QtWidgets.QScrollArea(parent=self.page_4) + self.scrollArea_2.setWidgetResizable(True) + self.scrollArea_2.setObjectName("scrollArea_2") + self.scrollAreaWidgetContents_2 = QtWidgets.QWidget() + self.scrollAreaWidgetContents_2.setGeometry(QtCore.QRect(0, 0, 613, 241)) + self.scrollAreaWidgetContents_2.setObjectName("scrollAreaWidgetContents_2") + self.verticalLayout_6 = QtWidgets.QVBoxLayout(self.scrollAreaWidgetContents_2) + self.verticalLayout_6.setObjectName("verticalLayout_6") + self.vertical_icons = QtWidgets.QVBoxLayout() + self.vertical_icons.setObjectName("vertical_icons") + self.verticalLayout_6.addLayout(self.vertical_icons) + self.scrollArea_2.setWidget(self.scrollAreaWidgetContents_2) + self.verticalLayout_4.addWidget(self.scrollArea_2) + self.toolBox.addItem(self.page_4, "") + self.verticalLayout.addWidget(self.toolBox) + 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.addWidget(self.buttonBox) + self.label_5.setBuddy(self.db_name) + self.label_12.setBuddy(self.save_path) + self.label_11.setBuddy(self.db_path) self.retranslateUi(Dialog) + self.toolBox.setCurrentIndex(2) self.email_settings.setCurrentIndex(0) - self.buttonBox.accepted.connect(Dialog.accept) # type: ignore - self.buttonBox.rejected.connect(Dialog.reject) # type: ignore + 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) def retranslateUi(self, Dialog): _translate = QtCore.QCoreApplication.translate Dialog.setWindowTitle(_translate("Dialog", "Dialog")) - self.label_2.setText(_translate("Dialog", "Allgemeine Einstellungen")) - self.tb_select_db.setText(_translate("Dialog", "...")) - self.label_3.setToolTip( - _translate( - "Dialog", - '

Name der Datenbank, welche verwendet werden soll. Muss auf .db enden

', - ) - ) - self.label_3.setText(_translate("Dialog", "Datenbankname")) self.db_name.setText(_translate("Dialog", "sap.db")) - self.label_4.setText(_translate("Dialog", "Datenbankpfad")) + self.label_5.setToolTip(_translate("Dialog", "

Name der Datenbank, welche verwendet werden soll. Muss auf .db enden

")) + self.label_5.setText(_translate("Dialog", "Datenbankname")) + self.label_12.setToolTip(_translate("Dialog", "Pfad, an dem heruntergeladene Dateien gespeichert werden sollen")) + self.label_12.setText(_translate("Dialog", "Temporäre Dateien")) + self.label_11.setText(_translate("Dialog", "Datenbankpfad")) self.tb_set_save_path.setText(_translate("Dialog", "...")) - self.label_5.setToolTip( - _translate( - "Dialog", - "Pfad, an dem heruntergeladene Dateien gespeichert werden sollen", - ) - ) - self.label_5.setText(_translate("Dialog", "Temporäre Dateien")) - self.label_8.setText(_translate("Dialog", "Nutzername")) - self.use_username_smtp_login.setStatusTip( - _translate( - "Dialog", - "Anklicken, wenn Nutzername benötigt wird, um sich beim Server anzumelden", - ) - ) - self.use_username_smtp_login.setText( - _translate("Dialog", "Nutzername zum\n Anmelden verwenden") - ) - self.mail_username.setStatusTip( - _translate("Dialog", "Kürzel, von der Hochschule vergeben, bsp: Aky547") - ) - self.label_10.setText(_translate("Dialog", "Passwort")) - self.label_7.setText(_translate("Dialog", "Sender-eMail")) - self.label.setText(_translate("Dialog", "SMTP-Server")) + self.tb_select_db.setText(_translate("Dialog", "...")) + self.toolBox.setItemText(self.toolBox.indexOf(self.page_1), _translate("Dialog", "Datenbank")) + self.label_4.setText(_translate("Dialog", "Bibliothekstyp")) + self.label_3.setText(_translate("Dialog", "Bibliotheks-ID")) + self.label_2.setText(_translate("Dialog", "API Key")) + self.toolBox.setItemText(self.toolBox.indexOf(self.page_2), _translate("Dialog", "Zotero")) + self.use_username_smtp_login.setStatusTip(_translate("Dialog", "Anklicken, wenn Nutzername benötigt wird, um sich beim Server anzumelden")) + self.use_username_smtp_login.setText(_translate("Dialog", "Nutzername zum\n" +" Anmelden verwenden")) self.label_6.setText(_translate("Dialog", "Port")) - self.email_settings.setTabText( - self.email_settings.indexOf(self.email_settingsPage1_2), - _translate("Dialog", "Allgemeines"), - ) + self.label_7.setText(_translate("Dialog", "Sender-eMail")) + self.mail_username.setStatusTip(_translate("Dialog", "Kürzel, von der Hochschule vergeben, bsp: Aky547")) + self.label.setText(_translate("Dialog", "SMTP-Server")) + self.label_10.setText(_translate("Dialog", "Passwort")) + self.label_8.setText(_translate("Dialog", "Nutzername")) + self.label_13.setText(_translate("Dialog", "Printmail")) + self.email_settings.setTabText(self.email_settings.indexOf(self.email_settingsPage1_2), _translate("Dialog", "Allgemeines")) self.bold.setText(_translate("Dialog", "Fett")) self.italic.setText(_translate("Dialog", "Kursiv")) self.underscore.setText(_translate("Dialog", "Unterstrichen")) @@ -289,7 +335,7 @@ class Ui_Dialog(object): self.font_size.setItemText(13, _translate("Dialog", "48")) self.font_size.setItemText(14, _translate("Dialog", "72")) self.debug.setText(_translate("Dialog", "Debug")) - self.email_settings.setTabText( - self.email_settings.indexOf(self.email_settingsPage2_2), - _translate("Dialog", "Signatur"), - ) + self.email_settings.setTabText(self.email_settings.indexOf(self.email_settingsPage2_2), _translate("Dialog", "Signatur")) + self.toolBox.setItemText(self.toolBox.indexOf(self.page_3), _translate("Dialog", "e-Mail")) + self.groupBox.setTitle(_translate("Dialog", "Farben")) + self.toolBox.setItemText(self.toolBox.indexOf(self.page_4), _translate("Dialog", "Icons")) diff --git a/src/ui/dialogs/docuprint.py b/src/ui/dialogs/docuprint.py new file mode 100644 index 0000000..4556ebd --- /dev/null +++ b/src/ui/dialogs/docuprint.py @@ -0,0 +1,153 @@ +from .dialog_sources.documentprint_ui import Ui_Dialog +from PyQt6 import QtWidgets, QtCore +from src import Icon + +from src.utils.richtext import SemapSchilder, SemesterDocument +from src.backend import Semester, Database +from natsort import natsorted + + +class DocumentPrintDialog(QtWidgets.QDialog, Ui_Dialog): + def __init__(self, parent=None): + super().__init__(parent) + self.setupUi(self) + self.setWindowIcon(Icon("print").icon) + self.frame.hide() + + self.semester = Semester() + + self.db = Database() + + self.insert_table_data() + self.expertMode.clicked.connect(self.enable_expert_mode) + # Ensure the signal is connected only once + try: + self.pushButton_2.clicked.disconnect() + except TypeError: + pass # Signal was not connected before + self.pushButton_2.clicked.connect(self.on_pushButton_2_clicked) + + try: + self.pushButton.clicked.disconnect() + except TypeError: + pass + self.pushButton.clicked.connect(self.on_pushButton_clicked) + + try: + self.btn_load_current_apparats.clicked.disconnect() + except TypeError: + pass + self.btn_load_current_apparats.clicked.connect(self.load_current_clicked) + + try: + self.manualCheck.clicked.disconnect() + except TypeError: + pass + self.manualCheck.clicked.connect(self.manual_request) + + def manual_request(self): + self.tableWidget.setRowCount(0) + request_text = self.textBrowser.toPlainText() + data = self.db.query_db(request_text) + apparats: list[str] = [] + if not data: + self.tableWidget.setRowCount(0) + return + for row in data: + apparats.append(f"{row[0]}") + + self.tableWidget.setHorizontalHeaderLabels(["", "Semesterapparat"]) + self.tableWidget.setColumnWidth(0, 50) + for entry in apparats: + # insert the entry, column 1 should be a checkbox, column 2 the data + self.tableWidget.insertRow(0) + self.tableWidget.setItem(0, 0, QtWidgets.QTableWidgetItem("")) + checkbox = QtWidgets.QCheckBox() + + self.tableWidget.setCellWidget(0, 0, checkbox) + + self.tableWidget.setItem(0, 1, QtWidgets.QTableWidgetItem(entry)) + # align row 0 column 0 to center + + def load_current_clicked(self): + entries = self.get_valid_apparats_for_signs() + self.tableWidget.setHorizontalHeaderLabels(["", "Semesterapparat"]) + self.tableWidget.setColumnWidth(0, 50) + self.tableWidget.setRowCount(0) + for entry in entries: + # insert the entry, column 1 should be a checkbox, column 2 the data + self.tableWidget.insertRow(0) + self.tableWidget.setItem(0, 0, QtWidgets.QTableWidgetItem("")) + checkbox = QtWidgets.QCheckBox() + + self.tableWidget.setCellWidget(0, 0, checkbox) + + self.tableWidget.setItem(0, 1, QtWidgets.QTableWidgetItem(entry)) + + def enable_expert_mode(self): + # if self.exportMode. + if self.expertMode.isChecked(): + self.frame.show() + self.expertMode.setText("Expertenmodus deaktivieren") + else: + self.frame.hide() + self.expertMode.setText("Expertenmodus aktivieren") + + def on_pushButton_2_clicked(self): + # get the checked items from the table + checked_items = [] + for i in range(self.tableWidget.rowCount()): + checkbox = self.tableWidget.cellWidget(i, 0) + if isinstance(checkbox, QtWidgets.QCheckBox) and checkbox.isChecked(): + item = self.tableWidget.item(i, 1) + if item is not None: + checked_items.append(item.text()) + document = SemapSchilder(checked_items) + document.send + + def on_pushButton_clicked(self): + apparats: list[tuple[int, str]] = [] + apps = self.db.getAllAparats(0) + apps = natsorted(apps, key=lambda x: x[4], reverse=True) + for app in apps: + prof = self.db.getProfById(app[2]) + data = (app[4], f"{prof.lastname} ({app[1]})") + apparats.append(data) + SemesterDocument( + semester=self.semester.value, + filename="Semesterapparat", + full=True, + apparats=apparats, + ) + + def insert_table_data(self): + entries = self.get_valid_apparats_for_signs() + self.tableWidget.setHorizontalHeaderLabels(["", "Semesterapparat"]) + self.tableWidget.setColumnWidth(0, 50) + for entry in entries: + # insert the entry, column 1 should be a checkbox, column 2 the data + self.tableWidget.insertRow(0) + self.tableWidget.setItem(0, 0, QtWidgets.QTableWidgetItem("")) + checkbox = QtWidgets.QCheckBox() + + self.tableWidget.setCellWidget(0, 0, checkbox) + + self.tableWidget.setItem(0, 1, QtWidgets.QTableWidgetItem(entry)) + # align row 0 column 0 to center + + def get_valid_apparats_for_signs(self): + this_sem = self.db.query_db( + query="SELECT prof.lname || ' (' || semesterapparat.name || ')' AS formatted_result from semesterapparat INNER JOIN prof ON semesterapparat.prof_id = prof.id WHERE (erstellsemester = ? OR erstellsemester = ?) AND semesterapparat.deletion_status=0", + args=(str(self.semester.value), str(self.semester.previous)), + ) + apparats: list[str] = [] + for row in this_sem: + apparats.append(f"{row[0]}") + return apparats + + +def launch(): + app = QtWidgets.QApplication([]) + dialog = DocumentPrintDialog() + dialog.show() + app.exec() diff --git a/src/ui/dialogs/elsa_add_entry.py b/src/ui/dialogs/elsa_add_entry.py index d068d33..597718e 100644 --- a/src/ui/dialogs/elsa_add_entry.py +++ b/src/ui/dialogs/elsa_add_entry.py @@ -118,7 +118,7 @@ class ElsaAddEntry(QtWidgets.QDialog, Ui_Dialog): if table["type"] == "zs": book = zot.createBook(table["isbn"]) res_key = zot.createJournalArticle(book, table) - logger.debug(book) + log.debug(book) a_lastname = table["section_author"].split(";")[0].strip().split(",")[0] a_firstname = table["section_author"].split(";")[0].strip().split(",")[1] author = f"{a_lastname}, {a_firstname[0]}" diff --git a/src/ui/dialogs/ext_app.py b/src/ui/dialogs/ext_app.py new file mode 100644 index 0000000..5ff330d --- /dev/null +++ b/src/ui/dialogs/ext_app.py @@ -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()) diff --git a/src/ui/dialogs/login.py b/src/ui/dialogs/login.py index 74c9708..e1e563e 100644 --- a/src/ui/dialogs/login.py +++ b/src/ui/dialogs/login.py @@ -2,11 +2,19 @@ import hashlib from PyQt6 import QtCore, QtWidgets -from src import Icon, logger + from src.backend.admin_console import AdminCommands from src.backend.database import Database -from .dialog_sources.Ui_login import Ui_Dialog +from .dialog_sources.login_ui import Ui_Dialog +import sys +import loguru +from src import Icon + +log = loguru.logger +log.remove() +log.add(sys.stdout) +log.add("logs/application.log", rotation="1 MB", retention="10 days") class LoginDialog(Ui_Dialog): @@ -75,7 +83,7 @@ class LoginDialog(Ui_Dialog): if self.db.login(username, hashed_password): self.lresult = 1 # Indicate successful login self.lusername = username - logger.success(f"User {username} logged in.") + log.success(f"User {username} logged in.") self.dialog.accept() else: diff --git a/src/ui/dialogs/mail.py b/src/ui/dialogs/mail.py index 8e9f3db..d7e0362 100644 --- a/src/ui/dialogs/mail.py +++ b/src/ui/dialogs/mail.py @@ -3,11 +3,19 @@ import sys from PyQt6 import QtWidgets -from src import Icon, settings as config, logger +from src import Icon, settings as config from .dialog_sources.Ui_mail_preview import Ui_eMailPreview as MailPreviewDialog from .mailTemplate import MailTemplateDialog +import loguru +import sys + +log = loguru.logger +log.remove() +log.add(sys.stdout) +log.add("logs/application.log", rotation="1 MB", retention="10 days") + empty_signature = """ @@ -45,7 +53,7 @@ class Mail_Dialog(QtWidgets.QDialog, MailPreviewDialog): super().__init__(parent) self.setupUi(self) - logger.info("Setting up mail dialog") + log.info("Setting up mail dialog") self.appid = app_id self.appname = app_name self.subject = app_subject @@ -77,7 +85,7 @@ class Mail_Dialog(QtWidgets.QDialog, MailPreviewDialog): self.btn_okay.clicked.connect(self.createAndSendMail) def open_new_template(self): - logger.info("Opening new template dialog") + log.info("Opening new template dialog") # TODO: implement new mail template dialog dialog = MailTemplateDialog() dialog.updateSignal.connect(self.load_mail_templates) @@ -96,9 +104,9 @@ Tel.: 0761/682-778 | 07617682-545""" def load_mail_templates(self): # print("loading mail templates") - logger.info("Loading mail templates") + log.info("Loading mail templates") mail_templates = os.listdir("mail_vorlagen") - logger.info(f"Mail templates: {mail_templates}") + log.info(f"Mail templates: {mail_templates}") self.comboBox.clear() for template in mail_templates: self.comboBox.addItem(template) @@ -117,10 +125,10 @@ Tel.: 0761/682-778 | 07617682-545""" return f"Guten Tag {name}," def set_mail(self): - logger.info("Setting mail") + log.info("Setting mail") email_template = self.comboBox.currentText() if email_template == "": - logger.debug("No mail template selected") + log.debug("No mail template selected") return with open(f"mail_vorlagen/{email_template}", "r", encoding="utf-8") as f: mail_template = f.read() @@ -145,7 +153,7 @@ Tel.: 0761/682-778 | 07617682-545""" self.mail_body.setHtml(mail_html) def createAndSendMail(self): - logger.info("Sending mail") + log.info("Sending mail") import smtplib from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText @@ -182,7 +190,7 @@ Tel.: 0761/682-778 | 07617682-545""" # print("Mail sent") # end active process server.quit() - logger.info("Mail sent, closing connection to server and dialog") + log.info("Mail sent, closing connection to server and dialog") # close the dialog self.accept() diff --git a/src/ui/dialogs/mailTemplate.py b/src/ui/dialogs/mailTemplate.py index 15786b9..9c55b7c 100644 --- a/src/ui/dialogs/mailTemplate.py +++ b/src/ui/dialogs/mailTemplate.py @@ -5,10 +5,25 @@ from PyQt6 import QtGui, QtWidgets, QtCore from src import Icon from .dialog_sources import NewMailTemplateDesignerDialog -from src import logger + +import sys +from loguru import logger as log + +logger = log +logger.remove() +logger.add("logs/application.log", rotation="1 week", retention="1 month", enqueue=True) +log.add( + f"logs/mail.log", + enqueue=True, +) + +# logger.add(sys.stderr, format="{time} {level} {message}", level="INFO") +logger.add(sys.stdout) + class MailTemplateDialog(QtWidgets.QDialog, NewMailTemplateDesignerDialog): updateSignal = QtCore.pyqtSignal() + def __init__(self, parent=None) -> None: super().__init__(parent) self.setupUi(self) @@ -37,7 +52,8 @@ class MailTemplateDialog(QtWidgets.QDialog, NewMailTemplateDesignerDialog): self.buttonBox.button( QtWidgets.QDialogButtonBox.StandardButton.Cancel ).clicked.connect(self.closeNow) - logger.info("Mail template dialog setup complete") + log.info("Mail template dialog setup complete") + def save_template(self): # print("save triggered") # create a dialog to ask for the name of the template @@ -50,11 +66,11 @@ class MailTemplateDialog(QtWidgets.QDialog, NewMailTemplateDesignerDialog): dialog.setWindowIcon(Icon("save").icon) save = dialog.exec() template_name = dialog.textValue() - logger.info("Saving template") + log.info("Saving template") if template_name != "" and save == 1: template = template_name + ".eml" if template in os.listdir("mail_vorlagen"): - logger.error("Template already exists") + log.error("Template already exists") # warning dialog dialog = QtWidgets.QMessageBox() dialog.setIcon(QtWidgets.QMessageBox.Icon.Warning) @@ -94,7 +110,7 @@ Content-Transfer-Encoding: 8bit f.write(mail) self.updateSignal.emit() self.close() - logger.success(f"Template {template} saved successfully") + log.success(f"Template {template} saved successfully") else: # warning dialog dialog = QtWidgets.QMessageBox() diff --git a/src/ui/dialogs/mail_preview_ui.py b/src/ui/dialogs/mail_preview_ui.py new file mode 100644 index 0000000..473a6de --- /dev/null +++ b/src/ui/dialogs/mail_preview_ui.py @@ -0,0 +1,92 @@ +# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\dialogs\mail_preview.ui' +# +# Created by: PyQt6 UI code generator 6.8.0 +# +# 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_eMailPreview(object): + def setupUi(self, eMailPreview): + eMailPreview.setObjectName("eMailPreview") + eMailPreview.resize(676, 676) + self.buttonBox = QtWidgets.QDialogButtonBox(parent=eMailPreview) + 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(parent=eMailPreview) + 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.label_5 = QtWidgets.QLabel(parent=self.gridLayoutWidget) + self.label_5.setObjectName("label_5") + self.gridLayout.addWidget(self.label_5, 0, 0, 1, 1) + self.prof_name = QtWidgets.QLineEdit(parent=self.gridLayoutWidget) + self.prof_name.setObjectName("prof_name") + self.gridLayout.addWidget(self.prof_name, 2, 2, 1, 1) + self.label_3 = QtWidgets.QLabel(parent=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, 5, 0, 1, 1) + self.mail_name = QtWidgets.QLineEdit(parent=self.gridLayoutWidget) + self.mail_name.setObjectName("mail_name") + self.gridLayout.addWidget(self.mail_name, 1, 2, 1, 1) + self.label_2 = QtWidgets.QLabel(parent=self.gridLayoutWidget) + self.label_2.setObjectName("label_2") + self.gridLayout.addWidget(self.label_2, 2, 0, 1, 1) + self.label_4 = QtWidgets.QLabel(parent=self.gridLayoutWidget) + self.label_4.setObjectName("label_4") + self.gridLayout.addWidget(self.label_4, 3, 0, 1, 1) + self.mail_header = QtWidgets.QLineEdit(parent=self.gridLayoutWidget) + self.mail_header.setObjectName("mail_header") + self.gridLayout.addWidget(self.mail_header, 3, 2, 1, 1) + self.label = QtWidgets.QLabel(parent=self.gridLayoutWidget) + self.label.setObjectName("label") + self.gridLayout.addWidget(self.label, 1, 0, 1, 1) + self.comboBox = QtWidgets.QComboBox(parent=self.gridLayoutWidget) + self.comboBox.setObjectName("comboBox") + self.gridLayout.addWidget(self.comboBox, 0, 2, 1, 1) + self.mail_body = QtWidgets.QTextEdit(parent=self.gridLayoutWidget) + self.mail_body.setObjectName("mail_body") + self.gridLayout.addWidget(self.mail_body, 5, 2, 1, 1) + self.horizontalLayout_3 = QtWidgets.QHBoxLayout() + self.horizontalLayout_3.setObjectName("horizontalLayout_3") + self.gender_male = QtWidgets.QRadioButton(parent=self.gridLayoutWidget) + self.gender_male.setObjectName("gender_male") + self.horizontalLayout_3.addWidget(self.gender_male) + self.gender_female = QtWidgets.QRadioButton(parent=self.gridLayoutWidget) + self.gender_female.setObjectName("gender_female") + self.horizontalLayout_3.addWidget(self.gender_female) + self.gender_non = QtWidgets.QRadioButton(parent=self.gridLayoutWidget) + self.gender_non.setObjectName("gender_non") + self.horizontalLayout_3.addWidget(self.gender_non) + spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) + self.horizontalLayout_3.addItem(spacerItem) + self.gridLayout.addLayout(self.horizontalLayout_3, 4, 2, 1, 1) + self.label_6 = QtWidgets.QLabel(parent=self.gridLayoutWidget) + self.label_6.setObjectName("label_6") + self.gridLayout.addWidget(self.label_6, 4, 0, 1, 1) + + self.retranslateUi(eMailPreview) + self.buttonBox.accepted.connect(eMailPreview.accept) # type: ignore + self.buttonBox.rejected.connect(eMailPreview.reject) # type: ignore + QtCore.QMetaObject.connectSlotsByName(eMailPreview) + + def retranslateUi(self, eMailPreview): + _translate = QtCore.QCoreApplication.translate + eMailPreview.setWindowTitle(_translate("eMailPreview", "Dialog")) + self.label_5.setText(_translate("eMailPreview", "Art")) + self.label_3.setText(_translate("eMailPreview", "Mail")) + self.label_2.setText(_translate("eMailPreview", "Prof")) + self.label_4.setText(_translate("eMailPreview", "Betreff")) + self.label.setText(_translate("eMailPreview", "eMail")) + self.gender_male.setText(_translate("eMailPreview", "M")) + self.gender_female.setText(_translate("eMailPreview", "W")) + self.gender_non.setText(_translate("eMailPreview", "Divers")) + self.label_6.setText(_translate("eMailPreview", "Geschlecht")) diff --git a/src/ui/dialogs/medienadder.py b/src/ui/dialogs/medienadder.py index ed5bd31..1f00c71 100644 --- a/src/ui/dialogs/medienadder.py +++ b/src/ui/dialogs/medienadder.py @@ -1,6 +1,6 @@ from PyQt6 import QtCore, QtGui, QtWidgets -from .dialog_sources.Ui_medianadder import Ui_Dialog +from .dialog_sources.medianadder_ui import Ui_Dialog from src import Icon diff --git a/src/ui/dialogs/parsed_titles.py b/src/ui/dialogs/parsed_titles.py index ece3c57..1142fe2 100644 --- a/src/ui/dialogs/parsed_titles.py +++ b/src/ui/dialogs/parsed_titles.py @@ -3,8 +3,14 @@ from PyQt6 import QtWidgets from src.backend import AutoAdder -from .dialog_sources.Ui_parsed_titles import Ui_Form +from .dialog_sources.parsed_titles_ui import Ui_Form +import loguru +import sys +log = loguru.logger +log.remove() +log.add(sys.stdout) +log.add("logs/application.log", rotation="1 MB", retention="10 days") class ParsedTitles(QtWidgets.QWidget, Ui_Form): def __init__(self, parent=None): @@ -33,7 +39,7 @@ class ParsedTitles(QtWidgets.QWidget, Ui_Form): self.worker = None def start(self): - logger.info("Starting AutoAdder") + log.info("Starting AutoAdder") self.worker = AutoAdder( data=self.signatures, @@ -52,8 +58,8 @@ class ParsedTitles(QtWidgets.QWidget, Ui_Form): self.worker.start() def on_completion(self): - logger.info("AutoAdder finished") - logger.info("Returning data") + log.info("AutoAdder finished") + log.info("Returning data") # create a function that closes the dialog @@ -62,7 +68,7 @@ class ParsedTitles(QtWidgets.QWidget, Ui_Form): length = self.listWidget.count() # print(f"Length of listWidget: {length}") if length == 0: - logger.info("AutoAdder finished") + log.info("AutoAdder finished") self.buttonBox.accepted.emit() def update_lists(self, signal): diff --git a/src/ui/dialogs/parsed_titles.ui b/src/ui/dialogs/parsed_titles.ui new file mode 100644 index 0000000..1789f2f --- /dev/null +++ b/src/ui/dialogs/parsed_titles.ui @@ -0,0 +1,163 @@ + + + Form + + + + 0 + 0 + 402 + 316 + + + + Form + + + + + 10 + 10 + 381 + 41 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + 0 + 0 + 381 + 41 + + + + + + + Es wurden + + + + + + + + 75 + true + + + + 0 + + + Qt::PlainText + + + + + + + Signaturen gefunden. + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + 10 + 80 + 381 + 201 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + 0 + 10 + 381 + 191 + + + + + + + + + + + + + + + + 10 + 60 + 381 + 23 + + + + 24 + + + + + + 230 + 290 + 156 + 23 + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + 20 + 290 + 25 + 19 + + + + ... + + + + + + diff --git a/src/ui/dialogs/reminder.py b/src/ui/dialogs/reminder.py index e6b79ca..4e096ff 100644 --- a/src/ui/dialogs/reminder.py +++ b/src/ui/dialogs/reminder.py @@ -1,6 +1,6 @@ from PyQt6 import QtWidgets -from .dialog_sources.Ui_reminder import Ui_Erinnerung as Ui_Dialog +from .dialog_sources.reminder_ui import Ui_Erinnerung as Ui_Dialog from src import Icon import datetime as date diff --git a/src/ui/dialogs/resources.qrc b/src/ui/dialogs/resources.qrc deleted file mode 100644 index e69de29..0000000 diff --git a/src/ui/dialogs/settings.py b/src/ui/dialogs/settings.py index 6c09c52..5211a1b 100644 --- a/src/ui/dialogs/settings.py +++ b/src/ui/dialogs/settings.py @@ -1,7 +1,16 @@ from PyQt6 import QtCore, QtGui, QtWidgets -from src import Icon, settings, logger -from .dialog_sources.Ui_settings import Ui_Dialog as _settings +from src import Icon, settings +from .dialog_sources.settings_ui import Ui_Dialog as _settings from src.ui.widgets.iconLine import IconWidget +import loguru +import sys + +log = loguru.logger +log.remove() +log.add(sys.stdout) +log.add("logs/application.log", rotation="1 MB", retention="10 days") + + base = """' @@ -67,7 +76,7 @@ class Settings(QtWidgets.QDialog, _settings): self.toolBox.setItemIcon(2, Icon("mail").icon) self.toolBox.setItemIcon(3, Icon("icons").icon) - logger.info("Settings dialog opened, data loaded") + log.info("Settings dialog opened, data loaded") def load_config(self): self.db_name.setText(settings.database.name) @@ -78,6 +87,8 @@ class Settings(QtWidgets.QDialog, _settings): self.sender_email.setText(settings.mail.sender) self.mail_username.setText(settings.mail.user_name) self.password.setText(settings.mail.password) + self.printermail.setText(settings.mail.printer_mail) + self.printermail.setPlaceholderText("E-Mail-Adresse des Druckers") self.use_username_smtp_login.setChecked( settings.mail.use_user_name if settings.mail.use_user_name else False ) @@ -102,7 +113,7 @@ class Settings(QtWidgets.QDialog, _settings): self.vertical_icons.addWidget(icon_widget) def change_color(self, lineedit): - logger.debug("Changing color for {}", lineedit.text()) + log.debug("Changing color for {}", lineedit.text()) colorDialog = QtWidgets.QColorDialog() colorDialog.setSizePolicy() color = colorDialog.getColor() @@ -176,7 +187,7 @@ class Settings(QtWidgets.QDialog, _settings): self.save_path.setText(file_dialog.selectedFiles()[0]) def debug_mode(self): - logger.debug(self.editSignature.toHtml()) + log.debug(self.editSignature.toHtml()) def return_data(self): port = self.smtp_port.text() @@ -200,6 +211,7 @@ class Settings(QtWidgets.QDialog, _settings): settings.set_mail_attr( "use_user_name", self.use_username_smtp_login.isChecked() ) + settings.set_mail_attr("printer_mail", self.printermail.text()) settings.set_mail_attr("signature", signature) settings.set_zotero_attr("api_key", self.zotero_api_key.text()) settings.set_zotero_attr("library_id", self.zotero_library_id.text()) diff --git a/src/ui/semesterapparat_ui.ui b/src/ui/semesterapparat_ui.ui index 734317d..d5a9c70 100644 --- a/src/ui/semesterapparat_ui.ui +++ b/src/ui/semesterapparat_ui.ui @@ -505,7 +505,7 @@ Qt::NoFocus - Apparatsdetails + SemesterApparatsdetails Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter @@ -595,67 +595,6 @@ - - - - 1110 - 120 - 131 - 51 - - - - - 9 - false - - - - Abhängig von der Anzahl der Medien kann die Suche sehr lange dauern - - - Medien aus Dokument - hinzufügen - - - - - - 1110 - 80 - 131 - 25 - - - - - 9 - false - - - - Dokument öffnen - - - - - - 1110 - 40 - 131 - 25 - - - - - 9 - false - - - - Dokument hinzufügen - - @@ -1506,6 +1445,103 @@ Speichern und anlegen + + + + 1110 + 17 + 131 + 181 + + + + + + + + 0 + 0 + + + + + 9 + false + + + + Dokument hinzufügen + + + + + + + + 0 + 0 + + + + + 9 + false + + + + Dokument öffnen + + + + + + + + 0 + 0 + + + + + 9 + false + + + + Abhängig von der Anzahl der Medien kann die Suche sehr lange dauern + + + Medien aus Dokument + hinzufügen + + + + + + + + 0 + 0 + + + + + 9 + false + + + + Die Apparatsdetails werden aus dem Dokument gelesen und eingetragen +Einige Angaben müssen ggf angepasst werden + + + Daten aus Dokument +übernehmen + + + + + diff --git a/src/ui/Ui_semesterapparat_ui.py b/src/ui/semesterapparat_ui_ui.py similarity index 94% rename from src/ui/Ui_semesterapparat_ui.py rename to src/ui/semesterapparat_ui_ui.py index 9eccf2d..4c0af77 100644 --- a/src/ui/Ui_semesterapparat_ui.py +++ b/src/ui/semesterapparat_ui_ui.py @@ -1,961 +1,1002 @@ -# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\semesterapparat_ui.ui' -# -# Created by: PyQt6 UI code generator 6.7.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.setWindowModality(QtCore.Qt.WindowModality.WindowModal) - MainWindow.setEnabled(True) - MainWindow.resize(1590, 800) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth()) - MainWindow.setSizePolicy(sizePolicy) - MainWindow.setMinimumSize(QtCore.QSize(1278, 800)) - MainWindow.setMaximumSize(QtCore.QSize(1590, 800)) - MainWindow.setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.NoContextMenu) - icon = QtGui.QIcon() - icon.addPixmap(QtGui.QPixmap("c:\\Users\\aky547\\GitHub\\SemesterapparatsManager\\src\\ui\\../../../../../../icons/logo.ico"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) - MainWindow.setWindowIcon(icon) - MainWindow.setStatusTip("") - self.centralwidget = QtWidgets.QWidget(parent=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(parent=self.centralwidget) - self.verticalLayoutWidget.setGeometry(QtCore.QRect(0, 0, 1271, 751)) - self.verticalLayoutWidget.setObjectName("verticalLayoutWidget") - self.mainLayout = QtWidgets.QVBoxLayout(self.verticalLayoutWidget) - self.mainLayout.setContentsMargins(0, 0, 0, 0) - self.mainLayout.setObjectName("mainLayout") - self.horizontalLayout = QtWidgets.QHBoxLayout() - self.horizontalLayout.setObjectName("horizontalLayout") - self.gridLayout = QtWidgets.QGridLayout() - self.gridLayout.setObjectName("gridLayout") - self.tabWidget = QtWidgets.QTabWidget(parent=self.verticalLayoutWidget) - self.tabWidget.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) - self.tabWidget.setObjectName("tabWidget") - self.createApparat = QtWidgets.QWidget() - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Preferred) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.createApparat.sizePolicy().hasHeightForWidth()) - self.createApparat.setSizePolicy(sizePolicy) - self.createApparat.setObjectName("createApparat") - self.horizontalLayoutWidget_2 = QtWidgets.QWidget(parent=self.createApparat) - self.horizontalLayoutWidget_2.setGeometry(QtCore.QRect(0, 0, 1261, 163)) - 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.create_document = QtWidgets.QPushButton(parent=self.horizontalLayoutWidget_2) - self.create_document.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) - self.create_document.setObjectName("create_document") - self.verticalLayout_2.addWidget(self.create_document) - self.create_new_app = QtWidgets.QPushButton(parent=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) - self.cancel_active_selection = QtWidgets.QPushButton(parent=self.horizontalLayoutWidget_2) - self.cancel_active_selection.setEnabled(False) - self.cancel_active_selection.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) - self.cancel_active_selection.setObjectName("cancel_active_selection") - self.verticalLayout_2.addWidget(self.cancel_active_selection) - spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) - self.verticalLayout_2.addItem(spacerItem1) - self.formLayout.setLayout(1, QtWidgets.QFormLayout.ItemRole.LabelRole, self.verticalLayout_2) - self.tableWidget_apparate = QtWidgets.QTableWidget(parent=self.horizontalLayoutWidget_2) - self.tableWidget_apparate.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) - self.tableWidget_apparate.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.SizeAdjustPolicy.AdjustToContents) - self.tableWidget_apparate.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers) - self.tableWidget_apparate.setAlternatingRowColors(True) - self.tableWidget_apparate.setTextElideMode(QtCore.Qt.TextElideMode.ElideMiddle) - self.tableWidget_apparate.setObjectName("tableWidget_apparate") - self.tableWidget_apparate.setColumnCount(6) - 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) - item = QtWidgets.QTableWidgetItem() - self.tableWidget_apparate.setHorizontalHeaderItem(4, item) - item = QtWidgets.QTableWidgetItem() - self.tableWidget_apparate.setHorizontalHeaderItem(5, item) - self.tableWidget_apparate.horizontalHeader().setCascadingSectionResizes(True) - self.formLayout.setWidget(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.tableWidget_apparate) - self.horizontalLayout_2.addLayout(self.formLayout) - self.line = QtWidgets.QFrame(parent=self.createApparat) - 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(parent=self.createApparat) - self.gridLayoutWidget_2.setEnabled(True) - self.gridLayoutWidget_2.setGeometry(QtCore.QRect(0, 180, 1261, 511)) - 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.horizontalLayout_5 = QtWidgets.QHBoxLayout() - self.horizontalLayout_5.setObjectName("horizontalLayout_5") - spacerItem2 = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Minimum) - self.horizontalLayout_5.addItem(spacerItem2) - self.chkbx_show_del_media = QtWidgets.QCheckBox(parent=self.gridLayoutWidget_2) - self.chkbx_show_del_media.setObjectName("chkbx_show_del_media") - self.horizontalLayout_5.addWidget(self.chkbx_show_del_media) - spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Minimum) - self.horizontalLayout_5.addItem(spacerItem3) - self.btn_reserve = QtWidgets.QPushButton(parent=self.gridLayoutWidget_2) - self.btn_reserve.setObjectName("btn_reserve") - self.horizontalLayout_5.addWidget(self.btn_reserve) - self.add_layout = QtWidgets.QHBoxLayout() - self.add_layout.setObjectName("add_layout") - self.label_info = QtWidgets.QLabel(parent=self.gridLayoutWidget_2) - self.label_info.setObjectName("label_info") - self.add_layout.addWidget(self.label_info) - self.line_2 = QtWidgets.QFrame(parent=self.gridLayoutWidget_2) - self.line_2.setFrameShape(QtWidgets.QFrame.Shape.VLine) - self.line_2.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) - self.line_2.setObjectName("line_2") - self.add_layout.addWidget(self.line_2) - self.progress_label = QtWidgets.QLabel(parent=self.gridLayoutWidget_2) - self.progress_label.setObjectName("progress_label") - self.add_layout.addWidget(self.progress_label) - self.horizontalLayout_5.addLayout(self.add_layout) - spacerItem4 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Minimum) - self.horizontalLayout_5.addItem(spacerItem4) - self.avail_layout = QtWidgets.QHBoxLayout() - self.avail_layout.setObjectName("avail_layout") - self.horizontalLayout_5.addLayout(self.avail_layout) - self.label_20 = QtWidgets.QLabel(parent=self.gridLayoutWidget_2) - self.label_20.setObjectName("label_20") - self.horizontalLayout_5.addWidget(self.label_20) - self.line_3 = QtWidgets.QFrame(parent=self.gridLayoutWidget_2) - self.line_3.setFrameShape(QtWidgets.QFrame.Shape.VLine) - self.line_3.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) - self.line_3.setObjectName("line_3") - self.horizontalLayout_5.addWidget(self.line_3) - self.avail_status = QtWidgets.QLabel(parent=self.gridLayoutWidget_2) - self.avail_status.setObjectName("avail_status") - self.horizontalLayout_5.addWidget(self.avail_status) - self.automation_add_selected_books = QtWidgets.QPushButton(parent=self.gridLayoutWidget_2) - self.automation_add_selected_books.setObjectName("automation_add_selected_books") - self.horizontalLayout_5.addWidget(self.automation_add_selected_books) - spacerItem5 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) - self.horizontalLayout_5.addItem(spacerItem5) - self.gridLayout_2.addLayout(self.horizontalLayout_5, 4, 0, 1, 1) - self.tableWidget_apparat_media = QtWidgets.QTableWidget(parent=self.gridLayoutWidget_2) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Expanding) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.tableWidget_apparat_media.sizePolicy().hasHeightForWidth()) - self.tableWidget_apparat_media.setSizePolicy(sizePolicy) - self.tableWidget_apparat_media.setMinimumSize(QtCore.QSize(1259, 0)) - self.tableWidget_apparat_media.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) - self.tableWidget_apparat_media.setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.CustomContextMenu) - self.tableWidget_apparat_media.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.SizeAdjustPolicy.AdjustToContents) - self.tableWidget_apparat_media.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers) - self.tableWidget_apparat_media.setAlternatingRowColors(True) - self.tableWidget_apparat_media.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectionBehavior.SelectRows) - self.tableWidget_apparat_media.setObjectName("tableWidget_apparat_media") - self.tableWidget_apparat_media.setColumnCount(7) - 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) - item = QtWidgets.QTableWidgetItem() - self.tableWidget_apparat_media.setHorizontalHeaderItem(4, item) - item = QtWidgets.QTableWidgetItem() - self.tableWidget_apparat_media.setHorizontalHeaderItem(5, item) - item = QtWidgets.QTableWidgetItem() - self.tableWidget_apparat_media.setHorizontalHeaderItem(6, item) - self.tableWidget_apparat_media.horizontalHeader().setCascadingSectionResizes(True) - self.gridLayout_2.addWidget(self.tableWidget_apparat_media, 9, 0, 1, 1) - self.label = QtWidgets.QLabel(parent=self.gridLayoutWidget_2) - font = QtGui.QFont() - font.setPointSize(11) - font.setBold(True) - self.label.setFont(font) - self.label.setObjectName("label") - self.gridLayout_2.addWidget(self.label, 2, 0, 1, 1) - self.app_group_box = QtWidgets.QGroupBox(parent=self.gridLayoutWidget_2) - self.app_group_box.setEnabled(True) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.app_group_box.sizePolicy().hasHeightForWidth()) - self.app_group_box.setSizePolicy(sizePolicy) - self.app_group_box.setMinimumSize(QtCore.QSize(0, 210)) - font = QtGui.QFont() - font.setPointSize(12) - font.setBold(True) - self.app_group_box.setFont(font) - self.app_group_box.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) - 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.document_list = QtWidgets.QTableWidget(parent=self.app_group_box) - self.document_list.setGeometry(QtCore.QRect(780, 20, 321, 181)) - font = QtGui.QFont() - font.setPointSize(10) - font.setBold(False) - font.setKerning(False) - self.document_list.setFont(font) - self.document_list.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) - self.document_list.setAcceptDrops(True) - self.document_list.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarPolicy.ScrollBarAlwaysOff) - self.document_list.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.SizeAdjustPolicy.AdjustToContents) - self.document_list.setDragEnabled(True) - self.document_list.setDragDropMode(QtWidgets.QAbstractItemView.DragDropMode.DragOnly) - self.document_list.setDefaultDropAction(QtCore.Qt.DropAction.LinkAction) - self.document_list.setSelectionMode(QtWidgets.QAbstractItemView.SelectionMode.SingleSelection) - self.document_list.setObjectName("document_list") - self.document_list.setColumnCount(4) - self.document_list.setRowCount(0) - item = QtWidgets.QTableWidgetItem() - font = QtGui.QFont() - font.setFamily("Arial") - font.setPointSize(8) - item.setFont(font) - self.document_list.setHorizontalHeaderItem(0, item) - item = QtWidgets.QTableWidgetItem() - font = QtGui.QFont() - font.setFamily("Arial") - font.setPointSize(8) - item.setFont(font) - self.document_list.setHorizontalHeaderItem(1, item) - item = QtWidgets.QTableWidgetItem() - font = QtGui.QFont() - font.setFamily("Arial") - font.setPointSize(8) - item.setFont(font) - self.document_list.setHorizontalHeaderItem(2, item) - item = QtWidgets.QTableWidgetItem() - self.document_list.setHorizontalHeaderItem(3, item) - self.document_list.horizontalHeader().setDefaultSectionSize(107) - self.check_file = QtWidgets.QPushButton(parent=self.app_group_box) - self.check_file.setGeometry(QtCore.QRect(1110, 120, 131, 51)) - font = QtGui.QFont() - font.setPointSize(9) - font.setBold(False) - self.check_file.setFont(font) - self.check_file.setObjectName("check_file") - self.btn_open_document = QtWidgets.QPushButton(parent=self.app_group_box) - self.btn_open_document.setGeometry(QtCore.QRect(1110, 80, 131, 25)) - font = QtGui.QFont() - font.setPointSize(9) - font.setBold(False) - self.btn_open_document.setFont(font) - self.btn_open_document.setObjectName("btn_open_document") - self.btn_add_document = QtWidgets.QPushButton(parent=self.app_group_box) - self.btn_add_document.setGeometry(QtCore.QRect(1110, 40, 131, 25)) - font = QtGui.QFont() - font.setPointSize(9) - font.setBold(False) - self.btn_add_document.setFont(font) - self.btn_add_document.setObjectName("btn_add_document") - self.appname_mand = QtWidgets.QLabel(parent=self.app_group_box) - self.appname_mand.setGeometry(QtCore.QRect(330, 50, 16, 21)) - font = QtGui.QFont() - font.setPointSize(9) - font.setBold(False) - self.appname_mand.setFont(font) - self.appname_mand.setObjectName("appname_mand") - self.profname_mand = QtWidgets.QLabel(parent=self.app_group_box) - self.profname_mand.setGeometry(QtCore.QRect(110, 110, 16, 21)) - font = QtGui.QFont() - font.setPointSize(9) - font.setBold(False) - self.profname_mand.setFont(font) - self.profname_mand.setObjectName("profname_mand") - self.prof_title = QtWidgets.QLineEdit(parent=self.app_group_box) - self.prof_title.setGeometry(QtCore.QRect(120, 80, 71, 20)) - font = QtGui.QFont() - font.setPointSize(9) - font.setBold(False) - self.prof_title.setFont(font) - self.prof_title.setFocusPolicy(QtCore.Qt.FocusPolicy.ClickFocus) - self.prof_title.setObjectName("prof_title") - self.fach_mand = QtWidgets.QLabel(parent=self.app_group_box) - self.fach_mand.setGeometry(QtCore.QRect(510, 50, 47, 21)) - font = QtGui.QFont() - font.setPointSize(9) - font.setBold(False) - self.fach_mand.setFont(font) - self.fach_mand.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) - self.fach_mand.setObjectName("fach_mand") - self.btn_apparat_apply = QtWidgets.QPushButton(parent=self.app_group_box) - self.btn_apparat_apply.setGeometry(QtCore.QRect(360, 150, 75, 23)) - font = QtGui.QFont() - font.setPointSize(9) - font.setBold(False) - self.btn_apparat_apply.setFont(font) - self.btn_apparat_apply.setObjectName("btn_apparat_apply") - self.label_9 = QtWidgets.QLabel(parent=self.app_group_box) - self.label_9.setGeometry(QtCore.QRect(20, 160, 71, 21)) - font = QtGui.QFont() - font.setPointSize(9) - font.setBold(False) - self.label_9.setFont(font) - self.label_9.setObjectName("label_9") - self.gridLayoutWidget_5 = QtWidgets.QWidget(parent=self.app_group_box) - self.gridLayoutWidget_5.setGeometry(QtCore.QRect(520, 30, 241, 61)) - self.gridLayoutWidget_5.setObjectName("gridLayoutWidget_5") - self.gridLayout_6 = QtWidgets.QGridLayout(self.gridLayoutWidget_5) - self.gridLayout_6.setContentsMargins(0, 0, 0, 0) - self.gridLayout_6.setObjectName("gridLayout_6") - self.app_fach = QtWidgets.QComboBox(parent=self.gridLayoutWidget_5) - self.app_fach.setMaximumSize(QtCore.QSize(16777215, 25)) - font = QtGui.QFont() - font.setPointSize(9) - font.setBold(False) - self.app_fach.setFont(font) - self.app_fach.setEditable(True) - self.app_fach.setObjectName("app_fach") - self.gridLayout_6.addWidget(self.app_fach, 0, 1, 1, 1) - spacerItem6 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) - self.gridLayout_6.addItem(spacerItem6, 0, 3, 1, 1) - self.valid_check_app_fach = QtWidgets.QToolButton(parent=self.gridLayoutWidget_5) - self.valid_check_app_fach.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) - self.valid_check_app_fach.setText("") - self.valid_check_app_fach.setAutoRaise(True) - self.valid_check_app_fach.setArrowType(QtCore.Qt.ArrowType.NoArrow) - self.valid_check_app_fach.setObjectName("valid_check_app_fach") - self.gridLayout_6.addWidget(self.valid_check_app_fach, 0, 2, 1, 1) - self._mand = QtWidgets.QLabel(parent=self.app_group_box) - self._mand.setGeometry(QtCore.QRect(330, 90, 16, 21)) - font = QtGui.QFont() - font.setPointSize(9) - font.setBold(False) - self._mand.setFont(font) - self._mand.setObjectName("_mand") - self.prof_tel_nr = QtWidgets.QLineEdit(parent=self.app_group_box) - self.prof_tel_nr.setGeometry(QtCore.QRect(120, 160, 121, 20)) - font = QtGui.QFont() - font.setPointSize(9) - font.setBold(False) - self.prof_tel_nr.setFont(font) - self.prof_tel_nr.setInputMethodHints(QtCore.Qt.InputMethodHint.ImhNone) - self.prof_tel_nr.setPlaceholderText("") - self.prof_tel_nr.setObjectName("prof_tel_nr") - self.check_eternal_app = QtWidgets.QCheckBox(parent=self.app_group_box) - self.check_eternal_app.setEnabled(False) - self.check_eternal_app.setGeometry(QtCore.QRect(340, 120, 101, 17)) - font = QtGui.QFont() - font.setPointSize(9) - font.setBold(False) - self.check_eternal_app.setFont(font) - self.check_eternal_app.setObjectName("check_eternal_app") - self.sem_sommer = QtWidgets.QCheckBox(parent=self.app_group_box) - self.sem_sommer.setGeometry(QtCore.QRect(340, 100, 82, 17)) - font = QtGui.QFont() - font.setPointSize(9) - font.setBold(False) - self.sem_sommer.setFont(font) - self.sem_sommer.setFocusPolicy(QtCore.Qt.FocusPolicy.StrongFocus) - self.sem_sommer.setObjectName("sem_sommer") - self.drpdwn_prof_name = QtWidgets.QComboBox(parent=self.app_group_box) - self.drpdwn_prof_name.setGeometry(QtCore.QRect(120, 110, 121, 22)) - font = QtGui.QFont() - font.setPointSize(9) - font.setBold(False) - self.drpdwn_prof_name.setFont(font) - self.drpdwn_prof_name.setFocusPolicy(QtCore.Qt.FocusPolicy.StrongFocus) - self.drpdwn_prof_name.setInputMethodHints(QtCore.Qt.InputMethodHint.ImhNone) - self.drpdwn_prof_name.setEditable(True) - self.drpdwn_prof_name.setInsertPolicy(QtWidgets.QComboBox.InsertPolicy.InsertAlphabetically) - self.drpdwn_prof_name.setPlaceholderText("") - self.drpdwn_prof_name.setFrame(True) - self.drpdwn_prof_name.setObjectName("drpdwn_prof_name") - self.mail_mand = QtWidgets.QLabel(parent=self.app_group_box) - self.mail_mand.setGeometry(QtCore.QRect(110, 140, 47, 21)) - font = QtGui.QFont() - font.setPointSize(9) - font.setBold(False) - self.mail_mand.setFont(font) - self.mail_mand.setObjectName("mail_mand") - self.label_3 = QtWidgets.QLabel(parent=self.app_group_box) - self.label_3.setGeometry(QtCore.QRect(20, 80, 61, 20)) - font = QtGui.QFont() - font.setPointSize(9) - font.setBold(False) - self.label_3.setFont(font) - self.label_3.setObjectName("label_3") - self.label_2 = QtWidgets.QLabel(parent=self.app_group_box) - self.label_2.setGeometry(QtCore.QRect(20, 50, 101, 21)) - font = QtGui.QFont() - font.setPointSize(9) - font.setBold(False) - self.label_2.setFont(font) - self.label_2.setObjectName("label_2") - self.label_8 = QtWidgets.QLabel(parent=self.app_group_box) - self.label_8.setGeometry(QtCore.QRect(20, 140, 71, 21)) - font = QtGui.QFont() - font.setPointSize(9) - font.setBold(False) - self.label_8.setFont(font) - self.label_8.setObjectName("label_8") - self.label_10 = QtWidgets.QLabel(parent=self.app_group_box) - self.label_10.setGeometry(QtCore.QRect(480, 50, 51, 21)) - font = QtGui.QFont() - font.setPointSize(9) - font.setBold(False) - self.label_10.setFont(font) - self.label_10.setObjectName("label_10") - self.prof_mail = QtWidgets.QLineEdit(parent=self.app_group_box) - self.prof_mail.setGeometry(QtCore.QRect(120, 140, 121, 20)) - font = QtGui.QFont() - font.setPointSize(9) - font.setBold(False) - self.prof_mail.setFont(font) - self.prof_mail.setInputMethodHints(QtCore.Qt.InputMethodHint.ImhEmailCharactersOnly) - self.prof_mail.setMaxLength(200) - self.prof_mail.setPlaceholderText("") - self.prof_mail.setObjectName("prof_mail") - self.formLayoutWidget_2 = QtWidgets.QWidget(parent=self.app_group_box) - self.formLayoutWidget_2.setGeometry(QtCore.QRect(560, 100, 211, 99)) - self.formLayoutWidget_2.setObjectName("formLayoutWidget_2") - self.formLayout_3 = QtWidgets.QFormLayout(self.formLayoutWidget_2) - self.formLayout_3.setContentsMargins(0, 0, 0, 0) - self.formLayout_3.setObjectName("formLayout_3") - self.label_12 = QtWidgets.QLabel(parent=self.formLayoutWidget_2) - font = QtGui.QFont() - font.setPointSize(9) - font.setBold(False) - self.label_12.setFont(font) - self.label_12.setObjectName("label_12") - self.formLayout_3.setWidget(0, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_12) - self.prof_id_adis = QtWidgets.QLineEdit(parent=self.formLayoutWidget_2) - font = QtGui.QFont() - font.setPointSize(9) - font.setBold(False) - self.prof_id_adis.setFont(font) - self.prof_id_adis.setInputMethodHints(QtCore.Qt.InputMethodHint.ImhPreferNumbers) - self.prof_id_adis.setText("") - self.prof_id_adis.setObjectName("prof_id_adis") - self.formLayout_3.setWidget(0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.prof_id_adis) - self.label_13 = QtWidgets.QLabel(parent=self.formLayoutWidget_2) - font = QtGui.QFont() - font.setPointSize(9) - font.setBold(False) - self.label_13.setFont(font) - self.label_13.setObjectName("label_13") - self.formLayout_3.setWidget(1, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_13) - self.apparat_id_adis = QtWidgets.QLineEdit(parent=self.formLayoutWidget_2) - font = QtGui.QFont() - font.setPointSize(9) - font.setBold(False) - self.apparat_id_adis.setFont(font) - self.apparat_id_adis.setInputMethodHints(QtCore.Qt.InputMethodHint.ImhPreferNumbers) - self.apparat_id_adis.setObjectName("apparat_id_adis") - self.formLayout_3.setWidget(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.apparat_id_adis) - self.sem_year = QtWidgets.QLineEdit(parent=self.app_group_box) - self.sem_year.setGeometry(QtCore.QRect(410, 90, 113, 20)) - font = QtGui.QFont() - font.setPointSize(9) - font.setBold(False) - self.sem_year.setFont(font) - self.sem_year.setFocusPolicy(QtCore.Qt.FocusPolicy.StrongFocus) - self.sem_year.setMaxLength(5) - self.sem_year.setObjectName("sem_year") - self.check_send_mail = QtWidgets.QCheckBox(parent=self.app_group_box) - self.check_send_mail.setGeometry(QtCore.QRect(450, 150, 91, 24)) - font = QtGui.QFont() - font.setPointSize(9) - font.setBold(False) - self.check_send_mail.setFont(font) - self.check_send_mail.setObjectName("check_send_mail") - self.sem_winter = QtWidgets.QCheckBox(parent=self.app_group_box) - self.sem_winter.setGeometry(QtCore.QRect(340, 80, 82, 17)) - font = QtGui.QFont() - font.setPointSize(9) - font.setBold(False) - self.sem_winter.setFont(font) - self.sem_winter.setFocusPolicy(QtCore.Qt.FocusPolicy.StrongFocus) - self.sem_winter.setObjectName("sem_winter") - self.label_4 = QtWidgets.QLabel(parent=self.app_group_box) - self.label_4.setGeometry(QtCore.QRect(20, 110, 71, 21)) - font = QtGui.QFont() - font.setPointSize(9) - font.setBold(False) - self.label_4.setFont(font) - self.label_4.setObjectName("label_4") - self.telnr_mand = QtWidgets.QLabel(parent=self.app_group_box) - self.telnr_mand.setGeometry(QtCore.QRect(110, 160, 47, 21)) - font = QtGui.QFont() - font.setPointSize(9) - font.setBold(False) - self.telnr_mand.setFont(font) - self.telnr_mand.setObjectName("telnr_mand") - self.btn_apparat_save = QtWidgets.QPushButton(parent=self.app_group_box) - self.btn_apparat_save.setGeometry(QtCore.QRect(270, 150, 75, 23)) - font = QtGui.QFont() - font.setPointSize(9) - font.setBold(False) - self.btn_apparat_save.setFont(font) - self.btn_apparat_save.setStatusTip("") - self.btn_apparat_save.setObjectName("btn_apparat_save") - self.label_5 = QtWidgets.QLabel(parent=self.app_group_box) - self.label_5.setGeometry(QtCore.QRect(250, 50, 91, 21)) - font = QtGui.QFont() - font.setPointSize(9) - font.setBold(False) - self.label_5.setFont(font) - self.label_5.setObjectName("label_5") - self.app_name = QtWidgets.QLineEdit(parent=self.app_group_box) - self.app_name.setGeometry(QtCore.QRect(340, 50, 113, 20)) - font = QtGui.QFont() - font.setPointSize(9) - font.setBold(False) - self.app_name.setFont(font) - self.app_name.setFocusPolicy(QtCore.Qt.FocusPolicy.StrongFocus) - self.app_name.setObjectName("app_name") - self.drpdwn_app_nr = QtWidgets.QComboBox(parent=self.app_group_box) - self.drpdwn_app_nr.setGeometry(QtCore.QRect(120, 50, 69, 22)) - font = QtGui.QFont() - font.setPointSize(9) - font.setBold(False) - self.drpdwn_app_nr.setFont(font) - self.drpdwn_app_nr.setInputMethodHints(QtCore.Qt.InputMethodHint.ImhNone) - self.drpdwn_app_nr.setEditable(True) - self.drpdwn_app_nr.setObjectName("drpdwn_app_nr") - self.label_6 = QtWidgets.QLabel(parent=self.app_group_box) - self.label_6.setGeometry(QtCore.QRect(270, 90, 61, 21)) - font = QtGui.QFont() - font.setPointSize(9) - font.setBold(False) - self.label_6.setFont(font) - self.label_6.setObjectName("label_6") - self.valid_check_profname = QtWidgets.QToolButton(parent=self.app_group_box) - self.valid_check_profname.setGeometry(QtCore.QRect(240, 110, 23, 22)) - self.valid_check_profname.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) - self.valid_check_profname.setText("") - self.valid_check_profname.setAutoRaise(True) - self.valid_check_profname.setArrowType(QtCore.Qt.ArrowType.NoArrow) - self.valid_check_profname.setObjectName("valid_check_profname") - self.valid_check_appname = QtWidgets.QToolButton(parent=self.app_group_box) - self.valid_check_appname.setGeometry(QtCore.QRect(450, 50, 22, 22)) - self.valid_check_appname.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) - self.valid_check_appname.setText("") - self.valid_check_appname.setAutoRaise(True) - self.valid_check_appname.setObjectName("valid_check_appname") - self.valid_check_semester = QtWidgets.QToolButton(parent=self.app_group_box) - self.valid_check_semester.setGeometry(QtCore.QRect(520, 90, 22, 22)) - self.valid_check_semester.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) - self.valid_check_semester.setText("") - self.valid_check_semester.setAutoRaise(True) - self.valid_check_semester.setObjectName("valid_check_semester") - self.valid_check_mail = QtWidgets.QToolButton(parent=self.app_group_box) - self.valid_check_mail.setGeometry(QtCore.QRect(240, 140, 22, 22)) - self.valid_check_mail.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) - self.valid_check_mail.setText("") - self.valid_check_mail.setAutoRaise(True) - self.valid_check_mail.setObjectName("valid_check_mail") - self.valid_check_telnr = QtWidgets.QToolButton(parent=self.app_group_box) - self.valid_check_telnr.setGeometry(QtCore.QRect(240, 160, 22, 22)) - self.valid_check_telnr.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) - self.valid_check_telnr.setText("") - self.valid_check_telnr.setAutoRaise(True) - self.valid_check_telnr.setObjectName("valid_check_telnr") - self.saveandcreate = QtWidgets.QPushButton(parent=self.app_group_box) - self.saveandcreate.setEnabled(False) - self.saveandcreate.setGeometry(QtCore.QRect(270, 180, 161, 24)) - font = QtGui.QFont() - font.setPointSize(9) - font.setBold(False) - self.saveandcreate.setFont(font) - self.saveandcreate.setObjectName("saveandcreate") - self.gridLayout_2.addWidget(self.app_group_box, 1, 0, 1, 1) - self.add_medium = QtWidgets.QPushButton(parent=self.createApparat) - self.add_medium.setGeometry(QtCore.QRect(3, 695, 121, 20)) - self.add_medium.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) - self.add_medium.setObjectName("add_medium") - self.tabWidget.addTab(self.createApparat, "") - self.search_statistics = QtWidgets.QWidget() - self.search_statistics.setObjectName("search_statistics") - self.tabWidget.addTab(self.search_statistics, "") - self.elsatab = QtWidgets.QWidget() - self.elsatab.setObjectName("elsatab") - self.tabWidget.addTab(self.elsatab, "") - self.admin = QtWidgets.QWidget() - self.admin.setObjectName("admin") - self.label_21 = QtWidgets.QLabel(parent=self.admin) - self.label_21.setGeometry(QtCore.QRect(10, 30, 47, 22)) - self.label_21.setObjectName("label_21") - self.select_action_box = QtWidgets.QComboBox(parent=self.admin) - self.select_action_box.setGeometry(QtCore.QRect(60, 30, 181, 22)) - self.select_action_box.setObjectName("select_action_box") - self.select_action_box.addItem("") - self.select_action_box.addItem("") - self.select_action_box.addItem("") - self.admin_action = QtWidgets.QGroupBox(parent=self.admin) - self.admin_action.setGeometry(QtCore.QRect(10, 70, 570, 291)) - font = QtGui.QFont() - font.setBold(False) - self.admin_action.setFont(font) - self.admin_action.setFlat(True) - self.admin_action.setCheckable(False) - self.admin_action.setObjectName("admin_action") - self.tabWidget.addTab(self.admin, "") - self.gridLayout.addWidget(self.tabWidget, 0, 0, 1, 1) - self.horizontalLayout.addLayout(self.gridLayout) - self.mainLayout.addLayout(self.horizontalLayout) - self.verticalLayoutWidget_2 = QtWidgets.QWidget(parent=self.centralwidget) - self.verticalLayoutWidget_2.setGeometry(QtCore.QRect(1280, 0, 306, 751)) - self.verticalLayoutWidget_2.setObjectName("verticalLayoutWidget_2") - self.verticalLayout = QtWidgets.QVBoxLayout(self.verticalLayoutWidget_2) - self.verticalLayout.setContentsMargins(0, 0, 0, 0) - self.verticalLayout.setObjectName("verticalLayout") - self.calendar_frame = QtWidgets.QFrame(parent=self.verticalLayoutWidget_2) - self.calendar_frame.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel) - self.calendar_frame.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) - self.calendar_frame.setObjectName("calendar_frame") - self.verticalLayout_7 = QtWidgets.QVBoxLayout(self.calendar_frame) - self.verticalLayout_7.setObjectName("verticalLayout_7") - self.calendarlayout = QtWidgets.QVBoxLayout() - self.calendarlayout.setObjectName("calendarlayout") - self.verticalLayout_7.addLayout(self.calendarlayout) - self.verticalLayout.addWidget(self.calendar_frame) - self.frame_creation_progress = QtWidgets.QFrame(parent=self.verticalLayoutWidget_2) - self.frame_creation_progress.setObjectName("frame_creation_progress") - self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.frame_creation_progress) - self.verticalLayout_4.setSpacing(6) - self.verticalLayout_4.setObjectName("verticalLayout_4") - self.steps = QtWidgets.QFrame(parent=self.frame_creation_progress) - self.steps.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel) - self.steps.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) - self.steps.setObjectName("steps") - self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.steps) - self.verticalLayout_3.setSpacing(0) - self.verticalLayout_3.setObjectName("verticalLayout_3") - self.groupBox_2 = QtWidgets.QGroupBox(parent=self.steps) - self.groupBox_2.setEnabled(True) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Expanding) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.groupBox_2.sizePolicy().hasHeightForWidth()) - self.groupBox_2.setSizePolicy(sizePolicy) - font = QtGui.QFont() - font.setPointSize(11) - font.setBold(True) - self.groupBox_2.setFont(font) - self.groupBox_2.setObjectName("groupBox_2") - self.verticalLayout_6 = QtWidgets.QVBoxLayout(self.groupBox_2) - self.verticalLayout_6.setObjectName("verticalLayout_6") - self.appdata_check = QtWidgets.QCheckBox(parent=self.groupBox_2) - font = QtGui.QFont() - font.setPointSize(8) - font.setBold(False) - self.appdata_check.setFont(font) - self.appdata_check.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) - self.appdata_check.setObjectName("appdata_check") - self.verticalLayout_6.addWidget(self.appdata_check) - self.media_check = QtWidgets.QCheckBox(parent=self.groupBox_2) - font = QtGui.QFont() - font.setPointSize(8) - font.setBold(False) - self.media_check.setFont(font) - self.media_check.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) - self.media_check.setObjectName("media_check") - self.verticalLayout_6.addWidget(self.media_check) - self.ids_check = QtWidgets.QCheckBox(parent=self.groupBox_2) - font = QtGui.QFont() - font.setPointSize(8) - font.setBold(False) - self.ids_check.setFont(font) - self.ids_check.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) - self.ids_check.setObjectName("ids_check") - self.verticalLayout_6.addWidget(self.ids_check) - self.verticalLayout_3.addWidget(self.groupBox_2) - self.groupBox = QtWidgets.QGroupBox(parent=self.steps) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Expanding) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.groupBox.sizePolicy().hasHeightForWidth()) - self.groupBox.setSizePolicy(sizePolicy) - font = QtGui.QFont() - font.setPointSize(11) - font.setBold(True) - self.groupBox.setFont(font) - self.groupBox.setObjectName("groupBox") - self.verticalLayout_5 = QtWidgets.QVBoxLayout(self.groupBox) - self.verticalLayout_5.setObjectName("verticalLayout_5") - self.media_checked = QtWidgets.QCheckBox(parent=self.groupBox) - font = QtGui.QFont() - font.setPointSize(8) - font.setBold(False) - font.setItalic(False) - font.setUnderline(False) - font.setKerning(True) - font.setStyleStrategy(QtGui.QFont.StyleStrategy.PreferDefault) - self.media_checked.setFont(font) - self.media_checked.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) - self.media_checked.setObjectName("media_checked") - self.verticalLayout_5.addWidget(self.media_checked) - self.media_edited_check = QtWidgets.QCheckBox(parent=self.groupBox) - font = QtGui.QFont() - font.setPointSize(8) - font.setBold(False) - font.setItalic(False) - font.setUnderline(False) - font.setKerning(True) - font.setStyleStrategy(QtGui.QFont.StyleStrategy.PreferDefault) - self.media_edited_check.setFont(font) - self.media_edited_check.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) - self.media_edited_check.setObjectName("media_edited_check") - self.verticalLayout_5.addWidget(self.media_edited_check) - self.app_created = QtWidgets.QCheckBox(parent=self.groupBox) - font = QtGui.QFont() - font.setPointSize(8) - font.setBold(False) - font.setItalic(False) - font.setUnderline(False) - font.setKerning(True) - font.setStyleStrategy(QtGui.QFont.StyleStrategy.PreferDefault) - self.app_created.setFont(font) - self.app_created.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) - self.app_created.setObjectName("app_created") - self.verticalLayout_5.addWidget(self.app_created) - self.btn_copy_adis_command = QtWidgets.QPushButton(parent=self.groupBox) - font = QtGui.QFont() - font.setPointSize(8) - font.setBold(False) - font.setItalic(False) - font.setUnderline(False) - font.setKerning(True) - font.setStyleStrategy(QtGui.QFont.StyleStrategy.PreferDefault) - self.btn_copy_adis_command.setFont(font) - self.btn_copy_adis_command.setStatusTip("") - self.btn_copy_adis_command.setWhatsThis("") - self.btn_copy_adis_command.setAccessibleDescription("") - self.btn_copy_adis_command.setAutoFillBackground(False) - icon1 = QtGui.QIcon() - icon1.addPixmap(QtGui.QPixmap("c:\\Users\\aky547\\GitHub\\SemesterapparatsManager\\src\\ui\\../../../../../../.designer/backup/icons/information.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) - self.btn_copy_adis_command.setIcon(icon1) - self.btn_copy_adis_command.setCheckable(False) - self.btn_copy_adis_command.setChecked(False) - self.btn_copy_adis_command.setAutoDefault(False) - self.btn_copy_adis_command.setObjectName("btn_copy_adis_command") - self.verticalLayout_5.addWidget(self.btn_copy_adis_command) - self.verticalLayout_3.addWidget(self.groupBox) - self.verticalLayout_4.addWidget(self.steps) - self.verticalLayout.addWidget(self.frame_creation_progress) - MainWindow.setCentralWidget(self.centralwidget) - self.menubar = QtWidgets.QMenuBar(parent=MainWindow) - self.menubar.setGeometry(QtCore.QRect(0, 0, 1590, 22)) - self.menubar.setObjectName("menubar") - self.menuDatei = QtWidgets.QMenu(parent=self.menubar) - self.menuDatei.setObjectName("menuDatei") - self.menuEinstellungen = QtWidgets.QMenu(parent=self.menubar) - self.menuEinstellungen.setObjectName("menuEinstellungen") - self.menuHelp = QtWidgets.QMenu(parent=self.menubar) - self.menuHelp.setObjectName("menuHelp") - MainWindow.setMenuBar(self.menubar) - self.statusBar = QtWidgets.QStatusBar(parent=MainWindow) - self.statusBar.setObjectName("statusBar") - MainWindow.setStatusBar(self.statusBar) - self.actionBeenden = QtGui.QAction(parent=MainWindow) - self.actionBeenden.setMenuRole(QtGui.QAction.MenuRole.QuitRole) - self.actionBeenden.setShortcutVisibleInContextMenu(True) - self.actionBeenden.setObjectName("actionBeenden") - self.actionEinstellungen = QtGui.QAction(parent=MainWindow) - self.actionEinstellungen.setShortcutVisibleInContextMenu(True) - self.actionEinstellungen.setObjectName("actionEinstellungen") - self.actionDokumentation = QtGui.QAction(parent=MainWindow) - self.actionDokumentation.setShortcutContext(QtCore.Qt.ShortcutContext.ApplicationShortcut) - self.actionDokumentation.setObjectName("actionDokumentation") - self.actionAbout = QtGui.QAction(parent=MainWindow) - self.actionAbout.setMenuRole(QtGui.QAction.MenuRole.AboutRole) - self.actionAbout.setObjectName("actionAbout") - self.actionDokumentation_lokal = QtGui.QAction(parent=MainWindow) - self.actionDokumentation_lokal.setObjectName("actionDokumentation_lokal") - self.menuDatei.addAction(self.actionBeenden) - self.menuEinstellungen.addAction(self.actionEinstellungen) - self.menuHelp.addAction(self.actionDokumentation_lokal) - self.menuHelp.addAction(self.actionAbout) - self.menubar.addAction(self.menuDatei.menuAction()) - self.menubar.addAction(self.menuEinstellungen.menuAction()) - self.menubar.addAction(self.menuHelp.menuAction()) - self.label_9.setBuddy(self.prof_tel_nr) - self.label_3.setBuddy(self.prof_title) - self.label_2.setBuddy(self.drpdwn_app_nr) - self.label_8.setBuddy(self.prof_mail) - self.label_10.setBuddy(self.app_fach) - self.label_12.setBuddy(self.prof_id_adis) - self.label_13.setBuddy(self.apparat_id_adis) - self.label_4.setBuddy(self.drpdwn_prof_name) - self.label_5.setBuddy(self.app_name) - self.label_6.setBuddy(self.sem_year) - - self.retranslateUi(MainWindow) - self.tabWidget.setCurrentIndex(0) - QtCore.QMetaObject.connectSlotsByName(MainWindow) - MainWindow.setTabOrder(self.drpdwn_app_nr, 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_sommer) - MainWindow.setTabOrder(self.sem_sommer, self.sem_winter) - MainWindow.setTabOrder(self.sem_winter, 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.check_file) - MainWindow.setTabOrder(self.check_file, self.check_send_mail) - MainWindow.setTabOrder(self.check_send_mail, self.btn_apparat_save) - MainWindow.setTabOrder(self.btn_apparat_save, self.btn_apparat_apply) - MainWindow.setTabOrder(self.btn_apparat_apply, self.chkbx_show_del_media) - MainWindow.setTabOrder(self.chkbx_show_del_media, self.btn_reserve) - MainWindow.setTabOrder(self.btn_reserve, self.select_action_box) - MainWindow.setTabOrder(self.select_action_box, self.prof_id_adis) - MainWindow.setTabOrder(self.prof_id_adis, self.apparat_id_adis) - MainWindow.setTabOrder(self.apparat_id_adis, self.automation_add_selected_books) - MainWindow.setTabOrder(self.automation_add_selected_books, self.saveandcreate) - - def retranslateUi(self, MainWindow): - _translate = QtCore.QCoreApplication.translate - MainWindow.setWindowTitle(_translate("MainWindow", "Semesterapparatsmanagement")) - self.create_document.setToolTip(_translate("MainWindow", "Erstellt die Übersicht, welche am Regal ausgehängt werden kann")) - self.create_document.setText(_translate("MainWindow", "Übersicht erstellen")) - self.create_new_app.setText(_translate("MainWindow", "neu. App anlegen")) - self.cancel_active_selection.setText(_translate("MainWindow", "Auswahl abbrechen")) - self.tableWidget_apparate.setSortingEnabled(False) - 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", "gültig bis")) - item = self.tableWidget_apparate.horizontalHeaderItem(4) - item.setText(_translate("MainWindow", "Dauerapparat")) - item = self.tableWidget_apparate.horizontalHeaderItem(5) - item.setText(_translate("MainWindow", "KontoNr")) - self.chkbx_show_del_media.setText(_translate("MainWindow", "gel. Medien anzeigen")) - self.btn_reserve.setText(_translate("MainWindow", "im Apparat?")) - self.label_info.setText(_translate("MainWindow", "Medien werden hinzugefügt")) - self.progress_label.setText(_translate("MainWindow", "Medium x/y")) - self.label_20.setText(_translate("MainWindow", "Medien werden geprüft")) - self.avail_status.setText(_translate("MainWindow", "TextLabel")) - self.automation_add_selected_books.setText(_translate("MainWindow", "Ausgewählte als verfügbar markieren")) - self.tableWidget_apparat_media.setSortingEnabled(True) - item = self.tableWidget_apparat_media.horizontalHeaderItem(0) - item.setText(_translate("MainWindow", "Buchtitel")) - item.setToolTip(_translate("MainWindow", "Es kann sein, dass der Buchtitel leer ist, dies kommt vor, wenn der Titel nicht passend formatiert ist")) - item = self.tableWidget_apparat_media.horizontalHeaderItem(1) - item.setText(_translate("MainWindow", "Signatur")) - item = self.tableWidget_apparat_media.horizontalHeaderItem(2) - item.setText(_translate("MainWindow", "Auflage")) - item = self.tableWidget_apparat_media.horizontalHeaderItem(3) - item.setText(_translate("MainWindow", "Autor")) - item = self.tableWidget_apparat_media.horizontalHeaderItem(4) - item.setText(_translate("MainWindow", "im Apparat?")) - item.setToolTip(_translate("MainWindow", "Diese Angabe ist nicht zuverlässig. Ist das ❌ vorhanden, kann das Medium im Apparat sein, aber aufgrund eines Bugs nicht gefunden worden")) - item = self.tableWidget_apparat_media.horizontalHeaderItem(5) - item.setText(_translate("MainWindow", "Vorgemerkt")) - item = self.tableWidget_apparat_media.horizontalHeaderItem(6) - item.setText(_translate("MainWindow", "Link")) - self.label.setText(_translate("MainWindow", " Medienliste")) - self.app_group_box.setTitle(_translate("MainWindow", "Apparatsdetails")) - item = self.document_list.horizontalHeaderItem(0) - item.setText(_translate("MainWindow", "Dokumentname")) - item = self.document_list.horizontalHeaderItem(1) - item.setText(_translate("MainWindow", "Dateityp")) - item = self.document_list.horizontalHeaderItem(2) - item.setText(_translate("MainWindow", "Neu?")) - item = self.document_list.horizontalHeaderItem(3) - item.setText(_translate("MainWindow", "path")) - self.check_file.setToolTip(_translate("MainWindow", "Abhängig von der Anzahl der Medien kann die Suche sehr lange dauern")) - self.check_file.setText(_translate("MainWindow", "Medien aus Dokument\n" -" hinzufügen")) - self.btn_open_document.setText(_translate("MainWindow", "Dokument öffnen")) - self.btn_add_document.setText(_translate("MainWindow", "Dokument hinzufügen")) - self.appname_mand.setText(_translate("MainWindow", "*")) - self.profname_mand.setText(_translate("MainWindow", "*")) - self.fach_mand.setText(_translate("MainWindow", "*")) - self.btn_apparat_apply.setText(_translate("MainWindow", "Aktualisieren")) - self.label_9.setText(_translate("MainWindow", "Tel")) - self._mand.setText(_translate("MainWindow", "*")) - self.check_eternal_app.setText(_translate("MainWindow", "Dauerapparat")) - self.sem_sommer.setText(_translate("MainWindow", "Sommer")) - self.drpdwn_prof_name.setToolTip(_translate("MainWindow", "Nachname, Vorname")) - self.mail_mand.setText(_translate("MainWindow", "*")) - self.label_3.setStatusTip(_translate("MainWindow", "sdvosdvsdv")) - self.label_3.setText(_translate("MainWindow", "Prof. Titel")) - self.label_2.setText(_translate("MainWindow", "Apparatsnummer")) - self.label_8.setText(_translate("MainWindow", "Mail")) - self.label_10.setText(_translate("MainWindow", "Fach")) - self.label_12.setText(_translate("MainWindow", "Prof-ID-aDIS")) - self.label_13.setText(_translate("MainWindow", "Apparat-ID-aDIS")) - self.sem_year.setPlaceholderText(_translate("MainWindow", "2023")) - self.check_send_mail.setText(_translate("MainWindow", "Mail senden")) - self.sem_winter.setText(_translate("MainWindow", "Winter")) - self.label_4.setText(_translate("MainWindow", "Prof. Name")) - self.telnr_mand.setText(_translate("MainWindow", "*")) - self.btn_apparat_save.setText(_translate("MainWindow", "Speichern")) - self.label_5.setText(_translate("MainWindow", "Apparatsname")) - self.label_6.setText(_translate("MainWindow", "Semester")) - self.valid_check_profname.setStatusTip(_translate("MainWindow", "Format: Nachname, Vorname")) - self.valid_check_mail.setStatusTip(_translate("MainWindow", "mail@irgendwas.wasanderes")) - self.saveandcreate.setText(_translate("MainWindow", "Speichern und anlegen")) - self.add_medium.setText(_translate("MainWindow", "Medien hinzufügen")) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.createApparat), _translate("MainWindow", "Anlegen")) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.search_statistics), _translate("MainWindow", "Suchen / Statistik")) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.elsatab), _translate("MainWindow", "ELSA")) - self.label_21.setText(_translate("MainWindow", "Aktion:")) - self.select_action_box.setItemText(0, _translate("MainWindow", "Nutzer anlegen")) - self.select_action_box.setItemText(1, _translate("MainWindow", "Nutzer bearbeiten")) - self.select_action_box.setItemText(2, _translate("MainWindow", "Lehrperson bearbeiten")) - self.admin_action.setTitle(_translate("MainWindow", "GroupBox")) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.admin), _translate("MainWindow", "Admin")) - self.groupBox_2.setTitle(_translate("MainWindow", "Software")) - self.appdata_check.setText(_translate("MainWindow", "Apparatsdaten eingegeben")) - self.media_check.setText(_translate("MainWindow", "Medien hinzugefügt / importiert")) - self.ids_check.setText(_translate("MainWindow", "Prof-ID und Apparat-ID eingetragen")) - self.groupBox.setTitle(_translate("MainWindow", "aDIS")) - self.media_checked.setText(_translate("MainWindow", "Medien geprüft")) - self.media_edited_check.setText(_translate("MainWindow", "Medien bearbeitet")) - self.app_created.setText(_translate("MainWindow", "Apparat angelegt")) - self.btn_copy_adis_command.setToolTip(_translate("MainWindow", "Hier klicken, um die aDIS Abfrage in die Zwischenablage zu kopieren")) - self.btn_copy_adis_command.setText(_translate("MainWindow", " aDIS Abfrage in Zwischenablage kopieren")) - self.menuDatei.setTitle(_translate("MainWindow", "Datei")) - self.menuEinstellungen.setTitle(_translate("MainWindow", "Bearbeiten")) - self.menuHelp.setTitle(_translate("MainWindow", "Help")) - self.actionBeenden.setText(_translate("MainWindow", "Beenden")) - self.actionBeenden.setShortcut(_translate("MainWindow", "Ctrl+Q")) - self.actionEinstellungen.setText(_translate("MainWindow", "Einstellungen")) - self.actionEinstellungen.setShortcut(_translate("MainWindow", "Alt+S")) - self.actionDokumentation.setText(_translate("MainWindow", "Dokumentation (online)")) - self.actionDokumentation.setShortcut(_translate("MainWindow", "F1")) - self.actionAbout.setText(_translate("MainWindow", "About")) - self.actionDokumentation_lokal.setText(_translate("MainWindow", "Dokumentation (lokal)")) - self.actionDokumentation_lokal.setShortcut(_translate("MainWindow", "F1")) +# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\semesterapparat_ui.ui' +# +# Created by: PyQt6 UI code generator 6.9.0 +# +# 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.setWindowModality(QtCore.Qt.WindowModality.WindowModal) + MainWindow.setEnabled(True) + MainWindow.resize(1590, 800) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth()) + MainWindow.setSizePolicy(sizePolicy) + MainWindow.setMinimumSize(QtCore.QSize(1278, 800)) + MainWindow.setMaximumSize(QtCore.QSize(1590, 800)) + MainWindow.setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.NoContextMenu) + icon = QtGui.QIcon() + icon.addPixmap(QtGui.QPixmap("c:\\Users\\aky547\\GitHub\\SemesterapparatsManager\\src\\ui\\../../../../../../icons/logo.ico"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) + MainWindow.setWindowIcon(icon) + MainWindow.setStatusTip("") + self.centralwidget = QtWidgets.QWidget(parent=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(parent=self.centralwidget) + self.verticalLayoutWidget.setGeometry(QtCore.QRect(0, 0, 1271, 751)) + self.verticalLayoutWidget.setObjectName("verticalLayoutWidget") + self.mainLayout = QtWidgets.QVBoxLayout(self.verticalLayoutWidget) + self.mainLayout.setContentsMargins(0, 0, 0, 0) + self.mainLayout.setObjectName("mainLayout") + self.horizontalLayout = QtWidgets.QHBoxLayout() + self.horizontalLayout.setObjectName("horizontalLayout") + self.gridLayout = QtWidgets.QGridLayout() + self.gridLayout.setObjectName("gridLayout") + self.tabWidget = QtWidgets.QTabWidget(parent=self.verticalLayoutWidget) + self.tabWidget.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.tabWidget.setObjectName("tabWidget") + self.createApparat = QtWidgets.QWidget() + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.createApparat.sizePolicy().hasHeightForWidth()) + self.createApparat.setSizePolicy(sizePolicy) + self.createApparat.setObjectName("createApparat") + self.horizontalLayoutWidget_2 = QtWidgets.QWidget(parent=self.createApparat) + self.horizontalLayoutWidget_2.setGeometry(QtCore.QRect(0, 0, 1261, 163)) + 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.create_document = QtWidgets.QPushButton(parent=self.horizontalLayoutWidget_2) + self.create_document.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.create_document.setObjectName("create_document") + self.verticalLayout_2.addWidget(self.create_document) + self.create_new_app = QtWidgets.QPushButton(parent=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) + self.cancel_active_selection = QtWidgets.QPushButton(parent=self.horizontalLayoutWidget_2) + self.cancel_active_selection.setEnabled(False) + self.cancel_active_selection.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.cancel_active_selection.setObjectName("cancel_active_selection") + self.verticalLayout_2.addWidget(self.cancel_active_selection) + spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) + self.verticalLayout_2.addItem(spacerItem1) + self.formLayout.setLayout(1, QtWidgets.QFormLayout.ItemRole.LabelRole, self.verticalLayout_2) + self.tableWidget_apparate = QtWidgets.QTableWidget(parent=self.horizontalLayoutWidget_2) + self.tableWidget_apparate.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.tableWidget_apparate.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.SizeAdjustPolicy.AdjustToContents) + self.tableWidget_apparate.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers) + self.tableWidget_apparate.setAlternatingRowColors(True) + self.tableWidget_apparate.setTextElideMode(QtCore.Qt.TextElideMode.ElideMiddle) + self.tableWidget_apparate.setObjectName("tableWidget_apparate") + self.tableWidget_apparate.setColumnCount(6) + 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) + item = QtWidgets.QTableWidgetItem() + self.tableWidget_apparate.setHorizontalHeaderItem(4, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget_apparate.setHorizontalHeaderItem(5, item) + self.tableWidget_apparate.horizontalHeader().setCascadingSectionResizes(True) + self.formLayout.setWidget(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.tableWidget_apparate) + self.horizontalLayout_2.addLayout(self.formLayout) + self.line = QtWidgets.QFrame(parent=self.createApparat) + 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(parent=self.createApparat) + self.gridLayoutWidget_2.setEnabled(True) + self.gridLayoutWidget_2.setGeometry(QtCore.QRect(0, 180, 1261, 511)) + 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.horizontalLayout_5 = QtWidgets.QHBoxLayout() + self.horizontalLayout_5.setObjectName("horizontalLayout_5") + spacerItem2 = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Minimum) + self.horizontalLayout_5.addItem(spacerItem2) + self.chkbx_show_del_media = QtWidgets.QCheckBox(parent=self.gridLayoutWidget_2) + self.chkbx_show_del_media.setObjectName("chkbx_show_del_media") + self.horizontalLayout_5.addWidget(self.chkbx_show_del_media) + spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Minimum) + self.horizontalLayout_5.addItem(spacerItem3) + self.btn_reserve = QtWidgets.QPushButton(parent=self.gridLayoutWidget_2) + self.btn_reserve.setObjectName("btn_reserve") + self.horizontalLayout_5.addWidget(self.btn_reserve) + self.add_layout = QtWidgets.QHBoxLayout() + self.add_layout.setObjectName("add_layout") + self.label_info = QtWidgets.QLabel(parent=self.gridLayoutWidget_2) + self.label_info.setObjectName("label_info") + self.add_layout.addWidget(self.label_info) + self.line_2 = QtWidgets.QFrame(parent=self.gridLayoutWidget_2) + self.line_2.setFrameShape(QtWidgets.QFrame.Shape.VLine) + self.line_2.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) + self.line_2.setObjectName("line_2") + self.add_layout.addWidget(self.line_2) + self.progress_label = QtWidgets.QLabel(parent=self.gridLayoutWidget_2) + self.progress_label.setObjectName("progress_label") + self.add_layout.addWidget(self.progress_label) + self.horizontalLayout_5.addLayout(self.add_layout) + spacerItem4 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Minimum) + self.horizontalLayout_5.addItem(spacerItem4) + self.avail_layout = QtWidgets.QHBoxLayout() + self.avail_layout.setObjectName("avail_layout") + self.horizontalLayout_5.addLayout(self.avail_layout) + self.label_20 = QtWidgets.QLabel(parent=self.gridLayoutWidget_2) + self.label_20.setObjectName("label_20") + self.horizontalLayout_5.addWidget(self.label_20) + self.line_3 = QtWidgets.QFrame(parent=self.gridLayoutWidget_2) + self.line_3.setFrameShape(QtWidgets.QFrame.Shape.VLine) + self.line_3.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) + self.line_3.setObjectName("line_3") + self.horizontalLayout_5.addWidget(self.line_3) + self.avail_status = QtWidgets.QLabel(parent=self.gridLayoutWidget_2) + self.avail_status.setObjectName("avail_status") + self.horizontalLayout_5.addWidget(self.avail_status) + self.automation_add_selected_books = QtWidgets.QPushButton(parent=self.gridLayoutWidget_2) + self.automation_add_selected_books.setObjectName("automation_add_selected_books") + self.horizontalLayout_5.addWidget(self.automation_add_selected_books) + spacerItem5 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) + self.horizontalLayout_5.addItem(spacerItem5) + self.gridLayout_2.addLayout(self.horizontalLayout_5, 4, 0, 1, 1) + self.tableWidget_apparat_media = QtWidgets.QTableWidget(parent=self.gridLayoutWidget_2) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Expanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.tableWidget_apparat_media.sizePolicy().hasHeightForWidth()) + self.tableWidget_apparat_media.setSizePolicy(sizePolicy) + self.tableWidget_apparat_media.setMinimumSize(QtCore.QSize(1259, 0)) + self.tableWidget_apparat_media.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.tableWidget_apparat_media.setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.CustomContextMenu) + self.tableWidget_apparat_media.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.SizeAdjustPolicy.AdjustToContents) + self.tableWidget_apparat_media.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers) + self.tableWidget_apparat_media.setAlternatingRowColors(True) + self.tableWidget_apparat_media.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectionBehavior.SelectRows) + self.tableWidget_apparat_media.setObjectName("tableWidget_apparat_media") + self.tableWidget_apparat_media.setColumnCount(7) + 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) + item = QtWidgets.QTableWidgetItem() + self.tableWidget_apparat_media.setHorizontalHeaderItem(4, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget_apparat_media.setHorizontalHeaderItem(5, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget_apparat_media.setHorizontalHeaderItem(6, item) + self.tableWidget_apparat_media.horizontalHeader().setCascadingSectionResizes(True) + self.gridLayout_2.addWidget(self.tableWidget_apparat_media, 9, 0, 1, 1) + self.label = QtWidgets.QLabel(parent=self.gridLayoutWidget_2) + font = QtGui.QFont() + font.setPointSize(11) + font.setBold(True) + self.label.setFont(font) + self.label.setObjectName("label") + self.gridLayout_2.addWidget(self.label, 2, 0, 1, 1) + self.app_group_box = QtWidgets.QGroupBox(parent=self.gridLayoutWidget_2) + self.app_group_box.setEnabled(True) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.app_group_box.sizePolicy().hasHeightForWidth()) + self.app_group_box.setSizePolicy(sizePolicy) + self.app_group_box.setMinimumSize(QtCore.QSize(0, 210)) + font = QtGui.QFont() + font.setPointSize(12) + font.setBold(True) + self.app_group_box.setFont(font) + self.app_group_box.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + 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.document_list = QtWidgets.QTableWidget(parent=self.app_group_box) + self.document_list.setGeometry(QtCore.QRect(780, 20, 321, 181)) + font = QtGui.QFont() + font.setPointSize(10) + font.setBold(False) + font.setKerning(False) + self.document_list.setFont(font) + self.document_list.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.document_list.setAcceptDrops(True) + self.document_list.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarPolicy.ScrollBarAlwaysOff) + self.document_list.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.SizeAdjustPolicy.AdjustToContents) + self.document_list.setDragEnabled(True) + self.document_list.setDragDropMode(QtWidgets.QAbstractItemView.DragDropMode.DragOnly) + self.document_list.setDefaultDropAction(QtCore.Qt.DropAction.LinkAction) + self.document_list.setSelectionMode(QtWidgets.QAbstractItemView.SelectionMode.SingleSelection) + self.document_list.setObjectName("document_list") + self.document_list.setColumnCount(4) + self.document_list.setRowCount(0) + item = QtWidgets.QTableWidgetItem() + font = QtGui.QFont() + font.setFamily("Arial") + font.setPointSize(8) + item.setFont(font) + self.document_list.setHorizontalHeaderItem(0, item) + item = QtWidgets.QTableWidgetItem() + font = QtGui.QFont() + font.setFamily("Arial") + font.setPointSize(8) + item.setFont(font) + self.document_list.setHorizontalHeaderItem(1, item) + item = QtWidgets.QTableWidgetItem() + font = QtGui.QFont() + font.setFamily("Arial") + font.setPointSize(8) + item.setFont(font) + self.document_list.setHorizontalHeaderItem(2, item) + item = QtWidgets.QTableWidgetItem() + self.document_list.setHorizontalHeaderItem(3, item) + self.document_list.horizontalHeader().setDefaultSectionSize(107) + self.appname_mand = QtWidgets.QLabel(parent=self.app_group_box) + self.appname_mand.setGeometry(QtCore.QRect(330, 50, 16, 21)) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + self.appname_mand.setFont(font) + self.appname_mand.setObjectName("appname_mand") + self.profname_mand = QtWidgets.QLabel(parent=self.app_group_box) + self.profname_mand.setGeometry(QtCore.QRect(110, 110, 16, 21)) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + self.profname_mand.setFont(font) + self.profname_mand.setObjectName("profname_mand") + self.prof_title = QtWidgets.QLineEdit(parent=self.app_group_box) + self.prof_title.setGeometry(QtCore.QRect(120, 80, 71, 20)) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + self.prof_title.setFont(font) + self.prof_title.setFocusPolicy(QtCore.Qt.FocusPolicy.ClickFocus) + self.prof_title.setObjectName("prof_title") + self.fach_mand = QtWidgets.QLabel(parent=self.app_group_box) + self.fach_mand.setGeometry(QtCore.QRect(510, 50, 47, 21)) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + self.fach_mand.setFont(font) + self.fach_mand.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.fach_mand.setObjectName("fach_mand") + self.btn_apparat_apply = QtWidgets.QPushButton(parent=self.app_group_box) + self.btn_apparat_apply.setGeometry(QtCore.QRect(360, 150, 75, 23)) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + self.btn_apparat_apply.setFont(font) + self.btn_apparat_apply.setObjectName("btn_apparat_apply") + self.label_9 = QtWidgets.QLabel(parent=self.app_group_box) + self.label_9.setGeometry(QtCore.QRect(20, 160, 71, 21)) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + self.label_9.setFont(font) + self.label_9.setObjectName("label_9") + self.gridLayoutWidget_5 = QtWidgets.QWidget(parent=self.app_group_box) + self.gridLayoutWidget_5.setGeometry(QtCore.QRect(520, 30, 241, 61)) + self.gridLayoutWidget_5.setObjectName("gridLayoutWidget_5") + self.gridLayout_6 = QtWidgets.QGridLayout(self.gridLayoutWidget_5) + self.gridLayout_6.setContentsMargins(0, 0, 0, 0) + self.gridLayout_6.setObjectName("gridLayout_6") + self.app_fach = QtWidgets.QComboBox(parent=self.gridLayoutWidget_5) + self.app_fach.setMaximumSize(QtCore.QSize(16777215, 25)) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + self.app_fach.setFont(font) + self.app_fach.setEditable(True) + self.app_fach.setObjectName("app_fach") + self.gridLayout_6.addWidget(self.app_fach, 0, 1, 1, 1) + spacerItem6 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) + self.gridLayout_6.addItem(spacerItem6, 0, 3, 1, 1) + self.valid_check_app_fach = QtWidgets.QToolButton(parent=self.gridLayoutWidget_5) + self.valid_check_app_fach.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.valid_check_app_fach.setText("") + self.valid_check_app_fach.setAutoRaise(True) + self.valid_check_app_fach.setArrowType(QtCore.Qt.ArrowType.NoArrow) + self.valid_check_app_fach.setObjectName("valid_check_app_fach") + self.gridLayout_6.addWidget(self.valid_check_app_fach, 0, 2, 1, 1) + self._mand = QtWidgets.QLabel(parent=self.app_group_box) + self._mand.setGeometry(QtCore.QRect(330, 90, 16, 21)) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + self._mand.setFont(font) + self._mand.setObjectName("_mand") + self.prof_tel_nr = QtWidgets.QLineEdit(parent=self.app_group_box) + self.prof_tel_nr.setGeometry(QtCore.QRect(120, 160, 121, 20)) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + self.prof_tel_nr.setFont(font) + self.prof_tel_nr.setInputMethodHints(QtCore.Qt.InputMethodHint.ImhNone) + self.prof_tel_nr.setPlaceholderText("") + self.prof_tel_nr.setObjectName("prof_tel_nr") + self.check_eternal_app = QtWidgets.QCheckBox(parent=self.app_group_box) + self.check_eternal_app.setEnabled(False) + self.check_eternal_app.setGeometry(QtCore.QRect(340, 120, 101, 17)) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + self.check_eternal_app.setFont(font) + self.check_eternal_app.setObjectName("check_eternal_app") + self.sem_sommer = QtWidgets.QCheckBox(parent=self.app_group_box) + self.sem_sommer.setGeometry(QtCore.QRect(340, 100, 82, 17)) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + self.sem_sommer.setFont(font) + self.sem_sommer.setFocusPolicy(QtCore.Qt.FocusPolicy.StrongFocus) + self.sem_sommer.setObjectName("sem_sommer") + self.drpdwn_prof_name = QtWidgets.QComboBox(parent=self.app_group_box) + self.drpdwn_prof_name.setGeometry(QtCore.QRect(120, 110, 121, 22)) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + self.drpdwn_prof_name.setFont(font) + self.drpdwn_prof_name.setFocusPolicy(QtCore.Qt.FocusPolicy.StrongFocus) + self.drpdwn_prof_name.setInputMethodHints(QtCore.Qt.InputMethodHint.ImhNone) + self.drpdwn_prof_name.setEditable(True) + self.drpdwn_prof_name.setInsertPolicy(QtWidgets.QComboBox.InsertPolicy.InsertAlphabetically) + self.drpdwn_prof_name.setPlaceholderText("") + self.drpdwn_prof_name.setFrame(True) + self.drpdwn_prof_name.setObjectName("drpdwn_prof_name") + self.mail_mand = QtWidgets.QLabel(parent=self.app_group_box) + self.mail_mand.setGeometry(QtCore.QRect(110, 140, 47, 21)) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + self.mail_mand.setFont(font) + self.mail_mand.setObjectName("mail_mand") + self.label_3 = QtWidgets.QLabel(parent=self.app_group_box) + self.label_3.setGeometry(QtCore.QRect(20, 80, 61, 20)) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + self.label_3.setFont(font) + self.label_3.setObjectName("label_3") + self.label_2 = QtWidgets.QLabel(parent=self.app_group_box) + self.label_2.setGeometry(QtCore.QRect(20, 50, 101, 21)) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + self.label_2.setFont(font) + self.label_2.setObjectName("label_2") + self.label_8 = QtWidgets.QLabel(parent=self.app_group_box) + self.label_8.setGeometry(QtCore.QRect(20, 140, 71, 21)) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + self.label_8.setFont(font) + self.label_8.setObjectName("label_8") + self.label_10 = QtWidgets.QLabel(parent=self.app_group_box) + self.label_10.setGeometry(QtCore.QRect(480, 50, 51, 21)) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + self.label_10.setFont(font) + self.label_10.setObjectName("label_10") + self.prof_mail = QtWidgets.QLineEdit(parent=self.app_group_box) + self.prof_mail.setGeometry(QtCore.QRect(120, 140, 121, 20)) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + self.prof_mail.setFont(font) + self.prof_mail.setInputMethodHints(QtCore.Qt.InputMethodHint.ImhEmailCharactersOnly) + self.prof_mail.setMaxLength(200) + self.prof_mail.setPlaceholderText("") + self.prof_mail.setObjectName("prof_mail") + self.formLayoutWidget_2 = QtWidgets.QWidget(parent=self.app_group_box) + self.formLayoutWidget_2.setGeometry(QtCore.QRect(560, 100, 211, 99)) + self.formLayoutWidget_2.setObjectName("formLayoutWidget_2") + self.formLayout_3 = QtWidgets.QFormLayout(self.formLayoutWidget_2) + self.formLayout_3.setContentsMargins(0, 0, 0, 0) + self.formLayout_3.setObjectName("formLayout_3") + self.label_12 = QtWidgets.QLabel(parent=self.formLayoutWidget_2) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + self.label_12.setFont(font) + self.label_12.setObjectName("label_12") + self.formLayout_3.setWidget(0, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_12) + self.prof_id_adis = QtWidgets.QLineEdit(parent=self.formLayoutWidget_2) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + self.prof_id_adis.setFont(font) + self.prof_id_adis.setInputMethodHints(QtCore.Qt.InputMethodHint.ImhPreferNumbers) + self.prof_id_adis.setText("") + self.prof_id_adis.setObjectName("prof_id_adis") + self.formLayout_3.setWidget(0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.prof_id_adis) + self.label_13 = QtWidgets.QLabel(parent=self.formLayoutWidget_2) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + self.label_13.setFont(font) + self.label_13.setObjectName("label_13") + self.formLayout_3.setWidget(1, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_13) + self.apparat_id_adis = QtWidgets.QLineEdit(parent=self.formLayoutWidget_2) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + self.apparat_id_adis.setFont(font) + self.apparat_id_adis.setInputMethodHints(QtCore.Qt.InputMethodHint.ImhPreferNumbers) + self.apparat_id_adis.setObjectName("apparat_id_adis") + self.formLayout_3.setWidget(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.apparat_id_adis) + self.sem_year = QtWidgets.QLineEdit(parent=self.app_group_box) + self.sem_year.setGeometry(QtCore.QRect(410, 90, 113, 20)) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + self.sem_year.setFont(font) + self.sem_year.setFocusPolicy(QtCore.Qt.FocusPolicy.StrongFocus) + self.sem_year.setMaxLength(5) + self.sem_year.setObjectName("sem_year") + self.check_send_mail = QtWidgets.QCheckBox(parent=self.app_group_box) + self.check_send_mail.setGeometry(QtCore.QRect(450, 150, 91, 24)) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + self.check_send_mail.setFont(font) + self.check_send_mail.setObjectName("check_send_mail") + self.sem_winter = QtWidgets.QCheckBox(parent=self.app_group_box) + self.sem_winter.setGeometry(QtCore.QRect(340, 80, 82, 17)) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + self.sem_winter.setFont(font) + self.sem_winter.setFocusPolicy(QtCore.Qt.FocusPolicy.StrongFocus) + self.sem_winter.setObjectName("sem_winter") + self.label_4 = QtWidgets.QLabel(parent=self.app_group_box) + self.label_4.setGeometry(QtCore.QRect(20, 110, 71, 21)) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + self.label_4.setFont(font) + self.label_4.setObjectName("label_4") + self.telnr_mand = QtWidgets.QLabel(parent=self.app_group_box) + self.telnr_mand.setGeometry(QtCore.QRect(110, 160, 47, 21)) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + self.telnr_mand.setFont(font) + self.telnr_mand.setObjectName("telnr_mand") + self.btn_apparat_save = QtWidgets.QPushButton(parent=self.app_group_box) + self.btn_apparat_save.setGeometry(QtCore.QRect(270, 150, 75, 23)) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + self.btn_apparat_save.setFont(font) + self.btn_apparat_save.setStatusTip("") + self.btn_apparat_save.setObjectName("btn_apparat_save") + self.label_5 = QtWidgets.QLabel(parent=self.app_group_box) + self.label_5.setGeometry(QtCore.QRect(250, 50, 91, 21)) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + self.label_5.setFont(font) + self.label_5.setObjectName("label_5") + self.app_name = QtWidgets.QLineEdit(parent=self.app_group_box) + self.app_name.setGeometry(QtCore.QRect(340, 50, 113, 20)) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + self.app_name.setFont(font) + self.app_name.setFocusPolicy(QtCore.Qt.FocusPolicy.StrongFocus) + self.app_name.setObjectName("app_name") + self.drpdwn_app_nr = QtWidgets.QComboBox(parent=self.app_group_box) + self.drpdwn_app_nr.setGeometry(QtCore.QRect(120, 50, 69, 22)) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + self.drpdwn_app_nr.setFont(font) + self.drpdwn_app_nr.setInputMethodHints(QtCore.Qt.InputMethodHint.ImhNone) + self.drpdwn_app_nr.setEditable(True) + self.drpdwn_app_nr.setObjectName("drpdwn_app_nr") + self.label_6 = QtWidgets.QLabel(parent=self.app_group_box) + self.label_6.setGeometry(QtCore.QRect(270, 90, 61, 21)) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + self.label_6.setFont(font) + self.label_6.setObjectName("label_6") + self.valid_check_profname = QtWidgets.QToolButton(parent=self.app_group_box) + self.valid_check_profname.setGeometry(QtCore.QRect(240, 110, 23, 22)) + self.valid_check_profname.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.valid_check_profname.setText("") + self.valid_check_profname.setAutoRaise(True) + self.valid_check_profname.setArrowType(QtCore.Qt.ArrowType.NoArrow) + self.valid_check_profname.setObjectName("valid_check_profname") + self.valid_check_appname = QtWidgets.QToolButton(parent=self.app_group_box) + self.valid_check_appname.setGeometry(QtCore.QRect(450, 50, 22, 22)) + self.valid_check_appname.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.valid_check_appname.setText("") + self.valid_check_appname.setAutoRaise(True) + self.valid_check_appname.setObjectName("valid_check_appname") + self.valid_check_semester = QtWidgets.QToolButton(parent=self.app_group_box) + self.valid_check_semester.setGeometry(QtCore.QRect(520, 90, 22, 22)) + self.valid_check_semester.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.valid_check_semester.setText("") + self.valid_check_semester.setAutoRaise(True) + self.valid_check_semester.setObjectName("valid_check_semester") + self.valid_check_mail = QtWidgets.QToolButton(parent=self.app_group_box) + self.valid_check_mail.setGeometry(QtCore.QRect(240, 140, 22, 22)) + self.valid_check_mail.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.valid_check_mail.setText("") + self.valid_check_mail.setAutoRaise(True) + self.valid_check_mail.setObjectName("valid_check_mail") + self.valid_check_telnr = QtWidgets.QToolButton(parent=self.app_group_box) + self.valid_check_telnr.setGeometry(QtCore.QRect(240, 160, 22, 22)) + self.valid_check_telnr.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.valid_check_telnr.setText("") + self.valid_check_telnr.setAutoRaise(True) + self.valid_check_telnr.setObjectName("valid_check_telnr") + self.saveandcreate = QtWidgets.QPushButton(parent=self.app_group_box) + self.saveandcreate.setEnabled(False) + self.saveandcreate.setGeometry(QtCore.QRect(270, 180, 161, 24)) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + self.saveandcreate.setFont(font) + self.saveandcreate.setObjectName("saveandcreate") + self.verticalLayoutWidget_3 = QtWidgets.QWidget(parent=self.app_group_box) + self.verticalLayoutWidget_3.setGeometry(QtCore.QRect(1110, 17, 131, 181)) + self.verticalLayoutWidget_3.setObjectName("verticalLayoutWidget_3") + self.verticalLayout_8 = QtWidgets.QVBoxLayout(self.verticalLayoutWidget_3) + self.verticalLayout_8.setContentsMargins(0, 0, 0, 0) + self.verticalLayout_8.setObjectName("verticalLayout_8") + self.btn_add_document = QtWidgets.QPushButton(parent=self.verticalLayoutWidget_3) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.MinimumExpanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.btn_add_document.sizePolicy().hasHeightForWidth()) + self.btn_add_document.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + self.btn_add_document.setFont(font) + self.btn_add_document.setObjectName("btn_add_document") + self.verticalLayout_8.addWidget(self.btn_add_document) + self.btn_open_document = QtWidgets.QPushButton(parent=self.verticalLayoutWidget_3) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.MinimumExpanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.btn_open_document.sizePolicy().hasHeightForWidth()) + self.btn_open_document.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + self.btn_open_document.setFont(font) + self.btn_open_document.setObjectName("btn_open_document") + self.verticalLayout_8.addWidget(self.btn_open_document) + self.check_file = QtWidgets.QPushButton(parent=self.verticalLayoutWidget_3) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.MinimumExpanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.check_file.sizePolicy().hasHeightForWidth()) + self.check_file.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + self.check_file.setFont(font) + self.check_file.setObjectName("check_file") + self.verticalLayout_8.addWidget(self.check_file) + self.btn_extract_data_from_document = QtWidgets.QPushButton(parent=self.verticalLayoutWidget_3) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.MinimumExpanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.btn_extract_data_from_document.sizePolicy().hasHeightForWidth()) + self.btn_extract_data_from_document.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + self.btn_extract_data_from_document.setFont(font) + self.btn_extract_data_from_document.setObjectName("btn_extract_data_from_document") + self.verticalLayout_8.addWidget(self.btn_extract_data_from_document) + self.verticalLayout_8.setStretch(0, 1) + self.verticalLayout_8.setStretch(1, 1) + self.verticalLayout_8.setStretch(2, 2) + self.verticalLayout_8.setStretch(3, 2) + self.gridLayout_2.addWidget(self.app_group_box, 1, 0, 1, 1) + self.add_medium = QtWidgets.QPushButton(parent=self.createApparat) + self.add_medium.setGeometry(QtCore.QRect(3, 695, 121, 20)) + self.add_medium.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.add_medium.setObjectName("add_medium") + self.tabWidget.addTab(self.createApparat, "") + self.search_statistics = QtWidgets.QWidget() + self.search_statistics.setObjectName("search_statistics") + self.tabWidget.addTab(self.search_statistics, "") + self.elsatab = QtWidgets.QWidget() + self.elsatab.setObjectName("elsatab") + self.tabWidget.addTab(self.elsatab, "") + self.admin = QtWidgets.QWidget() + self.admin.setObjectName("admin") + self.label_21 = QtWidgets.QLabel(parent=self.admin) + self.label_21.setGeometry(QtCore.QRect(10, 30, 47, 22)) + self.label_21.setObjectName("label_21") + self.select_action_box = QtWidgets.QComboBox(parent=self.admin) + self.select_action_box.setGeometry(QtCore.QRect(60, 30, 181, 22)) + self.select_action_box.setObjectName("select_action_box") + self.select_action_box.addItem("") + self.select_action_box.addItem("") + self.select_action_box.addItem("") + self.admin_action = QtWidgets.QGroupBox(parent=self.admin) + self.admin_action.setGeometry(QtCore.QRect(10, 70, 570, 291)) + font = QtGui.QFont() + font.setBold(False) + self.admin_action.setFont(font) + self.admin_action.setFlat(True) + self.admin_action.setCheckable(False) + self.admin_action.setObjectName("admin_action") + self.tabWidget.addTab(self.admin, "") + self.gridLayout.addWidget(self.tabWidget, 0, 0, 1, 1) + self.horizontalLayout.addLayout(self.gridLayout) + self.mainLayout.addLayout(self.horizontalLayout) + self.verticalLayoutWidget_2 = QtWidgets.QWidget(parent=self.centralwidget) + self.verticalLayoutWidget_2.setGeometry(QtCore.QRect(1280, 0, 306, 751)) + self.verticalLayoutWidget_2.setObjectName("verticalLayoutWidget_2") + self.verticalLayout = QtWidgets.QVBoxLayout(self.verticalLayoutWidget_2) + self.verticalLayout.setContentsMargins(0, 0, 0, 0) + self.verticalLayout.setObjectName("verticalLayout") + self.calendar_frame = QtWidgets.QFrame(parent=self.verticalLayoutWidget_2) + self.calendar_frame.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel) + self.calendar_frame.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) + self.calendar_frame.setObjectName("calendar_frame") + self.verticalLayout_7 = QtWidgets.QVBoxLayout(self.calendar_frame) + self.verticalLayout_7.setObjectName("verticalLayout_7") + self.calendarlayout = QtWidgets.QVBoxLayout() + self.calendarlayout.setObjectName("calendarlayout") + self.verticalLayout_7.addLayout(self.calendarlayout) + self.verticalLayout.addWidget(self.calendar_frame) + self.frame_creation_progress = QtWidgets.QFrame(parent=self.verticalLayoutWidget_2) + self.frame_creation_progress.setObjectName("frame_creation_progress") + self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.frame_creation_progress) + self.verticalLayout_4.setSpacing(6) + self.verticalLayout_4.setObjectName("verticalLayout_4") + self.steps = QtWidgets.QFrame(parent=self.frame_creation_progress) + self.steps.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel) + self.steps.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) + self.steps.setObjectName("steps") + self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.steps) + self.verticalLayout_3.setSpacing(0) + self.verticalLayout_3.setObjectName("verticalLayout_3") + self.groupBox_2 = QtWidgets.QGroupBox(parent=self.steps) + self.groupBox_2.setEnabled(True) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Expanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.groupBox_2.sizePolicy().hasHeightForWidth()) + self.groupBox_2.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setPointSize(11) + font.setBold(True) + self.groupBox_2.setFont(font) + self.groupBox_2.setObjectName("groupBox_2") + self.verticalLayout_6 = QtWidgets.QVBoxLayout(self.groupBox_2) + self.verticalLayout_6.setObjectName("verticalLayout_6") + self.appdata_check = QtWidgets.QCheckBox(parent=self.groupBox_2) + font = QtGui.QFont() + font.setPointSize(8) + font.setBold(False) + self.appdata_check.setFont(font) + self.appdata_check.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.appdata_check.setObjectName("appdata_check") + self.verticalLayout_6.addWidget(self.appdata_check) + self.media_check = QtWidgets.QCheckBox(parent=self.groupBox_2) + font = QtGui.QFont() + font.setPointSize(8) + font.setBold(False) + self.media_check.setFont(font) + self.media_check.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.media_check.setObjectName("media_check") + self.verticalLayout_6.addWidget(self.media_check) + self.ids_check = QtWidgets.QCheckBox(parent=self.groupBox_2) + font = QtGui.QFont() + font.setPointSize(8) + font.setBold(False) + self.ids_check.setFont(font) + self.ids_check.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.ids_check.setObjectName("ids_check") + self.verticalLayout_6.addWidget(self.ids_check) + self.verticalLayout_3.addWidget(self.groupBox_2) + self.groupBox = QtWidgets.QGroupBox(parent=self.steps) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Expanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.groupBox.sizePolicy().hasHeightForWidth()) + self.groupBox.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setPointSize(11) + font.setBold(True) + self.groupBox.setFont(font) + self.groupBox.setObjectName("groupBox") + self.verticalLayout_5 = QtWidgets.QVBoxLayout(self.groupBox) + self.verticalLayout_5.setObjectName("verticalLayout_5") + self.media_checked = QtWidgets.QCheckBox(parent=self.groupBox) + font = QtGui.QFont() + font.setPointSize(8) + font.setBold(False) + font.setItalic(False) + font.setUnderline(False) + font.setKerning(True) + font.setStyleStrategy(QtGui.QFont.StyleStrategy.PreferDefault) + self.media_checked.setFont(font) + self.media_checked.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.media_checked.setObjectName("media_checked") + self.verticalLayout_5.addWidget(self.media_checked) + self.media_edited_check = QtWidgets.QCheckBox(parent=self.groupBox) + font = QtGui.QFont() + font.setPointSize(8) + font.setBold(False) + font.setItalic(False) + font.setUnderline(False) + font.setKerning(True) + font.setStyleStrategy(QtGui.QFont.StyleStrategy.PreferDefault) + self.media_edited_check.setFont(font) + self.media_edited_check.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.media_edited_check.setObjectName("media_edited_check") + self.verticalLayout_5.addWidget(self.media_edited_check) + self.app_created = QtWidgets.QCheckBox(parent=self.groupBox) + font = QtGui.QFont() + font.setPointSize(8) + font.setBold(False) + font.setItalic(False) + font.setUnderline(False) + font.setKerning(True) + font.setStyleStrategy(QtGui.QFont.StyleStrategy.PreferDefault) + self.app_created.setFont(font) + self.app_created.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.app_created.setObjectName("app_created") + self.verticalLayout_5.addWidget(self.app_created) + self.btn_copy_adis_command = QtWidgets.QPushButton(parent=self.groupBox) + font = QtGui.QFont() + font.setPointSize(8) + font.setBold(False) + font.setItalic(False) + font.setUnderline(False) + font.setKerning(True) + font.setStyleStrategy(QtGui.QFont.StyleStrategy.PreferDefault) + self.btn_copy_adis_command.setFont(font) + self.btn_copy_adis_command.setStatusTip("") + self.btn_copy_adis_command.setWhatsThis("") + self.btn_copy_adis_command.setAccessibleDescription("") + self.btn_copy_adis_command.setAutoFillBackground(False) + icon1 = QtGui.QIcon() + icon1.addPixmap(QtGui.QPixmap("c:\\Users\\aky547\\GitHub\\SemesterapparatsManager\\src\\ui\\../../../../../../.designer/backup/icons/information.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) + self.btn_copy_adis_command.setIcon(icon1) + self.btn_copy_adis_command.setCheckable(False) + self.btn_copy_adis_command.setChecked(False) + self.btn_copy_adis_command.setAutoDefault(False) + self.btn_copy_adis_command.setObjectName("btn_copy_adis_command") + self.verticalLayout_5.addWidget(self.btn_copy_adis_command) + self.verticalLayout_3.addWidget(self.groupBox) + self.verticalLayout_4.addWidget(self.steps) + self.verticalLayout.addWidget(self.frame_creation_progress) + MainWindow.setCentralWidget(self.centralwidget) + self.menubar = QtWidgets.QMenuBar(parent=MainWindow) + self.menubar.setGeometry(QtCore.QRect(0, 0, 1590, 22)) + self.menubar.setObjectName("menubar") + self.menuDatei = QtWidgets.QMenu(parent=self.menubar) + self.menuDatei.setObjectName("menuDatei") + self.menuEinstellungen = QtWidgets.QMenu(parent=self.menubar) + self.menuEinstellungen.setObjectName("menuEinstellungen") + self.menuHelp = QtWidgets.QMenu(parent=self.menubar) + self.menuHelp.setObjectName("menuHelp") + MainWindow.setMenuBar(self.menubar) + self.statusBar = QtWidgets.QStatusBar(parent=MainWindow) + self.statusBar.setObjectName("statusBar") + MainWindow.setStatusBar(self.statusBar) + self.actionBeenden = QtGui.QAction(parent=MainWindow) + self.actionBeenden.setMenuRole(QtGui.QAction.MenuRole.QuitRole) + self.actionBeenden.setShortcutVisibleInContextMenu(True) + self.actionBeenden.setObjectName("actionBeenden") + self.actionEinstellungen = QtGui.QAction(parent=MainWindow) + self.actionEinstellungen.setShortcutVisibleInContextMenu(True) + self.actionEinstellungen.setObjectName("actionEinstellungen") + self.actionDokumentation = QtGui.QAction(parent=MainWindow) + self.actionDokumentation.setShortcutContext(QtCore.Qt.ShortcutContext.ApplicationShortcut) + self.actionDokumentation.setObjectName("actionDokumentation") + self.actionAbout = QtGui.QAction(parent=MainWindow) + self.actionAbout.setMenuRole(QtGui.QAction.MenuRole.AboutRole) + self.actionAbout.setObjectName("actionAbout") + self.actionDokumentation_lokal = QtGui.QAction(parent=MainWindow) + self.actionDokumentation_lokal.setObjectName("actionDokumentation_lokal") + self.menuDatei.addAction(self.actionBeenden) + self.menuEinstellungen.addAction(self.actionEinstellungen) + self.menuHelp.addAction(self.actionDokumentation_lokal) + self.menuHelp.addAction(self.actionAbout) + self.menubar.addAction(self.menuDatei.menuAction()) + self.menubar.addAction(self.menuEinstellungen.menuAction()) + self.menubar.addAction(self.menuHelp.menuAction()) + self.label_9.setBuddy(self.prof_tel_nr) + self.label_3.setBuddy(self.prof_title) + self.label_2.setBuddy(self.drpdwn_app_nr) + self.label_8.setBuddy(self.prof_mail) + self.label_10.setBuddy(self.app_fach) + self.label_12.setBuddy(self.prof_id_adis) + self.label_13.setBuddy(self.apparat_id_adis) + self.label_4.setBuddy(self.drpdwn_prof_name) + self.label_5.setBuddy(self.app_name) + self.label_6.setBuddy(self.sem_year) + + self.retranslateUi(MainWindow) + self.tabWidget.setCurrentIndex(0) + QtCore.QMetaObject.connectSlotsByName(MainWindow) + MainWindow.setTabOrder(self.drpdwn_app_nr, 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_sommer) + MainWindow.setTabOrder(self.sem_sommer, self.sem_winter) + MainWindow.setTabOrder(self.sem_winter, 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.check_file) + MainWindow.setTabOrder(self.check_file, self.check_send_mail) + MainWindow.setTabOrder(self.check_send_mail, self.btn_apparat_save) + MainWindow.setTabOrder(self.btn_apparat_save, self.btn_apparat_apply) + MainWindow.setTabOrder(self.btn_apparat_apply, self.chkbx_show_del_media) + MainWindow.setTabOrder(self.chkbx_show_del_media, self.btn_reserve) + MainWindow.setTabOrder(self.btn_reserve, self.select_action_box) + MainWindow.setTabOrder(self.select_action_box, self.prof_id_adis) + MainWindow.setTabOrder(self.prof_id_adis, self.apparat_id_adis) + MainWindow.setTabOrder(self.apparat_id_adis, self.automation_add_selected_books) + MainWindow.setTabOrder(self.automation_add_selected_books, self.saveandcreate) + + def retranslateUi(self, MainWindow): + _translate = QtCore.QCoreApplication.translate + MainWindow.setWindowTitle(_translate("MainWindow", "Semesterapparatsmanagement")) + self.create_document.setToolTip(_translate("MainWindow", "Erstellt die Übersicht, welche am Regal ausgehängt werden kann")) + self.create_document.setText(_translate("MainWindow", "Übersicht erstellen")) + self.create_new_app.setText(_translate("MainWindow", "neu. App anlegen")) + self.cancel_active_selection.setText(_translate("MainWindow", "Auswahl abbrechen")) + self.tableWidget_apparate.setSortingEnabled(False) + 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", "gültig bis")) + item = self.tableWidget_apparate.horizontalHeaderItem(4) + item.setText(_translate("MainWindow", "Dauerapparat")) + item = self.tableWidget_apparate.horizontalHeaderItem(5) + item.setText(_translate("MainWindow", "KontoNr")) + self.chkbx_show_del_media.setText(_translate("MainWindow", "gel. Medien anzeigen")) + self.btn_reserve.setText(_translate("MainWindow", "im Apparat?")) + self.label_info.setText(_translate("MainWindow", "Medien werden hinzugefügt")) + self.progress_label.setText(_translate("MainWindow", "Medium x/y")) + self.label_20.setText(_translate("MainWindow", "Medien werden geprüft")) + self.avail_status.setText(_translate("MainWindow", "TextLabel")) + self.automation_add_selected_books.setText(_translate("MainWindow", "Ausgewählte als verfügbar markieren")) + self.tableWidget_apparat_media.setSortingEnabled(True) + item = self.tableWidget_apparat_media.horizontalHeaderItem(0) + item.setText(_translate("MainWindow", "Buchtitel")) + item.setToolTip(_translate("MainWindow", "Es kann sein, dass der Buchtitel leer ist, dies kommt vor, wenn der Titel nicht passend formatiert ist")) + item = self.tableWidget_apparat_media.horizontalHeaderItem(1) + item.setText(_translate("MainWindow", "Signatur")) + item = self.tableWidget_apparat_media.horizontalHeaderItem(2) + item.setText(_translate("MainWindow", "Auflage")) + item = self.tableWidget_apparat_media.horizontalHeaderItem(3) + item.setText(_translate("MainWindow", "Autor")) + item = self.tableWidget_apparat_media.horizontalHeaderItem(4) + item.setText(_translate("MainWindow", "im Apparat?")) + item.setToolTip(_translate("MainWindow", "Diese Angabe ist nicht zuverlässig. Ist das ❌ vorhanden, kann das Medium im Apparat sein, aber aufgrund eines Bugs nicht gefunden worden")) + item = self.tableWidget_apparat_media.horizontalHeaderItem(5) + item.setText(_translate("MainWindow", "Vorgemerkt")) + item = self.tableWidget_apparat_media.horizontalHeaderItem(6) + item.setText(_translate("MainWindow", "Link")) + self.label.setText(_translate("MainWindow", " Medienliste")) + self.app_group_box.setTitle(_translate("MainWindow", "SemesterApparatsdetails")) + item = self.document_list.horizontalHeaderItem(0) + item.setText(_translate("MainWindow", "Dokumentname")) + item = self.document_list.horizontalHeaderItem(1) + item.setText(_translate("MainWindow", "Dateityp")) + item = self.document_list.horizontalHeaderItem(2) + item.setText(_translate("MainWindow", "Neu?")) + item = self.document_list.horizontalHeaderItem(3) + item.setText(_translate("MainWindow", "path")) + self.appname_mand.setText(_translate("MainWindow", "*")) + self.profname_mand.setText(_translate("MainWindow", "*")) + self.fach_mand.setText(_translate("MainWindow", "*")) + self.btn_apparat_apply.setText(_translate("MainWindow", "Aktualisieren")) + self.label_9.setText(_translate("MainWindow", "Tel")) + self._mand.setText(_translate("MainWindow", "*")) + self.check_eternal_app.setText(_translate("MainWindow", "Dauerapparat")) + self.sem_sommer.setText(_translate("MainWindow", "Sommer")) + self.drpdwn_prof_name.setToolTip(_translate("MainWindow", "Nachname, Vorname")) + self.mail_mand.setText(_translate("MainWindow", "*")) + self.label_3.setStatusTip(_translate("MainWindow", "sdvosdvsdv")) + self.label_3.setText(_translate("MainWindow", "Prof. Titel")) + self.label_2.setText(_translate("MainWindow", "Apparatsnummer")) + self.label_8.setText(_translate("MainWindow", "Mail")) + self.label_10.setText(_translate("MainWindow", "Fach")) + self.label_12.setText(_translate("MainWindow", "Prof-ID-aDIS")) + self.label_13.setText(_translate("MainWindow", "Apparat-ID-aDIS")) + self.sem_year.setPlaceholderText(_translate("MainWindow", "2023")) + self.check_send_mail.setText(_translate("MainWindow", "Mail senden")) + self.sem_winter.setText(_translate("MainWindow", "Winter")) + self.label_4.setText(_translate("MainWindow", "Prof. Name")) + self.telnr_mand.setText(_translate("MainWindow", "*")) + self.btn_apparat_save.setText(_translate("MainWindow", "Speichern")) + self.label_5.setText(_translate("MainWindow", "Apparatsname")) + self.label_6.setText(_translate("MainWindow", "Semester")) + self.valid_check_profname.setStatusTip(_translate("MainWindow", "Format: Nachname, Vorname")) + self.valid_check_mail.setStatusTip(_translate("MainWindow", "mail@irgendwas.wasanderes")) + self.saveandcreate.setText(_translate("MainWindow", "Speichern und anlegen")) + self.btn_add_document.setText(_translate("MainWindow", "Dokument hinzufügen")) + self.btn_open_document.setText(_translate("MainWindow", "Dokument öffnen")) + self.check_file.setToolTip(_translate("MainWindow", "Abhängig von der Anzahl der Medien kann die Suche sehr lange dauern")) + self.check_file.setText(_translate("MainWindow", "Medien aus Dokument\n" +" hinzufügen")) + self.btn_extract_data_from_document.setToolTip(_translate("MainWindow", "Die Apparatsdetails werden aus dem Dokument gelesen und eingetragen\n" +"Einige Angaben müssen ggf angepasst werden")) + self.btn_extract_data_from_document.setText(_translate("MainWindow", "Daten aus Dokument\n" +"übernehmen")) + self.add_medium.setText(_translate("MainWindow", "Medien hinzufügen")) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.createApparat), _translate("MainWindow", "Anlegen")) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.search_statistics), _translate("MainWindow", "Suchen / Statistik")) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.elsatab), _translate("MainWindow", "ELSA")) + self.label_21.setText(_translate("MainWindow", "Aktion:")) + self.select_action_box.setItemText(0, _translate("MainWindow", "Nutzer anlegen")) + self.select_action_box.setItemText(1, _translate("MainWindow", "Nutzer bearbeiten")) + self.select_action_box.setItemText(2, _translate("MainWindow", "Lehrperson bearbeiten")) + self.admin_action.setTitle(_translate("MainWindow", "GroupBox")) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.admin), _translate("MainWindow", "Admin")) + self.groupBox_2.setTitle(_translate("MainWindow", "Software")) + self.appdata_check.setText(_translate("MainWindow", "Apparatsdaten eingegeben")) + self.media_check.setText(_translate("MainWindow", "Medien hinzugefügt / importiert")) + self.ids_check.setText(_translate("MainWindow", "Prof-ID und Apparat-ID eingetragen")) + self.groupBox.setTitle(_translate("MainWindow", "aDIS")) + self.media_checked.setText(_translate("MainWindow", "Medien geprüft")) + self.media_edited_check.setText(_translate("MainWindow", "Medien bearbeitet")) + self.app_created.setText(_translate("MainWindow", "Apparat angelegt")) + self.btn_copy_adis_command.setToolTip(_translate("MainWindow", "Hier klicken, um die aDIS Abfrage in die Zwischenablage zu kopieren")) + self.btn_copy_adis_command.setText(_translate("MainWindow", " aDIS Abfrage in Zwischenablage kopieren")) + self.menuDatei.setTitle(_translate("MainWindow", "Datei")) + self.menuEinstellungen.setTitle(_translate("MainWindow", "Bearbeiten")) + self.menuHelp.setTitle(_translate("MainWindow", "Help")) + self.actionBeenden.setText(_translate("MainWindow", "Beenden")) + self.actionBeenden.setShortcut(_translate("MainWindow", "Ctrl+Q")) + self.actionEinstellungen.setText(_translate("MainWindow", "Einstellungen")) + self.actionEinstellungen.setShortcut(_translate("MainWindow", "Alt+S")) + self.actionDokumentation.setText(_translate("MainWindow", "Dokumentation (online)")) + self.actionDokumentation.setShortcut(_translate("MainWindow", "F1")) + self.actionAbout.setText(_translate("MainWindow", "About")) + self.actionDokumentation_lokal.setText(_translate("MainWindow", "Dokumentation (lokal)")) + self.actionDokumentation_lokal.setShortcut(_translate("MainWindow", "F1")) diff --git a/src/ui/sounds/semesterapparat_ui.ui b/src/ui/sounds/semesterapparat_ui.ui new file mode 100644 index 0000000..529011b --- /dev/null +++ b/src/ui/sounds/semesterapparat_ui.ui @@ -0,0 +1,2146 @@ + + + MainWindow + + + Qt::WindowModal + + + true + + + + 0 + 0 + 1593 + 800 + + + + + 0 + 0 + + + + + 1278 + 800 + + + + + 1920 + 800 + + + + Qt::NoContextMenu + + + Semesterapparatsmanagement + + + + + 0 + 0 + + + + + + 0 + 0 + 1271 + 761 + + + + + + + + + + + Qt::NoFocus + + + 1 + + + + + 0 + 0 + + + + Anlegen + + + + + 0 + 0 + 1261 + 163 + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Qt::NoFocus + + + Load the Semesterapparate from the database + + + App. aufrufen + + + + + + + Qt::NoFocus + + + neu. App anlegen + + + + + + + Auswahl abbrechen + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + Qt::NoFocus + + + QAbstractScrollArea::AdjustToContents + + + QAbstractItemView::SelectedClicked + + + true + + + Qt::ElideMiddle + + + true + + + true + + + + AppNr + + + + + App Name + + + + + Professor + + + + + gültig bis + + + + + Dauerapparat + + + + + KontoNr + + + + + + + + + + + + + + + + + + 0 + 160 + 1261 + 21 + + + + Qt::Horizontal + + + + + true + + + + 0 + 180 + 1261 + 511 + + + + + + + + 0 + 0 + + + + + 0 + 210 + + + + + 12 + 75 + true + + + + Apparatsdetails + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + false + + + + + 765 + 20 + 321 + 181 + + + + + 10 + 50 + false + false + + + + Qt::NoFocus + + + true + + + QAbstractScrollArea::AdjustToContents + + + true + + + QAbstractItemView::DropOnly + + + Qt::LinkAction + + + QAbstractItemView::SingleSelection + + + + Dokumentname + + + + Arial + 8 + + + + + + Dateityp + + + + Arial + 8 + + + + + + Neu? + + + + Arial + 8 + + + + + + path + + + + + + true + + + + 10 + 30 + 1241 + 151 + + + + + 0 + 0 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + 110 + 50 + 69 + 22 + + + + + 9 + 50 + false + + + + true + + + + + + 250 + 20 + 91 + 21 + + + + + 9 + 50 + false + + + + Apparatsname + + + + + + 340 + 50 + 82 + 17 + + + + + 9 + 50 + false + + + + Qt::NoFocus + + + Winter + + + + + + 10 + 80 + 71 + 21 + + + + + 9 + 50 + false + + + + Prof. Name + + + + + + 110 + 20 + 69 + 22 + + + + + 9 + 50 + false + + + + Qt::ImhDigitsOnly + + + true + + + + + + 340 + 20 + 113 + 20 + + + + + 9 + 50 + false + + + + Qt::StrongFocus + + + + + + 340 + 70 + 82 + 17 + + + + + 9 + 50 + false + + + + Qt::NoFocus + + + Sommer + + + + + + 10 + 50 + 61 + 20 + + + + + 9 + 50 + false + + + + Prof. Titel + + + + + + 270 + 60 + 61 + 21 + + + + + 9 + 50 + false + + + + Semester + + + + + + 410 + 60 + 113 + 20 + + + + + 9 + 50 + false + + + + Qt::StrongFocus + + + 4 + + + 2023 + + + + + + 10 + 20 + 101 + 21 + + + + + 9 + 50 + false + + + + Apparatsnummer + + + + + + 260 + 120 + 75 + 23 + + + + + 9 + 50 + false + + + + Speichern + + + + + + 350 + 120 + 75 + 23 + + + + + 9 + 50 + false + + + + Aktualisieren + + + + + + 340 + 90 + 101 + 17 + + + + + 9 + 50 + false + + + + Dauerapparat + + + + + + 10 + 110 + 71 + 21 + + + + + 9 + 50 + false + + + + Mail + + + + + + 110 + 110 + 121 + 20 + + + + + 9 + 50 + false + + + + Qt::ImhEmailCharactersOnly + + + 200 + + + + + + + + + 10 + 130 + 71 + 21 + + + + + 9 + 50 + false + + + + Tel + + + + + + 110 + 130 + 121 + 20 + + + + + 9 + 50 + false + + + + Qt::ImhDigitsOnly + + + + + + + + + 470 + 20 + 51 + 21 + + + + + 9 + 50 + false + + + + Fach + + + + + + 510 + 20 + 113 + 20 + + + + + 9 + 50 + false + + + + Qt::StrongFocus + + + + + + 110 + 80 + 121 + 22 + + + + + 8 + 50 + false + + + + Qt::StrongFocus + + + true + + + + + + QComboBox::InsertAlphabetically + + + true + + + + + + 100 + 110 + 47 + 21 + + + + + 9 + 50 + false + + + + * + + + + + + 100 + 130 + 47 + 21 + + + + + 9 + 50 + false + + + + * + + + + + + 100 + 80 + 47 + 21 + + + + + 9 + 50 + false + + + + * + + + + + + 330 + 20 + 16 + 21 + + + + + 9 + 50 + false + + + + * + + + + + + 500 + 20 + 47 + 21 + + + + + 9 + 50 + false + + + + Qt::NoFocus + + + * + + + + + + 330 + 60 + 16 + 21 + + + + + 9 + 50 + false + + + + * + + + + + + 1090 + 20 + 131 + 25 + + + + + 9 + 50 + false + + + + Dokument hinzufügen + + + + + + 1090 + 60 + 131 + 25 + + + + + 9 + 50 + false + + + + Dokument öffnen + + + + + + 1090 + 100 + 131 + 51 + + + + + 9 + 50 + false + + + + Abhängig von der Anzahl der Medien kann die Suche sehr lange dauern + + + Medien aus Dokument + hinzufügen + + + + + + 550 + 70 + 202 + 80 + + + + + + + + 9 + 50 + false + + + + Prof-ID-aDIS + + + + + + + + 9 + 50 + false + + + + + + + + + 9 + 50 + false + + + + Apparat-ID-aDIS + + + + + + + + + + + + 450 + 120 + 91 + 17 + + + + + 9 + 50 + false + + + + Mail senden + + + _mand + drpdwn_prof_title + label_5 + sem_winter + label_4 + drpdwn_app_nr + sem_sommer + label_3 + label_6 + sem_year + label_2 + btn_apparat_save + btn_apparat_apply + check_eternal_app + label_8 + label_9 + label_10 + mail_mand + telnr_mand + profname_mand + appname_mand + fach_mand + btn_add_document + btn_open_document + app_fach + app_name + prof_tel_nr + drpdwn_prof_name + prof_mail + check_file + formLayoutWidget_2 + check_send_mail + + frame + dokument_list + + + + + + + 0 + 0 + + + + + 1259 + 0 + + + + Qt::NoFocus + + + Qt::CustomContextMenu + + + QAbstractScrollArea::AdjustToContents + + + QAbstractItemView::NoEditTriggers + + + true + + + QAbstractItemView::SelectRows + + + true + + + true + + + + Buchtitel + + + + + Signatur + + + + + Auflage + + + + + Autor + + + + + verfügbar? + + + + + Vorgemerkt + + + + + Link + + + + + + + + + 11 + 75 + true + + + + Medienliste + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + gel. Medien anzeigen + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 40 + 20 + + + + + + + + + + Medien werden hinzugefügt + + + + + + + Qt::Vertical + + + + + + + Medium x/y + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 40 + 20 + + + + + + + + Vorgemertk? + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + 0 + 700 + 121 + 20 + + + + Qt::NoFocus + + + Medien hinzufügen + + + + + + Suchen / Statistik + + + + + 0 + 0 + 1251 + 721 + + + + + + + + 16777215 + 250 + + + + 0 + + + + Statistik + + + + + 10 + 180 + 75 + 23 + + + + Suchen + + + + + + 10 + 10 + 491 + 161 + + + + + + + Appnr.: + + + + + + + true + + + + + + + Dauerapp: + + + + + + + Endsemester: + + + + + + + Erstellsemester: + + + + + + + + + + Person: + + + + + + + Fach: + + + + + + + true + + + + + + + true + + + + + + + true + + + + + + + true + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Löschbar + + + + + + + + + + + + + + + + 100 + 180 + 401 + 23 + + + + + + + + + + Suchen + + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + 780 + 10 + 441 + 441 + + + + 0 + + + + Tabelle + + + + + 0 + 0 + 435 + 191 + + + + + 0 + 0 + + + + + 16777215 + 191 + + + + QAbstractItemView::NoEditTriggers + + + true + + + false + + + + Semester + + + + + Zugang + + + + + Abgang + + + + + + + 0 + 210 + 431 + 211 + + + + + + + Erstellte und gelöschte Semesterapparate + + + + + + + 10 + 10 + 761 + 441 + + + + + + 0 + 0 + 761 + 51 + + + + + + + Ausgewählte Löschen + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + 0 + 50 + 761 + 391 + + + + + + 0 + 0 + 761 + 391 + + + + QAbstractItemView::NoEditTriggers + + + + + + + + + Apparatsname + + + + + Apparatsnummer + + + + + Person + + + + + Fach + + + + + + + + + + + + + + Admin + + + + + + + + + + + + + + 1280 + 360 + 311 + 391 + + + + + + + + 6 + + + + + true + + + + 0 + 0 + + + + Software + + + + + 20 + 30 + 241 + 41 + + + + + 8 + 50 + false + + + + Apparatsdaten eingegeben + + + + + + 20 + 70 + 241 + 41 + + + + + 8 + 50 + false + + + + Medien hinzugefügt / importiert + + + + + + 20 + 140 + 241 + 41 + + + + + 8 + 50 + false + + + + Prof-ID und Apparat-ID eingetragen + + + + + + + + + 0 + 0 + + + + aDIS + + + + + 20 + 30 + 241 + 41 + + + + + 8 + 50 + false + false + false + PreferDefault + true + + + + Medien geprüft + + + + + + 20 + 70 + 241 + 41 + + + + + 8 + 50 + false + false + false + PreferDefault + true + + + + Medien bearbeitet + + + + + + 20 + 110 + 161 + 41 + + + + + 8 + 50 + false + false + false + PreferDefault + true + + + + Apparat angelegt + + + + + + 170 + 120 + 101 + 23 + + + + + 8 + 50 + false + false + false + PreferDefault + true + + + + Hier klicken, um die aDIS Abfrage in die Zwischenablage zu kopieren + + + + + + + + + + + + false + + + aDIS Abfrage + + + + ../../../.designer/backup/icons/information.png../../../.designer/backup/icons/information.png + + + false + + + false + + + false + + + + + + + + + + + + + 1280 + 10 + 301 + 341 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + 0 + 0 + 291 + 191 + + + + true + + + QCalendarWidget::NoVerticalHeader + + + + + + 0 + 210 + 291 + 121 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + 10 + 10 + 47 + 20 + + + + Apparat + + + + + true + + + + 60 + 10 + 31 + 20 + + + + + + + 10 + 40 + 271 + 71 + + + + + + + 130 + 10 + 75 + 23 + + + + Löschen + + + + + + 210 + 10 + 42 + 22 + + + + 1 + + + + + + 260 + 10 + 21 + 22 + + + + TextLabel + + + + + + + + + 0 + 0 + 1593 + 21 + + + + + Datei + + + + + + Bearbeiten + + + + + + + + + + Beenden + + + Ctrl+Q + + + true + + + + + Einstellungen + + + Alt+S + + + true + + + + + drpdwn_app_nr + drpdwn_prof_title + drpdwn_prof_name + prof_mail + prof_tel_nr + app_name + app_fach + sem_winter + sem_sommer + sem_year + check_eternal_app + btn_add_document + btn_open_document + btn_apparat_save + btn_apparat_apply + + + + diff --git a/src/ui/sounds/semesterapparat_ui_ui.py b/src/ui/sounds/semesterapparat_ui_ui.py new file mode 100644 index 0000000..7ed30a8 --- /dev/null +++ b/src/ui/sounds/semesterapparat_ui_ui.py @@ -0,0 +1,1075 @@ +# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\sounds\semesterapparat_ui.ui' +# +# Created by: PyQt6 UI code generator 6.8.0 +# +# 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.setWindowModality(QtCore.Qt.WindowModality.WindowModal) + MainWindow.setEnabled(True) + MainWindow.resize(1593, 800) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth()) + MainWindow.setSizePolicy(sizePolicy) + MainWindow.setMinimumSize(QtCore.QSize(1278, 800)) + MainWindow.setMaximumSize(QtCore.QSize(1920, 800)) + MainWindow.setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.NoContextMenu) + self.centralwidget = QtWidgets.QWidget(parent=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(parent=self.centralwidget) + self.verticalLayoutWidget.setGeometry(QtCore.QRect(0, 0, 1271, 761)) + 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(parent=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(parent=self.tab) + self.horizontalLayoutWidget_2.setGeometry(QtCore.QRect(0, 0, 1261, 163)) + 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(parent=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(parent=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) + self.cancel_active_selection = QtWidgets.QPushButton(parent=self.horizontalLayoutWidget_2) + self.cancel_active_selection.setObjectName("cancel_active_selection") + self.verticalLayout_2.addWidget(self.cancel_active_selection) + spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) + self.verticalLayout_2.addItem(spacerItem1) + self.formLayout.setLayout(1, QtWidgets.QFormLayout.ItemRole.LabelRole, self.verticalLayout_2) + self.tableWidget_apparate = QtWidgets.QTableWidget(parent=self.horizontalLayoutWidget_2) + self.tableWidget_apparate.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.tableWidget_apparate.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.SizeAdjustPolicy.AdjustToContents) + self.tableWidget_apparate.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger.SelectedClicked) + self.tableWidget_apparate.setAlternatingRowColors(True) + self.tableWidget_apparate.setTextElideMode(QtCore.Qt.TextElideMode.ElideMiddle) + self.tableWidget_apparate.setObjectName("tableWidget_apparate") + self.tableWidget_apparate.setColumnCount(6) + 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) + item = QtWidgets.QTableWidgetItem() + self.tableWidget_apparate.setHorizontalHeaderItem(4, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget_apparate.setHorizontalHeaderItem(5, item) + self.tableWidget_apparate.horizontalHeader().setCascadingSectionResizes(True) + self.formLayout.setWidget(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.tableWidget_apparate) + self.horizontalLayout_4 = QtWidgets.QHBoxLayout() + self.horizontalLayout_4.setObjectName("horizontalLayout_4") + self.formLayout.setLayout(2, QtWidgets.QFormLayout.ItemRole.FieldRole, self.horizontalLayout_4) + self.horizontalLayout_3 = QtWidgets.QHBoxLayout() + self.horizontalLayout_3.setObjectName("horizontalLayout_3") + self.formLayout.setLayout(3, QtWidgets.QFormLayout.ItemRole.LabelRole, self.horizontalLayout_3) + self.horizontalLayout_2.addLayout(self.formLayout) + self.line = QtWidgets.QFrame(parent=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(parent=self.tab) + self.gridLayoutWidget_2.setEnabled(True) + self.gridLayoutWidget_2.setGeometry(QtCore.QRect(0, 180, 1261, 511)) + 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(parent=self.gridLayoutWidget_2) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.app_group_box.sizePolicy().hasHeightForWidth()) + self.app_group_box.setSizePolicy(sizePolicy) + self.app_group_box.setMinimumSize(QtCore.QSize(0, 210)) + 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(parent=self.app_group_box) + self.dokument_list.setGeometry(QtCore.QRect(765, 20, 321, 181)) + font = QtGui.QFont() + font.setPointSize(10) + font.setBold(False) + font.setWeight(50) + font.setKerning(False) + self.dokument_list.setFont(font) + self.dokument_list.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.dokument_list.setAcceptDrops(True) + self.dokument_list.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.SizeAdjustPolicy.AdjustToContents) + self.dokument_list.setDragEnabled(True) + self.dokument_list.setDragDropMode(QtWidgets.QAbstractItemView.DragDropMode.DropOnly) + self.dokument_list.setDefaultDropAction(QtCore.Qt.DropAction.LinkAction) + 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(parent=self.app_group_box) + self.frame.setEnabled(True) + self.frame.setGeometry(QtCore.QRect(10, 30, 1241, 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(parent=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(parent=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(parent=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.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.sem_winter.setObjectName("sem_winter") + self.label_4 = QtWidgets.QLabel(parent=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(parent=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.setInputMethodHints(QtCore.Qt.InputMethodHint.ImhDigitsOnly) + self.drpdwn_app_nr.setEditable(True) + self.drpdwn_app_nr.setObjectName("drpdwn_app_nr") + self.app_name = QtWidgets.QLineEdit(parent=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.setFocusPolicy(QtCore.Qt.FocusPolicy.StrongFocus) + self.app_name.setObjectName("app_name") + self.sem_sommer = QtWidgets.QRadioButton(parent=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.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.sem_sommer.setObjectName("sem_sommer") + self.label_3 = QtWidgets.QLabel(parent=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(parent=self.frame) + self.label_6.setGeometry(QtCore.QRect(270, 60, 61, 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(parent=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.setFocusPolicy(QtCore.Qt.FocusPolicy.StrongFocus) + self.sem_year.setMaxLength(4) + self.sem_year.setObjectName("sem_year") + self.label_2 = QtWidgets.QLabel(parent=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(parent=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(parent=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(parent=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(parent=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(parent=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.setInputMethodHints(QtCore.Qt.InputMethodHint.ImhEmailCharactersOnly) + self.prof_mail.setMaxLength(200) + self.prof_mail.setPlaceholderText("") + self.prof_mail.setObjectName("prof_mail") + self.label_9 = QtWidgets.QLabel(parent=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(parent=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.setInputMethodHints(QtCore.Qt.InputMethodHint.ImhDigitsOnly) + self.prof_tel_nr.setPlaceholderText("") + self.prof_tel_nr.setObjectName("prof_tel_nr") + self.label_10 = QtWidgets.QLabel(parent=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(parent=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.setFocusPolicy(QtCore.Qt.FocusPolicy.StrongFocus) + self.app_fach.setObjectName("app_fach") + self.drpdwn_prof_name = QtWidgets.QComboBox(parent=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.mail_mand = QtWidgets.QLabel(parent=self.frame) + self.mail_mand.setGeometry(QtCore.QRect(100, 110, 47, 21)) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + font.setWeight(50) + self.mail_mand.setFont(font) + self.mail_mand.setObjectName("mail_mand") + self.telnr_mand = QtWidgets.QLabel(parent=self.frame) + self.telnr_mand.setGeometry(QtCore.QRect(100, 130, 47, 21)) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + font.setWeight(50) + self.telnr_mand.setFont(font) + self.telnr_mand.setObjectName("telnr_mand") + self.profname_mand = QtWidgets.QLabel(parent=self.frame) + self.profname_mand.setGeometry(QtCore.QRect(100, 80, 47, 21)) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + font.setWeight(50) + self.profname_mand.setFont(font) + self.profname_mand.setObjectName("profname_mand") + self.appname_mand = QtWidgets.QLabel(parent=self.frame) + self.appname_mand.setGeometry(QtCore.QRect(330, 20, 16, 21)) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + font.setWeight(50) + self.appname_mand.setFont(font) + self.appname_mand.setObjectName("appname_mand") + self.fach_mand = QtWidgets.QLabel(parent=self.frame) + self.fach_mand.setGeometry(QtCore.QRect(500, 20, 47, 21)) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + font.setWeight(50) + self.fach_mand.setFont(font) + self.fach_mand.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.fach_mand.setObjectName("fach_mand") + self._mand = QtWidgets.QLabel(parent=self.frame) + self._mand.setGeometry(QtCore.QRect(330, 60, 16, 21)) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + font.setWeight(50) + self._mand.setFont(font) + self._mand.setObjectName("_mand") + self.btn_add_document = QtWidgets.QPushButton(parent=self.frame) + self.btn_add_document.setGeometry(QtCore.QRect(1090, 20, 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(parent=self.frame) + self.btn_open_document.setGeometry(QtCore.QRect(1090, 60, 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.check_file = QtWidgets.QPushButton(parent=self.frame) + self.check_file.setGeometry(QtCore.QRect(1090, 100, 131, 51)) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + font.setWeight(50) + self.check_file.setFont(font) + self.check_file.setObjectName("check_file") + self.formLayoutWidget_2 = QtWidgets.QWidget(parent=self.frame) + self.formLayoutWidget_2.setGeometry(QtCore.QRect(550, 70, 202, 80)) + self.formLayoutWidget_2.setObjectName("formLayoutWidget_2") + self.formLayout_3 = QtWidgets.QFormLayout(self.formLayoutWidget_2) + self.formLayout_3.setContentsMargins(0, 0, 0, 0) + self.formLayout_3.setObjectName("formLayout_3") + self.label_12 = QtWidgets.QLabel(parent=self.formLayoutWidget_2) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + font.setWeight(50) + self.label_12.setFont(font) + self.label_12.setObjectName("label_12") + self.formLayout_3.setWidget(0, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_12) + self.prof_id_adis = QtWidgets.QLineEdit(parent=self.formLayoutWidget_2) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + font.setWeight(50) + self.prof_id_adis.setFont(font) + self.prof_id_adis.setObjectName("prof_id_adis") + self.formLayout_3.setWidget(0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.prof_id_adis) + self.label_13 = QtWidgets.QLabel(parent=self.formLayoutWidget_2) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + font.setWeight(50) + self.label_13.setFont(font) + self.label_13.setObjectName("label_13") + self.formLayout_3.setWidget(1, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_13) + self.apparat_id_adis = QtWidgets.QLineEdit(parent=self.formLayoutWidget_2) + self.apparat_id_adis.setObjectName("apparat_id_adis") + self.formLayout_3.setWidget(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.apparat_id_adis) + self.check_send_mail = QtWidgets.QCheckBox(parent=self.frame) + self.check_send_mail.setGeometry(QtCore.QRect(450, 120, 91, 17)) + font = QtGui.QFont() + font.setPointSize(9) + font.setBold(False) + font.setWeight(50) + self.check_send_mail.setFont(font) + self.check_send_mail.setObjectName("check_send_mail") + self._mand.raise_() + self.drpdwn_prof_title.raise_() + self.label_5.raise_() + self.sem_winter.raise_() + self.label_4.raise_() + self.drpdwn_app_nr.raise_() + self.sem_sommer.raise_() + self.label_3.raise_() + self.label_6.raise_() + self.sem_year.raise_() + self.label_2.raise_() + self.btn_apparat_save.raise_() + self.btn_apparat_apply.raise_() + self.check_eternal_app.raise_() + self.label_8.raise_() + self.label_9.raise_() + self.label_10.raise_() + self.mail_mand.raise_() + self.telnr_mand.raise_() + self.profname_mand.raise_() + self.appname_mand.raise_() + self.fach_mand.raise_() + self.btn_add_document.raise_() + self.btn_open_document.raise_() + self.app_fach.raise_() + self.app_name.raise_() + self.prof_tel_nr.raise_() + self.drpdwn_prof_name.raise_() + self.prof_mail.raise_() + self.check_file.raise_() + self.formLayoutWidget_2.raise_() + self.check_send_mail.raise_() + self.frame.raise_() + self.dokument_list.raise_() + self.gridLayout_2.addWidget(self.app_group_box, 1, 0, 1, 1) + self.tableWidget_apparat_media = QtWidgets.QTableWidget(parent=self.gridLayoutWidget_2) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Expanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.tableWidget_apparat_media.sizePolicy().hasHeightForWidth()) + self.tableWidget_apparat_media.setSizePolicy(sizePolicy) + self.tableWidget_apparat_media.setMinimumSize(QtCore.QSize(1259, 0)) + self.tableWidget_apparat_media.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.tableWidget_apparat_media.setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.CustomContextMenu) + self.tableWidget_apparat_media.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.SizeAdjustPolicy.AdjustToContents) + self.tableWidget_apparat_media.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers) + self.tableWidget_apparat_media.setAlternatingRowColors(True) + self.tableWidget_apparat_media.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectionBehavior.SelectRows) + self.tableWidget_apparat_media.setObjectName("tableWidget_apparat_media") + self.tableWidget_apparat_media.setColumnCount(7) + 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) + item = QtWidgets.QTableWidgetItem() + self.tableWidget_apparat_media.setHorizontalHeaderItem(4, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget_apparat_media.setHorizontalHeaderItem(5, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget_apparat_media.setHorizontalHeaderItem(6, item) + self.tableWidget_apparat_media.horizontalHeader().setCascadingSectionResizes(True) + self.gridLayout_2.addWidget(self.tableWidget_apparat_media, 9, 0, 1, 1) + self.label = QtWidgets.QLabel(parent=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, 2, 0, 1, 1) + self.horizontalLayout_5 = QtWidgets.QHBoxLayout() + self.horizontalLayout_5.setObjectName("horizontalLayout_5") + spacerItem2 = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Minimum) + self.horizontalLayout_5.addItem(spacerItem2) + self.chkbx_show_del_media = QtWidgets.QCheckBox(parent=self.gridLayoutWidget_2) + self.chkbx_show_del_media.setObjectName("chkbx_show_del_media") + self.horizontalLayout_5.addWidget(self.chkbx_show_del_media) + spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Minimum) + self.horizontalLayout_5.addItem(spacerItem3) + self.add_layout = QtWidgets.QHBoxLayout() + self.add_layout.setObjectName("add_layout") + self.label_info = QtWidgets.QLabel(parent=self.gridLayoutWidget_2) + self.label_info.setObjectName("label_info") + self.add_layout.addWidget(self.label_info) + self.line_2 = QtWidgets.QFrame(parent=self.gridLayoutWidget_2) + self.line_2.setFrameShape(QtWidgets.QFrame.Shape.VLine) + self.line_2.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) + self.line_2.setObjectName("line_2") + self.add_layout.addWidget(self.line_2) + self.progress_label = QtWidgets.QLabel(parent=self.gridLayoutWidget_2) + self.progress_label.setObjectName("progress_label") + self.add_layout.addWidget(self.progress_label) + self.horizontalLayout_5.addLayout(self.add_layout) + spacerItem4 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Minimum) + self.horizontalLayout_5.addItem(spacerItem4) + self.btn_reserve = QtWidgets.QPushButton(parent=self.gridLayoutWidget_2) + self.btn_reserve.setObjectName("btn_reserve") + self.horizontalLayout_5.addWidget(self.btn_reserve) + spacerItem5 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) + self.horizontalLayout_5.addItem(spacerItem5) + self.gridLayout_2.addLayout(self.horizontalLayout_5, 4, 0, 1, 1) + self.add_medium = QtWidgets.QPushButton(parent=self.tab) + self.add_medium.setGeometry(QtCore.QRect(0, 700, 121, 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.verticalLayoutWidget_2 = QtWidgets.QWidget(parent=self.tab_2) + self.verticalLayoutWidget_2.setGeometry(QtCore.QRect(0, 0, 1251, 721)) + self.verticalLayoutWidget_2.setObjectName("verticalLayoutWidget_2") + self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.verticalLayoutWidget_2) + self.verticalLayout_3.setContentsMargins(0, 0, 0, 0) + self.verticalLayout_3.setObjectName("verticalLayout_3") + self.tabWidget_2 = QtWidgets.QTabWidget(parent=self.verticalLayoutWidget_2) + self.tabWidget_2.setMaximumSize(QtCore.QSize(16777215, 250)) + self.tabWidget_2.setObjectName("tabWidget_2") + self.tab_3 = QtWidgets.QWidget() + self.tab_3.setObjectName("tab_3") + self.btn_search = QtWidgets.QPushButton(parent=self.tab_3) + self.btn_search.setGeometry(QtCore.QRect(10, 180, 75, 23)) + self.btn_search.setObjectName("btn_search") + self.gridLayoutWidget = QtWidgets.QWidget(parent=self.tab_3) + self.gridLayoutWidget.setGeometry(QtCore.QRect(10, 10, 491, 161)) + self.gridLayoutWidget.setObjectName("gridLayoutWidget") + self.gridLayout_3 = QtWidgets.QGridLayout(self.gridLayoutWidget) + self.gridLayout_3.setContentsMargins(0, 0, 0, 0) + self.gridLayout_3.setObjectName("gridLayout_3") + self.label_7 = QtWidgets.QLabel(parent=self.gridLayoutWidget) + self.label_7.setObjectName("label_7") + self.gridLayout_3.addWidget(self.label_7, 0, 0, 1, 1) + self.box_erstellsemester = QtWidgets.QComboBox(parent=self.gridLayoutWidget) + self.box_erstellsemester.setEditable(True) + self.box_erstellsemester.setObjectName("box_erstellsemester") + self.gridLayout_3.addWidget(self.box_erstellsemester, 1, 3, 1, 1) + self.label_18 = QtWidgets.QLabel(parent=self.gridLayoutWidget) + self.label_18.setObjectName("label_18") + self.gridLayout_3.addWidget(self.label_18, 2, 2, 1, 1) + self.label_17 = QtWidgets.QLabel(parent=self.gridLayoutWidget) + self.label_17.setObjectName("label_17") + self.gridLayout_3.addWidget(self.label_17, 0, 2, 1, 1) + self.label_19 = QtWidgets.QLabel(parent=self.gridLayoutWidget) + self.label_19.setObjectName("label_19") + self.gridLayout_3.addWidget(self.label_19, 1, 2, 1, 1) + self.box_dauerapp = QtWidgets.QComboBox(parent=self.gridLayoutWidget) + self.box_dauerapp.setObjectName("box_dauerapp") + self.gridLayout_3.addWidget(self.box_dauerapp, 2, 3, 1, 1) + self.label_11 = QtWidgets.QLabel(parent=self.gridLayoutWidget) + self.label_11.setObjectName("label_11") + self.gridLayout_3.addWidget(self.label_11, 1, 0, 1, 1) + self.label_16 = QtWidgets.QLabel(parent=self.gridLayoutWidget) + self.label_16.setObjectName("label_16") + self.gridLayout_3.addWidget(self.label_16, 2, 0, 1, 1) + self.box_semester = QtWidgets.QComboBox(parent=self.gridLayoutWidget) + self.box_semester.setEditable(True) + self.box_semester.setObjectName("box_semester") + self.gridLayout_3.addWidget(self.box_semester, 0, 3, 1, 1) + self.box_appnrs = QtWidgets.QComboBox(parent=self.gridLayoutWidget) + self.box_appnrs.setEditable(True) + self.box_appnrs.setObjectName("box_appnrs") + self.gridLayout_3.addWidget(self.box_appnrs, 0, 1, 1, 1) + self.box_fach = QtWidgets.QComboBox(parent=self.gridLayoutWidget) + self.box_fach.setEditable(True) + self.box_fach.setObjectName("box_fach") + self.gridLayout_3.addWidget(self.box_fach, 2, 1, 1, 1) + self.box_person = QtWidgets.QComboBox(parent=self.gridLayoutWidget) + self.box_person.setEditable(True) + self.box_person.setObjectName("box_person") + self.gridLayout_3.addWidget(self.box_person, 1, 1, 1, 1) + spacerItem6 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) + self.gridLayout_3.addItem(spacerItem6, 4, 0, 1, 1) + self.label_15 = QtWidgets.QLabel(parent=self.gridLayoutWidget) + self.label_15.setObjectName("label_15") + self.gridLayout_3.addWidget(self.label_15, 3, 0, 1, 1) + self.check_deletable = QtWidgets.QCheckBox(parent=self.gridLayoutWidget) + self.check_deletable.setText("") + self.check_deletable.setObjectName("check_deletable") + self.gridLayout_3.addWidget(self.check_deletable, 3, 1, 1, 1) + self.db_err_message = QtWidgets.QLabel(parent=self.tab_3) + self.db_err_message.setGeometry(QtCore.QRect(100, 180, 401, 23)) + self.db_err_message.setText("") + self.db_err_message.setObjectName("db_err_message") + self.tabWidget_2.addTab(self.tab_3, "") + self.tab_4 = QtWidgets.QWidget() + self.tab_4.setObjectName("tab_4") + self.tabWidget_2.addTab(self.tab_4, "") + self.verticalLayout_3.addWidget(self.tabWidget_2) + self.stackedWidget_4 = QtWidgets.QStackedWidget(parent=self.verticalLayoutWidget_2) + self.stackedWidget_4.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel) + self.stackedWidget_4.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) + self.stackedWidget_4.setObjectName("stackedWidget_4") + self.stackedWidget_4Page1 = QtWidgets.QWidget() + self.stackedWidget_4Page1.setObjectName("stackedWidget_4Page1") + self.tabWidget_3 = QtWidgets.QTabWidget(parent=self.stackedWidget_4Page1) + self.tabWidget_3.setGeometry(QtCore.QRect(780, 10, 441, 441)) + self.tabWidget_3.setObjectName("tabWidget_3") + self.tab_6 = QtWidgets.QWidget() + self.tab_6.setObjectName("tab_6") + self.statistics_table = QtWidgets.QTableWidget(parent=self.tab_6) + self.statistics_table.setGeometry(QtCore.QRect(0, 0, 435, 191)) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.statistics_table.sizePolicy().hasHeightForWidth()) + self.statistics_table.setSizePolicy(sizePolicy) + self.statistics_table.setMaximumSize(QtCore.QSize(16777215, 191)) + self.statistics_table.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers) + self.statistics_table.setAlternatingRowColors(True) + self.statistics_table.setObjectName("statistics_table") + self.statistics_table.setColumnCount(3) + self.statistics_table.setRowCount(0) + item = QtWidgets.QTableWidgetItem() + self.statistics_table.setHorizontalHeaderItem(0, item) + item = QtWidgets.QTableWidgetItem() + self.statistics_table.setHorizontalHeaderItem(1, item) + item = QtWidgets.QTableWidgetItem() + self.statistics_table.setHorizontalHeaderItem(2, item) + self.statistics_table.horizontalHeader().setCascadingSectionResizes(False) + self.widget_3 = QtWidgets.QWidget(parent=self.tab_6) + self.widget_3.setGeometry(QtCore.QRect(0, 210, 431, 211)) + self.widget_3.setObjectName("widget_3") + self.tabWidget_3.addTab(self.tab_6, "") + self.tab_7 = QtWidgets.QWidget() + self.tab_7.setObjectName("tab_7") + self.tabWidget_3.addTab(self.tab_7, "") + self.widget = QtWidgets.QWidget(parent=self.stackedWidget_4Page1) + self.widget.setGeometry(QtCore.QRect(10, 10, 761, 441)) + self.widget.setObjectName("widget") + self.horizontalLayoutWidget_3 = QtWidgets.QWidget(parent=self.widget) + self.horizontalLayoutWidget_3.setGeometry(QtCore.QRect(0, 0, 761, 51)) + self.horizontalLayoutWidget_3.setObjectName("horizontalLayoutWidget_3") + self.horizontalLayout_7 = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget_3) + self.horizontalLayout_7.setContentsMargins(0, 0, 0, 0) + self.horizontalLayout_7.setObjectName("horizontalLayout_7") + self.btn_del_select_apparats = QtWidgets.QPushButton(parent=self.horizontalLayoutWidget_3) + self.btn_del_select_apparats.setObjectName("btn_del_select_apparats") + self.horizontalLayout_7.addWidget(self.btn_del_select_apparats) + spacerItem7 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) + self.horizontalLayout_7.addItem(spacerItem7) + self.table = QtWidgets.QWidget(parent=self.widget) + self.table.setGeometry(QtCore.QRect(0, 50, 761, 391)) + self.table.setObjectName("table") + self.tableWidget = QtWidgets.QTableWidget(parent=self.table) + self.tableWidget.setGeometry(QtCore.QRect(0, 0, 761, 391)) + self.tableWidget.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers) + self.tableWidget.setObjectName("tableWidget") + self.tableWidget.setColumnCount(5) + self.tableWidget.setRowCount(0) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setHorizontalHeaderItem(0, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setHorizontalHeaderItem(1, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setHorizontalHeaderItem(2, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setHorizontalHeaderItem(3, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setHorizontalHeaderItem(4, item) + self.stackedWidget_4.addWidget(self.stackedWidget_4Page1) + self.verticalLayout_3.addWidget(self.stackedWidget_4) + self.tabWidget.addTab(self.tab_2, "") + self.tab_5 = QtWidgets.QWidget() + self.tab_5.setObjectName("tab_5") + self.tabWidget.addTab(self.tab_5, "") + self.gridLayout.addWidget(self.tabWidget, 0, 0, 1, 1) + self.horizontalLayout.addLayout(self.gridLayout) + self.verticalLayout.addLayout(self.horizontalLayout) + self.horizontalLayoutWidget = QtWidgets.QWidget(parent=self.centralwidget) + self.horizontalLayoutWidget.setGeometry(QtCore.QRect(1280, 360, 311, 391)) + self.horizontalLayoutWidget.setObjectName("horizontalLayoutWidget") + self.horizontalLayout_6 = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget) + self.horizontalLayout_6.setContentsMargins(0, 0, 0, 0) + self.horizontalLayout_6.setObjectName("horizontalLayout_6") + self.frame_creation_progress = QtWidgets.QFrame(parent=self.horizontalLayoutWidget) + self.frame_creation_progress.setObjectName("frame_creation_progress") + self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.frame_creation_progress) + self.verticalLayout_4.setSpacing(6) + self.verticalLayout_4.setObjectName("verticalLayout_4") + self.groupBox_2 = QtWidgets.QGroupBox(parent=self.frame_creation_progress) + self.groupBox_2.setEnabled(True) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Expanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.groupBox_2.sizePolicy().hasHeightForWidth()) + self.groupBox_2.setSizePolicy(sizePolicy) + self.groupBox_2.setObjectName("groupBox_2") + self.appdata_check = QtWidgets.QCheckBox(parent=self.groupBox_2) + self.appdata_check.setGeometry(QtCore.QRect(20, 30, 241, 41)) + font = QtGui.QFont() + font.setPointSize(8) + font.setBold(False) + font.setWeight(50) + self.appdata_check.setFont(font) + self.appdata_check.setObjectName("appdata_check") + self.media_check = QtWidgets.QCheckBox(parent=self.groupBox_2) + self.media_check.setGeometry(QtCore.QRect(20, 70, 241, 41)) + font = QtGui.QFont() + font.setPointSize(8) + font.setBold(False) + font.setWeight(50) + self.media_check.setFont(font) + self.media_check.setObjectName("media_check") + self.ids_check = QtWidgets.QCheckBox(parent=self.groupBox_2) + self.ids_check.setGeometry(QtCore.QRect(20, 140, 241, 41)) + font = QtGui.QFont() + font.setPointSize(8) + font.setBold(False) + font.setWeight(50) + self.ids_check.setFont(font) + self.ids_check.setObjectName("ids_check") + self.verticalLayout_4.addWidget(self.groupBox_2) + self.groupBox = QtWidgets.QGroupBox(parent=self.frame_creation_progress) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Expanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.groupBox.sizePolicy().hasHeightForWidth()) + self.groupBox.setSizePolicy(sizePolicy) + self.groupBox.setObjectName("groupBox") + self.media_checked = QtWidgets.QCheckBox(parent=self.groupBox) + self.media_checked.setGeometry(QtCore.QRect(20, 30, 241, 41)) + font = QtGui.QFont() + font.setPointSize(8) + font.setBold(False) + font.setItalic(False) + font.setUnderline(False) + font.setWeight(50) + font.setKerning(True) + font.setStyleStrategy(QtGui.QFont.StyleStrategy.PreferDefault) + self.media_checked.setFont(font) + self.media_checked.setObjectName("media_checked") + self.media_edited_check = QtWidgets.QCheckBox(parent=self.groupBox) + self.media_edited_check.setGeometry(QtCore.QRect(20, 70, 241, 41)) + font = QtGui.QFont() + font.setPointSize(8) + font.setBold(False) + font.setItalic(False) + font.setUnderline(False) + font.setWeight(50) + font.setKerning(True) + font.setStyleStrategy(QtGui.QFont.StyleStrategy.PreferDefault) + self.media_edited_check.setFont(font) + self.media_edited_check.setObjectName("media_edited_check") + self.app_created = QtWidgets.QCheckBox(parent=self.groupBox) + self.app_created.setGeometry(QtCore.QRect(20, 110, 161, 41)) + font = QtGui.QFont() + font.setPointSize(8) + font.setBold(False) + font.setItalic(False) + font.setUnderline(False) + font.setWeight(50) + font.setKerning(True) + font.setStyleStrategy(QtGui.QFont.StyleStrategy.PreferDefault) + self.app_created.setFont(font) + self.app_created.setObjectName("app_created") + self.btn_copy_adis_command = QtWidgets.QPushButton(parent=self.groupBox) + self.btn_copy_adis_command.setGeometry(QtCore.QRect(170, 120, 101, 23)) + font = QtGui.QFont() + font.setPointSize(8) + font.setBold(False) + font.setItalic(False) + font.setUnderline(False) + font.setWeight(50) + font.setKerning(True) + font.setStyleStrategy(QtGui.QFont.StyleStrategy.PreferDefault) + self.btn_copy_adis_command.setFont(font) + self.btn_copy_adis_command.setStatusTip("") + self.btn_copy_adis_command.setWhatsThis("") + self.btn_copy_adis_command.setAccessibleDescription("") + self.btn_copy_adis_command.setAutoFillBackground(False) + icon = QtGui.QIcon() + icon.addPixmap(QtGui.QPixmap("c:\\Users\\aky547\\GitHub\\SemesterapparatsManager\\src\\ui\\sounds\\../../../.designer/backup/icons/information.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) + self.btn_copy_adis_command.setIcon(icon) + self.btn_copy_adis_command.setCheckable(False) + self.btn_copy_adis_command.setChecked(False) + self.btn_copy_adis_command.setAutoDefault(False) + self.btn_copy_adis_command.setObjectName("btn_copy_adis_command") + self.verticalLayout_4.addWidget(self.groupBox) + self.horizontalLayout_6.addWidget(self.frame_creation_progress) + self.frame_2 = QtWidgets.QFrame(parent=self.centralwidget) + self.frame_2.setGeometry(QtCore.QRect(1280, 10, 301, 341)) + self.frame_2.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel) + self.frame_2.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) + self.frame_2.setObjectName("frame_2") + self.calendarWidget = QtWidgets.QCalendarWidget(parent=self.frame_2) + self.calendarWidget.setGeometry(QtCore.QRect(0, 0, 291, 191)) + self.calendarWidget.setGridVisible(True) + self.calendarWidget.setVerticalHeaderFormat(QtWidgets.QCalendarWidget.VerticalHeaderFormat.NoVerticalHeader) + self.calendarWidget.setObjectName("calendarWidget") + self.message_frame = QtWidgets.QFrame(parent=self.frame_2) + self.message_frame.setGeometry(QtCore.QRect(0, 210, 291, 121)) + self.message_frame.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel) + self.message_frame.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) + self.message_frame.setObjectName("message_frame") + self.label_14 = QtWidgets.QLabel(parent=self.message_frame) + self.label_14.setGeometry(QtCore.QRect(10, 10, 47, 20)) + self.label_14.setObjectName("label_14") + self.line_app_info = QtWidgets.QLineEdit(parent=self.message_frame) + self.line_app_info.setEnabled(True) + self.line_app_info.setGeometry(QtCore.QRect(60, 10, 31, 20)) + self.line_app_info.setObjectName("line_app_info") + self.message_box = QtWidgets.QTextEdit(parent=self.message_frame) + self.message_box.setGeometry(QtCore.QRect(10, 40, 271, 71)) + self.message_box.setObjectName("message_box") + self.btn_delete_message = QtWidgets.QPushButton(parent=self.message_frame) + self.btn_delete_message.setGeometry(QtCore.QRect(130, 10, 75, 23)) + self.btn_delete_message.setObjectName("btn_delete_message") + self.spin_select_message = QtWidgets.QSpinBox(parent=self.message_frame) + self.spin_select_message.setGeometry(QtCore.QRect(210, 10, 42, 22)) + self.spin_select_message.setMinimum(1) + self.spin_select_message.setObjectName("spin_select_message") + self.label_total_day_messages = QtWidgets.QLabel(parent=self.message_frame) + self.label_total_day_messages.setGeometry(QtCore.QRect(260, 10, 21, 22)) + self.label_total_day_messages.setObjectName("label_total_day_messages") + MainWindow.setCentralWidget(self.centralwidget) + self.menubar = QtWidgets.QMenuBar(parent=MainWindow) + self.menubar.setGeometry(QtCore.QRect(0, 0, 1593, 21)) + self.menubar.setObjectName("menubar") + self.menuDatei = QtWidgets.QMenu(parent=self.menubar) + self.menuDatei.setObjectName("menuDatei") + self.menuEinstellungen = QtWidgets.QMenu(parent=self.menubar) + self.menuEinstellungen.setObjectName("menuEinstellungen") + MainWindow.setMenuBar(self.menubar) + self.statusbar = QtWidgets.QStatusBar(parent=MainWindow) + self.statusbar.setObjectName("statusbar") + MainWindow.setStatusBar(self.statusbar) + self.actionBeenden = QtGui.QAction(parent=MainWindow) + self.actionBeenden.setShortcutVisibleInContextMenu(True) + self.actionBeenden.setObjectName("actionBeenden") + self.actionEinstellungen = QtGui.QAction(parent=MainWindow) + self.actionEinstellungen.setShortcutVisibleInContextMenu(True) + self.actionEinstellungen.setObjectName("actionEinstellungen") + self.menuDatei.addAction(self.actionBeenden) + self.menuEinstellungen.addAction(self.actionEinstellungen) + self.menubar.addAction(self.menuDatei.menuAction()) + self.menubar.addAction(self.menuEinstellungen.menuAction()) + + self.retranslateUi(MainWindow) + self.tabWidget.setCurrentIndex(1) + self.tabWidget_2.setCurrentIndex(0) + self.tabWidget_3.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.btn_apparat_save) + MainWindow.setTabOrder(self.btn_apparat_save, self.btn_apparat_apply) + + def retranslateUi(self, MainWindow): + _translate = QtCore.QCoreApplication.translate + MainWindow.setWindowTitle(_translate("MainWindow", "Semesterapparatsmanagement")) + 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")) + self.cancel_active_selection.setText(_translate("MainWindow", "Auswahl abbrechen")) + self.tableWidget_apparate.setSortingEnabled(True) + 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", "gültig bis")) + item = self.tableWidget_apparate.horizontalHeaderItem(4) + item.setText(_translate("MainWindow", "Dauerapparat")) + item = self.tableWidget_apparate.horizontalHeaderItem(5) + item.setText(_translate("MainWindow", "KontoNr")) + 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.mail_mand.setText(_translate("MainWindow", "*")) + self.telnr_mand.setText(_translate("MainWindow", "*")) + self.profname_mand.setText(_translate("MainWindow", "*")) + self.appname_mand.setText(_translate("MainWindow", "*")) + self.fach_mand.setText(_translate("MainWindow", "*")) + self._mand.setText(_translate("MainWindow", "*")) + self.btn_add_document.setText(_translate("MainWindow", "Dokument hinzufügen")) + self.btn_open_document.setText(_translate("MainWindow", "Dokument öffnen")) + self.check_file.setToolTip(_translate("MainWindow", "Abhängig von der Anzahl der Medien kann die Suche sehr lange dauern")) + self.check_file.setText(_translate("MainWindow", "Medien aus Dokument\n" +" hinzufügen")) + self.label_12.setText(_translate("MainWindow", "Prof-ID-aDIS")) + self.label_13.setText(_translate("MainWindow", "Apparat-ID-aDIS")) + self.check_send_mail.setText(_translate("MainWindow", "Mail senden")) + self.tableWidget_apparat_media.setSortingEnabled(True) + item = self.tableWidget_apparat_media.horizontalHeaderItem(0) + item.setText(_translate("MainWindow", "Buchtitel")) + item = self.tableWidget_apparat_media.horizontalHeaderItem(1) + item.setText(_translate("MainWindow", "Signatur")) + item = self.tableWidget_apparat_media.horizontalHeaderItem(2) + item.setText(_translate("MainWindow", "Auflage")) + item = self.tableWidget_apparat_media.horizontalHeaderItem(3) + item.setText(_translate("MainWindow", "Autor")) + item = self.tableWidget_apparat_media.horizontalHeaderItem(4) + item.setText(_translate("MainWindow", "verfügbar?")) + item = self.tableWidget_apparat_media.horizontalHeaderItem(5) + item.setText(_translate("MainWindow", "Vorgemerkt")) + item = self.tableWidget_apparat_media.horizontalHeaderItem(6) + item.setText(_translate("MainWindow", "Link")) + self.label.setText(_translate("MainWindow", " Medienliste")) + self.chkbx_show_del_media.setText(_translate("MainWindow", "gel. Medien anzeigen")) + self.label_info.setText(_translate("MainWindow", "Medien werden hinzugefügt")) + self.progress_label.setText(_translate("MainWindow", "Medium x/y")) + self.btn_reserve.setText(_translate("MainWindow", "Vorgemertk?")) + self.add_medium.setText(_translate("MainWindow", "Medien hinzufügen")) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), _translate("MainWindow", "Anlegen")) + self.btn_search.setText(_translate("MainWindow", "Suchen")) + self.label_7.setText(_translate("MainWindow", "Appnr.:")) + self.label_18.setText(_translate("MainWindow", "Dauerapp:")) + self.label_17.setText(_translate("MainWindow", "Endsemester:")) + self.label_19.setText(_translate("MainWindow", "Erstellsemester:")) + self.label_11.setText(_translate("MainWindow", "Person:")) + self.label_16.setText(_translate("MainWindow", "Fach:")) + self.label_15.setText(_translate("MainWindow", "Löschbar")) + self.tabWidget_2.setTabText(self.tabWidget_2.indexOf(self.tab_3), _translate("MainWindow", "Statistik")) + self.tabWidget_2.setTabText(self.tabWidget_2.indexOf(self.tab_4), _translate("MainWindow", "Suchen")) + item = self.statistics_table.horizontalHeaderItem(0) + item.setText(_translate("MainWindow", "Semester")) + item = self.statistics_table.horizontalHeaderItem(1) + item.setText(_translate("MainWindow", "Zugang")) + item = self.statistics_table.horizontalHeaderItem(2) + item.setText(_translate("MainWindow", "Abgang")) + self.tabWidget_3.setTabText(self.tabWidget_3.indexOf(self.tab_6), _translate("MainWindow", "Tabelle")) + self.tabWidget_3.setTabText(self.tabWidget_3.indexOf(self.tab_7), _translate("MainWindow", "Erstellte und gelöschte Semesterapparate")) + self.btn_del_select_apparats.setText(_translate("MainWindow", "Ausgewählte Löschen")) + item = self.tableWidget.horizontalHeaderItem(0) + item.setText(_translate("MainWindow", " ")) + item = self.tableWidget.horizontalHeaderItem(1) + item.setText(_translate("MainWindow", "Apparatsname")) + item = self.tableWidget.horizontalHeaderItem(2) + item.setText(_translate("MainWindow", "Apparatsnummer")) + item = self.tableWidget.horizontalHeaderItem(3) + item.setText(_translate("MainWindow", "Person")) + item = self.tableWidget.horizontalHeaderItem(4) + item.setText(_translate("MainWindow", "Fach")) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), _translate("MainWindow", "Suchen / Statistik")) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_5), _translate("MainWindow", "Admin")) + self.groupBox_2.setTitle(_translate("MainWindow", "Software")) + self.appdata_check.setText(_translate("MainWindow", "Apparatsdaten eingegeben")) + self.media_check.setText(_translate("MainWindow", "Medien hinzugefügt / importiert")) + self.ids_check.setText(_translate("MainWindow", "Prof-ID und Apparat-ID eingetragen")) + self.groupBox.setTitle(_translate("MainWindow", "aDIS")) + self.media_checked.setText(_translate("MainWindow", "Medien geprüft")) + self.media_edited_check.setText(_translate("MainWindow", "Medien bearbeitet")) + self.app_created.setText(_translate("MainWindow", "Apparat angelegt")) + self.btn_copy_adis_command.setToolTip(_translate("MainWindow", "Hier klicken, um die aDIS Abfrage in die Zwischenablage zu kopieren")) + self.btn_copy_adis_command.setText(_translate("MainWindow", " aDIS Abfrage")) + self.label_14.setText(_translate("MainWindow", "Apparat")) + self.btn_delete_message.setText(_translate("MainWindow", "Löschen")) + self.label_total_day_messages.setText(_translate("MainWindow", "TextLabel")) + self.menuDatei.setTitle(_translate("MainWindow", "Datei")) + self.menuEinstellungen.setTitle(_translate("MainWindow", "Bearbeiten")) + self.actionBeenden.setText(_translate("MainWindow", "Beenden")) + self.actionBeenden.setShortcut(_translate("MainWindow", "Ctrl+Q")) + self.actionEinstellungen.setText(_translate("MainWindow", "Einstellungen")) + self.actionEinstellungen.setShortcut(_translate("MainWindow", "Alt+S")) diff --git a/src/ui/userInterface.py b/src/ui/userInterface.py index 9cbddfc..6619a0d 100644 --- a/src/ui/userInterface.py +++ b/src/ui/userInterface.py @@ -6,13 +6,14 @@ import sys import tempfile import webbrowser from pathlib import Path +from typing import Any, Union from natsort import natsorted from PyQt6 import QtCore, QtGui, QtWidgets from PyQt6.QtCore import QThread from PyQt6.QtGui import QRegularExpressionValidator -from src import Icon, logger +from src import Icon from src.backend import Database, BookGrabber, AvailChecker, DocumentationThread from src.backend.semester import Semester from src.backend.create_file import recreateFile @@ -24,21 +25,23 @@ from src.logic import ( ApparatData, BookData, csv_to_list, - word_docx_to_csv, + word_to_semap, + SemapDocument, Prof, Apparat, ) from src.ui.dialogs import ( popus_confirm, - medienadder_ui, + MedienAdder, About, ApparatExtendDialog, Mail_Dialog, Settings, - edit_bookdata_ui, - login_ui, - parsed_titles_ui, - reminder_ui, + BookDataUI, + LoginDialog, + ParsedTitles, + ReminderDialog, + DocumentPrintDialog, ) from src.ui.widgets import ( ElsaDialog, @@ -50,65 +53,81 @@ from src.ui.widgets import ( EditUser, EditProf, ) -from src.utils import SemesterDocument + +from datetime import datetime + +import loguru + +log = loguru.logger +log.remove() +log.add(sys.stdout) +log.add("logs/application.log", rotation="1 MB", retention="10 days") + +log.add( + f"logs/{datetime.now().strftime('%Y-%m-%d')}.log", + rotation="1 day", + retention="1 month", +) valid_input = (0, 0, 0, 0, 0, 0) class Ui(Ui_Semesterapparat): # use the Ui_MainWindow class from mainwindow.py - def __init__(self, MainWindow, username: str) -> None: - logger.info("Starting Semesterapparatsmanagement") + def __init__(self, MainWindow, username: str) -> None: # type:ignore + log.info("Starting Semesterapparatsmanagement") super().__init__() self.active_user = username - self.setupUi(MainWindow) - self.MainWindow = MainWindow + self.setupUi(MainWindow) # type:ignore + self.MainWindow = MainWindow # type:ignore # set the window title - MainWindow.setWindowTitle("Semesterapparatsmanagement") - MainWindow.setWindowIcon(Icon("logo").icon) + MainWindow.setWindowTitle("Semesterapparatsmanagement") # type:ignore + MainWindow.setWindowIcon(Icon("logo").icon) # type:ignore self.db = Database() - self.btn_add_document.clicked.connect(self.add_document) - self.check_file.clicked.connect( + self.btn_add_document.clicked.connect(self.add_document) # type:ignore + self.check_file.clicked.connect( # type:ignore self.btn_check_file_threaded ) # default: self.add_media_from_file - self.create_new_app.clicked.connect(self.btn_create_new_apparat) - self.btn_apparat_save.clicked.connect(lambda: self.btn_save_apparat(True)) - self.btn_apparat_apply.clicked.connect(self.update_apparat) - self.btn_open_document.clicked.connect(self.open_document) - self.add_medium.clicked.connect(self.btn_add_medium) - self.btn_copy_adis_command.clicked.connect(self.text_to_clipboard) - self.btn_reserve.clicked.connect(self.check_availability) - self.create_document.clicked.connect(self.create_doc) + self.btn_extract_data_from_document.clicked.connect( # type:ignore + self.import_data_from_document + ) + self.create_new_app.clicked.connect(self.btn_create_new_apparat) # type:ignore + self.btn_apparat_save.clicked.connect(lambda: self.btn_save_apparat(True)) # type:ignore + self.btn_apparat_apply.clicked.connect(self.update_apparat) # type:ignore + self.btn_open_document.clicked.connect(self.open_document) # type:ignore + self.add_medium.clicked.connect(self.btn_add_medium) # type:ignore + self.btn_copy_adis_command.clicked.connect(self.text_to_clipboard) # type:ignore + self.btn_reserve.clicked.connect(self.check_availability) # type:ignore + self.create_document.clicked.connect(self.create_doc) # type:ignore self.calendarWidget = MessageCalendar(self.calendar_frame) self.calendarWidget.setGridVisible(True) self.calendarWidget.setVerticalHeaderFormat( QtWidgets.QCalendarWidget.VerticalHeaderFormat.NoVerticalHeader ) self.calendarWidget.setObjectName("MessageCalendar") - self.calendarWidget.clicked.connect(self.open_reminder) + self.calendarWidget.clicked.connect(self.open_reminder) # type:ignore # assign a context menu to the calendar self.calendarlayout.addWidget(self.calendarWidget) - self.tableWidget_apparat_media.horizontalHeader().setSectionResizeMode( + self.tableWidget_apparat_media.horizontalHeader().setSectionResizeMode( # type:ignore QtWidgets.QHeaderView.ResizeMode.Stretch ) - self.tableWidget_apparate.horizontalHeader().setSectionResizeMode( + self.tableWidget_apparate.horizontalHeader().setSectionResizeMode( # type:ignore QtWidgets.QHeaderView.ResizeMode.Stretch ) - self.tableWidget_apparate.setSortingEnabled(True) self.saveandcreate.hide() # Actions - self.actionEinstellungen.triggered.connect(self.open_settings) + self.actionEinstellungen.triggered.connect(self.open_settings) # type:ignore Icon("settings", self.actionEinstellungen) - self.actionDokumentation_lokal.triggered.connect(self.open_documentation) + self.actionDokumentation_lokal.triggered.connect(self.open_documentation) # type:ignore Icon("offAction", self.actionBeenden) - self.actionBeenden.triggered.connect(self.quit) - self.actionAbout.triggered.connect(self.open_about) + self.actionBeenden.triggered.connect(self.quit) # type:ignore + self.actionAbout.triggered.connect(self.open_about) # type:ignore # set validators - self.sem_sommer.clicked.connect(lambda: self.toggleButton(self.sem_winter)) - self.sem_winter.clicked.connect(lambda: self.toggleButton(self.sem_sommer)) + self.sem_sommer.clicked.connect(lambda: self.toggleButton(self.sem_winter)) # type:ignore + self.sem_winter.clicked.connect(lambda: self.toggleButton(self.sem_sommer)) # type:ignore self.sem_year.setText(str(QtCore.QDate.currentDate().year())) self.prof_mail.setValidator( QRegularExpressionValidator( @@ -121,7 +140,7 @@ class Ui(Ui_Semesterapparat): self.prof_tel_nr.setValidator( QtGui.QRegularExpressionValidator(QtCore.QRegularExpression(r"^\d{3,14}")) ) - # #print(self.prof_tel_nr.maxLength()) + # #log.debug(self.prof_tel_nr.maxLength()) self.app_fach.setValidator( # validator to allow typing in the app_fach field QtGui.QRegularExpressionValidator( QtCore.QRegularExpression(r"[a-zA-Z0-9\s\W]+") @@ -137,9 +156,9 @@ class Ui(Ui_Semesterapparat): self.tableWidget_apparate.addScrollBarWidget( QtWidgets.QScrollBar(), QtCore.Qt.AlignmentFlag.AlignRight ) - self.tableWidget_apparate.doubleClicked.connect(self.load_app_data) + self.tableWidget_apparate.doubleClicked.connect(self.load_app_data) # type:ignore - # #print(f"user:{self.active_user}") + # #log.debug(f"user:{self.active_user}") userrole = self.db.getRole(self.active_user) # hide admin interface when non-admin is logged in if userrole == "admin": @@ -150,18 +169,18 @@ class Ui(Ui_Semesterapparat): self.populate_prof_dropdown() self.populate_appfach_dropdown() # if the focus is changed from the prof name dropdown, set the prof data if the prof exists in the database, otherwise show a message - self.drpdwn_prof_name.currentIndexChanged.connect(self.set_prof_data) - self.cancel_active_selection.clicked.connect(self.btn_cancel_active_selection) - self.check_eternal_app.stateChanged.connect(self.set_state) + self.drpdwn_prof_name.currentIndexChanged.connect(self.set_prof_data) # type:ignore + self.cancel_active_selection.clicked.connect(self.btn_cancel_active_selection) # type:ignore + self.check_eternal_app.stateChanged.connect(self.set_state) # type:ignore # validate inputs - self.prof_mail.textChanged.connect(self.validate_prof_mail) - self.drpdwn_prof_name.editTextChanged.connect(self.validate_prof_name) - self.prof_tel_nr.textChanged.connect(self.validate_prof_tel) - self.app_name.textChanged.connect(self.validate_app_name) - self.app_fach.currentTextChanged.connect(self.validate_app_fach) - self.sem_year.textChanged.connect(self.validate_semester) - self.check_eternal_app.stateChanged.connect(self.validate_semester) - self.chkbx_show_del_media.stateChanged.connect(self.update_app_media_list) + self.prof_mail.textChanged.connect(self.validate_prof_mail) # type:ignore + self.drpdwn_prof_name.editTextChanged.connect(self.validate_prof_name) # type:ignore + self.prof_tel_nr.textChanged.connect(self.validate_prof_tel) # type:ignore + self.app_name.textChanged.connect(self.validate_app_name) # type:ignore + self.app_fach.currentTextChanged.connect(self.validate_app_fach) # type:ignore + self.sem_year.textChanged.connect(self.validate_semester) # type:ignore + self.check_eternal_app.stateChanged.connect(self.validate_semester) # type:ignore + self.chkbx_show_del_media.stateChanged.connect(self.update_app_media_list) # type:ignore self.progress_label.setText("Bitte warten...") # Set visibility/enabled state of certain entries @@ -178,16 +197,16 @@ class Ui(Ui_Semesterapparat): self.automation_add_selected_books.hide() # self.btn_del_select_apparats.setEnabled(False) - self.tabWidget.currentChanged.connect(self.tabW1_changed) + self.tabWidget.currentChanged.connect(self.tabW1_changed) # type:ignore # create a thread, that continually checks the validity of the inputs self.validate_thread = QThread() - self.validate_thread.started.connect(self.thread_check) + self.validate_thread.started.connect(self.thread_check) # type:ignore self.validate_thread.start() self.add_medium.setEnabled(False) self.docu = DocumentationThread() - self.docu.start() - self.actionDokumentation_lokal.triggered.connect(self.open_documentation) + + self.actionDokumentation_lokal.triggered.connect(self.open_documentation) # type:ignore # get all current apparats and cache them in a list self.apparats = self.get_apparats() @@ -203,22 +222,22 @@ class Ui(Ui_Semesterapparat): self.tableWidget_apparat_media.setContextMenuPolicy( QtCore.Qt.ContextMenuPolicy.CustomContextMenu ) - self.tableWidget_apparate.customContextMenuRequested.connect( - self.open_context_menu + self.tableWidget_apparate.customContextMenuRequested.connect( # type:ignore + self.open_context_menu # type:ignore ) - self.tableWidget_apparat_media.customContextMenuRequested.connect( - self.media_context_menu + self.tableWidget_apparat_media.customContextMenuRequested.connect( # type:ignore + self.media_context_menu # type:ignore ) # admin buttons - self.select_action_box.currentTextChanged.connect(self.adminActions) + self.select_action_box.currentTextChanged.connect(self.adminActions) # type:ignore self.select_action_box.addItem("") self.select_action_box.setCurrentText("") self.admin_action.setLayout(QtWidgets.QVBoxLayout()) self.admin_action.setTitle("") # Create instances to be used by the threads in the application - self.bookGrabber = [] + self.bookGrabber: list[QThread] = [] self.availChecker = None self.mail_thread = None self.autoGrabber = None @@ -236,31 +255,13 @@ class Ui(Ui_Semesterapparat): self.steps.hide() - def create_doc(self): - result = self.confirm_popup( - "Mit dem Klick auf Okay wird eine Übersicht aller aktiven Semesterapparate erstellt und an den FollowME Drucker gesendet. Es kann bis zu 10 Minuten dauern, bis das document im Drucker angezeigt wird", - "document erstellen?", - ) - if result == QtWidgets.QDialog.DialogCode.Accepted: - # print("Creating document") - apparats = self.apparats - apps = [] - for apparat in apparats: - prof = self.db.getProf(apparat[2]) - data = (apparat[4], f"{prof.lastname} ({apparat[1]})") - apps.append(data) - # print(apps) - doc = SemesterDocument( - semester=Semester(), - filename="Semesterapparate", - apparats=apps, - ) - doc.make_document() - doc.create_pdf() - doc.print_document() - doc.cleanup() + self.valid_check_semester.clicked.connect(self.display_valid_semester) # type:ignore - # kill thread after execution done + def create_doc(self): + log.debug("Creating document") + # open DocumentPrintDialog + dialog = DocumentPrintDialog(self.MainWindow) + dialog.show() def checkValidInput(self): if valid_input == (1, 1, 1, 1, 1, 1): @@ -329,7 +330,9 @@ class Ui(Ui_Semesterapparat): self.app_fach.addItems([subject[1] for subject in self.db.getSubjects()]) def open_documentation(self): - logger.info("Opening Documentation") + log.info("Opening Documentation") + if not self.docu.isRunning(): + self.docu.start() webbrowser.open("http://localhost:8000") def update_calendar(self, data): @@ -352,7 +355,7 @@ class Ui(Ui_Semesterapparat): statistics.updateCalendar.connect(self.update_calendar) stats_layout.addWidget(statistics) - # #print("searchpage") + # #log.debug("searchpage") if self.tabWidget.currentIndex() == 0: # Apparate # clear all entries from the table self.tableWidget_apparate.setRowCount(0) @@ -370,7 +373,7 @@ class Ui(Ui_Semesterapparat): widget.deleteLater() elsa_layout.addWidget(ElsaDialog()) - # print("added") + # log.debug("added") pass def generateSemester(self, today=False): @@ -413,9 +416,9 @@ class Ui(Ui_Semesterapparat): self.prof_mail.setText(appdata.prof.mail) self.prof_tel_nr.setText(appdata.prof.telnr) self.app_name.setText(appdata.apparat.name) - # #print("changing dropdown app_fach from '' to ", appdata.app_fach) + # #log.debug("changing dropdown app_fach from '' to ", appdata.app_fach) self.app_fach.setCurrentText(appdata.apparat.subject) - # #print("changed dropdown app_fach to ", self.app_fach.currentText()) + # #log.debug("changed dropdown app_fach to ", self.app_fach.currentText()) self.sem_year.setText(appdata.apparat.get_semester.split(" ")[1]) match appdata.apparat.get_semester.split(" ")[0]: case "SoSe": @@ -480,7 +483,7 @@ class Ui(Ui_Semesterapparat): return popup.result() def thread_check(self): - # #print("Thread started") + # #log.debug("Thread started") self.prof_mail.textChanged.connect(self.validate_prof_mail) self.drpdwn_prof_name.editTextChanged.connect(self.validate_prof_name) self.prof_tel_nr.textChanged.connect(self.validate_prof_tel) @@ -544,22 +547,24 @@ class Ui(Ui_Semesterapparat): self.__setValidState(self.valid_check_app_fach, 0, self.fach_mand, 4) def validate_semester(self): - if ( - self.app_group_box.isEnabled() - and ( - (self.sem_sommer.isChecked() or self.sem_winter.isChecked()) - and self.sem_year.text() != "" - and len(self.sem_year.text()) - >= 2 # check if the year is at least 2 digits long - ) - or self.check_eternal_app.isChecked() - ): + valid = (self.sem_sommer.isChecked() or self.sem_winter.isChecked()) and len( + self.sem_year.text() + ) >= 2 + if valid or self.check_eternal_app.isChecked(): self.__setValidState(self.valid_check_semester, 1, self._mand, 5) self.check_eternal_app.setEnabled(True) else: self.__setValidState(self.valid_check_semester, 0, self._mand, 5) self.check_eternal_app.setEnabled(False) + def display_valid_semester(self): + print(f""" + Semester: {self.sem_year.text()} + Sommer: {self.sem_sommer.isChecked()} + Winter: {self.sem_winter.isChecked()} + Eternal: {self.check_eternal_app.isChecked()} + """) + def change_state(self, index, state): global valid_input valid_input = list(valid_input) @@ -589,7 +594,7 @@ class Ui(Ui_Semesterapparat): return selected_prof = self.drpdwn_prof_name.currentText() data = self.db.getProfData(selected_prof) - # logger.debug(data) + # log.debug(data) prof_title = data.title if prof_title == "None": prof_title = "Kein Titel" @@ -686,27 +691,27 @@ class Ui(Ui_Semesterapparat): self.drpdwn_prof_name.clear() # set drop down menu for apparat numbers to only available numbers taken_app_nrs = self.db.getUnavailableApparatNumbers() - self.drpdwn_app_nr.addItems([str(i) for i in APP_NRS if i not in taken_app_nrs]) + self.drpdwn_app_nr.addItems([str(i) for i in APP_NRS if i not in taken_app_nrs]) # type:ignore valid_input = (0, 0, 0, 0, 0, 0) self.populate_prof_dropdown() - def update_progress_label(self, curr, total): + def update_progress_label(self, curr: int, total: int): text = f"Medium {curr}/{total}" - logger.info(text) + log.info(text) self.progress_label.setText(text) # update tableWidget_apparat_media self.update_app_media_list() def hide_progress_label(self): - logger.info("Finished adding media, hiding progress label") + log.info("Finished adding media, hiding progress label") self.progress_label.hide() self.progress_label.setText("Bitte warten...") self.line_2.hide() self.label_info.hide() def btn_add_medium(self): - media = medienadder_ui() + media = MedienAdder() media.exec() mode = media.mode data = media.data @@ -726,7 +731,7 @@ class Ui(Ui_Semesterapparat): app_id = self.active_apparat prof_id = self.db.getProfId(self.profdata) - logger.debug(prof_id) + log.debug(prof_id) # check if app_id is in database if self.db.checkApparatExistsById(app_id) is False: # create apparat @@ -734,7 +739,7 @@ class Ui(Ui_Semesterapparat): # create a thread that updates the progress label after each medium # self.bookGrabber = None - bookGrabber = BookGrabber(self.active_apparat) + bookGrabber = BookGrabber() bookGrabber.add_values( mode=mode, prof_id=prof_id, @@ -749,7 +754,7 @@ class Ui(Ui_Semesterapparat): bookGrabber.start() while bookGrabber.isRunning(): - # #print("waiting for thread to finish") + # #log.debug("waiting for thread to finish") QtWidgets.QApplication.processEvents() # self.__clear_fields() @@ -758,7 +763,6 @@ class Ui(Ui_Semesterapparat): return def check_availability(self): - def _update_progress(current, all_titles): self.avail_status.setText("{}/{}".format(current, all_titles)) @@ -782,7 +786,8 @@ class Ui(Ui_Semesterapparat): self.tableWidget_apparat_media.currentRow(), 1 ).text() ] - items = len(links) + # get the number of selected rows from the table + items = self.tableWidget_apparat_media.rowCount() self.label_20.setText("Verfügbarkeit wird geprüft, bitte warten...") self.label_20.show() self.avail_status.setText(f"0/{items}") @@ -795,7 +800,7 @@ class Ui(Ui_Semesterapparat): # thread = QThread() appnumber = self.active_apparat - # #print(links) + # #log.debug(links) self.availChecker = AvailChecker(links, appnumber, books=books) # availcheck.moveToThread(thread) # availcheck.finished.connect(thread.quit) @@ -844,7 +849,7 @@ class Ui(Ui_Semesterapparat): app_id, prof_id, deleted ) - # # #print(books) + # # #log.debug(books) # take the dataclass from the tuple # booklist:list[BookData]=[book[0] for book in books] self.tableWidget_apparat_media.setRowCount(0) @@ -853,7 +858,7 @@ class Ui(Ui_Semesterapparat): book_data = book["bookdata"] availability = book["available"] # bd = BookData().from_string(book) - # # #print(bd, type(bd)) + # # #log.debug(bd, type(bd)) # create a new row below the last one self.tableWidget_apparat_media.insertRow( self.tableWidget_apparat_media.rowCount() @@ -906,7 +911,7 @@ class Ui(Ui_Semesterapparat): ).setToolTip("Das Medium wurde nicht im Apparat gefunden") # make table link clickable - #self.tableWidget_apparat_media.itemClicked.connect(self.open_link) + # self.tableWidget_apparat_media.itemClicked.connect(self.open_link) # self.tableWidget_apparat_media. def open_link(self, item): @@ -926,7 +931,7 @@ class Ui(Ui_Semesterapparat): link = __openLink(item.text()) if link is not None: webbrowser.open(link) - #os.system("start " + link) + # os.system("start " + link) return else: pass @@ -947,11 +952,11 @@ class Ui(Ui_Semesterapparat): self.drpdwn_prof_name.addItem(prof) def add_document(self): - # #print("Add document") + # #log.debug("Add document") picker = FilePicker() files = picker.pick_files() for file in files: - # #print(file) + # #log.debug(file) filename = file.split("/")[-1] filetype = filename.split(".")[-1] self.document_list.insertRow(0) @@ -999,9 +1004,9 @@ class Ui(Ui_Semesterapparat): app_id = self.active_apparat prof_id = self.db.getProfId(self.profdata) - def __open_dialog(signatures): + def __open_dialog(signatures: list[str]): dialog = QtWidgets.QDialog() - frame = parsed_titles_ui() + frame = ParsedTitles() frame.setupUi(dialog) dialog.show() frame.signatures = signatures @@ -1023,7 +1028,7 @@ class Ui(Ui_Semesterapparat): else: # if file is selected, check for books in the file if self.document_list.currentRow() != -1: - # #print("File selected") + # #log.debug("File selected") file = self.document_list.item( self.document_list.currentRow(), 3 ).text() @@ -1064,12 +1069,8 @@ class Ui(Ui_Semesterapparat): bookdata=book, app_id=app_id, prof_id=prof_id ) if file_type == "docx": - data = word_docx_to_csv(file) - signatures = [ - i - for i in data["Standnummer"].values - if i != "\u2002\u2002\u2002\u2002\u2002" - ] + data = word_to_semap(file) + signatures = data.signatures data = __open_dialog(signatures) # if no data was returned, return if data == []: @@ -1081,81 +1082,111 @@ class Ui(Ui_Semesterapparat): bookdata=book, app_id=app_id, prof_id=prof_id ) self.update_app_media_list() - # #print(len(signatures)) + # #log.debug(len(signatures)) + + def extract_document_data(self) -> Union[list[str], SemapDocument]: + file_type = self.document_list.item(self.document_list.currentRow(), 1).text() + file_location = self.document_list.item( + self.document_list.currentRow(), 3 + ).text() + file_name = self.document_list.item(self.document_list.currentRow(), 0).text() + file = file_location + log.info("File selected: {}, {}", file_name, file_location) + if file_location == "Database": + # create warning, then return + self.db.recreateFile(file_name, self.active_apparat, filetype=file_type) + if file_type == "pdf": + # Todo: implement parser here + self.confirm_popup("PDF Dateien werden nicht unterstützt!", title="Fehler") + return [""] + if file_type == "csv": + signatures = csv_to_list(file) + # add the data to the database + return signatures + if file_type == "docx": + data = word_to_semap(file) + log.info("Converted data from semap file") + log.debug("Got the data: {}", data) + + return data + + def import_data_from_document(self): + global valid_input + data = self.extract_document_data() + if data is None: + return + if isinstance(data, list): + return + + self.prof_mail.setText(data.mail) + self.prof_tel_nr.setText(str(data.phoneNumber)) + self.app_name.setText(data.title) + self.app_fach.setCurrentText(data.subject) + self.prof_title.setText(data.personTitle) + self.drpdwn_prof_name.setCurrentText(data.personName) + self.sem_year.setText("20" + data.semester.year) def btn_check_file_threaded(self): - # #print("Checking file") + for runner in self.bookGrabber: + if not runner.isRunning(): + runner.deleteLater() + # #log.debug("Checking file") # get active app_id and prof_id self.tableWidget_apparate.setEnabled(False) self.tableWidget_apparate.setToolTip( "Bitte warten, bis alle Medien hinzugefügt wurden" ) app_id = self.active_apparat - logger.debug(self.profdata) + log.debug(self.profdata) prof_id = self.db.getProfId(self.profdata) - logger.debug(prof_id) + log.debug("Prof id: {}", prof_id) # check if apparat in database - + if prof_id is None: + prof = Prof( + fullname=self.drpdwn_prof_name.currentText(), + telnr=self.prof_tel_nr.text(), + mail=self.prof_mail.text(), + firstname=self.drpdwn_prof_name.currentText().split(", ")[1], + lastname=self.drpdwn_prof_name.currentText().split(", ")[0], + ) + self.db.createProf(prof) # if app_id not in database, create apparat - created = False if not self.db.checkApparatExistsById(app_id): + log.info("Apparat does not exist, creating new apparat") # create apparat - # #print("Creating apparat") + # #log.debug("Creating apparat") if not self.btn_save_apparat(False): return - created = True + if self.document_list.rowCount() == 0: - # #print("No file selected") + log.info("No file selected") self.tableWidget_apparate.setEnabled(True) self.tableWidget_apparate.setToolTip("") return else: # if file is selected, check for books in the file - # #print("File selected") - file = self.document_list.item(self.document_list.currentRow(), 3).text() + # #log.debug("File selected") - file_type = self.document_list.item( - self.document_list.currentRow(), 1 - ).text() - file_location = self.document_list.item( - self.document_list.currentRow(), 3 - ).text() - file_name = self.document_list.item( - self.document_list.currentRow(), 0 - ).text() - if file_location == "Database": - file = recreateFile(file_name, app_id, file_type, open=False) - else: - if not created: - self.add_files(prof_id) - if file_type == "pdf": - # Todo: implement parser here - self.confirm_popup( - "PDF Dateien werden nicht unterstützt!", title="Fehler" - ) - return - if file_type == "csv": - signatures = csv_to_list(file) - # add the data to the database - if file_type == "docx": - data = word_docx_to_csv(file) - signatures = [ - i - for i in data["Standnummer"].values - if i != "\u2002\u2002\u2002\u2002\u2002" - ] - - signatures = [i for i in signatures if i != ""] - # logger.debug(signatures) - # #print("starting thread") if prof_id is None: prof_id = self.db.getProfId(self.profdata) - # print("Prof ID is None", prof_id) - autoGrabber = BookGrabber(self.active_apparat) + # log.debug("Prof ID is None", prof_id) + document = self.extract_document_data() + if document is None: + log.error("Document is None") + elif isinstance(document, SemapDocument): + signatures = document.signatures + else: + signatures = document + autoGrabber = BookGrabber() autoGrabber.add_values( - mode="ARRAY", app_id=app_id, prof_id=prof_id, data=signatures + mode="ARRAY", + app_id=int(app_id), + prof_id=int(prof_id), + data=signatures, + any_book=True, + exact=True, ) self.label_info.show() self.progress_label.show() @@ -1164,13 +1195,12 @@ class Ui(Ui_Semesterapparat): # self.autoGrabber.finished.connect(self.autoGrabber.deleteLater) autoGrabber.finished.connect(self.hide_progress_label) autoGrabber.finished.connect(self.unlock_apparate) - autoGrabber.updateSignal.connect(self.update_progress_label) # worker.finished.connect(worker.deleteLater) autoGrabber.start() - while autoGrabber.isRunning(): - QtWidgets.QApplication.processEvents() + self.bookGrabber.append(autoGrabber) + # refresh book table # end of thread # self.autoGrabber.exit() # self.__clear_fields() @@ -1255,7 +1285,7 @@ class Ui(Ui_Semesterapparat): pid=appd.prof.fullname, ) if clear_fields: - # #print("clearing fields") + # #log.debug("clearing fields") self.__clear_fields() return True @@ -1276,7 +1306,15 @@ class Ui(Ui_Semesterapparat): } def add_files(self, prof_id=None): - files = [] + """ + Add Files to the associated prof in the database + + Parameters + ---------- + prof_id : int, optional + The ID associated to the prof, by default None + """ + files: list[dict[str, Any]] = [] for i in range(self.document_list.rowCount()): files.append( { @@ -1306,10 +1344,10 @@ class Ui(Ui_Semesterapparat): for apparat in self.apparats: self.insert_apparat_into_table(apparat) - logger.info("Inserted {} apparats into table".format(len(self.apparats))) + log.info("Inserted {} apparats into table".format(len(self.apparats))) def insert_apparat_into_table(self, apparat): - # logger.debug(apparat) + # log.debug(apparat) def __dauer_check(apparat): return "Ja" if apparat[7] == 1 else "Nein" @@ -1358,7 +1396,7 @@ class Ui(Ui_Semesterapparat): return app_id = self.tableWidget_apparate.item(row, 0).text() pid = self.db.getProfIDByApparat(app_id) - logger.debug(app_id, pid) + log.debug(app_id, pid) delete_action.triggered.connect(lambda: self.delete_apparat(pos)) # pass pos to contact_prof contact_action.triggered.connect( @@ -1367,14 +1405,14 @@ class Ui(Ui_Semesterapparat): menu.exec(self.tableWidget_apparate.mapToGlobal(position)) def reminder(self): - logger.info("Opening reminder dialog") - reminder = reminder_ui() + log.info("Opening reminder dialog") + reminder = ReminderDialog() reminder.exec() tableposition = self.tableWidget_apparate.currentRow() appnr = self.tableWidget_apparate.item(tableposition, 0).text() if reminder.result() == QtWidgets.QDialog.DialogCode.Accepted: data = reminder.return_message() - # #print(data) + # #log.debug(data) self.db.addMessage( data, self.active_user, @@ -1383,18 +1421,18 @@ class Ui(Ui_Semesterapparat): self.update_calendar(data) # self.db.update_bookdata(data, book_id) # self.db.update_bookdata(data) - logger.info("committed message to database") + log.info("committed message to database") # self.update_app_media_list() def get_reminders(self): messages = self.db.getAllMessages() - logger.info(f"Got {len(messages)} messages from database") + log.info(f"Got {len(messages)} messages from database") self.calendarWidget.setMessages(messages) self.calendarWidget.updateCells() def open_reminder(self): selected_date = self.calendarWidget.selectedDate().toString("yyyy-MM-dd") - # # #print(selected_date) + # # #log.debug(selected_date) messages = self.db.getMessages(selected_date) if messages == []: return @@ -1405,13 +1443,13 @@ class Ui(Ui_Semesterapparat): dialog.repaintSignal.connect(lambda: self.calendarWidget.reload(selected_date)) def open_settings(self): - # print(settings.dict()) + # log.debug(settings.dict()) settingsUI = Settings(self.active_user) settingsUI.exec() if settingsUI.result() == QtWidgets.QDialog.DialogCode.Accepted: settingsUI.save() - # print(settings.dict()) + # log.debug(settings.dict()) # self.reload() @@ -1430,6 +1468,7 @@ class Ui(Ui_Semesterapparat): delete_action = QtGui.QAction("Löschen") edit_action = QtGui.QAction("Bearbeiten") + update_data_action = QtGui.QAction("Daten aktualisieren") apparat_add_action = QtGui.QAction("Zum Apparat hinzufügen") apparat_move_action = QtGui.QAction("In Apparat verschieben") apparat_copy_action = QtGui.QAction("In Apparat kopieren") @@ -1439,7 +1478,7 @@ class Ui(Ui_Semesterapparat): apparatmenu.addActions( [apparat_add_action, apparat_copy_action, apparat_move_action] ) - generalmenu.addActions([edit_action, delete_action]) + generalmenu.addActions([edit_action, delete_action, update_data_action]) # disable apparat_add_action apparat_add_action.setEnabled(False) delete_action.triggered.connect(self.delete_medium) @@ -1447,8 +1486,13 @@ class Ui(Ui_Semesterapparat): apparat_add_action.triggered.connect(self.add_to_apparat) apparat_copy_action.triggered.connect(self.copy_to_apparat) apparat_move_action.triggered.connect(self.move_to_apparat) + update_data_action.triggered.connect(self.update_data) menu.exec(self.tableWidget_apparat_media.mapToGlobal(position)) + def update_data(self): + # TODO: use link in table, parse data and if needed, update location / signature + pass + def copy_to_apparat(self): selected_rows = self.tableWidget_apparat_media.selectionModel().selectedRows() signatures = [] @@ -1537,7 +1581,7 @@ class Ui(Ui_Semesterapparat): signature=signature, prof_id=self.db.getProfId(self.profdata), ) - # print(medium.adis_idn, medium.signature) + # log.debug(medium.adis_idn, medium.signature) def edit_medium(self): book = self.tableWidget_apparat_media.item( @@ -1555,7 +1599,7 @@ class Ui(Ui_Semesterapparat): book, ) widget = QtWidgets.QDialog() - bookedit = edit_bookdata_ui() + bookedit = BookDataUI() bookedit.setupUi(widget) widget.setWindowIcon(Icon("settings").icon) # change title of dialog @@ -1564,10 +1608,10 @@ class Ui(Ui_Semesterapparat): widget.exec() if widget.result() == QtWidgets.QDialog.DialogCode.Accepted: data = bookedit.get_data() - # #print(data) + # #log.debug(data) self.db.updateBookdata(bookdata=data, book_id=book_id) # self.db.update_bookdata(data) - # #print("accepted") + # #log.debug("accepted") self.update_app_media_list() else: return @@ -1591,7 +1635,7 @@ class Ui(Ui_Semesterapparat): ) message = f'Soll das Medium "{self.tableWidget_apparat_media.item(self.tableWidget_apparat_media.currentRow(), 0).text()}" wirklich gelöscht werden?' state = self.confirm_popup(message, title="Löschen?") - # #print(state) + # #log.debug(state) if state == 1: self.db.deleteBook(book_id) self.update_app_media_list() @@ -1603,7 +1647,7 @@ class Ui(Ui_Semesterapparat): for r in ranges: for row in range(r.topRow(), r.bottomRow() + 1): rows.append(row) - # #print(rows) + # #log.debug(rows) message = f"Sollen die {len(rows)} Medien wirklich gelöscht werden?" state = self.confirm_popup(message, title="Löschen?") if state == 1: @@ -1623,12 +1667,12 @@ class Ui(Ui_Semesterapparat): # return data from dialog if ok is pressed if framework.result() == QtWidgets.QDialog.DialogCode.Accepted: data = framework.get_data() - # #print(data) + # #log.debug(data) # return data selected_apparat_id = self.tableWidget_apparate.item( self.tableWidget_apparate.currentRow(), 0 ).text() - # #print(selected_apparat_id) + # #log.debug(selected_apparat_id) self.db.setNewSemesterDate( selected_apparat_id, data["semester"], dauerapp=data["dauerapp"] @@ -1639,7 +1683,7 @@ class Ui(Ui_Semesterapparat): return def __contact_dialog(self, apparat, location: tuple | str, mail=None, pid=""): - logger.debug( + log.debug( "Got these values apparat: {}, location: {}, mail: {}, pid: {}".format( apparat, location, mail, pid ) @@ -1682,8 +1726,8 @@ class Ui(Ui_Semesterapparat): self.mail_thread.show() def contact_prof(self, apparat="", location="", mail="", pid=""): - logger.debug(apparat) - logger.debug(location) + log.debug(apparat) + log.debug(location) if self.active_apparat == "": if apparat is False: self.confirm_popup( @@ -1699,10 +1743,10 @@ class Ui(Ui_Semesterapparat): ).text() message = f"Soll der Apparat {selected_apparat_id} wirklich gelöscht werden?" state = self.confirm_popup(message, title="Löschen?") - # #print(state) - logger.info("Result state: {}", state) + # #log.debug(state) + log.info("Result state: {}", state) if state == 1: - logger.debug("Deleting apparat {}", selected_apparat_id) + log.debug("Deleting apparat {}", selected_apparat_id) pid = self.db.getProfIDByApparat(selected_apparat_id) self.db.deleteApparat(selected_apparat_id, Semester().value) # delete the corresponding entry from self.apparats @@ -1711,7 +1755,7 @@ class Ui(Ui_Semesterapparat): self.apparats.remove(apparat) break self.old_apparats = self.apparats - # #print(self.apparats) + # #log.debug(self.apparats) # remove the row from the table self.tableWidget_apparate.removeRow(self.tableWidget_apparate.currentRow()) # send mail to prof @@ -1719,24 +1763,24 @@ class Ui(Ui_Semesterapparat): def launch_gui(): - # #print("trying to login") - # #print("checking if database available") + # #log.debug("trying to login") + # #log.debug("checking if database available") - logger.info("Starting login dialog") + log.info("Starting login dialog") app = QtWidgets.QApplication(sys.argv) login_dialog = QtWidgets.QDialog() - ui = login_ui() + ui = LoginDialog() ui.setupUi(login_dialog) login_dialog.exec() # This will block until the dialog is closed if ui.lresult == 1: # if login is successful, open main window # show login dialog - # #print(ui.lusername) + # #log.debug(ui.lusername) MainWindow = QtWidgets.QMainWindow() aui = Ui(MainWindow, username=ui.lusername) - # #print(aui.active_user) + # #log.debug(aui.active_user) MainWindow.show() # atexit.register() atexit.register(tempdelete) @@ -1753,7 +1797,7 @@ def launch_gui(): if __name__ == "__main__": - # #print("This is the main window") + # #log.debug("This is the main window") # app = QtWidgets.QApplication(sys.argv) # window = MainWindow() # app.exec() diff --git a/src/ui/widgets/MessageCalendar.py b/src/ui/widgets/MessageCalendar.py index 44ec907..48d93eb 100644 --- a/src/ui/widgets/MessageCalendar.py +++ b/src/ui/widgets/MessageCalendar.py @@ -1,9 +1,16 @@ -from src import logger from PyQt6 import QtWidgets, QtCore from PyQt6.QtCore import QDate from PyQt6.QtGui import QColor, QPen from src.backend import Database import darkdetect +import loguru +import sys + +log = loguru.logger +log.remove() +log.add(sys.stdout) +log.add("logs/application.log", rotation="1 MB", retention="10 days") + color = "#ddfb00" if darkdetect.isDark() else "#2204ff" pen = QPen(QColor(color)) @@ -22,7 +29,7 @@ class MessageCalendar(QtWidgets.QCalendarWidget): def getMessages(self): # Get the messages from the database messages = Database().getAllMessages() - logger.debug("Got {} messages", len(messages)) + log.debug("Got {} messages", len(messages)) self.setMessages(messages) def deleteMessage(self, id): diff --git a/src/ui/widgets/admin_create_user.py b/src/ui/widgets/admin_create_user.py index 1f695a9..2be5e2a 100644 --- a/src/ui/widgets/admin_create_user.py +++ b/src/ui/widgets/admin_create_user.py @@ -1,6 +1,6 @@ from PyQt6 import QtWidgets from PyQt6.QtCore import pyqtSignal -from .widget_sources.Ui_admin_create_user import Ui_Dialog +from .widget_sources.admin_create_user_ui import Ui_Dialog from src.backend import AdminCommands, Database diff --git a/src/ui/widgets/admin_edit_prof.py b/src/ui/widgets/admin_edit_prof.py index e3a0870..dfb9195 100644 --- a/src/ui/widgets/admin_edit_prof.py +++ b/src/ui/widgets/admin_edit_prof.py @@ -1,8 +1,16 @@ -from .widget_sources.Ui_admin_edit_prof import Ui_Dialog # +from .widget_sources.admin_edit_prof_ui import Ui_Dialog # from PyQt6 import QtWidgets -from src import logger + from src.logic import Prof from src.backend import Database +import loguru +import sys + +log = loguru.logger +log.remove() +log.add(sys.stdout) +log.add("logs/application.log", rotation="1 MB", retention="10 days") + class EditProf(QtWidgets.QDialog, Ui_Dialog): @@ -60,7 +68,7 @@ class EditProf(QtWidgets.QDialog, Ui_Dialog): else: self.faculty_member_old_telnr.setText(data.telnr) self.faculty_member_oldmail.setText(data.mail) - logger.debug(data) + log.debug(data) ( self.edit_faculty_member_title.setText(data.title) if data.title is not None @@ -84,7 +92,7 @@ class EditProf(QtWidgets.QDialog, Ui_Dialog): olddata = self.db.getProfByName( self.edit_faculty_member_select_member.currentText() ) - logger.debug(olddata) + log.debug(olddata) data = olddata oldlname = data.lastname oldfname = data.firstname diff --git a/src/ui/widgets/admin_edit_user.py b/src/ui/widgets/admin_edit_user.py index 2cbd2c5..7ce5914 100644 --- a/src/ui/widgets/admin_edit_user.py +++ b/src/ui/widgets/admin_edit_user.py @@ -1,4 +1,4 @@ -from .widget_sources.Ui_admin_edit_user import Ui_Dialog +from .widget_sources.admin_edit_user_ui import Ui_Dialog from PyQt6 import QtWidgets from src.backend import Database from src.backend import AdminCommands diff --git a/src/ui/widgets/admin_query.py b/src/ui/widgets/admin_query.py new file mode 100644 index 0000000..46389ee --- /dev/null +++ b/src/ui/widgets/admin_query.py @@ -0,0 +1,45 @@ +from .widget_sources.admin_query_ui import Ui_Form + +from PyQt6 import QtWidgets, QtCore +from src import Icon +from src.backend import Database + + +class AdminQueryWidget(QtWidgets.QWidget, Ui_Form): + def __init__(self, parent=None): + super().__init__(parent) + self.setupUi(self) + self.setWindowIcon(Icon("db_search").icon) + self.db = Database() + # Connect the button click to the method + self.sendquery.clicked.connect(self.on_pushButton_clicked) + + def on_pushButton_clicked(self): + # Handle button click event + self.queryResult.setRowCount(0) # Clear previous results + request_text = self.sqlquery.toPlainText() + if not request_text.strip(): + return + + data = self.db.query_db(request_text) + print(data) + table_names = ( + request_text.lower().split("select")[1].split("from")[0].split(",") + ) + table_names = [name.strip() for name in table_names] + # reset the horizontal header labels + self.queryResult.setHorizontalHeaderLabels(table_names) + for result in data: + row_position = self.queryResult.rowCount() + self.queryResult.insertRow(row_position) + for column, value in enumerate(result): + item = QtWidgets.QTableWidgetItem(str(value)) + item.setFlags(item.flags() & ~QtCore.Qt.ItemFlag.ItemIsEditable) + self.queryResult.setItem(row_position, column, item) + + +def launch(): + app = QtWidgets.QApplication([]) + widget = AdminQueryWidget() + widget.show() + app.exec() diff --git a/src/ui/widgets/calendar_entry.py b/src/ui/widgets/calendar_entry.py index 03966ee..1c70b94 100644 --- a/src/ui/widgets/calendar_entry.py +++ b/src/ui/widgets/calendar_entry.py @@ -1,4 +1,4 @@ -from .widget_sources.Ui_calendar_entry import Ui_Dialog +from .widget_sources.calendar_entry_ui import Ui_Dialog from PyQt6 import QtWidgets from PyQt6.QtCore import pyqtSignal from src.backend.database import Database diff --git a/src/ui/widgets/default_apps.py b/src/ui/widgets/default_apps.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/ui/widgets/elsa_main.py b/src/ui/widgets/elsa_main.py index 25fe659..0a0b5a4 100644 --- a/src/ui/widgets/elsa_main.py +++ b/src/ui/widgets/elsa_main.py @@ -1,14 +1,22 @@ import os -from natsort import natsorted -from .widget_sources.Ui_elsa_maindialog import Ui_Dialog +from .widget_sources.elsa_maindialog_ui import Ui_Dialog from PyQt6 import QtCore, QtWidgets, QtGui from PyQt6.QtGui import QRegularExpressionValidator from PyQt6.QtCore import QDate -from src import Icon, logger +from src import Icon from src.backend import Semester, Database from src.logic import elsa_word_to_csv, Prof from src.ui.dialogs import ElsaAddEntry, popus_confirm from src.ui.widgets import FilePicker, DataGraph +from src.backend import recreateElsaFile +import loguru +import sys + +log = loguru.logger +log.remove() +log.add(sys.stdout) +log.add("logs/application.log", rotation="1 MB", retention="10 days") + class ElsaDialog(QtWidgets.QDialog, Ui_Dialog): @@ -70,7 +78,7 @@ class ElsaDialog(QtWidgets.QDialog, Ui_Dialog): ##Variables self.db = Database() - self.graph_data = {"x": [Semester().value], "y": [0]} + self.graph_data = {"x": [""], "y": [0]} self.createProf = False self.profs = self.getProfs() @@ -84,7 +92,7 @@ class ElsaDialog(QtWidgets.QDialog, Ui_Dialog): self.newProf_title.textChanged.connect(self.checkProfData) self.loadFrame() - logger.info("Elsa Dialog loaded") + log.info("Elsa Dialog loaded") # self.show() def checkProfData(self): @@ -224,11 +232,11 @@ class ElsaDialog(QtWidgets.QDialog, Ui_Dialog): lastname=prof.split(", ")[0], mail=self.newProf_mail.text(), telnr=self.newProf_telnr.text(), - title=self.newProf_title.text(), + _title=self.newProf_title.text(), fullname=f"{prof.split(', ')[0]} {prof.split(', ')[1]}", ) prof_id = self.db.getProfId(profdata) - logger.debug(profdata, prof_id) + log.debug(f"ProfData: {profdata}, id:{prof_id}") if prof_id is None: self.db.createProf(profdata) @@ -254,12 +262,12 @@ class ElsaDialog(QtWidgets.QDialog, Ui_Dialog): files, elsa_id, ) - logger.info("Stored {} files in the database", len(files)) + log.info("Stored {} files in the database", len(files)) self.cancel_elsa_creation() self.refresh_elsa_table() self.elsa_prof.setCurrentText("") self.quote_entry.setEnabled(False) - logger.info("Saved apparat to database, id {}", elsa_id) + log.info("Saved apparat to database, id {}", elsa_id) def refresh_elsa_table(self): self.elsa_table.setRowCount(0) @@ -279,13 +287,13 @@ class ElsaDialog(QtWidgets.QDialog, Ui_Dialog): def open_elsa(self): prof = self.elsa_table.item(self.elsa_table.currentRow(), 0).text() - logger.info("prof", prof) + log.info("prof", prof) date = self.elsa_table.item(self.elsa_table.currentRow(), 1).text() semester = self.elsa_table.item(self.elsa_table.currentRow(), 2).text() self.elsa_update.setEnabled(True) self.elsa_save.setEnabled(False) if self.elsa_prof.currentText() == prof and date == self.elsa_date.text(): - logger.debug("Same prof, stopping") + log.debug("Same prof, stopping") return self.create_frame_elsa.setEnabled(True) self.dokument_list_elsa.setRowCount(0) @@ -305,7 +313,7 @@ class ElsaDialog(QtWidgets.QDialog, Ui_Dialog): self.elsa_date.setText(date) self.elsa_semester.setText(semester) self.elsa_prof.setCurrentText(prof) - logger.info("Elsa ID is {}", elsa_id) + log.info("Elsa ID is {}", elsa_id) if elsa_id is None: return documents = self.db.getElsaFiles(elsa_id) @@ -402,11 +410,8 @@ class ElsaDialog(QtWidgets.QDialog, Ui_Dialog): self.elsa_semester.text(), self.elsa_date.text(), ) - logger.debug( - elsa_id, - self.elsa_prof.currentText(), - self.elsa_semester.text(), - self.elsa_date.text(), + log.debug( + f"elsa_id: {elsa_id}, prof: {self.elsa_prof.currentText()}, semester: {self.elsa_semester.text()}, date: {self.elsa_date.text()}" ) for row in data: if self.seperateEntries.isChecked(): @@ -439,10 +444,10 @@ class ElsaDialog(QtWidgets.QDialog, Ui_Dialog): try: self.elsa_statistics.removeTab(1) except: - logger.debug("No tab to remove") + log.debug("No tab to remove") self.elsa_table.setRowCount(0) elsa_apparats = self.db.getElsaApparats() - elsa_apparats = natsorted(elsa_apparats, key=lambda x: x[2], reverse=True) + # elsa_apparats = natsorted(elsa_apparats, key=lambda x: x[2], reverse=True) # x = semester, y = number of apparats for apparat in elsa_apparats: @@ -455,15 +460,15 @@ class ElsaDialog(QtWidgets.QDialog, Ui_Dialog): else: index = self.graph_data["x"].index(semester) self.graph_data["y"][index] += number - - generateMissing = True if len(self.graph_data["x"]) > 1 else False + self.graph_data["x"].pop(0) + self.graph_data["y"].pop(0) + # generateMissing = True if len(self.graph_data["x"]) > 2 else False graph = DataGraph( - "ELSA Apparate pro Semester", - self.graph_data, - generateMissing, - "Anzahl der Apparate", + title="ELSA Apparate pro Semester", + data=self.graph_data, + label="Anzahl der Apparate", ) - logger.debug(self.graph_data) + log.debug(self.graph_data) self.elsa_statistics_table.setRowCount(0) for i in range(len(self.graph_data["x"])): self.elsa_statistics_table.insertRow(0) @@ -477,7 +482,7 @@ class ElsaDialog(QtWidgets.QDialog, Ui_Dialog): def launch(): - logger.debug("Launching Elsa Dialog") + log.debug("Launching Elsa Dialog") app = QtWidgets.QApplication([]) window = ElsaDialog() window.show() diff --git a/src/ui/widgets/graph.py b/src/ui/widgets/graph.py index a4a2ddd..a7a389f 100644 --- a/src/ui/widgets/graph.py +++ b/src/ui/widgets/graph.py @@ -3,6 +3,13 @@ from typing import Union import pyqtgraph as pg from PyQt6 import QtWidgets +import loguru +import sys + +log = loguru.logger +log.remove() +log.add(sys.stdout) +log.add("logs/application.log", rotation="1 MB", retention="10 days") def mergedicts(d1, d2): @@ -31,7 +38,11 @@ class DataGraph(QtWidgets.QWidget): label=None, ): super().__init__() - + log.debug( + "Initialized with options: {}, {}, {}, {}".format( + title, data, generateMissing, label + ) + ) lst = [] if generateMissing: x_data = data["x"] @@ -142,20 +153,10 @@ if __name__ == "__main__": import sys app = QtWidgets.QApplication(sys.argv) - data_1 = { - "x": ["SoSe 10", "WiSe 10/11", "SoSe 11", "SoSe 14"], - "y": { - "Added": [1, 2, 3, 4], - "Deleted": [4, 3, 2, 1], - }, - } - data_2 = { - "x": ["SoSe 10"], - "y": [2], - } - graph_data = {"x": ["SoSe 24"], "y": [1]} + + graph_data = {"x": ["WiSe 25/26", "WiSe 24/25", "SoSe 25"], "y": [1, 2, 1]} widget = DataGraph( - "ELSA Apparate pro Semester", data_2, True, "Anzahl der Apparate" + "ELSA Apparate pro Semester", graph_data, True, "Anzahl der Apparate" ) widget.show() sys.exit(app.exec()) diff --git a/src/ui/widgets/iconLine.py b/src/ui/widgets/iconLine.py index 5beb729..d4f1478 100644 --- a/src/ui/widgets/iconLine.py +++ b/src/ui/widgets/iconLine.py @@ -1,6 +1,16 @@ -from .widget_sources.Ui_icon_widget import Ui_Dialog +from .widget_sources.icon_widget_ui import Ui_Dialog from PyQt6 import QtWidgets -from src import logger + +import sys +from loguru import logger as log + +logger = log +logger.remove() +logger.add("logs/application.log", rotation="1 week", retention="1 month", enqueue=True) + + +# logger.add(sys.stderr, format="{time} {level} {message}", level="INFO") +logger.add(sys.stdout) class IconWidget(QtWidgets.QWidget, Ui_Dialog): @@ -19,9 +29,12 @@ class IconWidget(QtWidgets.QWidget, Ui_Dialog): self.icon_filename_line.setText( file_dialog.selectedFiles()[0].split("/")[-1] ) - logger.debug( - "Icon changed to: {}", file_dialog.selectedFiles()[0].split("/")[-1] - ) + try: + log.debug( + "Icon changed to: {}", file_dialog.selectedFiles()[0].split("/")[-1] + ) + except IndexError: + log.debug("No file selected") def return_data(self): return self.icon_name_settings.text(), self.icon_filename_line.text() diff --git a/src/ui/widgets/searchPage.py b/src/ui/widgets/searchPage.py index d622154..87fe6ea 100644 --- a/src/ui/widgets/searchPage.py +++ b/src/ui/widgets/searchPage.py @@ -1,13 +1,21 @@ -from .widget_sources.Ui_search_statistic_page import Ui_Dialog +from .widget_sources.search_statistic_page_ui import Ui_Dialog from PyQt6 import QtWidgets, QtGui, QtCore from PyQt6.QtCore import pyqtSignal from src.backend import Database, Semester -from src import logger + from src.logic import custom_sort, Prof, sort_semesters_list -from src.ui.dialogs import Mail_Dialog, ApparatExtendDialog, reminder_ui +from src.ui.dialogs import Mail_Dialog, ApparatExtendDialog, ReminderDialog from src.ui.widgets import DataGraph, StatusWidget from natsort import natsorted +import loguru +import sys + +log = loguru.logger +log.remove() +log.add(sys.stdout) +log.add("logs/application.log", rotation="1 MB", retention="10 days") + class MyComboBox(QtWidgets.QComboBox): @@ -22,7 +30,7 @@ class SearchStatisticPage(QtWidgets.QDialog, Ui_Dialog): updateCalendar = pyqtSignal(int, list) def __init__(self): - logger.info("SearchStatisticPage started") + log.info("SearchStatisticPage started") super().__init__() self.setupUi(self) self.book_search_result.horizontalHeader().setSectionResizeMode( @@ -36,7 +44,6 @@ class SearchStatisticPage(QtWidgets.QDialog, Ui_Dialog): self.statistics_table.doubleClicked.connect(self.display_detailed_data) self.tabWidget_2.currentChanged.connect(self.tabW2_changed) self.btn_search.clicked.connect(self.statistics) - self.book_search.clicked.connect(self.search_book) self.tableWidget.customContextMenuRequested.connect( self.statistics_table_context_menu ) @@ -59,6 +66,8 @@ class SearchStatisticPage(QtWidgets.QDialog, Ui_Dialog): # set tableWidget column 0 to be 50px wide self.tableWidget.setColumnWidth(0, 50) self.semester = Semester().value + self.search_by_signature.returnPressed.connect(self.search_book) + self.search_by_title.returnPressed.connect(self.search_book) self.populate_tab() def restore_apparat(self): @@ -73,7 +82,7 @@ class SearchStatisticPage(QtWidgets.QDialog, Ui_Dialog): apparats.append(self.tableWidget.item(row.row(), 1).text()) for apparat in apparats: apparat_id = self.db.getApparatId(apparat) - self.db.restoreApparat(apparat_id) + self.db.restoreApparat(apparat_id, apparat) # remove the red color from the row # get row where the apparat is row = self.tableWidget.findItems(apparat, QtCore.Qt.MatchFlag.MatchExactly)[ @@ -100,7 +109,7 @@ class SearchStatisticPage(QtWidgets.QDialog, Ui_Dialog): extend.exec() if extend.result() == QtWidgets.QDialog.DialogCode.Accepted: data = extend.get_data() - logger.debug(data) + log.debug(data) app_name = self.tableWidget.item(self.tableWidget.currentRow(), 1).text() app_id = self.db.getApparatId(app_name) self.db.setNewSemesterDate(app_id, data["semester"], data["dauerapp"]) @@ -109,8 +118,8 @@ class SearchStatisticPage(QtWidgets.QDialog, Ui_Dialog): self.refreshSignal.emit() def reminder(self): - logger.info("Opening reminder dialog") - reminder = reminder_ui() + log.info("Opening reminder dialog") + reminder = ReminderDialog() reminder.exec() tableposition = self.tableWidget.currentRow() appnr = self.tableWidget.item(tableposition, 2).text() @@ -123,7 +132,7 @@ class SearchStatisticPage(QtWidgets.QDialog, Ui_Dialog): appnr, ) self.updateCalendar.emit(data) - logger.info("committed message to database") + log.info("committed message to database") def tabW2_changed(self): if self.tabWidget_2.currentIndex() == 0: @@ -133,18 +142,19 @@ class SearchStatisticPage(QtWidgets.QDialog, Ui_Dialog): def search_book(self): self.book_search_result.setRowCount(0) - signature = self.seach_by_signature.text() + signature = self.search_by_signature.text() title = self.search_by_title.text() params = { "signature": signature if signature != "" else None, "title": title if title != "" else None, } params = {key: value for key, value in params.items() if value is not None} - logger.debug(params) + log.debug(params) retdata = self.db.searchBook(params) if retdata is None: return for book in retdata: + log.debug(book) self.book_search_result.insertRow(0) self.book_search_result.setItem( 0, 0, QtWidgets.QTableWidgetItem(book[0].title) @@ -156,7 +166,12 @@ class SearchStatisticPage(QtWidgets.QDialog, Ui_Dialog): self.book_search_result.setItem( 0, 2, - QtWidgets.QTableWidgetItem(self.db.getApparatName(book[1], book[2])), + QtWidgets.QTableWidgetItem( + self.db.fetch_one( + "SELECT semesterapparat.appnr || ' (' || semesterapparat.name || ')' AS formatted_result from semesterapparat WHERE semesterapparat.appnr = ?", + (book[1],), + )[0], + ), ) def notify_for_deletion(self): @@ -171,7 +186,7 @@ class SearchStatisticPage(QtWidgets.QDialog, Ui_Dialog): selected_apparats.append(data) # delete all selected apparats - logger.debug(selected_apparats) + log.debug(selected_apparats) dialogs = [] for i in selected_apparats: app_id = i["app_id"] @@ -231,7 +246,7 @@ class SearchStatisticPage(QtWidgets.QDialog, Ui_Dialog): self.box_dauerapp.setEnabled(True) def populate_tab(self, table_or_graph=0): - logger.info("populate_tab started") + log.info("populate_tab started") # add default values to the dropdowns self.box_appnrs.clear() self.box_appnrs.addItem("") @@ -298,7 +313,7 @@ class SearchStatisticPage(QtWidgets.QDialog, Ui_Dialog): # place the graph into tabWidget_3 self.tabWidget_3.addTab(graph, "Graph") self.tabWidget_3.setCurrentIndex(table_or_graph) - logger.info("populate_tab finished") + log.info("populate_tab finished") def delete_selected_apparats(self): # get all selected apparats @@ -310,7 +325,7 @@ class SearchStatisticPage(QtWidgets.QDialog, Ui_Dialog): selected_apparat_rows.append(i) # delete all selected apparats # # #print(selected_apparats) - logger.info(f"Deleting apparats: {selected_apparats}") + log.info(f"Deleting apparats: {selected_apparats}") for apparat in selected_apparats: self.db.deleteApparat(apparat, self.semester) for row in selected_apparat_rows: @@ -383,7 +398,7 @@ class SearchStatisticPage(QtWidgets.QDialog, Ui_Dialog): sem = Semester().from_string( entry[8] if entry[8] is not None else entry[5] ) - logger.info(f"Semester: {sem}") + log.info(f"Semester: {sem}") if sem.isPastSemester(Semester()): data.append(entry) else: @@ -483,7 +498,7 @@ class SearchStatisticPage(QtWidgets.QDialog, Ui_Dialog): checkbox.setChecked(False) self.tableWidget.setCellWidget(0, 0, checkbox) # if i[9] is 1, set the background of the row to red - if int(app[9]) == 1: + if int(app.deleted) == 1: for j in range(5): self.tableWidget.item(0, j).setBackground( QtGui.QColor(235, 74, 71) diff --git a/src/ui/widgets/widget_sources/Ui_admin_create_user.ui.py b/src/ui/widgets/widget_sources/Ui_admin_create_user.ui.py deleted file mode 100644 index 1e8b7a0..0000000 --- a/src/ui/widgets/widget_sources/Ui_admin_create_user.ui.py +++ /dev/null @@ -1,8 +0,0 @@ -# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\widgets\widget_sources\admin_create_user.ui.iytYFY' -# -# Created by: PyQt6 UI code generator 6.6.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. - - diff --git a/src/ui/widgets/widget_sources/Ui_admin_create_user.py b/src/ui/widgets/widget_sources/admin_create_user_ui.py similarity index 97% rename from src/ui/widgets/widget_sources/Ui_admin_create_user.py rename to src/ui/widgets/widget_sources/admin_create_user_ui.py index a989524..a43d4bb 100644 --- a/src/ui/widgets/widget_sources/Ui_admin_create_user.py +++ b/src/ui/widgets/widget_sources/admin_create_user_ui.py @@ -1,12 +1,12 @@ # Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\widgets\widget_sources\admin_create_user.ui' # -# Created by: PyQt6 UI code generator 6.7.1 +# Created by: PyQt6 UI code generator 6.8.0 # # 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 +from PyQt6 import QtCore, QtGui, QtWidgets class Ui_Dialog(object): diff --git a/src/ui/widgets/widget_sources/Ui_admin_edit_prof.py b/src/ui/widgets/widget_sources/admin_edit_prof_ui.py similarity index 81% rename from src/ui/widgets/widget_sources/Ui_admin_edit_prof.py rename to src/ui/widgets/widget_sources/admin_edit_prof_ui.py index 63deb93..1ecaddc 100644 --- a/src/ui/widgets/widget_sources/Ui_admin_edit_prof.py +++ b/src/ui/widgets/widget_sources/admin_edit_prof_ui.py @@ -1,12 +1,12 @@ # Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\widgets\widget_sources\admin_edit_prof.ui' # -# Created by: PyQt6 UI code generator 6.7.1 +# Created by: PyQt6 UI code generator 6.8.0 # # 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 +from PyQt6 import QtCore, QtGui, QtWidgets class Ui_Dialog(object): @@ -26,14 +26,10 @@ class Ui_Dialog(object): self.faculty_member_old_telnr.setObjectName("faculty_member_old_telnr") self.gridLayout_2.addWidget(self.faculty_member_old_telnr, 1, 1, 1, 1) self.edit_faculty_member_title = QtWidgets.QLineEdit(parent=Dialog) - sizePolicy = QtWidgets.QSizePolicy( - QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed - ) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth( - self.edit_faculty_member_title.sizePolicy().hasHeightForWidth() - ) + sizePolicy.setHeightForWidth(self.edit_faculty_member_title.sizePolicy().hasHeightForWidth()) self.edit_faculty_member_title.setSizePolicy(sizePolicy) self.edit_faculty_member_title.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) self.edit_faculty_member_title.setReadOnly(True) @@ -46,9 +42,7 @@ class Ui_Dialog(object): self.label_3.setObjectName("label_3") self.gridLayout_2.addWidget(self.label_3, 1, 0, 1, 1) self.edit_faculty_member_select_member = QtWidgets.QComboBox(parent=Dialog) - self.edit_faculty_member_select_member.setObjectName( - "edit_faculty_member_select_member" - ) + self.edit_faculty_member_select_member.setObjectName("edit_faculty_member_select_member") self.gridLayout_2.addWidget(self.edit_faculty_member_select_member, 0, 1, 1, 1) self.faculty_member_oldmail = QtWidgets.QLineEdit(parent=Dialog) self.faculty_member_oldmail.setReadOnly(True) @@ -62,12 +56,7 @@ class Ui_Dialog(object): self.delete_faculty_member.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) self.delete_faculty_member.setObjectName("delete_faculty_member") self.horizontalLayout.addWidget(self.delete_faculty_member) - spacerItem = QtWidgets.QSpacerItem( - 40, - 20, - QtWidgets.QSizePolicy.Policy.Fixed, - QtWidgets.QSizePolicy.Policy.Minimum, - ) + spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Minimum) self.horizontalLayout.addItem(spacerItem) self.update_faculty_member = QtWidgets.QPushButton(parent=Dialog) self.update_faculty_member.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) @@ -91,14 +80,10 @@ class Ui_Dialog(object): self.label_9.setObjectName("label_9") self.gridLayout_3.addWidget(self.label_9, 4, 0, 1, 1) self.edit_faculty_member_new_title = QtWidgets.QLineEdit(parent=Dialog) - self.edit_faculty_member_new_title.setObjectName( - "edit_faculty_member_new_title" - ) + self.edit_faculty_member_new_title.setObjectName("edit_faculty_member_new_title") self.gridLayout_3.addWidget(self.edit_faculty_member_new_title, 0, 1, 1, 1) self.user_faculty_member_new_telnr = QtWidgets.QLineEdit(parent=Dialog) - self.user_faculty_member_new_telnr.setObjectName( - "user_faculty_member_new_telnr" - ) + self.user_faculty_member_new_telnr.setObjectName("user_faculty_member_new_telnr") self.gridLayout_3.addWidget(self.user_faculty_member_new_telnr, 3, 1, 1, 1) self.label_8 = QtWidgets.QLabel(parent=Dialog) self.label_8.setObjectName("label_8") @@ -113,9 +98,7 @@ class Ui_Dialog(object): self.user_faculty_member_new_name.setObjectName("user_faculty_member_new_name") self.gridLayout_3.addWidget(self.user_faculty_member_new_name, 2, 1, 1, 1) self.edit_faculty_member_new_surname = QtWidgets.QLineEdit(parent=Dialog) - self.edit_faculty_member_new_surname.setObjectName( - "edit_faculty_member_new_surname" - ) + self.edit_faculty_member_new_surname.setObjectName("edit_faculty_member_new_surname") self.gridLayout_3.addWidget(self.edit_faculty_member_new_surname, 1, 1, 1, 1) self.label_5 = QtWidgets.QLabel(parent=Dialog) self.label_5.setObjectName("label_5") @@ -140,28 +123,14 @@ class Ui_Dialog(object): self.retranslateUi(Dialog) QtCore.QMetaObject.connectSlotsByName(Dialog) - Dialog.setTabOrder( - self.edit_faculty_member_select_member, self.faculty_member_old_telnr - ) + Dialog.setTabOrder(self.edit_faculty_member_select_member, self.faculty_member_old_telnr) Dialog.setTabOrder(self.faculty_member_old_telnr, self.faculty_member_oldmail) - Dialog.setTabOrder( - self.faculty_member_oldmail, self.edit_faculty_member_new_title - ) - Dialog.setTabOrder( - self.edit_faculty_member_new_title, self.edit_faculty_member_new_surname - ) - Dialog.setTabOrder( - self.edit_faculty_member_new_surname, self.user_faculty_member_new_name - ) - Dialog.setTabOrder( - self.user_faculty_member_new_name, self.user_faculty_member_new_telnr - ) - Dialog.setTabOrder( - self.user_faculty_member_new_telnr, self.user_faculty_member_new_mail - ) - Dialog.setTabOrder( - self.user_faculty_member_new_mail, self.edit_faculty_member_title - ) + Dialog.setTabOrder(self.faculty_member_oldmail, self.edit_faculty_member_new_title) + Dialog.setTabOrder(self.edit_faculty_member_new_title, self.edit_faculty_member_new_surname) + Dialog.setTabOrder(self.edit_faculty_member_new_surname, self.user_faculty_member_new_name) + Dialog.setTabOrder(self.user_faculty_member_new_name, self.user_faculty_member_new_telnr) + Dialog.setTabOrder(self.user_faculty_member_new_telnr, self.user_faculty_member_new_mail) + Dialog.setTabOrder(self.user_faculty_member_new_mail, self.edit_faculty_member_title) def retranslateUi(self, Dialog): _translate = QtCore.QCoreApplication.translate diff --git a/src/ui/widgets/widget_sources/Ui_admin_edit_user.py b/src/ui/widgets/widget_sources/admin_edit_user_ui.py similarity index 94% rename from src/ui/widgets/widget_sources/Ui_admin_edit_user.py rename to src/ui/widgets/widget_sources/admin_edit_user_ui.py index df0f159..8094d24 100644 --- a/src/ui/widgets/widget_sources/Ui_admin_edit_user.py +++ b/src/ui/widgets/widget_sources/admin_edit_user_ui.py @@ -1,12 +1,12 @@ # Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\widgets\widget_sources\admin_edit_user.ui' # -# Created by: PyQt6 UI code generator 6.7.1 +# Created by: PyQt6 UI code generator 6.8.0 # # 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 +from PyQt6 import QtCore, QtGui, QtWidgets class Ui_Dialog(object): @@ -28,9 +28,7 @@ class Ui_Dialog(object): self.user_edit_frame_new_password.setObjectName("user_edit_frame_new_password") self.gridLayout.addWidget(self.user_edit_frame_new_password, 1, 1, 1, 1) self.user_delete_frame_user_select = QtWidgets.QComboBox(parent=Dialog) - self.user_delete_frame_user_select.setObjectName( - "user_delete_frame_user_select" - ) + self.user_delete_frame_user_select.setObjectName("user_delete_frame_user_select") self.gridLayout.addWidget(self.user_delete_frame_user_select, 0, 1, 1, 1) self.label_2 = QtWidgets.QLabel(parent=Dialog) self.label_2.setObjectName("label_2") diff --git a/src/ui/widgets/widget_sources/Ui_calendar_entry.py b/src/ui/widgets/widget_sources/calendar_entry_ui.py similarity index 84% rename from src/ui/widgets/widget_sources/Ui_calendar_entry.py rename to src/ui/widgets/widget_sources/calendar_entry_ui.py index dda7e06..e5ea069 100644 --- a/src/ui/widgets/widget_sources/Ui_calendar_entry.py +++ b/src/ui/widgets/widget_sources/calendar_entry_ui.py @@ -1,12 +1,12 @@ # Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\widgets\widget_sources\calendar_entry.ui' # -# Created by: PyQt6 UI code generator 6.7.1 +# Created by: PyQt6 UI code generator 6.8.0 # # 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 +from PyQt6 import QtCore, QtGui, QtWidgets class Ui_Dialog(object): @@ -22,14 +22,10 @@ class Ui_Dialog(object): self.horizontalLayout.addWidget(self.label_14) self.line_app_info = QtWidgets.QLineEdit(parent=Dialog) self.line_app_info.setEnabled(True) - sizePolicy = QtWidgets.QSizePolicy( - QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed - ) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth( - self.line_app_info.sizePolicy().hasHeightForWidth() - ) + sizePolicy.setHeightForWidth(self.line_app_info.sizePolicy().hasHeightForWidth()) self.line_app_info.setSizePolicy(sizePolicy) self.line_app_info.setMaximumSize(QtCore.QSize(30, 16777215)) self.line_app_info.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) @@ -42,14 +38,10 @@ class Ui_Dialog(object): self.btn_delete_message.setObjectName("btn_delete_message") self.horizontalLayout.addWidget(self.btn_delete_message) self.spin_select_message = QtWidgets.QSpinBox(parent=Dialog) - sizePolicy = QtWidgets.QSizePolicy( - QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed - ) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth( - self.spin_select_message.sizePolicy().hasHeightForWidth() - ) + sizePolicy.setHeightForWidth(self.spin_select_message.sizePolicy().hasHeightForWidth()) self.spin_select_message.setSizePolicy(sizePolicy) self.spin_select_message.setMaximumSize(QtCore.QSize(500, 16777215)) self.spin_select_message.setMinimum(1) diff --git a/src/ui/widgets/widget_sources/Ui_elsa_maindialog.py b/src/ui/widgets/widget_sources/elsa_maindialog_ui.py similarity index 99% rename from src/ui/widgets/widget_sources/Ui_elsa_maindialog.py rename to src/ui/widgets/widget_sources/elsa_maindialog_ui.py index 4aa0a24..2822004 100644 --- a/src/ui/widgets/widget_sources/Ui_elsa_maindialog.py +++ b/src/ui/widgets/widget_sources/elsa_maindialog_ui.py @@ -1,12 +1,12 @@ # Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\widgets\widget_sources\elsa_maindialog.ui' # -# Created by: PyQt6 UI code generator 6.7.1 +# Created by: PyQt6 UI code generator 6.8.0 # # 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 +from PyQt6 import QtCore, QtGui, QtWidgets class Ui_Dialog(object): diff --git a/src/ui/widgets/widget_sources/Ui_icon_widget.py b/src/ui/widgets/widget_sources/icon_widget_ui.py similarity index 95% rename from src/ui/widgets/widget_sources/Ui_icon_widget.py rename to src/ui/widgets/widget_sources/icon_widget_ui.py index 04c9d61..82f9c01 100644 --- a/src/ui/widgets/widget_sources/Ui_icon_widget.py +++ b/src/ui/widgets/widget_sources/icon_widget_ui.py @@ -1,12 +1,12 @@ # Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\widgets\widget_sources\icon_widget.ui' # -# Created by: PyQt6 UI code generator 6.7.1 +# Created by: PyQt6 UI code generator 6.8.0 # # 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 +from PyQt6 import QtCore, QtGui, QtWidgets class Ui_Dialog(object): diff --git a/src/ui/widgets/widget_sources/search_statistic_page.ui b/src/ui/widgets/widget_sources/search_statistic_page.ui index e1e24db..5356983 100644 --- a/src/ui/widgets/widget_sources/search_statistic_page.ui +++ b/src/ui/widgets/widget_sources/search_statistic_page.ui @@ -209,17 +209,7 @@ - - - - - Signatur - - - seach_by_signature - - - + @@ -240,26 +230,6 @@ - - - - Suchen - - - - - - - Qt::ClickFocus - - - Trunkierung mit * am Ende unterstützt - - - true - - - @@ -273,6 +243,29 @@ + + + + Signatur + + + search_by_signature + + + + + + + Qt::ClickFocus + + + Trunkierung mit * am Ende unterstützt + + + true + + + @@ -372,12 +365,18 @@ QAbstractItemView::NoEditTriggers + + Qt::NoPen + true true + + true + @@ -532,9 +531,15 @@ 200 + + true + true + + false + Titel @@ -570,9 +575,8 @@ box_dauerapp btn_search book_search_result - seach_by_signature + search_by_signature search_by_title - book_search diff --git a/src/ui/widgets/widget_sources/Ui_search_statistic_page.py b/src/ui/widgets/widget_sources/search_statistic_page_ui.py similarity index 93% rename from src/ui/widgets/widget_sources/Ui_search_statistic_page.py rename to src/ui/widgets/widget_sources/search_statistic_page_ui.py index fb5958a..210d580 100644 --- a/src/ui/widgets/widget_sources/Ui_search_statistic_page.py +++ b/src/ui/widgets/widget_sources/search_statistic_page_ui.py @@ -1,12 +1,12 @@ # Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\widgets\widget_sources\search_statistic_page.ui' # -# Created by: PyQt6 UI code generator 6.7.1 +# Created by: PyQt6 UI code generator 6.9.0 # # 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 +from PyQt6 import QtCore, QtGui, QtWidgets class Ui_Dialog(object): @@ -102,9 +102,6 @@ class Ui_Dialog(object): self.horizontalLayout_3.setObjectName("horizontalLayout_3") self.gridLayout = QtWidgets.QGridLayout() self.gridLayout.setObjectName("gridLayout") - self.label_25 = QtWidgets.QLabel(parent=self.tab_4) - self.label_25.setObjectName("label_25") - self.gridLayout.addWidget(self.label_25, 0, 0, 1, 1) self.label_26 = QtWidgets.QLabel(parent=self.tab_4) self.label_26.setObjectName("label_26") self.gridLayout.addWidget(self.label_26, 1, 0, 1, 1) @@ -113,20 +110,16 @@ class Ui_Dialog(object): self.search_by_title.setClearButtonEnabled(True) self.search_by_title.setObjectName("search_by_title") self.gridLayout.addWidget(self.search_by_title, 1, 1, 1, 1) - self.book_search = QtWidgets.QPushButton(parent=self.tab_4) - self.book_search.setObjectName("book_search") - self.gridLayout.addWidget(self.book_search, 3, 0, 1, 1) - self.seach_by_signature = QtWidgets.QLineEdit(parent=self.tab_4) - self.seach_by_signature.setFocusPolicy(QtCore.Qt.FocusPolicy.ClickFocus) - self.seach_by_signature.setClearButtonEnabled(True) - self.seach_by_signature.setObjectName("seach_by_signature") - self.gridLayout.addWidget(self.seach_by_signature, 0, 1, 1, 1) spacerItem2 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) self.gridLayout.addItem(spacerItem2, 2, 0, 1, 1) - self.gridLayout.setRowMinimumHeight(0, 1) - self.gridLayout.setRowMinimumHeight(1, 1) - self.gridLayout.setRowMinimumHeight(2, 1) - self.gridLayout.setRowMinimumHeight(3, 1) + self.label_25 = QtWidgets.QLabel(parent=self.tab_4) + self.label_25.setObjectName("label_25") + self.gridLayout.addWidget(self.label_25, 0, 0, 1, 1) + self.search_by_signature = QtWidgets.QLineEdit(parent=self.tab_4) + self.search_by_signature.setFocusPolicy(QtCore.Qt.FocusPolicy.ClickFocus) + self.search_by_signature.setClearButtonEnabled(True) + self.search_by_signature.setObjectName("search_by_signature") + self.gridLayout.addWidget(self.search_by_signature, 0, 1, 1, 1) self.horizontalLayout_3.addLayout(self.gridLayout) spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) self.horizontalLayout_3.addItem(spacerItem3) @@ -175,6 +168,7 @@ class Ui_Dialog(object): self.tableWidget.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) self.tableWidget.setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.CustomContextMenu) self.tableWidget.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers) + self.tableWidget.setGridStyle(QtCore.Qt.PenStyle.NoPen) self.tableWidget.setObjectName("tableWidget") self.tableWidget.setColumnCount(5) self.tableWidget.setRowCount(0) @@ -189,6 +183,7 @@ class Ui_Dialog(object): item = QtWidgets.QTableWidgetItem() self.tableWidget.setHorizontalHeaderItem(4, item) self.tableWidget.horizontalHeader().setStretchLastSection(True) + self.tableWidget.verticalHeader().setSortIndicatorShown(True) self.verticalLayout_4.addWidget(self.tableWidget) self.verticalLayout_6.addLayout(self.verticalLayout_4) self.horizontalLayout.addWidget(self.app_results) @@ -264,7 +259,9 @@ class Ui_Dialog(object): self.book_search_result.horizontalHeader().setCascadingSectionResizes(True) self.book_search_result.horizontalHeader().setDefaultSectionSize(200) self.book_search_result.horizontalHeader().setMinimumSectionSize(100) + self.book_search_result.horizontalHeader().setSortIndicatorShown(True) self.book_search_result.horizontalHeader().setStretchLastSection(True) + self.book_search_result.verticalHeader().setSortIndicatorShown(False) self.verticalLayout_2.addWidget(self.book_search_result) self.stackedWidget_4.addWidget(self.bookresult) self.verticalLayout_3.addWidget(self.stackedWidget_4) @@ -276,8 +273,8 @@ class Ui_Dialog(object): self.label_17.setBuddy(self.box_semester) self.label_19.setBuddy(self.box_erstellsemester) self.label_16.setBuddy(self.box_fach) - self.label_25.setBuddy(self.seach_by_signature) self.label_26.setBuddy(self.search_by_title) + self.label_25.setBuddy(self.search_by_signature) self.retranslateUi(Dialog) self.tabWidget_2.setCurrentIndex(0) @@ -292,9 +289,8 @@ class Ui_Dialog(object): Dialog.setTabOrder(self.box_erstellsemester, self.box_dauerapp) Dialog.setTabOrder(self.box_dauerapp, self.btn_search) Dialog.setTabOrder(self.btn_search, self.book_search_result) - Dialog.setTabOrder(self.book_search_result, self.seach_by_signature) - Dialog.setTabOrder(self.seach_by_signature, self.search_by_title) - Dialog.setTabOrder(self.search_by_title, self.book_search) + Dialog.setTabOrder(self.book_search_result, self.search_by_signature) + Dialog.setTabOrder(self.search_by_signature, self.search_by_title) def retranslateUi(self, Dialog): _translate = QtCore.QCoreApplication.translate @@ -308,10 +304,9 @@ class Ui_Dialog(object): self.label_16.setText(_translate("Dialog", "Fach:")) self.btn_search.setText(_translate("Dialog", "Suchen")) self.tabWidget_2.setTabText(self.tabWidget_2.indexOf(self.tab_3), _translate("Dialog", "Statistik")) - self.label_25.setText(_translate("Dialog", "Signatur")) self.label_26.setText(_translate("Dialog", "Titel")) - self.book_search.setText(_translate("Dialog", "Suchen")) - self.seach_by_signature.setStatusTip(_translate("Dialog", "Trunkierung mit * am Ende unterstützt")) + self.label_25.setText(_translate("Dialog", "Signatur")) + self.search_by_signature.setStatusTip(_translate("Dialog", "Trunkierung mit * am Ende unterstützt")) self.tabWidget_2.setTabText(self.tabWidget_2.indexOf(self.tab_4), _translate("Dialog", "Suchen")) self.btn_del_select_apparats.setText(_translate("Dialog", "Ausgewählte Löschen")) self.btn_notify_for_deletion.setStatusTip(_translate("Dialog", "Zeigt für jeden ausgewählten Apparat eine eMail-Vorlage an")) diff --git a/src/utils/__init__.py b/src/utils/__init__.py index c6d5f16..0eafea8 100644 --- a/src/utils/__init__.py +++ b/src/utils/__init__.py @@ -1,5 +1,3 @@ -from .blob import create_blob from .icon import Icon -from .pickles import dump_pickle, load_pickle from .sortgenerator import app_sort, name_sort from .richtext import SemesterDocument diff --git a/src/utils/blob.py b/src/utils/blob.py index c28636a..f2c8070 100644 --- a/src/utils/blob.py +++ b/src/utils/blob.py @@ -1,4 +1,4 @@ -def create_blob(file): +def create_blob(file: str): """ Creates a blob from a file. """ diff --git a/src/utils/docs_ui.py b/src/utils/docs_ui.py index a29295c..3e11e63 100644 --- a/src/utils/docs_ui.py +++ b/src/utils/docs_ui.py @@ -1,45 +1,30 @@ -# -*- coding: utf-8 -*- +# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\utils\docs.ui' +# +# Created by: PyQt6 UI code generator 6.8.0 +# +# 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. -################################################################################ -## Form generated from reading UI file 'docs.ui' -## -## Created by: Qt User Interface Compiler version 6.6.2 -## -## WARNING! All changes made in this file will be lost when recompiling UI file! -################################################################################ -from PyQt6.QtCore import ( - QCoreApplication, - QMetaObject, -) -from PyQt6.QtWidgets import ( - QGridLayout, - QTabWidget, -) +from PyQt6 import QtCore, QtGui, QtWidgets class Ui_Dialog(object): def setupUi(self, Dialog): - Dialog.setObjectName("Dokumentation") + Dialog.setObjectName("Dialog") Dialog.resize(800, 600) - self.gridLayout_2 = QGridLayout(Dialog) + self.gridLayout_2 = QtWidgets.QGridLayout(Dialog) self.gridLayout_2.setObjectName("gridLayout_2") - self.gridLayout = QGridLayout() + self.gridLayout = QtWidgets.QGridLayout() self.gridLayout.setObjectName("gridLayout") - self.tabs = QTabWidget(Dialog) + self.tabs = QtWidgets.QTabWidget(parent=Dialog) self.tabs.setObjectName("tabs") - self.gridLayout.addWidget(self.tabs, 0, 0, 1, 1) - self.gridLayout_2.addLayout(self.gridLayout, 0, 0, 1, 1) self.retranslateUi(Dialog) - - QMetaObject.connectSlotsByName(Dialog) - - # setupUi + QtCore.QMetaObject.connectSlotsByName(Dialog) def retranslateUi(self, Dialog): - Dialog.setWindowTitle(QCoreApplication.translate("Dialog", "Dialog", None)) - - # retranslateUi + _translate = QtCore.QCoreApplication.translate + Dialog.setWindowTitle(_translate("Dialog", "Dialog")) diff --git a/src/utils/pickles.py b/src/utils/pickles.py index cb5a84f..e943a0d 100644 --- a/src/utils/pickles.py +++ b/src/utils/pickles.py @@ -1,9 +1,10 @@ import pickle +from typing import Any -def load_pickle(data): +def load_pickle(data: Any): return pickle.loads(data) -def dump_pickle(data): +def dump_pickle(data: Any): return pickle.dumps(data) diff --git a/src/utils/richtext.py b/src/utils/richtext.py index ccc3a97..ff2b005 100644 --- a/src/utils/richtext.py +++ b/src/utils/richtext.py @@ -6,35 +6,116 @@ from docx.oxml import OxmlElement from docx.oxml.ns import qn import os from os.path import basename +from loguru import logger as log +import sys +from src import settings + + +logger = log +logger.remove() +logger.add("logs/application.log", rotation="1 week", retention="1 month", enqueue=True) +log.add( + f"logs/{datetime.now().strftime('%Y-%m-%d')}.log", + rotation="1 day", + compression="zip", +) + +# logger.add(sys.stderr, format="{time} {level} {message}", level="INFO") +logger.add(sys.stdout) + +font = "Cascadia Mono" + + +def print_document(file: str): + # send document to printer as attachment of email + import smtplib + from email.mime.multipart import MIMEMultipart + from email.mime.application import MIMEApplication + from email.mime.text import MIMEText + + smtp = settings.mail.smtp_server + port = settings.mail.port + sender_email = settings.mail.sender + password = settings.mail.password + receiver = settings.mail.printer_mail + message = MIMEMultipart() + message["From"] = sender_email + message["To"] = receiver + message["cc"] = settings.mail.sender + message["Subject"] = "." + mail_body = "." + message.attach(MIMEText(mail_body, "html")) + with open(file, "rb") as fil: + part = MIMEApplication(fil.read(), Name=basename(file)) + # After the file is closed + part["Content-Disposition"] = 'attachment; filename="%s"' % basename(file) + message.attach(part) + mail = message.as_string() + with smtplib.SMTP_SSL(smtp, port) as server: + server.connect(smtp, port) + server.login(settings.mail.user_name, password) + server.sendmail(sender_email, receiver, mail) + server.quit() + log.success("Mail sent") + + +class SemesterError(Exception): + """Custom exception for semester-related errors.""" + + def __init__(self, message: str): + super().__init__(message) + log.error(message) + + def __str__(self): + return f"SemesterError: {self.args[0]}" class SemesterDocument: - def __init__(self, apparats: list[tuple[int, str]], semester: str, filename): - assert isinstance(apparats, list), "Apparats must be a list of tuples" - assert all(isinstance(apparat, tuple) for apparat in apparats), ( + def __init__( + self, + apparats: list[tuple[int, str]], + semester: str, + filename: str, + full: bool = False, + ): + assert isinstance(apparats, list), SemesterError( "Apparats must be a list of tuples" ) - assert all(isinstance(apparat[0], int) for apparat in apparats), ( + assert all(isinstance(apparat, tuple) for apparat in apparats), SemesterError( + "Apparats must be a list of tuples" + ) + assert all(isinstance(apparat[0], int) for apparat in apparats), SemesterError( "Apparat numbers must be integers" ) - assert all(isinstance(apparat[1], str) for apparat in apparats), ( + assert all(isinstance(apparat[1], str) for apparat in apparats), SemesterError( "Apparat names must be strings" ) - assert isinstance(semester, str), "Semester must be a string" - assert "." not in filename and isinstance(filename, str), ( + assert isinstance(semester, str), SemesterError("Semester must be a string") + assert "." not in filename and isinstance(filename, str), SemesterError( "Filename must be a string and not contain an extension" ) self.doc = Document() self.apparats = apparats self.semester = semester - self.table_font = "Arial" - self.header_font = "Times New Roman" + self.table_font_normal = font + self.table_font_bold = font + self.header_font = font self.header_font_size = Pt(26) self.sub_header_font_size = Pt(18) self.table_font_size = Pt(10) self.color_red = RGBColor(255, 0, 0) self.color_blue = RGBColor(0, 0, 255) self.filename = filename + if full: + log.info("Full document generation") + self.cleanup + log.info("Cleanup done") + self.make_document() + log.info("Document created") + self.create_pdf() + log.info("PDF created") + print_document(self.filename + ".pdf") + log.info("Document printed") def set_table_border(self, table): """ @@ -65,7 +146,7 @@ class SemesterDocument: table.alignment = WD_PARAGRAPH_ALIGNMENT.CENTER # Set column widths by directly modifying the cell properties - widths = [Cm(1.19), Cm(10.39)] + widths = [Cm(1.19), Cm(10)] for col_idx, width in enumerate(widths): for cell in table.columns[col_idx].cells: cell_width_element = cell._element.xpath(".//w:tcPr")[0] @@ -91,7 +172,7 @@ class SemesterDocument: # Set font for the first column (number) cell_number_paragraph = row.cells[0].paragraphs[0] cell_number_run = cell_number_paragraph.add_run(str(number)) - cell_number_run.font.name = self.table_font + cell_number_run.font.name = self.table_font_bold cell_number_run.font.size = self.table_font_size cell_number_run.font.bold = True cell_number_run.font.color.rgb = self.color_red @@ -104,13 +185,13 @@ class SemesterDocument: # Add the first word in bold bold_run = cell_name_paragraph.add_run(words[0]) bold_run.font.bold = True - bold_run.font.name = self.table_font + bold_run.font.name = self.table_font_bold bold_run.font.size = self.table_font_size # Add the rest of the words normally if len(words) > 1: normal_run = cell_name_paragraph.add_run(" " + " ".join(words[1:])) - normal_run.font.name = self.table_font + normal_run.font.name = self.table_font_normal normal_run.font.size = self.table_font_size cell_name_paragraph.alignment = WD_PARAGRAPH_ALIGNMENT.LEFT @@ -153,42 +234,6 @@ class SemesterDocument: def save_document(self, name): # Save the document self.doc.save(name) - print(f"Document saved as {name}") - - def print_document(self): - # send document to printer as attachment of email - import smtplib - from email.mime.multipart import MIMEMultipart - from email.mime.application import MIMEApplication - from email.mime.text import MIMEText - from src import settings as config - - smtp = config.mail.smtp_server - port = config.mail.port - sender_email = config.mail.sender - password = config.mail.password - receiver = "mobileprint@ph-freiburg.de" - message = MIMEMultipart() - message["From"] = sender_email - message["To"] = receiver - message["cc"] = config.mail.sender - message["Subject"] = "." - mail_body = "." - message.attach(MIMEText(mail_body, "html")) - with open(self.filename + ".pdf", "rb") as fil: - part = MIMEApplication(fil.read(), Name=basename(self.filename + "pdf")) - # After the file is closed - part["Content-Disposition"] = 'attachment; filename="%s"' % basename( - self.filename + ".pdf" - ) - message.attach(part) - mail = message.as_string() - with smtplib.SMTP_SSL(smtp, port) as server: - server.connect(smtp, port) - server.login(config.mail.user_name, password) - server.sendmail(sender_email, receiver, mail) - server.quit() - print("Mail sent") def create_pdf(self): # Save the document @@ -202,30 +247,135 @@ class SemesterDocument: doc.SaveAs(f"{curdir}/{self.filename}.pdf", FileFormat=17) doc.Close() word.Quit() - print("PDF saved") + log.debug("PDF saved") + + @property + def cleanup(self): + if os.path.exists(f"{self.filename}.docx"): + os.remove(f"{self.filename}.docx") + os.remove(f"{self.filename}.pdf") + + @property + def send(self): + print_document(self.filename + ".pdf") + log.debug("Document sent to printer") + + +class SemapSchilder: + def __init__(self, entries: list[str]): + self.entries = entries + self.filename = "Schilder" + self.font_size = Pt(23) + self.font_name = font + self.doc = Document() + self.define_doc_properties() + self.add_entries() + self.cleanup() + self.create_pdf() + + def define_doc_properties(self): + # set the doc to have a top margin of 1cm, left and right are 0.5cm, bottom is 0cm + section = self.doc.sections[0] + section.top_margin = Cm(1) + section.bottom_margin = Cm(0) + section.left_margin = Cm(0.5) + section.right_margin = Cm(0.5) + + # set the font to Times New Roman, size 23 bold, color black + for paragraph in self.doc.paragraphs: + for run in paragraph.runs: + run.font.name = self.font_name + run.font.size = self.font_size + run.font.bold = True + run.font.color.rgb = RGBColor(0, 0, 0) + paragraph.alignment = WD_PARAGRAPH_ALIGNMENT.CENTER + + # if the length of the text is + + def add_entries(self): + for entry in self.entries: + paragraph = self.doc.add_paragraph(entry) + paragraph.alignment = WD_PARAGRAPH_ALIGNMENT.CENTER + paragraph.paragraph_format.line_spacing = Pt(23) # Set fixed line spacing + paragraph.paragraph_format.space_before = Pt(2) # Remove spacing before + paragraph.paragraph_format.space_after = Pt(2) # Remove spacing after + + run = paragraph.runs[0] + run.font.name = self.font_name + run.font.size = self.font_size + run.font.bold = True + run.font.color.rgb = RGBColor(0, 0, 0) + + # Add a line to be used as a guideline for cutting + line = self.doc.add_paragraph() + line.alignment = WD_PARAGRAPH_ALIGNMENT.CENTER + line.paragraph_format.line_spacing = Pt(23) # Match line spacing + line.paragraph_format.space_before = Pt(2) # Remove spacing before + line.paragraph_format.space_after = Pt(2) # Remove spacing after + line.add_run("--------------------------") + + def save_document(self): + # Save the document + self.doc.save(f"{self.filename}.docx") + log.debug(f"Document saved as {self.filename}.docx") + + def create_pdf(self): + # Save the document + import comtypes.client + + word = comtypes.client.CreateObject("Word.Application") + self.save_document() + docpath = os.path.abspath(f"{self.filename}.docx") + doc = word.Documents.Open(docpath) + curdir = os.getcwd() + doc.SaveAs(f"{curdir}/{self.filename}.pdf", FileFormat=17) + doc.Close() + word.Quit() + log.debug("PDF saved") def cleanup(self): - os.remove(f"{self.filename}.docx") - os.remove(f"{self.filename}.pdf") + if os.path.exists(f"{self.filename}.docx"): + os.remove(f"{self.filename}.docx") + if os.path.exists(f"{self.filename}.pdf"): + os.remove(f"{self.filename}.pdf") + + @property + def send(self): + print_document(self.filename + ".pdf") + log.debug("Document sent to printer") if __name__ == "__main__": - apparat = [(i, f"Item {i}") for i in range(405, 438)] - doc = SemesterDocument( - apparat, - "WiSe 24/25", - "semap", - ) - doc.make_document() - doc.create_pdf() - # doc.print_document() - - -# def printers(): -# printers = win32print.EnumPrinters( -# win32print.PRINTER_ENUM_LOCAL | win32print.PRINTER_ENUM_CONNECTIONS -# ) -# for i, printer in enumerate(printers): -# print(f"{i}: {printer[2]}") - -# list printers + entries = [ + "Lüsebrink (Theorie und Praxis der Leichtathletik)", + "Kulovics (ISP-Betreuung)", + "Köhler (Ausgewählte Aspekte der materiellen Kultur Textil)", + "Grau (Young Adult Literature)", + "Schiebel (Bewegung II:Ausgewählte Problemfelder)", + "Schiebel (Ernährungswiss. Perspektive)", + "Park (Kommunikation und Kooperation)", + "Schiebel (Schwimmen)", + "Huppertz (Philosophieren mit Kindern)", + "Heyl (Heyl)", + "Reuter (Verschiedene Veranstaltungen)", + "Reinhold (Arithmetik und mathematisches Denken)", + "Wirtz (Forschungsmethoden)", + "Schleider (Essstörungen)", + "Schleider (Klinische Psychologie)", + "Schleider (Doktorandenkolloquium)", + "Schleider (Störungen Sozialverhaltens/Delinquenz)", + "Burth (EU Forschung im Int. Vergleich/EU Gegenstand biling. Didaktik)", + "Reinhardt (Einführung Politikdidaktik)", + "Schleider (Psychologische Interventionsmethoden)", + "Schleider (ADHS)", + "Schleider (Beratung und Teamarbeit)", + "Schleider (LRS)", + "Schleider (Gesundheitspsychologie)", + "Schleider (Elterntraining)", + "Wulff (Hochschulzertifikat DaZ)", + "Dinkelaker ( )", + "Droll (Einführung in die Sprachwissenschaft)", + "Karoß (Gymnastik - Sich Bewegen mit und ohne Handgeräte)", + "Sahrai (Kindheit und Gesellschaft)", + ] + doc = SemapSchilder(entries) \ No newline at end of file