From 6d1119783fc3da1aa9ad63128db4b350e3ff6907 Mon Sep 17 00:00:00 2001 From: WorldTeacher <41587052+WorldTeacher@users.noreply.github.com> Date: Mon, 19 Feb 2024 18:12:19 +0100 Subject: [PATCH] add wfh files --- .trunk/trunk.yaml | 2 +- docs/database.html | 4266 +++++++++++++++++++++++++++++++ docs/db.html | 132 + src/backend/admin_console.py | 63 +- src/backend/database.py | 431 +++- src/logic/userInterface.py | 12 +- src/ui/Ui_semesterapparat_ui.py | 306 +-- src/ui/resources_rc.py | 155 ++ src/ui/semesterapparat_ui.ui | 18 +- src/ui/semesterapparat_ui_ui.py | 2596 ++++++++++--------- src/ui/widgets/webview.ui | 54 + src/ui/widgets/webview_ui.py | 37 + src/utils/documentationview.py | 37 + 13 files changed, 6618 insertions(+), 1491 deletions(-) create mode 100644 docs/database.html create mode 100644 docs/db.html create mode 100644 src/ui/resources_rc.py create mode 100644 src/ui/widgets/webview.ui create mode 100644 src/ui/widgets/webview_ui.py create mode 100644 src/utils/documentationview.py diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index a21366c..05fcfa9 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -33,7 +33,7 @@ lint: - bandit@1.7.7 - markdownlint@0.39.0 - yamllint@1.34.0 - - black@24.1.1 + - black@24.2.0 actions: disabled: - trunk-fmt-pre-commit diff --git a/docs/database.html b/docs/database.html new file mode 100644 index 0000000..7be3ffd --- /dev/null +++ b/docs/database.html @@ -0,0 +1,4266 @@ + + + + + + +database API documentation + + + + + + + + + + + +
+
+
+

Module database

+
+
+
+ +Expand source code + +
import datetime
+import os
+import re
+import sqlite3 as sql
+import tempfile
+from src.logic.log import MyLogger
+from icecream import ic
+from typing import List, Tuple, Dict, Any, Optional, Union
+from pathlib import Path
+from omegaconf import OmegaConf
+from src.backend.db import CREATE_TABLE_APPARAT, CREATE_TABLE_MESSAGES, CREATE_TABLE_MEDIA, CREATE_TABLE_APPKONTOS, CREATE_TABLE_FILES, CREATE_TABLE_PROF, CREATE_TABLE_USER, CREATE_TABLE_SUBJECTS
+from src.logic.constants import SEMAP_MEDIA_ACCOUNTS
+from src.logic.dataclass import ApparatData, BookData
+from src.errors import NoResultError, AppPresentError
+from src.utils import load_pickle, dump_pickle,create_blob
+config = OmegaConf.load("config.yaml")
+logger = MyLogger(__name__)
+
+
+class Database:
+    """
+    Initialize the database and create the tables if they do not exist.
+    """
+    def __init__(self, db_path: str = None):
+        """
+        Default constructor for the database class
+
+        Args:
+            db_path (str, optional): Optional Path for testing / specific purposes. Defaults to None.
+        """
+        if db_path is None:
+            self.db_path = config.database.path + config.database.name
+            self.db_path = self.db_path.replace("~", str(Path.home()))
+        else:
+            self.db_path = db_path
+        if self.get_db_contents() is None:
+            logger.log_critical("Database does not exist, creating tables")
+            self.create_tables()
+    def get_db_contents(self)->Union[List[Tuple], None]:
+        """
+        Get the contents of the 
+
+        Returns:
+            Union[List[Tuple], None]: _description_
+        """
+        try:
+            with sql.connect(self.db_path) as conn:
+                cursor = conn.cursor()
+                cursor.execute("SELECT * FROM sqlite_master WHERE type='table'")
+                return cursor.fetchall()
+        except sql.OperationalError:
+            return None
+    def connect(self)->sql.Connection:
+        """
+        Connect to the database
+
+        Returns:
+            sql.Connection: The active connection to the database
+        """
+        return sql.connect(self.db_path)
+    def close_connection(self, conn: sql.Connection):
+        """
+        closes the connection to the database
+        
+        Args:
+        ----
+            - conn (sql.Connection): the connection to be closed
+        """
+        conn.close()
+    def create_tables(self):
+        """
+        Create the tables in the database
+        """
+        conn = self.connect()
+        cursor = conn.cursor()
+        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)
+        cursor.execute(CREATE_TABLE_SUBJECTS)
+        conn.commit()
+        self.close_connection(conn)
+    def insertInto(self, query:str, params:Tuple) -> None:
+        """
+        Insert sent data into the database
+
+        Args:
+            query (str): The query to be executed
+            params (Tuple): the parameters to be inserted into the database
+        """
+        conn = self.connect()
+        cursor = conn.cursor()
+        logger.log_info(f"Inserting {params} into database with query {query}")
+        cursor.execute(query, params)
+        conn.commit()
+        self.close_connection(conn)
+    def query_db(self, query: str, args: Tuple = (), one: bool = False)->Union[Tuple, List[Tuple]]:
+        """
+        Query the Database for the sent query.
+
+        Args:
+            query (str): The query to be executed
+            args (Tuple, optional): The arguments for the query. Defaults to ().
+            one (bool, optional): Return the first result only. Defaults to False.
+
+        Returns:
+            Union[Typle|List[Tuple]]: Returns the result of the query
+        """
+        conn = self.connect()
+        cursor = conn.cursor()
+        logger.log_info(f"Querying database with query {query}, args: {args}")
+        cursor.execute(query, args)
+        rv = cursor.fetchall()
+        conn.commit()
+        self.close_connection(conn)
+        return (rv[0] if rv else None) if one else rv
+
+    # Books
+    def addBookToDatabase(self, bookdata:BookData,app_id:Union[str,int], prof_id:Union[str,int]):
+        """
+        Add books to the database. Both app_id and prof_id are required to add the book to the database, as the app_id and prof_id are used to select the books later on.
+
+        Args:
+            bookdata (BookData): The metadata of the book to be added
+            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.
+        """
+        conn = self.connect()
+        cursor = conn.cursor()
+        t_query = (
+            f"SELECT bookdata FROM media WHERE app_id={app_id} AND prof_id={prof_id}"
+        )
+        # print(t_query)
+        result = cursor.execute(t_query).fetchall()
+        result = [load_pickle(i[0]) for i in result]
+        if bookdata in result:
+            print("Bookdata already in database")
+            # check if the book was deleted in the apparat
+            query = (
+                "SELECT deleted FROM media WHERE app_id=? AND prof_id=? AND bookdata=?"
+            )
+            params = (app_id, prof_id, dump_pickle(bookdata))
+            result = cursor.execute(query, params).fetchone()
+            if result[0] == 1:
+                print("Book was deleted, updating bookdata")
+                query = "UPDATE media SET deleted=0 WHERE app_id=? AND prof_id=? AND bookdata=?"
+                params = (app_id, prof_id, dump_pickle(bookdata))
+                cursor.execute(query, params)
+                conn.commit()
+            return
+
+        query = (
+            "INSERT INTO media (bookdata, app_id, prof_id,deleted) VALUES (?, ?, ?,?)"
+        )
+        converted = dump_pickle(bookdata)
+        params = (converted, app_id, prof_id, 0)
+        cursor.execute(query, params)
+        conn.commit()
+        self.close_connection(conn)
+    def getBookIdBasedOnSignature(self, app_id:Union[str,int], prof_id:Union[str,int],signature:str)->int:
+        """
+        Get a book id based on the signature of the book.
+
+        Args:
+            app_id (str): The apparat id the book should be associated with
+            prof_id (str): The professor id the book should be associated with
+            signature (str): The signature of the book
+
+        Returns:
+            int: The id of the book
+        """
+        result = self.query_db("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]
+        book = [i for i in books if i[0].signature == signature][0][1]
+        return book
+    def getBookBasedOnSignature(self, app_id:Union[str,int], prof_id:Union[str,int],signature:str)->BookData:
+        """
+        Get the book based on the signature of the book.
+
+        Args:
+            app_id (str): The apparat id the book should be associated with
+            prof_id (str): The professor id the book should be associated with
+            signature (str): The signature of the book
+
+        Returns:
+            BookData: The total metadata of the book wrapped in a BookData object
+        """
+        result = self.query_db("SELECT bookdata FROM media WHERE app_id=? AND prof_id=?", (app_id,prof_id))
+        books = [load_pickle(i[0]) for i in result]
+        book = [i for i in books if i.signature == signature][0]
+        return book
+    def getLastBookId(self)->int:
+        """
+        Get the last book id in the database
+
+        Returns:
+            int: ID of the last book in the database
+        """
+        return self.query_db("SELECT id FROM media ORDER BY id DESC", one=True)[0]
+    def searchBook(self, data:dict[str, str])->list[tuple[BookData, int]]:
+        """
+        Search a book in the database based on the sent data.
+
+        Args:
+            data (dict[str, str]): A dictionary containing the data to be searched for. The dictionary can contain the following: 
+            - signature: The signature of the book
+            - title: The title of the book
+
+        Returns:
+            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")
+        ic(rdata, len(rdata))
+        mode = 0
+        if len(data)== 1:
+            if "signature" in data.keys():
+                mode = 1
+            elif "title" in data.keys():
+                mode = 2
+        elif len(data) == 2:
+            mode = 3
+        else:
+            return None
+        ret = []
+        for book in rdata:
+            bookdata = load_pickle(book[1])
+            app_id = book[2]
+            prof_id = book[3]
+            if mode == 1:
+                if data["signature"] in bookdata.signature:
+                    ret.append((bookdata,app_id,prof_id))
+            elif mode == 2:
+                if data["title"] in bookdata.title:
+                    ret.append((bookdata,app_id,prof_id))
+            elif mode == 3:
+                if data["signature"] in bookdata.signature and data["title"] in bookdata.title:
+                    ret.append((bookdata,app_id,prof_id))
+        ic(ret)
+        return ret
+    def setAvailability(self, book_id:str, available:str):
+        """
+        Set the availability of a book in the database
+
+        Args:
+            book_id (str): The id of the book
+            available (str): The availability of the book
+        """
+        self.query_db("UPDATE media SET available=? WHERE id=?", (available,book_id))
+    def getBookId(self, bookdata:BookData, app_id:Union[str,int], prof_id:Union[str,int])->int:
+        """
+        Get the id of a book based on the metadata of the book
+
+        Args:
+            bookdata (BookData): The wrapped metadata of the book
+            app_id (str): The apparat id the book should be associated with
+            prof_id (str): The professor id the book should be associated with
+
+        Returns:
+            int: ID of the book
+        """
+        result = self.query_db("SELECT id FROM media WHERE bookdata=? AND app_id=? AND prof_id=?", (dump_pickle(bookdata),app_id,prof_id), one=True)
+        return result[0]
+    def getBook(self,book_id:int)->BookData:
+        """
+        Get the book based on the id in the database
+
+        Args:
+            book_id (int): The id of the book
+
+        Returns:
+            BookData: The metadata of the book wrapped in a BookData object
+        """
+        return load_pickle(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]]:
+        """
+        Get the Books based on the apparat id and the professor id
+
+        Args:
+            app_id (str): The ID of the apparat
+            prof_id (str): The ID of the professor
+            deleted (int, optional): The state of the book. Set to 1 to include deleted ones. Defaults to 0.
+
+        Returns:
+            list[dict[int, BookData, int]]: A list of dictionaries containing the id, the metadata of the book and the availability of the book
+        """
+        qdata = self.query_db(f"SELECT id,bookdata,available FROM media WHERE (app_id={app_id} AND prof_id={prof_id}) AND (deleted={deleted if deleted == 0 else '1 OR deleted=0'})")
+        ret_result = []
+        for result_a in qdata:
+            data = {"id": int, "bookdata": BookData, "available": int}
+            data["id"] = result_a[0]
+            data["bookdata"] = load_pickle(result_a[1])
+            data["available"] = result_a[2]
+            ret_result.append(data)
+        return ret_result
+    def updateBookdata(self, book_id, bookdata:BookData):
+        """
+        Update the bookdata in the database
+
+        Args:
+            book_id (str): The id of the book
+            bookdata (BookData): The new metadata of the book
+        """
+        self.query_db("UPDATE media SET bookdata=? WHERE id=?", (dump_pickle(bookdata),book_id))
+    def deleteBook(self, book_id):
+        """
+        Delete a book from the database
+
+        Args:
+            book_id (str): ID of the book
+        """
+        self.query_db("UPDATE media SET deleted=1 WHERE id=?", (book_id,))
+
+    # File Interactions
+    def getBlob(self, filename, app_id:Union[str,int]):
+        """
+        Get a blob from the database
+
+        Args:
+            filename (str): The name of the file
+            app_id (str): ID of the apparat
+
+        Returns:
+            bytes: The file stored in 
+        """
+        return self.query_db("SELECT fileblob FROM files WHERE filename=? AND app_id=?", (filename,app_id), one=True)[0]
+    def insertFile(self, file: list[dict], app_id:Union[str,int], prof_id:Union[str,int]):
+        """Instert a list of files into the database
+
+        Args:
+            file (list[dict]): a list containing all the files to be inserted
+            Structured: [{"name": "filename", "path": "path", "type": "filetype"}]
+            app_id (int): the id of the apparat
+            prof_id (str): the id of the professor
+        """
+        for f in file:
+            filename = f["name"]
+            path = f["path"]
+            filetyp = f["type"]
+            if path == "Database":
+                continue
+            blob = create_blob(path)
+            query = "INSERT OR IGNORE INTO files (filename, fileblob, app_id, filetyp,prof_id) VALUES (?, ?, ?, ?,?)"
+            self.query_db(query, (filename, blob, app_id, filetyp,prof_id))
+    def recreateFile(self, filename:str, app_id:Union[str,int],filetype:str)->str:
+        """Recreate a file from the database
+
+        Args:
+            filename (str): the name of the file
+            app_id (Union[str,int]): the id of the apparat
+            filetype (str): the extension of the file to be created
+
+        Returns:
+            str: The filename of the recreated file 
+        """
+        blob = self.getBlob(filename, app_id)
+        tempdir = config.database.tempdir
+        tempdir = tempdir.replace("~", str(Path.home()))
+        tempdir_path = Path(tempdir)        
+        if not os.path.exists(tempdir_path):
+            os.mkdir(tempdir_path)
+        file = tempfile.NamedTemporaryFile(
+            delete=False, dir=tempdir_path, mode="wb", suffix=f".{filetype}"
+        )
+        file.write(blob)
+        print("file created")
+        return file.name
+    def getFiles(self, app_id:Union[str,int], prof_id:int)->list[tuple]:
+        """Get all the files associated with the apparat and the professor
+
+        Args:
+            app_id (Union[str,int]): The id of the apparat
+            prof_id (Union[str,int]): the id of the professor
+
+        Returns:
+            list[tuple]: a list of tuples containing the filename and the filetype for the corresponding apparat and professor
+        """
+        return self.query_db("SELECT filename, filetyp FROM files WHERE app_id=? AND prof_id=?", (app_id,prof_id))
+
+    def getSemersters(self)->list[str]:
+        """Return all the unique semesters in the database
+
+        Returns:
+            list: a list of strings containing the semesters
+        """
+        data = self.query_db("SELECT DISTINCT erstellsemester FROM semesterapparat")
+        return [i[0] for i in data]
+
+    def getSubjects(self):
+        """Get all the subjects in the database
+
+        Returns:
+            list[tuple]: a list of tuples containing the subjects
+        """
+        return self.query_db("SELECT * FROM subjects")
+
+    # Messages
+    def addMessage(self, message:dict,user:str, app_id:Union[str,int]):
+        """add a Message to the database
+
+        Args:
+            message (dict): the message to be added
+            user (str): the user who added the message
+            app_id (Union[str,int]): the id of the apparat
+        """
+        def __getUserId(user):
+            return self.query_db("SELECT id FROM user WHERE username=?", (user,), one=True)[0]
+        user_id = __getUserId(user)
+        self.query_db("INSERT INTO messages (message, user_id, remind_at,appnr) VALUES (?,?,?,?)", (message["message"],user_id,message["remind_at"],app_id))
+    def getMessages(self, date:str)->list[dict[str, str, str, str]]:
+        """Get all the messages for a specific date
+
+        Args:
+            date (str): a date.datetime object formatted as a string in the format "YYYY-MM-DD"
+        
+        Returns:
+            list[dict[str, str, str, str]]: a list of dictionaries containing the message, the user who added the message, the apparat id and the id of the message
+        """
+        def __get_user_name(user_id):
+            return self.query_db("SELECT username FROM user WHERE id=?", (user_id,), one=True)[0]
+        messages = self.query_db("SELECT * FROM messages WHERE remind_at=?", (date,))
+        ret = [
+            {
+                "message": i[2],
+                "user": __get_user_name(i[4]),
+                "appnr": i[5],
+                "id": i[0]
+            }
+            for i in messages
+        ]
+        return ret
+    def deleteMessage(self, message_id):
+        """Delete a message from the database
+
+        Args:
+            message_id (str): the id of the message
+        """
+        self.query_db("DELETE FROM messages WHERE id=?", (message_id,))
+
+    # Prof data
+    def getProfNameById(self, prof_id:Union[str,int],add_title:bool=False)->str:
+        """Get a professor name based on the id
+
+        Args:
+            prof_id (Union[str,int]): The id of the professor
+            add_title (bool, optional): wether to add the title or no. Defaults to False.
+
+        Returns:
+            str: The name of the professor
+        """
+        prof = self.query_db("SELECT fullname FROM prof WHERE id=?", (prof_id,), one=True)
+        if add_title:
+            return f"{self.getTitleById(prof_id)}{prof[0]}"
+        else:
+            return prof[0]
+    def getTitleById(self, prof_id:Union[str,int])->str:
+        """get the title of a professor based on the id
+
+        Args:
+            prof_id (Union[str,int]): the id of the professor
+
+        Returns:
+            str: the title of the professor, with an added whitespace at the end, if no title is present, an empty string is returned
+        """
+        title = self.query_db("SELECT titel FROM prof WHERE id=?", (prof_id,), one=True)[0]
+        return f"{title} " if title is not None else ""
+    def getProfByName(self, prof_name:str)->tuple:
+        """get all the data of a professor based on the name
+
+        Args:
+            prof_name (str): the name of the professor
+
+        Returns:
+            tuple: the data of the professor
+        """
+        return self.query_db("SELECT * FROM prof WHERE fullname=?", (prof_name,), one=True)
+    def getProfId(self, prof_name:str)->Optional[int]:
+        """Get the id of a professor based on the name
+
+        Args:
+            prof_name (str): the name of the professor
+
+        Returns:
+            Optional[int]: the id of the professor, if the professor is not found, None is returned
+        """
+        
+        data = self.getProfByName(prof_name.replace(",", ""))
+        if data is None:
+            return None
+        else:
+            return data[0]
+    def getSpecificProfData(self, prof_id:Union[str,int], fields:List[str])->tuple:
+        """A customisable function to get specific data of a professor based on the id
+
+        Args:
+            prof_id (Union[str,int]): the id of the professor
+            fields (List[str]): a list of fields to be returned
+
+        Returns:
+            tuple: a tuple containing the requested data
+        """
+        query = "SELECT "
+        for field in fields:
+            query += f"{field},"
+        query = query[:-1]
+        query += " FROM prof WHERE id=?"
+        return self.query_db(query, (prof_id,), one=True)[0]
+    def getProfData(self, profname:str):
+        """Get mail, telephone number and title of a professor based on the name
+
+        Args:
+            profname (str): name of the professor
+
+        Returns:
+            tuple: the mail, telephone number and title of the professor
+        """
+        data = self.query_db("SELECT mail, telnr, titel FROM prof WHERE fullname=?", (profname.replace(",",""),), one=True)
+        return data
+    def createProf(self, prof_details:dict):
+        """Create a professor in the database
+
+        Args:
+            prof_details (dict): a dictionary containing the details of the professor
+        """
+        prof_title = prof_details["prof_title"]
+        prof_fname = prof_details["profname"].split(",")[1]
+        prof_fname = prof_fname.strip()
+        prof_lname = prof_details["profname"].split(",")[0]
+        prof_lname = prof_lname.strip()
+        prof_fullname = prof_details["profname"].replace(",", "")
+        prof_mail = prof_details["prof_mail"]
+        prof_tel = prof_details["prof_tel"]
+        params = (prof_title, prof_fname, prof_lname, prof_mail, prof_tel, prof_fullname)
+        query = "INSERT OR IGNORE INTO prof (titel, fname, lname, mail, telnr, fullname) VALUES (?, ?, ?, ?, ?, ?)"
+        self.insertInto(query=query, params=params)
+    def getProfs(self)->list[tuple]:
+        """Return all the professors in the database
+
+        Returns:
+            list[tuple]: a list containing all the professors in individual tuples
+        """
+        return self.query_db("SELECT * FROM prof")
+
+    # Apparat
+    def getAllAparats(self,deleted=0)->list[tuple]:
+        """Get all the apparats in the database
+
+        Args:
+            deleted (int, optional): Switch the result to use . Defaults to 0.
+
+        Returns:
+            list[tuple]: a list of tuples containing the apparats
+        """
+        return self.query_db("SELECT * FROM semesterapparat WHERE deletion_status=?", (deleted,))
+    def getApparatData(self, appnr, appname)->ApparatData:
+        """Get the Apparat data based on the apparat number and the name
+
+        Args:
+            appnr (str): the apparat number
+            appname (str): the name of the apparat
+
+        Raises:
+            NoResultError: an error is raised if no result is found
+
+        Returns:
+            ApparatData: the appended data of the apparat wrapped in an ApparatData object
+        """
+        result = self.query_db("SELECT * FROM semesterapparat WHERE appnr=? AND name=?", (appnr,appname), one=True)
+        if result is None:
+            raise NoResultError("No result found")
+        apparat = ApparatData()
+        apparat.appname = result[1]
+        apparat.appnr = result[4]
+        apparat.dauerapp = True if result[7] == 1 else False
+        prof_data = self.getProfData(self.getProfNameById(result[2]))
+        apparat.profname = self.getProfNameById(result[2])
+        apparat.prof_mail = prof_data[0]
+        apparat.prof_tel = prof_data[1]
+        apparat.prof_title = prof_data[2]
+        apparat.app_fach = result[3]
+        apparat.erstellsemester = result[5]
+        apparat.semester = result[8]
+        apparat.deleted = result[9]
+        apparat.apparat_adis_id = result[11]
+        apparat.prof_adis_id = result[12]
+        return apparat
+    def getUnavailableApparatNumbers(self)->List[int]:
+        """Get a list of all the apparat numbers in the database that are currently in use
+
+        Returns:
+            List[int]: the list of used apparat numbers
+        """
+        numbers = self.query_db("SELECT appnr FROM semesterapparat WHERE deletion_status=0")    
+        numbers = [i[0] for i in numbers]
+        logger.log_info(f"Currently used apparat numbers: {numbers}")
+        return numbers
+    def setNewSemesterDate(self, app_id:Union[str,int], newDate, dauerapp=False):
+        """Set the new semester date for an apparat
+
+        Args:
+            app_id (Union[str,int]): the id of the apparat
+            newDate (str): the new date
+            dauerapp (bool, optional): if the apparat was changed to dauerapparat. Defaults to False.
+        """
+        date = datetime.datetime.strptime(newDate, "%d.%m.%Y").strftime("%Y-%m-%d")
+        if dauerapp:
+            self.query_db("UPDATE semesterapparat SET verlängerung_bis=?, dauerapp=? WHERE appnr=?", (date,dauerapp,app_id))
+        else:
+            self.query_db("UPDATE semesterapparat SET endsemester=? WHERE appnr=?", (date,app_id))
+    def getApparatId(self, apparat_name)->Optional[int]:
+        """get the id of an apparat based on the name
+
+        Args:
+            apparat_name (str): the name of the apparat e.g. "Semesterapparat 1"
+
+        Returns:
+            Optional[int]: the id of the apparat, if the apparat is not found, None is returned
+        """
+        data = self.query_db("SELECT appnr FROM semesterapparat WHERE name=?", (apparat_name,), one=True)
+        if data is None:
+            return None
+        else:
+            return data[0]
+    def createApparat(self, apparat:ApparatData)->int:
+        """create the apparat in the database
+
+        Args:
+            apparat (ApparatData): the wrapped metadata of the apparat
+
+        Raises:
+            AppPresentError: an error describing that the apparats chosen id is already present in the database
+
+        Returns:
+            Optional[int]: the id of the apparat
+        """
+                
+        prof_id = self.getProfId(apparat.profname)
+        app_id = self.getApparatId(apparat.appname)
+        if app_id:
+            raise AppPresentError(app_id)
+
+        self.createProf(apparat.get_prof_details())
+        prof_id = self.getProfId(apparat.profname)
+        ic(prof_id)
+        query = f"INSERT OR IGNORE INTO semesterapparat (appnr, name, erstellsemester, dauer, prof_id, fach,deletion_status,konto) VALUES ('{apparat.appnr}', '{apparat.appname}', '{apparat.semester}', '{apparat.dauerapp}', {prof_id}, '{apparat.app_fach}', '{0}', '{SEMAP_MEDIA_ACCOUNTS[apparat.appnr]}')"
+        logger.log_info(query)
+        self.query_db(query)
+        return self.getApparatId(apparat.appname)
+    def getApparatsByProf(self, prof_id:Union[str,int])->list[tuple]:
+        """Get all apparats based on the professor id
+
+        Args:
+            prof_id (Union[str,int]): the id of the professor
+
+        Returns:
+            list[tuple]: a list of tuples containing the apparats
+        """
+        return self.query_db("SELECT * FROM semesterapparat WHERE prof_id=?", (prof_id,))
+    def getApparatsBySemester(self, semester:str)->dict[list]:
+        """get all apparats based on the semester
+
+        Args:
+            semester (str): the selected semester
+
+        Returns:
+            dict[list]: a list off all created and deleted apparats for the selected semester
+        """
+        data = self.query_db("SELECT name, prof_id FROM semesterapparat WHERE erstellsemester=?", (semester,))
+        conn = self.connect()
+        cursor = conn.cursor()
+        c_tmp = []
+        for i in data:
+            c_tmp.append((i[0], self.getProfNameById(i[1])))
+        query = (
+            f"SELECT name,prof_id FROM semesterapparat WHERE deleted_date='{semester}'"
+        )
+        result = cursor.execute(query).fetchall()
+        d_tmp = []
+        for i in result:
+            d_tmp.append((i[0], self.getProfNameById(i[1])))
+        # group the apparats by prof
+        c_ret = {}
+        for i in c_tmp:
+            if i[1] not in c_ret.keys():
+                c_ret[i[1]] = [i[0]]
+            else:
+                c_ret[i[1]].append(i[0])
+        d_ret = {}
+        for i in d_tmp:
+            if i[1] not in d_ret.keys():
+                d_ret[i[1]] = [i[0]]
+            else:
+                d_ret[i[1]].append(i[0])
+        self.close_connection(conn)
+        return {"created": c_ret, "deleted": d_ret}
+    def getApparatCountBySemester(self)->tuple[list[str],list[int]]:
+        """get a list of all apparats created and deleted by semester
+
+        Returns:
+            tuple[list[str],list[int]]: a tuple containing two lists, the first list contains the semesters, the second list contains the amount of apparats created and deleted for the corresponding semester
+        """
+        conn = self.connect()
+        cursor = conn.cursor()
+        semesters = self.getSemersters()
+        created = []
+        deleted = []
+        for semester in semesters:
+            query = f"SELECT COUNT(*) FROM semesterapparat WHERE erstellsemester='{semester}'"
+            result = cursor.execute(query).fetchone()
+            created.append(result[0])
+            query = f"SELECT COUNT(*) FROM semesterapparat WHERE deletion_status=1 AND deleted_date='{semester}'"
+            result = cursor.execute(query).fetchone()
+            deleted.append(result[0])
+        # store data in a tuple
+        ret = []
+        e_tuple = ()
+        for sem in semesters:
+            e_tuple = (
+                sem,
+                created[semesters.index(sem)],
+                deleted[semesters.index(sem)],
+            )
+            ret.append(e_tuple)
+        self.close_connection(conn)
+        return ret 
+    def deleteApparat(self, app_id:Union[str,int], semester:str):
+        """Delete an apparat from the database
+
+        Args:
+            app_id (Union[str, int]): the id of the apparat
+            semester (str): the semester the apparat should be deleted from
+        """
+        self.query_db("UPDATE semesterapparat SET deletion_status=1, deleted_date=? WHERE appnr=?", (semester,app_id)) 
+    def isEternal(self, id):
+        """check if the apparat is eternal (dauerapparat)
+
+        Args:
+            id (int): the id of the apparat to be checked
+
+        Returns:
+            int: the state of the apparat
+        """
+        return self.query_db("SELECT dauer FROM semesterapparat WHERE appnr=?", (id,), one=True)
+    def getApparatName(self, app_id:Union[str,int], prof_id:Union[str,int]):
+        """get the name of the apparat based on the id
+
+        Args:
+            app_id (Union[str,int]): the id of the apparat
+            prof_id (Union[str,int]): the id of the professor
+
+        Returns:
+            str: the name of the apparat
+        """
+        return self.query_db("SELECT name FROM semesterapparat WHERE appnr=? AND prof_id=?", (app_id,prof_id), one=True)[0]
+    def updateApparat(self, apparat_data:ApparatData):
+        """Update an apparat in the database
+
+        Args:
+            apparat_data (ApparatData): the new metadata of the apparat
+        """
+        query = f"UPDATE semesterapparat SET name = ?, fach = ?, dauer = ?, prof_id = ? WHERE appnr = ?"
+        params = (
+            apparat_data.appname,
+            apparat_data.app_fach,
+            apparat_data.dauerapp,
+            self.getProfId(apparat_data.profname),
+            apparat_data.appnr,        
+        )
+        self.query_db(query, params)
+    def checkApparatExists(self, apparat_name:str):
+        """check if the apparat is already present in the database based on the name
+
+        Args:
+            apparat_name (str): the name of the apparat
+
+        Returns:
+            bool: True if the apparat is present, False if not
+        """
+        return True if self.query_db("SELECT appnr FROM semesterapparat WHERE name=?", (apparat_name,), one=True) else False
+    def checkApparatExistsById(self, app_id:Union[str,int])->bool:
+        """a check to see if the apparat is already present in the database, based on the id
+
+        Args:
+            app_id (Union[str, int]): the id of the apparat
+
+        Returns:
+            bool: True if the apparat is present, False if not
+        """
+        return True if self.query_db("SELECT appnr FROM semesterapparat WHERE appnr=?", (app_id,), one=True) else False
+    # Statistics
+    def statistic_request(self, **kwargs: Any):
+        """Take n amount of kwargs and return the result of the query
+        """
+        def __query(query):
+            """execute the query and return the result
+
+            Args:
+                query (str): the constructed query
+
+            Returns:
+                list: the result of the query
+            """
+            conn = self.connect()
+            cursor = conn.cursor()
+            result = cursor.execute(query).fetchall()
+            for result_a in result:
+                orig_value = result_a
+                prof_name = self.getProfNameById(result_a[2])
+                # replace the prof_id with the prof_name
+                result_a = list(result_a)
+                result_a[2] = prof_name
+                result_a = tuple(result_a)
+                result[result.index(orig_value)] = result_a
+            self.close_connection(conn)
+            return result
+        if "deletable" in kwargs.keys():
+            query = f"SELECT * FROM semesterapparat WHERE deletion_status=0 AND dauer=0 AND (erstellsemester!='{kwargs['deletesemester']}' OR verlängerung_bis!='{kwargs['deletesemester']}')"
+            return __query(query)
+        if "dauer" in kwargs.keys():
+            kwargs["dauer"] = kwargs["dauer"].replace("Ja", "1").replace("Nein", "0")
+        query = "SELECT * FROM semesterapparat WHERE "
+        for key, value in kwargs.items() if kwargs.items() is not None else {}:
+            print(key, value)
+            query += f"{key}='{value}' AND "
+            print(query)
+        # remove deletesemester part from normal query, as this will be added to the database upon deleting the apparat
+        if "deletesemester" in kwargs.keys():
+            query = query.replace(
+                f"deletesemester='{kwargs['deletesemester']}' AND ", ""
+            )
+        if "endsemester" in kwargs.keys():
+            if "erstellsemester" in kwargs.keys():
+                query = query.replace(f"endsemester='{kwargs['endsemester']}' AND ", "")
+                query = query.replace(
+                    f"erstellsemester='{kwargs['erstellsemester']} AND ", "xyz"
+                )
+            else:
+                query = query.replace(
+                    f"endsemester='{kwargs['endsemester']}' AND ", "xyz"
+                )
+                print("replaced")
+            query = query.replace(
+                "xyz",
+                f"(erstellsemester='{kwargs['endsemester']}' OR verlängerung_bis='{kwargs['endsemester']}') AND ",
+            )
+        # remove all x="" parts from the query where x is a key in kwargs
+        query = query[:-5]
+        print(query)
+        return __query(query)
+
+    # Admin data
+    def getUser(self):
+        """Get a single user from the database"""
+        return self.query_db("SELECT * FROM user", one=True)
+    def getUsers(self)->list[tuple]:
+        """Return a list of tuples of all the users in the database"""
+        return self.query_db("SELECT * FROM user")
+
+    def login(self, user, hashed_password):
+        """try to login the user.
+        The salt for the user will be requested from the database and then added to the hashed password. The password will then be compared to the password in the database 
+
+        Args:
+            user (str): username that tries to login
+            hashed_password (str): the password the user tries to login with
+
+        Returns:
+            bool: True if the login was successful, False if not
+        """
+        salt = self.query_db("SELECT salt FROM user WHERE username=?", (user,), one=True)[0]
+        if salt is None:
+            return False
+        hashed_password = salt + hashed_password
+        password = self.query_db("SELECT password FROM user WHERE username=?", (user,), one=True)[0]
+        if password == hashed_password:
+            return True
+        else:
+            return False
+    def changePassword(self, user, new_password):
+        """change the password of a user.
+        The password will be added with the salt and then committed to the database
+
+        Args:
+            user (str): username
+            new_password (str): the hashed password
+        """
+        salt = self.query_db("SELECT salt FROM user WHERE username=?", (user,), one=True)[0]
+        new_password = salt + new_password
+        self.query_db("UPDATE user SET password=? WHERE username=?", (new_password,user))
+    def getRole(self, user):
+        """get the role of the user
+
+        Args:
+            user (str): username
+
+        Returns:
+            str: the name of the role
+        """
+        return self.query_db("SELECT role FROM user WHERE username=?", (user,), one=True)[0]
+    def getRoles(self)->list[tuple]:
+        """get all the roles in the database
+
+        Returns:
+            list[str]: a list of all the roles
+        """
+        return self.query_db("SELECT role FROM user")
+    def checkUsername(self, user)->bool:
+        """a check to see if the username is already present in the database
+
+        Args:
+            user (str): the username
+
+        Returns:
+            bool: True if the username is present, False if not
+        """
+        data = self.query_db("SELECT username FROM user WHERE username=?", (user,), one=True)
+        return True if data is not None else False
+    def createUser(self, user, password, role, salt):
+        """create an user from the AdminCommands class.
+
+        Args:
+            user (str): the username of the user
+            password (str): a hashed password
+            role (str): the role of the user
+            salt (str): a salt for the password
+        """
+        self.query_db("INSERT OR IGNORE INTO user (username, password, role, salt) VALUES (?,?,?,?)", (user,password,role,salt))
+    def deleteUser(self, user):
+        """delete an unser
+
+        Args:
+            user (str): username of the user
+        """
+        self.query_db("DELETE FROM user WHERE username=?", (user,))
+    def updateUser(self, username, data:dict[str, str]):
+        """changge the data of a user
+
+        Args:
+            username (str): the username of the user
+            data (dict[str, str]): the data to be changed
+        """
+        conn = self.connect()
+        cursor = conn.cursor()
+        query = "UPDATE user SET "
+        for key,value in data.items():
+            if key == "username":
+                continue
+            query += f"{key}='{value}',"
+        query = query[:-1]
+        query += " WHERE username=?"
+        params = (username,)
+        cursor.execute(query, params)
+        conn.commit()
+        self.close_connection(conn)
+    def getFacultyMember(self, name:str)->tuple:
+        """get a faculty member based on the name
+
+        Args:
+            name (str): the name to be searched for
+
+        Returns:
+            tuple: a tuple containing the data of the faculty member
+        """
+        return self.query_db("SELECT titel, fname,lname,mail,telnr,fullname FROM prof WHERE fullname=?", (name,), one=True)
+    def updateFacultyMember(self, data:dict, oldlname:str, oldfname:str):
+        """update the data of a faculty member
+
+        Args:
+            data (dict): a dictionary containing the data to be updated
+            oldlname (str): the old last name of the faculty member
+            oldfname (str): the old first name of the faculty member
+        """
+        placeholders = ", ".join([f"{i}=:{i} " for i in data.keys()])
+        query = f"UPDATE prof SET {placeholders} WHERE lname = :oldlname AND fname = :oldfname"
+        data["oldlname"] = oldlname
+        data["oldfname"] = oldfname
+        self.query_db(query, data)
+    def getFacultyMembers(self):
+        """get a list of all faculty members
+
+        Returns:
+            list[tuple]: a list of tuples containing the faculty members
+        """
+        return self.query_db("SELECT titel, fname,lname,mail,telnr,fullname FROM prof")
+
+
+
+
+
+
+
+
+
+

Classes

+
+
+class Database +(db_path: str = None) +
+
+

Initialize the database and create the tables if they do not exist.

+

Default constructor for the database class

+

Args

+
+
db_path : str, optional
+
Optional Path for testing / specific purposes. Defaults to None.
+
+
+ +Expand source code + +
class Database:
+    """
+    Initialize the database and create the tables if they do not exist.
+    """
+    def __init__(self, db_path: str = None):
+        """
+        Default constructor for the database class
+
+        Args:
+            db_path (str, optional): Optional Path for testing / specific purposes. Defaults to None.
+        """
+        if db_path is None:
+            self.db_path = config.database.path + config.database.name
+            self.db_path = self.db_path.replace("~", str(Path.home()))
+        else:
+            self.db_path = db_path
+        if self.get_db_contents() is None:
+            logger.log_critical("Database does not exist, creating tables")
+            self.create_tables()
+    def get_db_contents(self)->Union[List[Tuple], None]:
+        """
+        Get the contents of the 
+
+        Returns:
+            Union[List[Tuple], None]: _description_
+        """
+        try:
+            with sql.connect(self.db_path) as conn:
+                cursor = conn.cursor()
+                cursor.execute("SELECT * FROM sqlite_master WHERE type='table'")
+                return cursor.fetchall()
+        except sql.OperationalError:
+            return None
+    def connect(self)->sql.Connection:
+        """
+        Connect to the database
+
+        Returns:
+            sql.Connection: The active connection to the database
+        """
+        return sql.connect(self.db_path)
+    def close_connection(self, conn: sql.Connection):
+        """
+        closes the connection to the database
+        
+        Args:
+        ----
+            - conn (sql.Connection): the connection to be closed
+        """
+        conn.close()
+    def create_tables(self):
+        """
+        Create the tables in the database
+        """
+        conn = self.connect()
+        cursor = conn.cursor()
+        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)
+        cursor.execute(CREATE_TABLE_SUBJECTS)
+        conn.commit()
+        self.close_connection(conn)
+    def insertInto(self, query:str, params:Tuple) -> None:
+        """
+        Insert sent data into the database
+
+        Args:
+            query (str): The query to be executed
+            params (Tuple): the parameters to be inserted into the database
+        """
+        conn = self.connect()
+        cursor = conn.cursor()
+        logger.log_info(f"Inserting {params} into database with query {query}")
+        cursor.execute(query, params)
+        conn.commit()
+        self.close_connection(conn)
+    def query_db(self, query: str, args: Tuple = (), one: bool = False)->Union[Tuple, List[Tuple]]:
+        """
+        Query the Database for the sent query.
+
+        Args:
+            query (str): The query to be executed
+            args (Tuple, optional): The arguments for the query. Defaults to ().
+            one (bool, optional): Return the first result only. Defaults to False.
+
+        Returns:
+            Union[Typle|List[Tuple]]: Returns the result of the query
+        """
+        conn = self.connect()
+        cursor = conn.cursor()
+        logger.log_info(f"Querying database with query {query}, args: {args}")
+        cursor.execute(query, args)
+        rv = cursor.fetchall()
+        conn.commit()
+        self.close_connection(conn)
+        return (rv[0] if rv else None) if one else rv
+
+    # Books
+    def addBookToDatabase(self, bookdata:BookData,app_id:Union[str,int], prof_id:Union[str,int]):
+        """
+        Add books to the database. Both app_id and prof_id are required to add the book to the database, as the app_id and prof_id are used to select the books later on.
+
+        Args:
+            bookdata (BookData): The metadata of the book to be added
+            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.
+        """
+        conn = self.connect()
+        cursor = conn.cursor()
+        t_query = (
+            f"SELECT bookdata FROM media WHERE app_id={app_id} AND prof_id={prof_id}"
+        )
+        # print(t_query)
+        result = cursor.execute(t_query).fetchall()
+        result = [load_pickle(i[0]) for i in result]
+        if bookdata in result:
+            print("Bookdata already in database")
+            # check if the book was deleted in the apparat
+            query = (
+                "SELECT deleted FROM media WHERE app_id=? AND prof_id=? AND bookdata=?"
+            )
+            params = (app_id, prof_id, dump_pickle(bookdata))
+            result = cursor.execute(query, params).fetchone()
+            if result[0] == 1:
+                print("Book was deleted, updating bookdata")
+                query = "UPDATE media SET deleted=0 WHERE app_id=? AND prof_id=? AND bookdata=?"
+                params = (app_id, prof_id, dump_pickle(bookdata))
+                cursor.execute(query, params)
+                conn.commit()
+            return
+
+        query = (
+            "INSERT INTO media (bookdata, app_id, prof_id,deleted) VALUES (?, ?, ?,?)"
+        )
+        converted = dump_pickle(bookdata)
+        params = (converted, app_id, prof_id, 0)
+        cursor.execute(query, params)
+        conn.commit()
+        self.close_connection(conn)
+    def getBookIdBasedOnSignature(self, app_id:Union[str,int], prof_id:Union[str,int],signature:str)->int:
+        """
+        Get a book id based on the signature of the book.
+
+        Args:
+            app_id (str): The apparat id the book should be associated with
+            prof_id (str): The professor id the book should be associated with
+            signature (str): The signature of the book
+
+        Returns:
+            int: The id of the book
+        """
+        result = self.query_db("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]
+        book = [i for i in books if i[0].signature == signature][0][1]
+        return book
+    def getBookBasedOnSignature(self, app_id:Union[str,int], prof_id:Union[str,int],signature:str)->BookData:
+        """
+        Get the book based on the signature of the book.
+
+        Args:
+            app_id (str): The apparat id the book should be associated with
+            prof_id (str): The professor id the book should be associated with
+            signature (str): The signature of the book
+
+        Returns:
+            BookData: The total metadata of the book wrapped in a BookData object
+        """
+        result = self.query_db("SELECT bookdata FROM media WHERE app_id=? AND prof_id=?", (app_id,prof_id))
+        books = [load_pickle(i[0]) for i in result]
+        book = [i for i in books if i.signature == signature][0]
+        return book
+    def getLastBookId(self)->int:
+        """
+        Get the last book id in the database
+
+        Returns:
+            int: ID of the last book in the database
+        """
+        return self.query_db("SELECT id FROM media ORDER BY id DESC", one=True)[0]
+    def searchBook(self, data:dict[str, str])->list[tuple[BookData, int]]:
+        """
+        Search a book in the database based on the sent data.
+
+        Args:
+            data (dict[str, str]): A dictionary containing the data to be searched for. The dictionary can contain the following: 
+            - signature: The signature of the book
+            - title: The title of the book
+
+        Returns:
+            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")
+        ic(rdata, len(rdata))
+        mode = 0
+        if len(data)== 1:
+            if "signature" in data.keys():
+                mode = 1
+            elif "title" in data.keys():
+                mode = 2
+        elif len(data) == 2:
+            mode = 3
+        else:
+            return None
+        ret = []
+        for book in rdata:
+            bookdata = load_pickle(book[1])
+            app_id = book[2]
+            prof_id = book[3]
+            if mode == 1:
+                if data["signature"] in bookdata.signature:
+                    ret.append((bookdata,app_id,prof_id))
+            elif mode == 2:
+                if data["title"] in bookdata.title:
+                    ret.append((bookdata,app_id,prof_id))
+            elif mode == 3:
+                if data["signature"] in bookdata.signature and data["title"] in bookdata.title:
+                    ret.append((bookdata,app_id,prof_id))
+        ic(ret)
+        return ret
+    def setAvailability(self, book_id:str, available:str):
+        """
+        Set the availability of a book in the database
+
+        Args:
+            book_id (str): The id of the book
+            available (str): The availability of the book
+        """
+        self.query_db("UPDATE media SET available=? WHERE id=?", (available,book_id))
+    def getBookId(self, bookdata:BookData, app_id:Union[str,int], prof_id:Union[str,int])->int:
+        """
+        Get the id of a book based on the metadata of the book
+
+        Args:
+            bookdata (BookData): The wrapped metadata of the book
+            app_id (str): The apparat id the book should be associated with
+            prof_id (str): The professor id the book should be associated with
+
+        Returns:
+            int: ID of the book
+        """
+        result = self.query_db("SELECT id FROM media WHERE bookdata=? AND app_id=? AND prof_id=?", (dump_pickle(bookdata),app_id,prof_id), one=True)
+        return result[0]
+    def getBook(self,book_id:int)->BookData:
+        """
+        Get the book based on the id in the database
+
+        Args:
+            book_id (int): The id of the book
+
+        Returns:
+            BookData: The metadata of the book wrapped in a BookData object
+        """
+        return load_pickle(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]]:
+        """
+        Get the Books based on the apparat id and the professor id
+
+        Args:
+            app_id (str): The ID of the apparat
+            prof_id (str): The ID of the professor
+            deleted (int, optional): The state of the book. Set to 1 to include deleted ones. Defaults to 0.
+
+        Returns:
+            list[dict[int, BookData, int]]: A list of dictionaries containing the id, the metadata of the book and the availability of the book
+        """
+        qdata = self.query_db(f"SELECT id,bookdata,available FROM media WHERE (app_id={app_id} AND prof_id={prof_id}) AND (deleted={deleted if deleted == 0 else '1 OR deleted=0'})")
+        ret_result = []
+        for result_a in qdata:
+            data = {"id": int, "bookdata": BookData, "available": int}
+            data["id"] = result_a[0]
+            data["bookdata"] = load_pickle(result_a[1])
+            data["available"] = result_a[2]
+            ret_result.append(data)
+        return ret_result
+    def updateBookdata(self, book_id, bookdata:BookData):
+        """
+        Update the bookdata in the database
+
+        Args:
+            book_id (str): The id of the book
+            bookdata (BookData): The new metadata of the book
+        """
+        self.query_db("UPDATE media SET bookdata=? WHERE id=?", (dump_pickle(bookdata),book_id))
+    def deleteBook(self, book_id):
+        """
+        Delete a book from the database
+
+        Args:
+            book_id (str): ID of the book
+        """
+        self.query_db("UPDATE media SET deleted=1 WHERE id=?", (book_id,))
+
+    # File Interactions
+    def getBlob(self, filename, app_id:Union[str,int]):
+        """
+        Get a blob from the database
+
+        Args:
+            filename (str): The name of the file
+            app_id (str): ID of the apparat
+
+        Returns:
+            bytes: The file stored in 
+        """
+        return self.query_db("SELECT fileblob FROM files WHERE filename=? AND app_id=?", (filename,app_id), one=True)[0]
+    def insertFile(self, file: list[dict], app_id:Union[str,int], prof_id:Union[str,int]):
+        """Instert a list of files into the database
+
+        Args:
+            file (list[dict]): a list containing all the files to be inserted
+            Structured: [{"name": "filename", "path": "path", "type": "filetype"}]
+            app_id (int): the id of the apparat
+            prof_id (str): the id of the professor
+        """
+        for f in file:
+            filename = f["name"]
+            path = f["path"]
+            filetyp = f["type"]
+            if path == "Database":
+                continue
+            blob = create_blob(path)
+            query = "INSERT OR IGNORE INTO files (filename, fileblob, app_id, filetyp,prof_id) VALUES (?, ?, ?, ?,?)"
+            self.query_db(query, (filename, blob, app_id, filetyp,prof_id))
+    def recreateFile(self, filename:str, app_id:Union[str,int],filetype:str)->str:
+        """Recreate a file from the database
+
+        Args:
+            filename (str): the name of the file
+            app_id (Union[str,int]): the id of the apparat
+            filetype (str): the extension of the file to be created
+
+        Returns:
+            str: The filename of the recreated file 
+        """
+        blob = self.getBlob(filename, app_id)
+        tempdir = config.database.tempdir
+        tempdir = tempdir.replace("~", str(Path.home()))
+        tempdir_path = Path(tempdir)        
+        if not os.path.exists(tempdir_path):
+            os.mkdir(tempdir_path)
+        file = tempfile.NamedTemporaryFile(
+            delete=False, dir=tempdir_path, mode="wb", suffix=f".{filetype}"
+        )
+        file.write(blob)
+        print("file created")
+        return file.name
+    def getFiles(self, app_id:Union[str,int], prof_id:int)->list[tuple]:
+        """Get all the files associated with the apparat and the professor
+
+        Args:
+            app_id (Union[str,int]): The id of the apparat
+            prof_id (Union[str,int]): the id of the professor
+
+        Returns:
+            list[tuple]: a list of tuples containing the filename and the filetype for the corresponding apparat and professor
+        """
+        return self.query_db("SELECT filename, filetyp FROM files WHERE app_id=? AND prof_id=?", (app_id,prof_id))
+
+    def getSemersters(self)->list[str]:
+        """Return all the unique semesters in the database
+
+        Returns:
+            list: a list of strings containing the semesters
+        """
+        data = self.query_db("SELECT DISTINCT erstellsemester FROM semesterapparat")
+        return [i[0] for i in data]
+
+    def getSubjects(self):
+        """Get all the subjects in the database
+
+        Returns:
+            list[tuple]: a list of tuples containing the subjects
+        """
+        return self.query_db("SELECT * FROM subjects")
+
+    # Messages
+    def addMessage(self, message:dict,user:str, app_id:Union[str,int]):
+        """add a Message to the database
+
+        Args:
+            message (dict): the message to be added
+            user (str): the user who added the message
+            app_id (Union[str,int]): the id of the apparat
+        """
+        def __getUserId(user):
+            return self.query_db("SELECT id FROM user WHERE username=?", (user,), one=True)[0]
+        user_id = __getUserId(user)
+        self.query_db("INSERT INTO messages (message, user_id, remind_at,appnr) VALUES (?,?,?,?)", (message["message"],user_id,message["remind_at"],app_id))
+    def getMessages(self, date:str)->list[dict[str, str, str, str]]:
+        """Get all the messages for a specific date
+
+        Args:
+            date (str): a date.datetime object formatted as a string in the format "YYYY-MM-DD"
+        
+        Returns:
+            list[dict[str, str, str, str]]: a list of dictionaries containing the message, the user who added the message, the apparat id and the id of the message
+        """
+        def __get_user_name(user_id):
+            return self.query_db("SELECT username FROM user WHERE id=?", (user_id,), one=True)[0]
+        messages = self.query_db("SELECT * FROM messages WHERE remind_at=?", (date,))
+        ret = [
+            {
+                "message": i[2],
+                "user": __get_user_name(i[4]),
+                "appnr": i[5],
+                "id": i[0]
+            }
+            for i in messages
+        ]
+        return ret
+    def deleteMessage(self, message_id):
+        """Delete a message from the database
+
+        Args:
+            message_id (str): the id of the message
+        """
+        self.query_db("DELETE FROM messages WHERE id=?", (message_id,))
+
+    # Prof data
+    def getProfNameById(self, prof_id:Union[str,int],add_title:bool=False)->str:
+        """Get a professor name based on the id
+
+        Args:
+            prof_id (Union[str,int]): The id of the professor
+            add_title (bool, optional): wether to add the title or no. Defaults to False.
+
+        Returns:
+            str: The name of the professor
+        """
+        prof = self.query_db("SELECT fullname FROM prof WHERE id=?", (prof_id,), one=True)
+        if add_title:
+            return f"{self.getTitleById(prof_id)}{prof[0]}"
+        else:
+            return prof[0]
+    def getTitleById(self, prof_id:Union[str,int])->str:
+        """get the title of a professor based on the id
+
+        Args:
+            prof_id (Union[str,int]): the id of the professor
+
+        Returns:
+            str: the title of the professor, with an added whitespace at the end, if no title is present, an empty string is returned
+        """
+        title = self.query_db("SELECT titel FROM prof WHERE id=?", (prof_id,), one=True)[0]
+        return f"{title} " if title is not None else ""
+    def getProfByName(self, prof_name:str)->tuple:
+        """get all the data of a professor based on the name
+
+        Args:
+            prof_name (str): the name of the professor
+
+        Returns:
+            tuple: the data of the professor
+        """
+        return self.query_db("SELECT * FROM prof WHERE fullname=?", (prof_name,), one=True)
+    def getProfId(self, prof_name:str)->Optional[int]:
+        """Get the id of a professor based on the name
+
+        Args:
+            prof_name (str): the name of the professor
+
+        Returns:
+            Optional[int]: the id of the professor, if the professor is not found, None is returned
+        """
+        
+        data = self.getProfByName(prof_name.replace(",", ""))
+        if data is None:
+            return None
+        else:
+            return data[0]
+    def getSpecificProfData(self, prof_id:Union[str,int], fields:List[str])->tuple:
+        """A customisable function to get specific data of a professor based on the id
+
+        Args:
+            prof_id (Union[str,int]): the id of the professor
+            fields (List[str]): a list of fields to be returned
+
+        Returns:
+            tuple: a tuple containing the requested data
+        """
+        query = "SELECT "
+        for field in fields:
+            query += f"{field},"
+        query = query[:-1]
+        query += " FROM prof WHERE id=?"
+        return self.query_db(query, (prof_id,), one=True)[0]
+    def getProfData(self, profname:str):
+        """Get mail, telephone number and title of a professor based on the name
+
+        Args:
+            profname (str): name of the professor
+
+        Returns:
+            tuple: the mail, telephone number and title of the professor
+        """
+        data = self.query_db("SELECT mail, telnr, titel FROM prof WHERE fullname=?", (profname.replace(",",""),), one=True)
+        return data
+    def createProf(self, prof_details:dict):
+        """Create a professor in the database
+
+        Args:
+            prof_details (dict): a dictionary containing the details of the professor
+        """
+        prof_title = prof_details["prof_title"]
+        prof_fname = prof_details["profname"].split(",")[1]
+        prof_fname = prof_fname.strip()
+        prof_lname = prof_details["profname"].split(",")[0]
+        prof_lname = prof_lname.strip()
+        prof_fullname = prof_details["profname"].replace(",", "")
+        prof_mail = prof_details["prof_mail"]
+        prof_tel = prof_details["prof_tel"]
+        params = (prof_title, prof_fname, prof_lname, prof_mail, prof_tel, prof_fullname)
+        query = "INSERT OR IGNORE INTO prof (titel, fname, lname, mail, telnr, fullname) VALUES (?, ?, ?, ?, ?, ?)"
+        self.insertInto(query=query, params=params)
+    def getProfs(self)->list[tuple]:
+        """Return all the professors in the database
+
+        Returns:
+            list[tuple]: a list containing all the professors in individual tuples
+        """
+        return self.query_db("SELECT * FROM prof")
+
+    # Apparat
+    def getAllAparats(self,deleted=0)->list[tuple]:
+        """Get all the apparats in the database
+
+        Args:
+            deleted (int, optional): Switch the result to use . Defaults to 0.
+
+        Returns:
+            list[tuple]: a list of tuples containing the apparats
+        """
+        return self.query_db("SELECT * FROM semesterapparat WHERE deletion_status=?", (deleted,))
+    def getApparatData(self, appnr, appname)->ApparatData:
+        """Get the Apparat data based on the apparat number and the name
+
+        Args:
+            appnr (str): the apparat number
+            appname (str): the name of the apparat
+
+        Raises:
+            NoResultError: an error is raised if no result is found
+
+        Returns:
+            ApparatData: the appended data of the apparat wrapped in an ApparatData object
+        """
+        result = self.query_db("SELECT * FROM semesterapparat WHERE appnr=? AND name=?", (appnr,appname), one=True)
+        if result is None:
+            raise NoResultError("No result found")
+        apparat = ApparatData()
+        apparat.appname = result[1]
+        apparat.appnr = result[4]
+        apparat.dauerapp = True if result[7] == 1 else False
+        prof_data = self.getProfData(self.getProfNameById(result[2]))
+        apparat.profname = self.getProfNameById(result[2])
+        apparat.prof_mail = prof_data[0]
+        apparat.prof_tel = prof_data[1]
+        apparat.prof_title = prof_data[2]
+        apparat.app_fach = result[3]
+        apparat.erstellsemester = result[5]
+        apparat.semester = result[8]
+        apparat.deleted = result[9]
+        apparat.apparat_adis_id = result[11]
+        apparat.prof_adis_id = result[12]
+        return apparat
+    def getUnavailableApparatNumbers(self)->List[int]:
+        """Get a list of all the apparat numbers in the database that are currently in use
+
+        Returns:
+            List[int]: the list of used apparat numbers
+        """
+        numbers = self.query_db("SELECT appnr FROM semesterapparat WHERE deletion_status=0")    
+        numbers = [i[0] for i in numbers]
+        logger.log_info(f"Currently used apparat numbers: {numbers}")
+        return numbers
+    def setNewSemesterDate(self, app_id:Union[str,int], newDate, dauerapp=False):
+        """Set the new semester date for an apparat
+
+        Args:
+            app_id (Union[str,int]): the id of the apparat
+            newDate (str): the new date
+            dauerapp (bool, optional): if the apparat was changed to dauerapparat. Defaults to False.
+        """
+        date = datetime.datetime.strptime(newDate, "%d.%m.%Y").strftime("%Y-%m-%d")
+        if dauerapp:
+            self.query_db("UPDATE semesterapparat SET verlängerung_bis=?, dauerapp=? WHERE appnr=?", (date,dauerapp,app_id))
+        else:
+            self.query_db("UPDATE semesterapparat SET endsemester=? WHERE appnr=?", (date,app_id))
+    def getApparatId(self, apparat_name)->Optional[int]:
+        """get the id of an apparat based on the name
+
+        Args:
+            apparat_name (str): the name of the apparat e.g. "Semesterapparat 1"
+
+        Returns:
+            Optional[int]: the id of the apparat, if the apparat is not found, None is returned
+        """
+        data = self.query_db("SELECT appnr FROM semesterapparat WHERE name=?", (apparat_name,), one=True)
+        if data is None:
+            return None
+        else:
+            return data[0]
+    def createApparat(self, apparat:ApparatData)->int:
+        """create the apparat in the database
+
+        Args:
+            apparat (ApparatData): the wrapped metadata of the apparat
+
+        Raises:
+            AppPresentError: an error describing that the apparats chosen id is already present in the database
+
+        Returns:
+            Optional[int]: the id of the apparat
+        """
+                
+        prof_id = self.getProfId(apparat.profname)
+        app_id = self.getApparatId(apparat.appname)
+        if app_id:
+            raise AppPresentError(app_id)
+
+        self.createProf(apparat.get_prof_details())
+        prof_id = self.getProfId(apparat.profname)
+        ic(prof_id)
+        query = f"INSERT OR IGNORE INTO semesterapparat (appnr, name, erstellsemester, dauer, prof_id, fach,deletion_status,konto) VALUES ('{apparat.appnr}', '{apparat.appname}', '{apparat.semester}', '{apparat.dauerapp}', {prof_id}, '{apparat.app_fach}', '{0}', '{SEMAP_MEDIA_ACCOUNTS[apparat.appnr]}')"
+        logger.log_info(query)
+        self.query_db(query)
+        return self.getApparatId(apparat.appname)
+    def getApparatsByProf(self, prof_id:Union[str,int])->list[tuple]:
+        """Get all apparats based on the professor id
+
+        Args:
+            prof_id (Union[str,int]): the id of the professor
+
+        Returns:
+            list[tuple]: a list of tuples containing the apparats
+        """
+        return self.query_db("SELECT * FROM semesterapparat WHERE prof_id=?", (prof_id,))
+    def getApparatsBySemester(self, semester:str)->dict[list]:
+        """get all apparats based on the semester
+
+        Args:
+            semester (str): the selected semester
+
+        Returns:
+            dict[list]: a list off all created and deleted apparats for the selected semester
+        """
+        data = self.query_db("SELECT name, prof_id FROM semesterapparat WHERE erstellsemester=?", (semester,))
+        conn = self.connect()
+        cursor = conn.cursor()
+        c_tmp = []
+        for i in data:
+            c_tmp.append((i[0], self.getProfNameById(i[1])))
+        query = (
+            f"SELECT name,prof_id FROM semesterapparat WHERE deleted_date='{semester}'"
+        )
+        result = cursor.execute(query).fetchall()
+        d_tmp = []
+        for i in result:
+            d_tmp.append((i[0], self.getProfNameById(i[1])))
+        # group the apparats by prof
+        c_ret = {}
+        for i in c_tmp:
+            if i[1] not in c_ret.keys():
+                c_ret[i[1]] = [i[0]]
+            else:
+                c_ret[i[1]].append(i[0])
+        d_ret = {}
+        for i in d_tmp:
+            if i[1] not in d_ret.keys():
+                d_ret[i[1]] = [i[0]]
+            else:
+                d_ret[i[1]].append(i[0])
+        self.close_connection(conn)
+        return {"created": c_ret, "deleted": d_ret}
+    def getApparatCountBySemester(self)->tuple[list[str],list[int]]:
+        """get a list of all apparats created and deleted by semester
+
+        Returns:
+            tuple[list[str],list[int]]: a tuple containing two lists, the first list contains the semesters, the second list contains the amount of apparats created and deleted for the corresponding semester
+        """
+        conn = self.connect()
+        cursor = conn.cursor()
+        semesters = self.getSemersters()
+        created = []
+        deleted = []
+        for semester in semesters:
+            query = f"SELECT COUNT(*) FROM semesterapparat WHERE erstellsemester='{semester}'"
+            result = cursor.execute(query).fetchone()
+            created.append(result[0])
+            query = f"SELECT COUNT(*) FROM semesterapparat WHERE deletion_status=1 AND deleted_date='{semester}'"
+            result = cursor.execute(query).fetchone()
+            deleted.append(result[0])
+        # store data in a tuple
+        ret = []
+        e_tuple = ()
+        for sem in semesters:
+            e_tuple = (
+                sem,
+                created[semesters.index(sem)],
+                deleted[semesters.index(sem)],
+            )
+            ret.append(e_tuple)
+        self.close_connection(conn)
+        return ret 
+    def deleteApparat(self, app_id:Union[str,int], semester:str):
+        """Delete an apparat from the database
+
+        Args:
+            app_id (Union[str, int]): the id of the apparat
+            semester (str): the semester the apparat should be deleted from
+        """
+        self.query_db("UPDATE semesterapparat SET deletion_status=1, deleted_date=? WHERE appnr=?", (semester,app_id)) 
+    def isEternal(self, id):
+        """check if the apparat is eternal (dauerapparat)
+
+        Args:
+            id (int): the id of the apparat to be checked
+
+        Returns:
+            int: the state of the apparat
+        """
+        return self.query_db("SELECT dauer FROM semesterapparat WHERE appnr=?", (id,), one=True)
+    def getApparatName(self, app_id:Union[str,int], prof_id:Union[str,int]):
+        """get the name of the apparat based on the id
+
+        Args:
+            app_id (Union[str,int]): the id of the apparat
+            prof_id (Union[str,int]): the id of the professor
+
+        Returns:
+            str: the name of the apparat
+        """
+        return self.query_db("SELECT name FROM semesterapparat WHERE appnr=? AND prof_id=?", (app_id,prof_id), one=True)[0]
+    def updateApparat(self, apparat_data:ApparatData):
+        """Update an apparat in the database
+
+        Args:
+            apparat_data (ApparatData): the new metadata of the apparat
+        """
+        query = f"UPDATE semesterapparat SET name = ?, fach = ?, dauer = ?, prof_id = ? WHERE appnr = ?"
+        params = (
+            apparat_data.appname,
+            apparat_data.app_fach,
+            apparat_data.dauerapp,
+            self.getProfId(apparat_data.profname),
+            apparat_data.appnr,        
+        )
+        self.query_db(query, params)
+    def checkApparatExists(self, apparat_name:str):
+        """check if the apparat is already present in the database based on the name
+
+        Args:
+            apparat_name (str): the name of the apparat
+
+        Returns:
+            bool: True if the apparat is present, False if not
+        """
+        return True if self.query_db("SELECT appnr FROM semesterapparat WHERE name=?", (apparat_name,), one=True) else False
+    def checkApparatExistsById(self, app_id:Union[str,int])->bool:
+        """a check to see if the apparat is already present in the database, based on the id
+
+        Args:
+            app_id (Union[str, int]): the id of the apparat
+
+        Returns:
+            bool: True if the apparat is present, False if not
+        """
+        return True if self.query_db("SELECT appnr FROM semesterapparat WHERE appnr=?", (app_id,), one=True) else False
+    # Statistics
+    def statistic_request(self, **kwargs: Any):
+        """Take n amount of kwargs and return the result of the query
+        """
+        def __query(query):
+            """execute the query and return the result
+
+            Args:
+                query (str): the constructed query
+
+            Returns:
+                list: the result of the query
+            """
+            conn = self.connect()
+            cursor = conn.cursor()
+            result = cursor.execute(query).fetchall()
+            for result_a in result:
+                orig_value = result_a
+                prof_name = self.getProfNameById(result_a[2])
+                # replace the prof_id with the prof_name
+                result_a = list(result_a)
+                result_a[2] = prof_name
+                result_a = tuple(result_a)
+                result[result.index(orig_value)] = result_a
+            self.close_connection(conn)
+            return result
+        if "deletable" in kwargs.keys():
+            query = f"SELECT * FROM semesterapparat WHERE deletion_status=0 AND dauer=0 AND (erstellsemester!='{kwargs['deletesemester']}' OR verlängerung_bis!='{kwargs['deletesemester']}')"
+            return __query(query)
+        if "dauer" in kwargs.keys():
+            kwargs["dauer"] = kwargs["dauer"].replace("Ja", "1").replace("Nein", "0")
+        query = "SELECT * FROM semesterapparat WHERE "
+        for key, value in kwargs.items() if kwargs.items() is not None else {}:
+            print(key, value)
+            query += f"{key}='{value}' AND "
+            print(query)
+        # remove deletesemester part from normal query, as this will be added to the database upon deleting the apparat
+        if "deletesemester" in kwargs.keys():
+            query = query.replace(
+                f"deletesemester='{kwargs['deletesemester']}' AND ", ""
+            )
+        if "endsemester" in kwargs.keys():
+            if "erstellsemester" in kwargs.keys():
+                query = query.replace(f"endsemester='{kwargs['endsemester']}' AND ", "")
+                query = query.replace(
+                    f"erstellsemester='{kwargs['erstellsemester']} AND ", "xyz"
+                )
+            else:
+                query = query.replace(
+                    f"endsemester='{kwargs['endsemester']}' AND ", "xyz"
+                )
+                print("replaced")
+            query = query.replace(
+                "xyz",
+                f"(erstellsemester='{kwargs['endsemester']}' OR verlängerung_bis='{kwargs['endsemester']}') AND ",
+            )
+        # remove all x="" parts from the query where x is a key in kwargs
+        query = query[:-5]
+        print(query)
+        return __query(query)
+
+    # Admin data
+    def getUser(self):
+        """Get a single user from the database"""
+        return self.query_db("SELECT * FROM user", one=True)
+    def getUsers(self)->list[tuple]:
+        """Return a list of tuples of all the users in the database"""
+        return self.query_db("SELECT * FROM user")
+
+    def login(self, user, hashed_password):
+        """try to login the user.
+        The salt for the user will be requested from the database and then added to the hashed password. The password will then be compared to the password in the database 
+
+        Args:
+            user (str): username that tries to login
+            hashed_password (str): the password the user tries to login with
+
+        Returns:
+            bool: True if the login was successful, False if not
+        """
+        salt = self.query_db("SELECT salt FROM user WHERE username=?", (user,), one=True)[0]
+        if salt is None:
+            return False
+        hashed_password = salt + hashed_password
+        password = self.query_db("SELECT password FROM user WHERE username=?", (user,), one=True)[0]
+        if password == hashed_password:
+            return True
+        else:
+            return False
+    def changePassword(self, user, new_password):
+        """change the password of a user.
+        The password will be added with the salt and then committed to the database
+
+        Args:
+            user (str): username
+            new_password (str): the hashed password
+        """
+        salt = self.query_db("SELECT salt FROM user WHERE username=?", (user,), one=True)[0]
+        new_password = salt + new_password
+        self.query_db("UPDATE user SET password=? WHERE username=?", (new_password,user))
+    def getRole(self, user):
+        """get the role of the user
+
+        Args:
+            user (str): username
+
+        Returns:
+            str: the name of the role
+        """
+        return self.query_db("SELECT role FROM user WHERE username=?", (user,), one=True)[0]
+    def getRoles(self)->list[tuple]:
+        """get all the roles in the database
+
+        Returns:
+            list[str]: a list of all the roles
+        """
+        return self.query_db("SELECT role FROM user")
+    def checkUsername(self, user)->bool:
+        """a check to see if the username is already present in the database
+
+        Args:
+            user (str): the username
+
+        Returns:
+            bool: True if the username is present, False if not
+        """
+        data = self.query_db("SELECT username FROM user WHERE username=?", (user,), one=True)
+        return True if data is not None else False
+    def createUser(self, user, password, role, salt):
+        """create an user from the AdminCommands class.
+
+        Args:
+            user (str): the username of the user
+            password (str): a hashed password
+            role (str): the role of the user
+            salt (str): a salt for the password
+        """
+        self.query_db("INSERT OR IGNORE INTO user (username, password, role, salt) VALUES (?,?,?,?)", (user,password,role,salt))
+    def deleteUser(self, user):
+        """delete an unser
+
+        Args:
+            user (str): username of the user
+        """
+        self.query_db("DELETE FROM user WHERE username=?", (user,))
+    def updateUser(self, username, data:dict[str, str]):
+        """changge the data of a user
+
+        Args:
+            username (str): the username of the user
+            data (dict[str, str]): the data to be changed
+        """
+        conn = self.connect()
+        cursor = conn.cursor()
+        query = "UPDATE user SET "
+        for key,value in data.items():
+            if key == "username":
+                continue
+            query += f"{key}='{value}',"
+        query = query[:-1]
+        query += " WHERE username=?"
+        params = (username,)
+        cursor.execute(query, params)
+        conn.commit()
+        self.close_connection(conn)
+    def getFacultyMember(self, name:str)->tuple:
+        """get a faculty member based on the name
+
+        Args:
+            name (str): the name to be searched for
+
+        Returns:
+            tuple: a tuple containing the data of the faculty member
+        """
+        return self.query_db("SELECT titel, fname,lname,mail,telnr,fullname FROM prof WHERE fullname=?", (name,), one=True)
+    def updateFacultyMember(self, data:dict, oldlname:str, oldfname:str):
+        """update the data of a faculty member
+
+        Args:
+            data (dict): a dictionary containing the data to be updated
+            oldlname (str): the old last name of the faculty member
+            oldfname (str): the old first name of the faculty member
+        """
+        placeholders = ", ".join([f"{i}=:{i} " for i in data.keys()])
+        query = f"UPDATE prof SET {placeholders} WHERE lname = :oldlname AND fname = :oldfname"
+        data["oldlname"] = oldlname
+        data["oldfname"] = oldfname
+        self.query_db(query, data)
+    def getFacultyMembers(self):
+        """get a list of all faculty members
+
+        Returns:
+            list[tuple]: a list of tuples containing the faculty members
+        """
+        return self.query_db("SELECT titel, fname,lname,mail,telnr,fullname FROM prof")
+
+

Methods

+
+
+def addBookToDatabase(self, bookdata: src.logic.dataclass.BookData, app_id: Union[str, int], prof_id: Union[str, int]) +
+
+

Add books to the database. Both app_id and prof_id are required to add the book to the database, as the app_id and prof_id are used to select the books later on.

+

Args

+
+
bookdata : BookData
+
The metadata of the book to be added
+
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.
+
+
+ +Expand source code + +
def addBookToDatabase(self, bookdata:BookData,app_id:Union[str,int], prof_id:Union[str,int]):
+    """
+    Add books to the database. Both app_id and prof_id are required to add the book to the database, as the app_id and prof_id are used to select the books later on.
+
+    Args:
+        bookdata (BookData): The metadata of the book to be added
+        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.
+    """
+    conn = self.connect()
+    cursor = conn.cursor()
+    t_query = (
+        f"SELECT bookdata FROM media WHERE app_id={app_id} AND prof_id={prof_id}"
+    )
+    # print(t_query)
+    result = cursor.execute(t_query).fetchall()
+    result = [load_pickle(i[0]) for i in result]
+    if bookdata in result:
+        print("Bookdata already in database")
+        # check if the book was deleted in the apparat
+        query = (
+            "SELECT deleted FROM media WHERE app_id=? AND prof_id=? AND bookdata=?"
+        )
+        params = (app_id, prof_id, dump_pickle(bookdata))
+        result = cursor.execute(query, params).fetchone()
+        if result[0] == 1:
+            print("Book was deleted, updating bookdata")
+            query = "UPDATE media SET deleted=0 WHERE app_id=? AND prof_id=? AND bookdata=?"
+            params = (app_id, prof_id, dump_pickle(bookdata))
+            cursor.execute(query, params)
+            conn.commit()
+        return
+
+    query = (
+        "INSERT INTO media (bookdata, app_id, prof_id,deleted) VALUES (?, ?, ?,?)"
+    )
+    converted = dump_pickle(bookdata)
+    params = (converted, app_id, prof_id, 0)
+    cursor.execute(query, params)
+    conn.commit()
+    self.close_connection(conn)
+
+
+
+def addMessage(self, message: dict, user: str, app_id: Union[str, int]) +
+
+

add a Message to the database

+

Args

+
+
message : dict
+
the message to be added
+
user : str
+
the user who added the message
+
app_id : Union[str,int]
+
the id of the apparat
+
+
+ +Expand source code + +
def addMessage(self, message:dict,user:str, app_id:Union[str,int]):
+    """add a Message to the database
+
+    Args:
+        message (dict): the message to be added
+        user (str): the user who added the message
+        app_id (Union[str,int]): the id of the apparat
+    """
+    def __getUserId(user):
+        return self.query_db("SELECT id FROM user WHERE username=?", (user,), one=True)[0]
+    user_id = __getUserId(user)
+    self.query_db("INSERT INTO messages (message, user_id, remind_at,appnr) VALUES (?,?,?,?)", (message["message"],user_id,message["remind_at"],app_id))
+
+
+
+def changePassword(self, user, new_password) +
+
+

change the password of a user. +The password will be added with the salt and then committed to the database

+

Args

+
+
user : str
+
username
+
new_password : str
+
the hashed password
+
+
+ +Expand source code + +
def changePassword(self, user, new_password):
+    """change the password of a user.
+    The password will be added with the salt and then committed to the database
+
+    Args:
+        user (str): username
+        new_password (str): the hashed password
+    """
+    salt = self.query_db("SELECT salt FROM user WHERE username=?", (user,), one=True)[0]
+    new_password = salt + new_password
+    self.query_db("UPDATE user SET password=? WHERE username=?", (new_password,user))
+
+
+
+def checkApparatExists(self, apparat_name: str) +
+
+

check if the apparat is already present in the database based on the name

+

Args

+
+
apparat_name : str
+
the name of the apparat
+
+

Returns

+
+
bool
+
True if the apparat is present, False if not
+
+
+ +Expand source code + +
def checkApparatExists(self, apparat_name:str):
+    """check if the apparat is already present in the database based on the name
+
+    Args:
+        apparat_name (str): the name of the apparat
+
+    Returns:
+        bool: True if the apparat is present, False if not
+    """
+    return True if self.query_db("SELECT appnr FROM semesterapparat WHERE name=?", (apparat_name,), one=True) else False
+
+
+
+def checkApparatExistsById(self, app_id: Union[str, int]) ‑> bool +
+
+

a check to see if the apparat is already present in the database, based on the id

+

Args

+
+
app_id : Union[str, int]
+
the id of the apparat
+
+

Returns

+
+
bool
+
True if the apparat is present, False if not
+
+
+ +Expand source code + +
def checkApparatExistsById(self, app_id:Union[str,int])->bool:
+    """a check to see if the apparat is already present in the database, based on the id
+
+    Args:
+        app_id (Union[str, int]): the id of the apparat
+
+    Returns:
+        bool: True if the apparat is present, False if not
+    """
+    return True if self.query_db("SELECT appnr FROM semesterapparat WHERE appnr=?", (app_id,), one=True) else False
+
+
+
+def checkUsername(self, user) ‑> bool +
+
+

a check to see if the username is already present in the database

+

Args

+
+
user : str
+
the username
+
+

Returns

+
+
bool
+
True if the username is present, False if not
+
+
+ +Expand source code + +
def checkUsername(self, user)->bool:
+    """a check to see if the username is already present in the database
+
+    Args:
+        user (str): the username
+
+    Returns:
+        bool: True if the username is present, False if not
+    """
+    data = self.query_db("SELECT username FROM user WHERE username=?", (user,), one=True)
+    return True if data is not None else False
+
+
+
+def close_connection(self, conn: sqlite3.Connection) +
+
+

closes the connection to the database

+

Args:

+
- conn (sql.Connection): the connection to be closed
+
+
+ +Expand source code + +
def close_connection(self, conn: sql.Connection):
+    """
+    closes the connection to the database
+    
+    Args:
+    ----
+        - conn (sql.Connection): the connection to be closed
+    """
+    conn.close()
+
+
+
+def connect(self) ‑> sqlite3.Connection +
+
+

Connect to the database

+

Returns

+
+
sql.Connection
+
The active connection to the database
+
+
+ +Expand source code + +
def connect(self)->sql.Connection:
+    """
+    Connect to the database
+
+    Returns:
+        sql.Connection: The active connection to the database
+    """
+    return sql.connect(self.db_path)
+
+
+
+def createApparat(self, apparat: src.logic.dataclass.ApparatData) ‑> int +
+
+

create the apparat in the database

+

Args

+
+
apparat : ApparatData
+
the wrapped metadata of the apparat
+
+

Raises

+
+
AppPresentError
+
an error describing that the apparats chosen id is already present in the database
+
+

Returns

+
+
Optional[int]
+
the id of the apparat
+
+
+ +Expand source code + +
def createApparat(self, apparat:ApparatData)->int:
+    """create the apparat in the database
+
+    Args:
+        apparat (ApparatData): the wrapped metadata of the apparat
+
+    Raises:
+        AppPresentError: an error describing that the apparats chosen id is already present in the database
+
+    Returns:
+        Optional[int]: the id of the apparat
+    """
+            
+    prof_id = self.getProfId(apparat.profname)
+    app_id = self.getApparatId(apparat.appname)
+    if app_id:
+        raise AppPresentError(app_id)
+
+    self.createProf(apparat.get_prof_details())
+    prof_id = self.getProfId(apparat.profname)
+    ic(prof_id)
+    query = f"INSERT OR IGNORE INTO semesterapparat (appnr, name, erstellsemester, dauer, prof_id, fach,deletion_status,konto) VALUES ('{apparat.appnr}', '{apparat.appname}', '{apparat.semester}', '{apparat.dauerapp}', {prof_id}, '{apparat.app_fach}', '{0}', '{SEMAP_MEDIA_ACCOUNTS[apparat.appnr]}')"
+    logger.log_info(query)
+    self.query_db(query)
+    return self.getApparatId(apparat.appname)
+
+
+
+def createProf(self, prof_details: dict) +
+
+

Create a professor in the database

+

Args

+
+
prof_details : dict
+
a dictionary containing the details of the professor
+
+
+ +Expand source code + +
def createProf(self, prof_details:dict):
+    """Create a professor in the database
+
+    Args:
+        prof_details (dict): a dictionary containing the details of the professor
+    """
+    prof_title = prof_details["prof_title"]
+    prof_fname = prof_details["profname"].split(",")[1]
+    prof_fname = prof_fname.strip()
+    prof_lname = prof_details["profname"].split(",")[0]
+    prof_lname = prof_lname.strip()
+    prof_fullname = prof_details["profname"].replace(",", "")
+    prof_mail = prof_details["prof_mail"]
+    prof_tel = prof_details["prof_tel"]
+    params = (prof_title, prof_fname, prof_lname, prof_mail, prof_tel, prof_fullname)
+    query = "INSERT OR IGNORE INTO prof (titel, fname, lname, mail, telnr, fullname) VALUES (?, ?, ?, ?, ?, ?)"
+    self.insertInto(query=query, params=params)
+
+
+
+def createUser(self, user, password, role, salt) +
+
+

create an user from the AdminCommands class.

+

Args

+
+
user : str
+
the username of the user
+
password : str
+
a hashed password
+
role : str
+
the role of the user
+
salt : str
+
a salt for the password
+
+
+ +Expand source code + +
def createUser(self, user, password, role, salt):
+    """create an user from the AdminCommands class.
+
+    Args:
+        user (str): the username of the user
+        password (str): a hashed password
+        role (str): the role of the user
+        salt (str): a salt for the password
+    """
+    self.query_db("INSERT OR IGNORE INTO user (username, password, role, salt) VALUES (?,?,?,?)", (user,password,role,salt))
+
+
+
+def create_tables(self) +
+
+

Create the tables in the database

+
+ +Expand source code + +
def create_tables(self):
+    """
+    Create the tables in the database
+    """
+    conn = self.connect()
+    cursor = conn.cursor()
+    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)
+    cursor.execute(CREATE_TABLE_SUBJECTS)
+    conn.commit()
+    self.close_connection(conn)
+
+
+
+def deleteApparat(self, app_id: Union[str, int], semester: str) +
+
+

Delete an apparat from the database

+

Args

+
+
app_id : Union[str, int]
+
the id of the apparat
+
semester : str
+
the semester the apparat should be deleted from
+
+
+ +Expand source code + +
def deleteApparat(self, app_id:Union[str,int], semester:str):
+    """Delete an apparat from the database
+
+    Args:
+        app_id (Union[str, int]): the id of the apparat
+        semester (str): the semester the apparat should be deleted from
+    """
+    self.query_db("UPDATE semesterapparat SET deletion_status=1, deleted_date=? WHERE appnr=?", (semester,app_id)) 
+
+
+
+def deleteBook(self, book_id) +
+
+

Delete a book from the database

+

Args

+
+
book_id : str
+
ID of the book
+
+
+ +Expand source code + +
def deleteBook(self, book_id):
+    """
+    Delete a book from the database
+
+    Args:
+        book_id (str): ID of the book
+    """
+    self.query_db("UPDATE media SET deleted=1 WHERE id=?", (book_id,))
+
+
+
+def deleteMessage(self, message_id) +
+
+

Delete a message from the database

+

Args

+
+
message_id : str
+
the id of the message
+
+
+ +Expand source code + +
def deleteMessage(self, message_id):
+    """Delete a message from the database
+
+    Args:
+        message_id (str): the id of the message
+    """
+    self.query_db("DELETE FROM messages WHERE id=?", (message_id,))
+
+
+
+def deleteUser(self, user) +
+
+

delete an unser

+

Args

+
+
user : str
+
username of the user
+
+
+ +Expand source code + +
def deleteUser(self, user):
+    """delete an unser
+
+    Args:
+        user (str): username of the user
+    """
+    self.query_db("DELETE FROM user WHERE username=?", (user,))
+
+
+
+def getAllAparats(self, deleted=0) ‑> list[tuple] +
+
+

Get all the apparats in the database

+

Args

+
+
deleted : int, optional
+
Switch the result to use . Defaults to 0.
+
+

Returns

+
+
list[tuple]
+
a list of tuples containing the apparats
+
+
+ +Expand source code + +
def getAllAparats(self,deleted=0)->list[tuple]:
+    """Get all the apparats in the database
+
+    Args:
+        deleted (int, optional): Switch the result to use . Defaults to 0.
+
+    Returns:
+        list[tuple]: a list of tuples containing the apparats
+    """
+    return self.query_db("SELECT * FROM semesterapparat WHERE deletion_status=?", (deleted,))
+
+
+
+def getApparatCountBySemester(self) ‑> tuple[list[str], list[int]] +
+
+

get a list of all apparats created and deleted by semester

+

Returns

+
+
tuple[list[str],list[int]]
+
a tuple containing two lists, the first list contains the semesters, the second list contains the amount of apparats created and deleted for the corresponding semester
+
+
+ +Expand source code + +
def getApparatCountBySemester(self)->tuple[list[str],list[int]]:
+    """get a list of all apparats created and deleted by semester
+
+    Returns:
+        tuple[list[str],list[int]]: a tuple containing two lists, the first list contains the semesters, the second list contains the amount of apparats created and deleted for the corresponding semester
+    """
+    conn = self.connect()
+    cursor = conn.cursor()
+    semesters = self.getSemersters()
+    created = []
+    deleted = []
+    for semester in semesters:
+        query = f"SELECT COUNT(*) FROM semesterapparat WHERE erstellsemester='{semester}'"
+        result = cursor.execute(query).fetchone()
+        created.append(result[0])
+        query = f"SELECT COUNT(*) FROM semesterapparat WHERE deletion_status=1 AND deleted_date='{semester}'"
+        result = cursor.execute(query).fetchone()
+        deleted.append(result[0])
+    # store data in a tuple
+    ret = []
+    e_tuple = ()
+    for sem in semesters:
+        e_tuple = (
+            sem,
+            created[semesters.index(sem)],
+            deleted[semesters.index(sem)],
+        )
+        ret.append(e_tuple)
+    self.close_connection(conn)
+    return ret 
+
+
+
+def getApparatData(self, appnr, appname) ‑> src.logic.dataclass.ApparatData +
+
+

Get the Apparat data based on the apparat number and the name

+

Args

+
+
appnr : str
+
the apparat number
+
appname : str
+
the name of the apparat
+
+

Raises

+
+
NoResultError
+
an error is raised if no result is found
+
+

Returns

+
+
ApparatData
+
the appended data of the apparat wrapped in an ApparatData object
+
+
+ +Expand source code + +
def getApparatData(self, appnr, appname)->ApparatData:
+    """Get the Apparat data based on the apparat number and the name
+
+    Args:
+        appnr (str): the apparat number
+        appname (str): the name of the apparat
+
+    Raises:
+        NoResultError: an error is raised if no result is found
+
+    Returns:
+        ApparatData: the appended data of the apparat wrapped in an ApparatData object
+    """
+    result = self.query_db("SELECT * FROM semesterapparat WHERE appnr=? AND name=?", (appnr,appname), one=True)
+    if result is None:
+        raise NoResultError("No result found")
+    apparat = ApparatData()
+    apparat.appname = result[1]
+    apparat.appnr = result[4]
+    apparat.dauerapp = True if result[7] == 1 else False
+    prof_data = self.getProfData(self.getProfNameById(result[2]))
+    apparat.profname = self.getProfNameById(result[2])
+    apparat.prof_mail = prof_data[0]
+    apparat.prof_tel = prof_data[1]
+    apparat.prof_title = prof_data[2]
+    apparat.app_fach = result[3]
+    apparat.erstellsemester = result[5]
+    apparat.semester = result[8]
+    apparat.deleted = result[9]
+    apparat.apparat_adis_id = result[11]
+    apparat.prof_adis_id = result[12]
+    return apparat
+
+
+
+def getApparatId(self, apparat_name) ‑> Optional[int] +
+
+

get the id of an apparat based on the name

+

Args

+
+
apparat_name : str
+
the name of the apparat e.g. "Semesterapparat 1"
+
+

Returns

+
+
Optional[int]
+
the id of the apparat, if the apparat is not found, None is returned
+
+
+ +Expand source code + +
def getApparatId(self, apparat_name)->Optional[int]:
+    """get the id of an apparat based on the name
+
+    Args:
+        apparat_name (str): the name of the apparat e.g. "Semesterapparat 1"
+
+    Returns:
+        Optional[int]: the id of the apparat, if the apparat is not found, None is returned
+    """
+    data = self.query_db("SELECT appnr FROM semesterapparat WHERE name=?", (apparat_name,), one=True)
+    if data is None:
+        return None
+    else:
+        return data[0]
+
+
+
+def getApparatName(self, app_id: Union[str, int], prof_id: Union[str, int]) +
+
+

get the name of the apparat based on the id

+

Args

+
+
app_id : Union[str,int]
+
the id of the apparat
+
prof_id : Union[str,int]
+
the id of the professor
+
+

Returns

+
+
str
+
the name of the apparat
+
+
+ +Expand source code + +
def getApparatName(self, app_id:Union[str,int], prof_id:Union[str,int]):
+    """get the name of the apparat based on the id
+
+    Args:
+        app_id (Union[str,int]): the id of the apparat
+        prof_id (Union[str,int]): the id of the professor
+
+    Returns:
+        str: the name of the apparat
+    """
+    return self.query_db("SELECT name FROM semesterapparat WHERE appnr=? AND prof_id=?", (app_id,prof_id), one=True)[0]
+
+
+
+def getApparatsByProf(self, prof_id: Union[str, int]) ‑> list[tuple] +
+
+

Get all apparats based on the professor id

+

Args

+
+
prof_id : Union[str,int]
+
the id of the professor
+
+

Returns

+
+
list[tuple]
+
a list of tuples containing the apparats
+
+
+ +Expand source code + +
def getApparatsByProf(self, prof_id:Union[str,int])->list[tuple]:
+    """Get all apparats based on the professor id
+
+    Args:
+        prof_id (Union[str,int]): the id of the professor
+
+    Returns:
+        list[tuple]: a list of tuples containing the apparats
+    """
+    return self.query_db("SELECT * FROM semesterapparat WHERE prof_id=?", (prof_id,))
+
+
+
+def getApparatsBySemester(self, semester: str) ‑> dict[list] +
+
+

get all apparats based on the semester

+

Args

+
+
semester : str
+
the selected semester
+
+

Returns

+
+
dict[list]
+
a list off all created and deleted apparats for the selected semester
+
+
+ +Expand source code + +
def getApparatsBySemester(self, semester:str)->dict[list]:
+    """get all apparats based on the semester
+
+    Args:
+        semester (str): the selected semester
+
+    Returns:
+        dict[list]: a list off all created and deleted apparats for the selected semester
+    """
+    data = self.query_db("SELECT name, prof_id FROM semesterapparat WHERE erstellsemester=?", (semester,))
+    conn = self.connect()
+    cursor = conn.cursor()
+    c_tmp = []
+    for i in data:
+        c_tmp.append((i[0], self.getProfNameById(i[1])))
+    query = (
+        f"SELECT name,prof_id FROM semesterapparat WHERE deleted_date='{semester}'"
+    )
+    result = cursor.execute(query).fetchall()
+    d_tmp = []
+    for i in result:
+        d_tmp.append((i[0], self.getProfNameById(i[1])))
+    # group the apparats by prof
+    c_ret = {}
+    for i in c_tmp:
+        if i[1] not in c_ret.keys():
+            c_ret[i[1]] = [i[0]]
+        else:
+            c_ret[i[1]].append(i[0])
+    d_ret = {}
+    for i in d_tmp:
+        if i[1] not in d_ret.keys():
+            d_ret[i[1]] = [i[0]]
+        else:
+            d_ret[i[1]].append(i[0])
+    self.close_connection(conn)
+    return {"created": c_ret, "deleted": d_ret}
+
+
+
+def getBlob(self, filename, app_id: Union[str, int]) +
+
+

Get a blob from the database

+

Args

+
+
filename : str
+
The name of the file
+
app_id : str
+
ID of the apparat
+
+

Returns

+
+
bytes
+
The file stored in
+
+
+ +Expand source code + +
def getBlob(self, filename, app_id:Union[str,int]):
+    """
+    Get a blob from the database
+
+    Args:
+        filename (str): The name of the file
+        app_id (str): ID of the apparat
+
+    Returns:
+        bytes: The file stored in 
+    """
+    return self.query_db("SELECT fileblob FROM files WHERE filename=? AND app_id=?", (filename,app_id), one=True)[0]
+
+
+
+def getBook(self, book_id: int) ‑> src.logic.dataclass.BookData +
+
+

Get the book based on the id in the database

+

Args

+
+
book_id : int
+
The id of the book
+
+

Returns

+
+
BookData
+
The metadata of the book wrapped in a BookData object
+
+
+ +Expand source code + +
def getBook(self,book_id:int)->BookData:
+    """
+    Get the book based on the id in the database
+
+    Args:
+        book_id (int): The id of the book
+
+    Returns:
+        BookData: The metadata of the book wrapped in a BookData object
+    """
+    return load_pickle(self.query_db("SELECT bookdata FROM media WHERE id=?", (book_id,), one=True)[0])
+
+
+
+def getBookBasedOnSignature(self, app_id: Union[str, int], prof_id: Union[str, int], signature: str) ‑> src.logic.dataclass.BookData +
+
+

Get the book based on the signature of the book.

+

Args

+
+
app_id : str
+
The apparat id the book should be associated with
+
prof_id : str
+
The professor id the book should be associated with
+
signature : str
+
The signature of the book
+
+

Returns

+
+
BookData
+
The total metadata of the book wrapped in a BookData object
+
+
+ +Expand source code + +
def getBookBasedOnSignature(self, app_id:Union[str,int], prof_id:Union[str,int],signature:str)->BookData:
+    """
+    Get the book based on the signature of the book.
+
+    Args:
+        app_id (str): The apparat id the book should be associated with
+        prof_id (str): The professor id the book should be associated with
+        signature (str): The signature of the book
+
+    Returns:
+        BookData: The total metadata of the book wrapped in a BookData object
+    """
+    result = self.query_db("SELECT bookdata FROM media WHERE app_id=? AND prof_id=?", (app_id,prof_id))
+    books = [load_pickle(i[0]) for i in result]
+    book = [i for i in books if i.signature == signature][0]
+    return book
+
+
+
+def getBookId(self, bookdata: src.logic.dataclass.BookData, app_id: Union[str, int], prof_id: Union[str, int]) ‑> int +
+
+

Get the id of a book based on the metadata of the book

+

Args

+
+
bookdata : BookData
+
The wrapped metadata of the book
+
app_id : str
+
The apparat id the book should be associated with
+
prof_id : str
+
The professor id the book should be associated with
+
+

Returns

+
+
int
+
ID of the book
+
+
+ +Expand source code + +
def getBookId(self, bookdata:BookData, app_id:Union[str,int], prof_id:Union[str,int])->int:
+    """
+    Get the id of a book based on the metadata of the book
+
+    Args:
+        bookdata (BookData): The wrapped metadata of the book
+        app_id (str): The apparat id the book should be associated with
+        prof_id (str): The professor id the book should be associated with
+
+    Returns:
+        int: ID of the book
+    """
+    result = self.query_db("SELECT id FROM media WHERE bookdata=? AND app_id=? AND prof_id=?", (dump_pickle(bookdata),app_id,prof_id), one=True)
+    return result[0]
+
+
+
+def getBookIdBasedOnSignature(self, app_id: Union[str, int], prof_id: Union[str, int], signature: str) ‑> int +
+
+

Get a book id based on the signature of the book.

+

Args

+
+
app_id : str
+
The apparat id the book should be associated with
+
prof_id : str
+
The professor id the book should be associated with
+
signature : str
+
The signature of the book
+
+

Returns

+
+
int
+
The id of the book
+
+
+ +Expand source code + +
def getBookIdBasedOnSignature(self, app_id:Union[str,int], prof_id:Union[str,int],signature:str)->int:
+    """
+    Get a book id based on the signature of the book.
+
+    Args:
+        app_id (str): The apparat id the book should be associated with
+        prof_id (str): The professor id the book should be associated with
+        signature (str): The signature of the book
+
+    Returns:
+        int: The id of the book
+    """
+    result = self.query_db("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]
+    book = [i for i in books if i[0].signature == signature][0][1]
+    return book
+
+
+
+def getBooks(self, app_id: Union[str, int], prof_id: Union[str, int], deleted=0) ‑> list[dict[int, src.logic.dataclass.BookData, int]] +
+
+

Get the Books based on the apparat id and the professor id

+

Args

+
+
app_id : str
+
The ID of the apparat
+
prof_id : str
+
The ID of the professor
+
deleted : int, optional
+
The state of the book. Set to 1 to include deleted ones. Defaults to 0.
+
+

Returns

+
+
list[dict[int, BookData, int]]
+
A list of dictionaries containing the id, the metadata of the book and the availability of the book
+
+
+ +Expand source code + +
def getBooks(self, app_id:Union[str,int], prof_id:Union[str,int], deleted=0)->list[dict[int, BookData, int]]:
+    """
+    Get the Books based on the apparat id and the professor id
+
+    Args:
+        app_id (str): The ID of the apparat
+        prof_id (str): The ID of the professor
+        deleted (int, optional): The state of the book. Set to 1 to include deleted ones. Defaults to 0.
+
+    Returns:
+        list[dict[int, BookData, int]]: A list of dictionaries containing the id, the metadata of the book and the availability of the book
+    """
+    qdata = self.query_db(f"SELECT id,bookdata,available FROM media WHERE (app_id={app_id} AND prof_id={prof_id}) AND (deleted={deleted if deleted == 0 else '1 OR deleted=0'})")
+    ret_result = []
+    for result_a in qdata:
+        data = {"id": int, "bookdata": BookData, "available": int}
+        data["id"] = result_a[0]
+        data["bookdata"] = load_pickle(result_a[1])
+        data["available"] = result_a[2]
+        ret_result.append(data)
+    return ret_result
+
+
+
+def getFacultyMember(self, name: str) ‑> tuple +
+
+

get a faculty member based on the name

+

Args

+
+
name : str
+
the name to be searched for
+
+

Returns

+
+
tuple
+
a tuple containing the data of the faculty member
+
+
+ +Expand source code + +
def getFacultyMember(self, name:str)->tuple:
+    """get a faculty member based on the name
+
+    Args:
+        name (str): the name to be searched for
+
+    Returns:
+        tuple: a tuple containing the data of the faculty member
+    """
+    return self.query_db("SELECT titel, fname,lname,mail,telnr,fullname FROM prof WHERE fullname=?", (name,), one=True)
+
+
+
+def getFacultyMembers(self) +
+
+

get a list of all faculty members

+

Returns

+
+
list[tuple]
+
a list of tuples containing the faculty members
+
+
+ +Expand source code + +
def getFacultyMembers(self):
+    """get a list of all faculty members
+
+    Returns:
+        list[tuple]: a list of tuples containing the faculty members
+    """
+    return self.query_db("SELECT titel, fname,lname,mail,telnr,fullname FROM prof")
+
+
+
+def getFiles(self, app_id: Union[str, int], prof_id: int) ‑> list[tuple] +
+
+

Get all the files associated with the apparat and the professor

+

Args

+
+
app_id : Union[str,int]
+
The id of the apparat
+
prof_id : Union[str,int]
+
the id of the professor
+
+

Returns

+
+
list[tuple]
+
a list of tuples containing the filename and the filetype for the corresponding apparat and professor
+
+
+ +Expand source code + +
def getFiles(self, app_id:Union[str,int], prof_id:int)->list[tuple]:
+    """Get all the files associated with the apparat and the professor
+
+    Args:
+        app_id (Union[str,int]): The id of the apparat
+        prof_id (Union[str,int]): the id of the professor
+
+    Returns:
+        list[tuple]: a list of tuples containing the filename and the filetype for the corresponding apparat and professor
+    """
+    return self.query_db("SELECT filename, filetyp FROM files WHERE app_id=? AND prof_id=?", (app_id,prof_id))
+
+
+
+def getLastBookId(self) ‑> int +
+
+

Get the last book id in the database

+

Returns

+
+
int
+
ID of the last book in the database
+
+
+ +Expand source code + +
def getLastBookId(self)->int:
+    """
+    Get the last book id in the database
+
+    Returns:
+        int: ID of the last book in the database
+    """
+    return self.query_db("SELECT id FROM media ORDER BY id DESC", one=True)[0]
+
+
+
+def getMessages(self, date: str) ‑> list[dict[str, str, str, str]] +
+
+

Get all the messages for a specific date

+

Args

+
+
date : str
+
a date.datetime object formatted as a string in the format "YYYY-MM-DD"
+
+

Returns

+
+
list[dict[str, str, str, str]]
+
a list of dictionaries containing the message, the user who added the message, the apparat id and the id of the message
+
+
+ +Expand source code + +
def getMessages(self, date:str)->list[dict[str, str, str, str]]:
+    """Get all the messages for a specific date
+
+    Args:
+        date (str): a date.datetime object formatted as a string in the format "YYYY-MM-DD"
+    
+    Returns:
+        list[dict[str, str, str, str]]: a list of dictionaries containing the message, the user who added the message, the apparat id and the id of the message
+    """
+    def __get_user_name(user_id):
+        return self.query_db("SELECT username FROM user WHERE id=?", (user_id,), one=True)[0]
+    messages = self.query_db("SELECT * FROM messages WHERE remind_at=?", (date,))
+    ret = [
+        {
+            "message": i[2],
+            "user": __get_user_name(i[4]),
+            "appnr": i[5],
+            "id": i[0]
+        }
+        for i in messages
+    ]
+    return ret
+
+
+
+def getProfByName(self, prof_name: str) ‑> tuple +
+
+

get all the data of a professor based on the name

+

Args

+
+
prof_name : str
+
the name of the professor
+
+

Returns

+
+
tuple
+
the data of the professor
+
+
+ +Expand source code + +
def getProfByName(self, prof_name:str)->tuple:
+    """get all the data of a professor based on the name
+
+    Args:
+        prof_name (str): the name of the professor
+
+    Returns:
+        tuple: the data of the professor
+    """
+    return self.query_db("SELECT * FROM prof WHERE fullname=?", (prof_name,), one=True)
+
+
+
+def getProfData(self, profname: str) +
+
+

Get mail, telephone number and title of a professor based on the name

+

Args

+
+
profname : str
+
name of the professor
+
+

Returns

+
+
tuple
+
the mail, telephone number and title of the professor
+
+
+ +Expand source code + +
def getProfData(self, profname:str):
+    """Get mail, telephone number and title of a professor based on the name
+
+    Args:
+        profname (str): name of the professor
+
+    Returns:
+        tuple: the mail, telephone number and title of the professor
+    """
+    data = self.query_db("SELECT mail, telnr, titel FROM prof WHERE fullname=?", (profname.replace(",",""),), one=True)
+    return data
+
+
+
+def getProfId(self, prof_name: str) ‑> Optional[int] +
+
+

Get the id of a professor based on the name

+

Args

+
+
prof_name : str
+
the name of the professor
+
+

Returns

+
+
Optional[int]
+
the id of the professor, if the professor is not found, None is returned
+
+
+ +Expand source code + +
def getProfId(self, prof_name:str)->Optional[int]:
+    """Get the id of a professor based on the name
+
+    Args:
+        prof_name (str): the name of the professor
+
+    Returns:
+        Optional[int]: the id of the professor, if the professor is not found, None is returned
+    """
+    
+    data = self.getProfByName(prof_name.replace(",", ""))
+    if data is None:
+        return None
+    else:
+        return data[0]
+
+
+
+def getProfNameById(self, prof_id: Union[str, int], add_title: bool = False) ‑> str +
+
+

Get a professor name based on the id

+

Args

+
+
prof_id : Union[str,int]
+
The id of the professor
+
add_title : bool, optional
+
wether to add the title or no. Defaults to False.
+
+

Returns

+
+
str
+
The name of the professor
+
+
+ +Expand source code + +
def getProfNameById(self, prof_id:Union[str,int],add_title:bool=False)->str:
+    """Get a professor name based on the id
+
+    Args:
+        prof_id (Union[str,int]): The id of the professor
+        add_title (bool, optional): wether to add the title or no. Defaults to False.
+
+    Returns:
+        str: The name of the professor
+    """
+    prof = self.query_db("SELECT fullname FROM prof WHERE id=?", (prof_id,), one=True)
+    if add_title:
+        return f"{self.getTitleById(prof_id)}{prof[0]}"
+    else:
+        return prof[0]
+
+
+
+def getProfs(self) ‑> list[tuple] +
+
+

Return all the professors in the database

+

Returns

+
+
list[tuple]
+
a list containing all the professors in individual tuples
+
+
+ +Expand source code + +
def getProfs(self)->list[tuple]:
+    """Return all the professors in the database
+
+    Returns:
+        list[tuple]: a list containing all the professors in individual tuples
+    """
+    return self.query_db("SELECT * FROM prof")
+
+
+
+def getRole(self, user) +
+
+

get the role of the user

+

Args

+
+
user : str
+
username
+
+

Returns

+
+
str
+
the name of the role
+
+
+ +Expand source code + +
def getRole(self, user):
+    """get the role of the user
+
+    Args:
+        user (str): username
+
+    Returns:
+        str: the name of the role
+    """
+    return self.query_db("SELECT role FROM user WHERE username=?", (user,), one=True)[0]
+
+
+
+def getRoles(self) ‑> list[tuple] +
+
+

get all the roles in the database

+

Returns

+
+
list[str]
+
a list of all the roles
+
+
+ +Expand source code + +
def getRoles(self)->list[tuple]:
+    """get all the roles in the database
+
+    Returns:
+        list[str]: a list of all the roles
+    """
+    return self.query_db("SELECT role FROM user")
+
+
+
+def getSemersters(self) ‑> list[str] +
+
+

Return all the unique semesters in the database

+

Returns

+
+
list
+
a list of strings containing the semesters
+
+
+ +Expand source code + +
def getSemersters(self)->list[str]:
+    """Return all the unique semesters in the database
+
+    Returns:
+        list: a list of strings containing the semesters
+    """
+    data = self.query_db("SELECT DISTINCT erstellsemester FROM semesterapparat")
+    return [i[0] for i in data]
+
+
+
+def getSpecificProfData(self, prof_id: Union[str, int], fields: List[str]) ‑> tuple +
+
+

A customisable function to get specific data of a professor based on the id

+

Args

+
+
prof_id : Union[str,int]
+
the id of the professor
+
fields : List[str]
+
a list of fields to be returned
+
+

Returns

+
+
tuple
+
a tuple containing the requested data
+
+
+ +Expand source code + +
def getSpecificProfData(self, prof_id:Union[str,int], fields:List[str])->tuple:
+    """A customisable function to get specific data of a professor based on the id
+
+    Args:
+        prof_id (Union[str,int]): the id of the professor
+        fields (List[str]): a list of fields to be returned
+
+    Returns:
+        tuple: a tuple containing the requested data
+    """
+    query = "SELECT "
+    for field in fields:
+        query += f"{field},"
+    query = query[:-1]
+    query += " FROM prof WHERE id=?"
+    return self.query_db(query, (prof_id,), one=True)[0]
+
+
+
+def getSubjects(self) +
+
+

Get all the subjects in the database

+

Returns

+
+
list[tuple]
+
a list of tuples containing the subjects
+
+
+ +Expand source code + +
def getSubjects(self):
+    """Get all the subjects in the database
+
+    Returns:
+        list[tuple]: a list of tuples containing the subjects
+    """
+    return self.query_db("SELECT * FROM subjects")
+
+
+
+def getTitleById(self, prof_id: Union[str, int]) ‑> str +
+
+

get the title of a professor based on the id

+

Args

+
+
prof_id : Union[str,int]
+
the id of the professor
+
+

Returns

+
+
str
+
the title of the professor, with an added whitespace at the end, if no title is present, an empty string is returned
+
+
+ +Expand source code + +
def getTitleById(self, prof_id:Union[str,int])->str:
+    """get the title of a professor based on the id
+
+    Args:
+        prof_id (Union[str,int]): the id of the professor
+
+    Returns:
+        str: the title of the professor, with an added whitespace at the end, if no title is present, an empty string is returned
+    """
+    title = self.query_db("SELECT titel FROM prof WHERE id=?", (prof_id,), one=True)[0]
+    return f"{title} " if title is not None else ""
+
+
+
+def getUnavailableApparatNumbers(self) ‑> List[int] +
+
+

Get a list of all the apparat numbers in the database that are currently in use

+

Returns

+
+
List[int]
+
the list of used apparat numbers
+
+
+ +Expand source code + +
def getUnavailableApparatNumbers(self)->List[int]:
+    """Get a list of all the apparat numbers in the database that are currently in use
+
+    Returns:
+        List[int]: the list of used apparat numbers
+    """
+    numbers = self.query_db("SELECT appnr FROM semesterapparat WHERE deletion_status=0")    
+    numbers = [i[0] for i in numbers]
+    logger.log_info(f"Currently used apparat numbers: {numbers}")
+    return numbers
+
+
+
+def getUser(self) +
+
+

Get a single user from the database

+
+ +Expand source code + +
def getUser(self):
+    """Get a single user from the database"""
+    return self.query_db("SELECT * FROM user", one=True)
+
+
+
+def getUsers(self) ‑> list[tuple] +
+
+

Return a list of tuples of all the users in the database

+
+ +Expand source code + +
def getUsers(self)->list[tuple]:
+    """Return a list of tuples of all the users in the database"""
+    return self.query_db("SELECT * FROM user")
+
+
+
+def get_db_contents(self) ‑> Optional[List[Tuple]] +
+
+

Get the contents of the

+

Returns

+
+
Union[List[Tuple], None]
+
description
+
+
+ +Expand source code + +
def get_db_contents(self)->Union[List[Tuple], None]:
+    """
+    Get the contents of the 
+
+    Returns:
+        Union[List[Tuple], None]: _description_
+    """
+    try:
+        with sql.connect(self.db_path) as conn:
+            cursor = conn.cursor()
+            cursor.execute("SELECT * FROM sqlite_master WHERE type='table'")
+            return cursor.fetchall()
+    except sql.OperationalError:
+        return None
+
+
+
+def insertFile(self, file: list[dict], app_id: Union[str, int], prof_id: Union[str, int]) +
+
+

Instert a list of files into the database

+

Args

+
+
file : list[dict]
+
a list containing all the files to be inserted
+
Structured
+
[{"name": "filename", "path": "path", "type": "filetype"}]
+
app_id : int
+
the id of the apparat
+
prof_id : str
+
the id of the professor
+
+
+ +Expand source code + +
def insertFile(self, file: list[dict], app_id:Union[str,int], prof_id:Union[str,int]):
+    """Instert a list of files into the database
+
+    Args:
+        file (list[dict]): a list containing all the files to be inserted
+        Structured: [{"name": "filename", "path": "path", "type": "filetype"}]
+        app_id (int): the id of the apparat
+        prof_id (str): the id of the professor
+    """
+    for f in file:
+        filename = f["name"]
+        path = f["path"]
+        filetyp = f["type"]
+        if path == "Database":
+            continue
+        blob = create_blob(path)
+        query = "INSERT OR IGNORE INTO files (filename, fileblob, app_id, filetyp,prof_id) VALUES (?, ?, ?, ?,?)"
+        self.query_db(query, (filename, blob, app_id, filetyp,prof_id))
+
+
+
+def insertInto(self, query: str, params: Tuple) ‑> None +
+
+

Insert sent data into the database

+

Args

+
+
query : str
+
The query to be executed
+
params : Tuple
+
the parameters to be inserted into the database
+
+
+ +Expand source code + +
def insertInto(self, query:str, params:Tuple) -> None:
+    """
+    Insert sent data into the database
+
+    Args:
+        query (str): The query to be executed
+        params (Tuple): the parameters to be inserted into the database
+    """
+    conn = self.connect()
+    cursor = conn.cursor()
+    logger.log_info(f"Inserting {params} into database with query {query}")
+    cursor.execute(query, params)
+    conn.commit()
+    self.close_connection(conn)
+
+
+
+def isEternal(self, id) +
+
+

check if the apparat is eternal (dauerapparat)

+

Args

+
+
id : int
+
the id of the apparat to be checked
+
+

Returns

+
+
int
+
the state of the apparat
+
+
+ +Expand source code + +
def isEternal(self, id):
+    """check if the apparat is eternal (dauerapparat)
+
+    Args:
+        id (int): the id of the apparat to be checked
+
+    Returns:
+        int: the state of the apparat
+    """
+    return self.query_db("SELECT dauer FROM semesterapparat WHERE appnr=?", (id,), one=True)
+
+
+
+def login(self, user, hashed_password) +
+
+

try to login the user. +The salt for the user will be requested from the database and then added to the hashed password. The password will then be compared to the password in the database

+

Args

+
+
user : str
+
username that tries to login
+
hashed_password : str
+
the password the user tries to login with
+
+

Returns

+
+
bool
+
True if the login was successful, False if not
+
+
+ +Expand source code + +
def login(self, user, hashed_password):
+    """try to login the user.
+    The salt for the user will be requested from the database and then added to the hashed password. The password will then be compared to the password in the database 
+
+    Args:
+        user (str): username that tries to login
+        hashed_password (str): the password the user tries to login with
+
+    Returns:
+        bool: True if the login was successful, False if not
+    """
+    salt = self.query_db("SELECT salt FROM user WHERE username=?", (user,), one=True)[0]
+    if salt is None:
+        return False
+    hashed_password = salt + hashed_password
+    password = self.query_db("SELECT password FROM user WHERE username=?", (user,), one=True)[0]
+    if password == hashed_password:
+        return True
+    else:
+        return False
+
+
+
+def query_db(self, query: str, args: Tuple = (), one: bool = False) ‑> Union[Tuple, List[Tuple]] +
+
+

Query the Database for the sent query.

+

Args

+
+
query : str
+
The query to be executed
+
args : Tuple, optional
+
The arguments for the query. Defaults to ().
+
one : bool, optional
+
Return the first result only. Defaults to False.
+
+

Returns

+

Union[Typle|List[Tuple]]: Returns the result of the query

+
+ +Expand source code + +
def query_db(self, query: str, args: Tuple = (), one: bool = False)->Union[Tuple, List[Tuple]]:
+    """
+    Query the Database for the sent query.
+
+    Args:
+        query (str): The query to be executed
+        args (Tuple, optional): The arguments for the query. Defaults to ().
+        one (bool, optional): Return the first result only. Defaults to False.
+
+    Returns:
+        Union[Typle|List[Tuple]]: Returns the result of the query
+    """
+    conn = self.connect()
+    cursor = conn.cursor()
+    logger.log_info(f"Querying database with query {query}, args: {args}")
+    cursor.execute(query, args)
+    rv = cursor.fetchall()
+    conn.commit()
+    self.close_connection(conn)
+    return (rv[0] if rv else None) if one else rv
+
+
+
+def recreateFile(self, filename: str, app_id: Union[str, int], filetype: str) ‑> str +
+
+

Recreate a file from the database

+

Args

+
+
filename : str
+
the name of the file
+
app_id : Union[str,int]
+
the id of the apparat
+
filetype : str
+
the extension of the file to be created
+
+

Returns

+
+
str
+
The filename of the recreated file
+
+
+ +Expand source code + +
def recreateFile(self, filename:str, app_id:Union[str,int],filetype:str)->str:
+    """Recreate a file from the database
+
+    Args:
+        filename (str): the name of the file
+        app_id (Union[str,int]): the id of the apparat
+        filetype (str): the extension of the file to be created
+
+    Returns:
+        str: The filename of the recreated file 
+    """
+    blob = self.getBlob(filename, app_id)
+    tempdir = config.database.tempdir
+    tempdir = tempdir.replace("~", str(Path.home()))
+    tempdir_path = Path(tempdir)        
+    if not os.path.exists(tempdir_path):
+        os.mkdir(tempdir_path)
+    file = tempfile.NamedTemporaryFile(
+        delete=False, dir=tempdir_path, mode="wb", suffix=f".{filetype}"
+    )
+    file.write(blob)
+    print("file created")
+    return file.name
+
+
+
+def searchBook(self, data: dict[str, str]) ‑> list[tuple[src.logic.dataclass.BookData, int]] +
+
+

Search a book in the database based on the sent data.

+

Args

+
+
data : dict[str, str]
+
A dictionary containing the data to be searched for. The dictionary can contain the following:
+
+
    +
  • signature: The signature of the book
  • +
  • title: The title of the book
  • +
+

Returns

+
+
list[tuple[BookData, int]]
+
A list of tuples containing the wrapped Metadata and the id of the book
+
+
+ +Expand source code + +
def searchBook(self, data:dict[str, str])->list[tuple[BookData, int]]:
+    """
+    Search a book in the database based on the sent data.
+
+    Args:
+        data (dict[str, str]): A dictionary containing the data to be searched for. The dictionary can contain the following: 
+        - signature: The signature of the book
+        - title: The title of the book
+
+    Returns:
+        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")
+    ic(rdata, len(rdata))
+    mode = 0
+    if len(data)== 1:
+        if "signature" in data.keys():
+            mode = 1
+        elif "title" in data.keys():
+            mode = 2
+    elif len(data) == 2:
+        mode = 3
+    else:
+        return None
+    ret = []
+    for book in rdata:
+        bookdata = load_pickle(book[1])
+        app_id = book[2]
+        prof_id = book[3]
+        if mode == 1:
+            if data["signature"] in bookdata.signature:
+                ret.append((bookdata,app_id,prof_id))
+        elif mode == 2:
+            if data["title"] in bookdata.title:
+                ret.append((bookdata,app_id,prof_id))
+        elif mode == 3:
+            if data["signature"] in bookdata.signature and data["title"] in bookdata.title:
+                ret.append((bookdata,app_id,prof_id))
+    ic(ret)
+    return ret
+
+
+
+def setAvailability(self, book_id: str, available: str) +
+
+

Set the availability of a book in the database

+

Args

+
+
book_id : str
+
The id of the book
+
available : str
+
The availability of the book
+
+
+ +Expand source code + +
def setAvailability(self, book_id:str, available:str):
+    """
+    Set the availability of a book in the database
+
+    Args:
+        book_id (str): The id of the book
+        available (str): The availability of the book
+    """
+    self.query_db("UPDATE media SET available=? WHERE id=?", (available,book_id))
+
+
+
+def setNewSemesterDate(self, app_id: Union[str, int], newDate, dauerapp=False) +
+
+

Set the new semester date for an apparat

+

Args

+
+
app_id : Union[str,int]
+
the id of the apparat
+
newDate : str
+
the new date
+
dauerapp : bool, optional
+
if the apparat was changed to dauerapparat. Defaults to False.
+
+
+ +Expand source code + +
def setNewSemesterDate(self, app_id:Union[str,int], newDate, dauerapp=False):
+    """Set the new semester date for an apparat
+
+    Args:
+        app_id (Union[str,int]): the id of the apparat
+        newDate (str): the new date
+        dauerapp (bool, optional): if the apparat was changed to dauerapparat. Defaults to False.
+    """
+    date = datetime.datetime.strptime(newDate, "%d.%m.%Y").strftime("%Y-%m-%d")
+    if dauerapp:
+        self.query_db("UPDATE semesterapparat SET verlängerung_bis=?, dauerapp=? WHERE appnr=?", (date,dauerapp,app_id))
+    else:
+        self.query_db("UPDATE semesterapparat SET endsemester=? WHERE appnr=?", (date,app_id))
+
+
+
+def statistic_request(self, **kwargs: Any) +
+
+

Take n amount of kwargs and return the result of the query

+
+ +Expand source code + +
def statistic_request(self, **kwargs: Any):
+    """Take n amount of kwargs and return the result of the query
+    """
+    def __query(query):
+        """execute the query and return the result
+
+        Args:
+            query (str): the constructed query
+
+        Returns:
+            list: the result of the query
+        """
+        conn = self.connect()
+        cursor = conn.cursor()
+        result = cursor.execute(query).fetchall()
+        for result_a in result:
+            orig_value = result_a
+            prof_name = self.getProfNameById(result_a[2])
+            # replace the prof_id with the prof_name
+            result_a = list(result_a)
+            result_a[2] = prof_name
+            result_a = tuple(result_a)
+            result[result.index(orig_value)] = result_a
+        self.close_connection(conn)
+        return result
+    if "deletable" in kwargs.keys():
+        query = f"SELECT * FROM semesterapparat WHERE deletion_status=0 AND dauer=0 AND (erstellsemester!='{kwargs['deletesemester']}' OR verlängerung_bis!='{kwargs['deletesemester']}')"
+        return __query(query)
+    if "dauer" in kwargs.keys():
+        kwargs["dauer"] = kwargs["dauer"].replace("Ja", "1").replace("Nein", "0")
+    query = "SELECT * FROM semesterapparat WHERE "
+    for key, value in kwargs.items() if kwargs.items() is not None else {}:
+        print(key, value)
+        query += f"{key}='{value}' AND "
+        print(query)
+    # remove deletesemester part from normal query, as this will be added to the database upon deleting the apparat
+    if "deletesemester" in kwargs.keys():
+        query = query.replace(
+            f"deletesemester='{kwargs['deletesemester']}' AND ", ""
+        )
+    if "endsemester" in kwargs.keys():
+        if "erstellsemester" in kwargs.keys():
+            query = query.replace(f"endsemester='{kwargs['endsemester']}' AND ", "")
+            query = query.replace(
+                f"erstellsemester='{kwargs['erstellsemester']} AND ", "xyz"
+            )
+        else:
+            query = query.replace(
+                f"endsemester='{kwargs['endsemester']}' AND ", "xyz"
+            )
+            print("replaced")
+        query = query.replace(
+            "xyz",
+            f"(erstellsemester='{kwargs['endsemester']}' OR verlängerung_bis='{kwargs['endsemester']}') AND ",
+        )
+    # remove all x="" parts from the query where x is a key in kwargs
+    query = query[:-5]
+    print(query)
+    return __query(query)
+
+
+
+def updateApparat(self, apparat_data: src.logic.dataclass.ApparatData) +
+
+

Update an apparat in the database

+

Args

+
+
apparat_data : ApparatData
+
the new metadata of the apparat
+
+
+ +Expand source code + +
def updateApparat(self, apparat_data:ApparatData):
+    """Update an apparat in the database
+
+    Args:
+        apparat_data (ApparatData): the new metadata of the apparat
+    """
+    query = f"UPDATE semesterapparat SET name = ?, fach = ?, dauer = ?, prof_id = ? WHERE appnr = ?"
+    params = (
+        apparat_data.appname,
+        apparat_data.app_fach,
+        apparat_data.dauerapp,
+        self.getProfId(apparat_data.profname),
+        apparat_data.appnr,        
+    )
+    self.query_db(query, params)
+
+
+
+def updateBookdata(self, book_id, bookdata: src.logic.dataclass.BookData) +
+
+

Update the bookdata in the database

+

Args

+
+
book_id : str
+
The id of the book
+
bookdata : BookData
+
The new metadata of the book
+
+
+ +Expand source code + +
def updateBookdata(self, book_id, bookdata:BookData):
+    """
+    Update the bookdata in the database
+
+    Args:
+        book_id (str): The id of the book
+        bookdata (BookData): The new metadata of the book
+    """
+    self.query_db("UPDATE media SET bookdata=? WHERE id=?", (dump_pickle(bookdata),book_id))
+
+
+
+def updateFacultyMember(self, data: dict, oldlname: str, oldfname: str) +
+
+

update the data of a faculty member

+

Args

+
+
data : dict
+
a dictionary containing the data to be updated
+
oldlname : str
+
the old last name of the faculty member
+
oldfname : str
+
the old first name of the faculty member
+
+
+ +Expand source code + +
def updateFacultyMember(self, data:dict, oldlname:str, oldfname:str):
+    """update the data of a faculty member
+
+    Args:
+        data (dict): a dictionary containing the data to be updated
+        oldlname (str): the old last name of the faculty member
+        oldfname (str): the old first name of the faculty member
+    """
+    placeholders = ", ".join([f"{i}=:{i} " for i in data.keys()])
+    query = f"UPDATE prof SET {placeholders} WHERE lname = :oldlname AND fname = :oldfname"
+    data["oldlname"] = oldlname
+    data["oldfname"] = oldfname
+    self.query_db(query, data)
+
+
+
+def updateUser(self, username, data: dict[str, str]) +
+
+

changge the data of a user

+

Args

+
+
username : str
+
the username of the user
+
data : dict[str, str]
+
the data to be changed
+
+
+ +Expand source code + +
def updateUser(self, username, data:dict[str, str]):
+    """changge the data of a user
+
+    Args:
+        username (str): the username of the user
+        data (dict[str, str]): the data to be changed
+    """
+    conn = self.connect()
+    cursor = conn.cursor()
+    query = "UPDATE user SET "
+    for key,value in data.items():
+        if key == "username":
+            continue
+        query += f"{key}='{value}',"
+    query = query[:-1]
+    query += " WHERE username=?"
+    params = (username,)
+    cursor.execute(query, params)
+    conn.commit()
+    self.close_connection(conn)
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/docs/db.html b/docs/db.html new file mode 100644 index 0000000..f2b125f --- /dev/null +++ b/docs/db.html @@ -0,0 +1,132 @@ + + + + + + +db API documentation + + + + + + + + + + + +
+
+
+

Module db

+
+
+

Module db provides the database schema for the semesterapparat application.

+
+
+
+ +Expand source code + +
CREATE_TABLE_APPARAT = """CREATE TABLE semesterapparat (
+    id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
+    name TEXT,
+    prof_id INTEGER,
+    fach TEXT,
+    appnr INTEGER,
+    erstellsemester TEXT,
+    verlängert_am TEXT,
+    dauer BOOLEAN,
+    verlängerung_bis TEXT,
+    deletion_status INTEGER,
+    deleted_date TEXT,
+    apparat_id_adis INTEGER,
+    prof_id_adis INTEGER,
+    konto INTEGER REFERENCES app_kontos (id),
+    FOREIGN KEY (prof_id) REFERENCES prof (id)
+  )"""
+CREATE_TABLE_MEDIA = """CREATE TABLE media (
+    id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
+    bookdata BLOB,
+    app_id INTEGER,
+    prof_id INTEGER,
+    deleted INTEGER DEFAULT (0),
+    available BOOLEAN,
+    reservation BOOLEAN,
+    FOREIGN KEY (prof_id) REFERENCES prof (id),
+    FOREIGN KEY (app_id) REFERENCES semesterapparat (id)
+  )"""
+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,
+    fileblob BLOB,
+    app_id INTEGER,
+    filetyp TEXT,
+    prof_id INTEGER REFERENCES prof (id),
+    FOREIGN KEY (app_id) REFERENCES semesterapparat (id)
+    )"""
+CREATE_TABLE_MESSAGES = """CREATE TABLE messages (
+    id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
+    created_at date NOT NULL DEFAULT CURRENT_TIMESTAMP,
+    message TEXT NOT NULL,
+    remind_at date NOT NULL DEFAULT CURRENT_TIMESTAMP,
+    user_id INTEGER NOT NULL,
+    appnr INTEGER,
+    FOREIGN KEY (user_id) REFERENCES user (id)
+  )"""
+CREATE_TABLE_PROF = """CREATE TABLE prof (
+    id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
+    titel TEXT,
+    fname TEXT,
+    lname TEXT,
+    fullname TEXT NOT NULL UNIQUE,
+    mail TEXT,
+    telnr TEXT
+  )"""
+CREATE_TABLE_USER = """CREATE TABLE user (
+    id integer NOT NULL PRIMARY KEY AUTOINCREMENT,
+    created_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
+    username TEXT NOT NULL UNIQUE,
+    password TEXT NOT NULL,
+    salt TEXT NOT NULL,
+    role TEXT NOT NULL,
+    email TEXT UNIQUE,
+    name TEXT
+  )"""
+CREATE_TABLE_SUBJECTS = """CREATE TABLE subjects (
+    id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
+    name TEXT NOT NULL UNIQUE
+)"""
+
+
+
+
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/src/backend/admin_console.py b/src/backend/admin_console.py index 891f9b1..586b64d 100644 --- a/src/backend/admin_console.py +++ b/src/backend/admin_console.py @@ -7,14 +7,31 @@ from src.backend.database import Database # change passwords for apparats, change passwords for users, list users, create and delete users etc # create a class that has all commands. for each command, create a function that does the thing class AdminCommands: + """Basic Admin commands for the admin console. This class is used to create, delete, and list users. It also has the ability to change passwords for users. + """ def __init__(self): + """Defaulf Constructor for the AdminCommands class. + """ self.db = Database() - def create_password(self, password): + def create_password(self, password:str)->tuple[str,str]: + """Create a hashed password and a salt for the password. + + Args: + password (str): the base password to be hashed. + + Returns: + tuple[str,str]: a tuple containing the hashed password and the salt used to hash the password. + """ salt = self.create_salt() hashed_password = self.hash_password(password) return (hashed_password,salt) - def create_salt(self): + def create_salt(self)->str: + """Generate a random 16 digit long salt for the password. + + Returns: + str: the randomized salt + """ return "".join( random.choices( "abcdefghijklmnopqrstuvwxyzQWERTZUIOPLKJHGFDSAYXCVBNM0123456789", k=16 @@ -22,31 +39,47 @@ class AdminCommands: ) def create_admin(self): + """Create the admin in the database. This is only used once, when the database is created. + """ salt = self.create_salt() hashed_password = self.hash_password("admin") self.db.createUser("admin", salt+hashed_password, "admin", salt) - def hash_password(self, password): + def hash_password(self, password:str)->str: + """Hash a password using SHA256. + + Args: + password (str): the password to be hashed. + + Returns: + str: the hashed password. + """ hashed = hashlib.sha256((password).encode("utf-8")).hexdigest() return hashed - def list_users(self): + def list_users(self)->list[tuple]: + """List all available users in the database. + + Returns: + list[tuple]: a list of all users, containing all stored data for each user in a tuple. + """ return self.db.getUsers() - def delete_user(self, username): + def delete_user(self, username:str): + """Delete a selected user from the database. + + Args: + username (str): the username of the user to be deleted. + """ self.db.deleteUser(username) def change_password(self, username, password): + """change the password for a user. + + Args: + username (str): username of the user to change the password for. + password (str): the new, non-hashed password to change to. + """ hashed_password = self.hash_password(password) self.db.changePassword(username, hashed_password) - -if __name__ == "__main__": - c = AdminCommands() - c.create_user("test", "test", "user") - c.create_user("admin", "admin", "admin") - print(c.list_users()) - c.delete_user("test") - print(c.list_users()) - c.change_password("admin", "nopass") - print(c.list_users()) diff --git a/src/backend/database.py b/src/backend/database.py index 214c115..32a6ec2 100644 --- a/src/backend/database.py +++ b/src/backend/database.py @@ -36,7 +36,6 @@ class Database: if self.get_db_contents() is None: logger.log_critical("Database does not exist, creating tables") self.create_tables() - def get_db_contents(self)->Union[List[Tuple], None]: """ Get the contents of the @@ -51,7 +50,6 @@ class Database: return cursor.fetchall() except sql.OperationalError: return None - def connect(self)->sql.Connection: """ Connect to the database @@ -60,7 +58,6 @@ class Database: sql.Connection: The active connection to the database """ return sql.connect(self.db_path) - def close_connection(self, conn: sql.Connection): """ closes the connection to the database @@ -70,7 +67,6 @@ class Database: - conn (sql.Connection): the connection to be closed """ conn.close() - def create_tables(self): """ Create the tables in the database @@ -87,7 +83,6 @@ class Database: cursor.execute(CREATE_TABLE_SUBJECTS) conn.commit() self.close_connection(conn) - def insertInto(self, query:str, params:Tuple) -> None: """ Insert sent data into the database @@ -102,7 +97,6 @@ class Database: cursor.execute(query, params) conn.commit() self.close_connection(conn) - def query_db(self, query: str, args: Tuple = (), one: bool = False)->Union[Tuple, List[Tuple]]: """ Query the Database for the sent query. @@ -125,7 +119,7 @@ class Database: return (rv[0] if rv else None) if one else rv # Books - def addBookToDatabase(self, bookdata:BookData,app_id:str, prof_id:str): + def addBookToDatabase(self, bookdata:BookData,app_id:Union[str,int], prof_id:Union[str,int]): """ Add books to the database. Both app_id and prof_id are required to add the book to the database, as the app_id and prof_id are used to select the books later on. @@ -166,7 +160,7 @@ class Database: cursor.execute(query, params) conn.commit() self.close_connection(conn) - def getBookIdBasedOnSignature(self, app_id:str, prof_id:str,signature:str)->int: + def getBookIdBasedOnSignature(self, app_id:Union[str,int], prof_id:Union[str,int],signature:str)->int: """ Get a book id based on the signature of the book. @@ -182,7 +176,7 @@ class Database: books = [(load_pickle(i[0]),i[1]) for i in result] book = [i for i in books if i[0].signature == signature][0][1] return book - def getBookBasedOnSignature(self, app_id:str, prof_id:str,signature:str)->BookData: + def getBookBasedOnSignature(self, app_id:Union[str,int], prof_id:Union[str,int],signature:str)->BookData: """ Get the book based on the signature of the book. @@ -255,7 +249,7 @@ class Database: available (str): The availability of the book """ self.query_db("UPDATE media SET available=? WHERE id=?", (available,book_id)) - def getBookId(self, bookdata:BookData, app_id, prof_id)->int: + def getBookId(self, bookdata:BookData, app_id:Union[str,int], prof_id:Union[str,int])->int: """ Get the id of a book based on the metadata of the book @@ -280,7 +274,7 @@ class Database: BookData: The metadata of the book wrapped in a BookData object """ return load_pickle(self.query_db("SELECT bookdata FROM media WHERE id=?", (book_id,), one=True)[0]) - def getBooks(self, app_id, prof_id, deleted=0)->list[dict[int, BookData, int]]: + def getBooks(self, app_id:Union[str,int], prof_id:Union[str,int], deleted=0)->list[dict[int, BookData, int]]: """ Get the Books based on the apparat id and the professor id @@ -301,7 +295,6 @@ class Database: data["available"] = result_a[2] ret_result.append(data) return ret_result - def updateBookdata(self, book_id, bookdata:BookData): """ Update the bookdata in the database @@ -321,7 +314,7 @@ class Database: self.query_db("UPDATE media SET deleted=1 WHERE id=?", (book_id,)) # File Interactions - def getBlob(self, filename, app_id): + def getBlob(self, filename, app_id:Union[str,int]): """ Get a blob from the database @@ -333,7 +326,15 @@ class Database: bytes: The file stored in """ return self.query_db("SELECT fileblob FROM files WHERE filename=? AND app_id=?", (filename,app_id), one=True)[0] - def insertFile(self, file: list[dict], app_id: int, prof_id): + def insertFile(self, file: list[dict], app_id:Union[str,int], prof_id:Union[str,int]): + """Instert a list of files into the database + + Args: + file (list[dict]): a list containing all the files to be inserted + Structured: [{"name": "filename", "path": "path", "type": "filetype"}] + app_id (int): the id of the apparat + prof_id (str): the id of the professor + """ for f in file: filename = f["name"] path = f["path"] @@ -343,7 +344,17 @@ class Database: blob = create_blob(path) query = "INSERT OR IGNORE INTO files (filename, fileblob, app_id, filetyp,prof_id) VALUES (?, ?, ?, ?,?)" self.query_db(query, (filename, blob, app_id, filetyp,prof_id)) - def recreateFile(self, filename, app_id,filetype): + def recreateFile(self, filename:str, app_id:Union[str,int],filetype:str)->str: + """Recreate a file from the database + + Args: + filename (str): the name of the file + app_id (Union[str,int]): the id of the apparat + filetype (str): the extension of the file to be created + + Returns: + str: The filename of the recreated file + """ blob = self.getBlob(filename, app_id) tempdir = config.database.tempdir tempdir = tempdir.replace("~", str(Path.home())) @@ -356,23 +367,57 @@ class Database: file.write(blob) print("file created") return file.name - def getFiles(self, app_id:int, prof_id:int)->list[tuple]: + def getFiles(self, app_id:Union[str,int], prof_id:int)->list[tuple]: + """Get all the files associated with the apparat and the professor + + Args: + app_id (Union[str,int]): The id of the apparat + prof_id (Union[str,int]): the id of the professor + + Returns: + list[tuple]: a list of tuples containing the filename and the filetype for the corresponding apparat and professor + """ return self.query_db("SELECT filename, filetyp FROM files WHERE app_id=? AND prof_id=?", (app_id,prof_id)) - def getSemersters(self): + def getSemersters(self)->list[str]: + """Return all the unique semesters in the database + + Returns: + list: a list of strings containing the semesters + """ data = self.query_db("SELECT DISTINCT erstellsemester FROM semesterapparat") return [i[0] for i in data] def getSubjects(self): + """Get all the subjects in the database + + Returns: + list[tuple]: a list of tuples containing the subjects + """ return self.query_db("SELECT * FROM subjects") # Messages - def addMessage(self, message:dict,user, appnr): + def addMessage(self, message:dict,user:str, app_id:Union[str,int]): + """add a Message to the database + + Args: + message (dict): the message to be added + user (str): the user who added the message + app_id (Union[str,int]): the id of the apparat + """ def __getUserId(user): return self.query_db("SELECT id FROM user WHERE username=?", (user,), one=True)[0] user_id = __getUserId(user) - self.query_db("INSERT INTO messages (message, user_id, remind_at,appnr) VALUES (?,?,?,?)", (message["message"],user_id,message["remind_at"],appnr)) - def getMessages(self, date:str): + self.query_db("INSERT INTO messages (message, user_id, remind_at,appnr) VALUES (?,?,?,?)", (message["message"],user_id,message["remind_at"],app_id)) + def getMessages(self, date:str)->list[dict[str, str, str, str]]: + """Get all the messages for a specific date + + Args: + date (str): a date.datetime object formatted as a string in the format "YYYY-MM-DD" + + Returns: + list[dict[str, str, str, str]]: a list of dictionaries containing the message, the user who added the message, the apparat id and the id of the message + """ def __get_user_name(user_id): return self.query_db("SELECT username FROM user WHERE id=?", (user_id,), one=True)[0] messages = self.query_db("SELECT * FROM messages WHERE remind_at=?", (date,)) @@ -387,48 +432,74 @@ class Database: ] return ret def deleteMessage(self, message_id): + """Delete a message from the database + + Args: + message_id (str): the id of the message + """ self.query_db("DELETE FROM messages WHERE id=?", (message_id,)) # Prof data - def getProfNameById(self, prof_id:int,add_title:bool=False): + def getProfNameById(self, prof_id:Union[str,int],add_title:bool=False)->str: + """Get a professor name based on the id + + Args: + prof_id (Union[str,int]): The id of the professor + add_title (bool, optional): wether to add the title or no. Defaults to False. + + Returns: + str: The name of the professor + """ prof = self.query_db("SELECT fullname FROM prof WHERE id=?", (prof_id,), one=True) if add_title: return f"{self.getTitleById(prof_id)}{prof[0]}" else: return prof[0] - def getTitleById(self, prof_id:int): + def getTitleById(self, prof_id:Union[str,int])->str: + """get the title of a professor based on the id + + Args: + prof_id (Union[str,int]): the id of the professor + + Returns: + str: the title of the professor, with an added whitespace at the end, if no title is present, an empty string is returned + """ title = self.query_db("SELECT titel FROM prof WHERE id=?", (prof_id,), one=True)[0] return f"{title} " if title is not None else "" - def getProfByName(self, prof_name:str): - return self.query_db("SELECT * FROM prof WHERE fullname=?", (prof_name,), one=True) - def getProfId(self, prof_name:str): - """ - getProfId _summary_ + def getProfByName(self, prof_name:str)->tuple: + """get all the data of a professor based on the name - :param prof_name: _description_ - :type prof_name: str - :return: _description_ - :rtype: _type_ + Args: + prof_name (str): the name of the professor + + Returns: + tuple: the data of the professor """ + return self.query_db("SELECT * FROM prof WHERE fullname=?", (prof_name,), one=True) + def getProfId(self, prof_name:str)->Optional[int]: + """Get the id of a professor based on the name + + Args: + prof_name (str): the name of the professor + + Returns: + Optional[int]: the id of the professor, if the professor is not found, None is returned + """ + data = self.getProfByName(prof_name.replace(",", "")) if data is None: return None else: return data[0] - def getSpecificProfData(self, prof_id:int, fields:List[str]): - """ - getSpecificProfData _summary_ - - - + def getSpecificProfData(self, prof_id:Union[str,int], fields:List[str])->tuple: + """A customisable function to get specific data of a professor based on the id + Args: - ---- - - prof_id (int): _description_ - - fields (List[str]): _description_ - + prof_id (Union[str,int]): the id of the professor + fields (List[str]): a list of fields to be returned + Returns: - ------- - - _type_: _description_ + tuple: a tuple containing the requested data """ query = "SELECT " for field in fields: @@ -437,10 +508,22 @@ class Database: query += " FROM prof WHERE id=?" return self.query_db(query, (prof_id,), one=True)[0] def getProfData(self, profname:str): - + """Get mail, telephone number and title of a professor based on the name + + Args: + profname (str): name of the professor + + Returns: + tuple: the mail, telephone number and title of the professor + """ data = self.query_db("SELECT mail, telnr, titel FROM prof WHERE fullname=?", (profname.replace(",",""),), one=True) return data def createProf(self, prof_details:dict): + """Create a professor in the database + + Args: + prof_details (dict): a dictionary containing the details of the professor + """ prof_title = prof_details["prof_title"] prof_fname = prof_details["profname"].split(",")[1] prof_fname = prof_fname.strip() @@ -452,14 +535,38 @@ class Database: params = (prof_title, prof_fname, prof_lname, prof_mail, prof_tel, prof_fullname) query = "INSERT OR IGNORE INTO prof (titel, fname, lname, mail, telnr, fullname) VALUES (?, ?, ?, ?, ?, ?)" self.insertInto(query=query, params=params) - def getProfs(self): + def getProfs(self)->list[tuple]: + """Return all the professors in the database + + Returns: + list[tuple]: a list containing all the professors in individual tuples + """ return self.query_db("SELECT * FROM prof") # Apparat - def getAllAparats(self,deleted=0): + def getAllAparats(self,deleted=0)->list[tuple]: + """Get all the apparats in the database + + Args: + deleted (int, optional): Switch the result to use . Defaults to 0. + + Returns: + list[tuple]: a list of tuples containing the apparats + """ return self.query_db("SELECT * FROM semesterapparat WHERE deletion_status=?", (deleted,)) def getApparatData(self, appnr, appname)->ApparatData: + """Get the Apparat data based on the apparat number and the name + Args: + appnr (str): the apparat number + appname (str): the name of the apparat + + Raises: + NoResultError: an error is raised if no result is found + + Returns: + ApparatData: the appended data of the apparat wrapped in an ApparatData object + """ result = self.query_db("SELECT * FROM semesterapparat WHERE appnr=? AND name=?", (appnr,appname), one=True) if result is None: raise NoResultError("No result found") @@ -480,36 +587,59 @@ class Database: apparat.prof_adis_id = result[12] return apparat def getUnavailableApparatNumbers(self)->List[int]: - """ - getUnavailableApparatNumbers returns a list of all currently used ApparatNumbers - - - + """Get a list of all the apparat numbers in the database that are currently in use + Returns: - ------- - - number(List[int]): a list of all currently used apparat numbers + List[int]: the list of used apparat numbers """ numbers = self.query_db("SELECT appnr FROM semesterapparat WHERE deletion_status=0") numbers = [i[0] for i in numbers] logger.log_info(f"Currently used apparat numbers: {numbers}") return numbers - def setNewSemesterDate(self, appnr, newDate, dauerapp=False): + def setNewSemesterDate(self, app_id:Union[str,int], newDate, dauerapp=False): + """Set the new semester date for an apparat + + Args: + app_id (Union[str,int]): the id of the apparat + newDate (str): the new date + dauerapp (bool, optional): if the apparat was changed to dauerapparat. Defaults to False. + """ date = datetime.datetime.strptime(newDate, "%d.%m.%Y").strftime("%Y-%m-%d") if dauerapp: - self.query_db("UPDATE semesterapparat SET verlängerung_bis=?, dauerapp=? WHERE appnr=?", (date,dauerapp,appnr)) + self.query_db("UPDATE semesterapparat SET verlängerung_bis=?, dauerapp=? WHERE appnr=?", (date,dauerapp,app_id)) else: - self.query_db("UPDATE semesterapparat SET endsemester=? WHERE appnr=?", (date,appnr)) - def getApparatId(self, apparat_name): + self.query_db("UPDATE semesterapparat SET endsemester=? WHERE appnr=?", (date,app_id)) + def getApparatId(self, apparat_name)->Optional[int]: + """get the id of an apparat based on the name + + Args: + apparat_name (str): the name of the apparat e.g. "Semesterapparat 1" + + Returns: + Optional[int]: the id of the apparat, if the apparat is not found, None is returned + """ data = self.query_db("SELECT appnr FROM semesterapparat WHERE name=?", (apparat_name,), one=True) if data is None: return None else: return data[0] - def createApparat(self, apparat:ApparatData)->Optional[AppPresentError]|int: + def createApparat(self, apparat:ApparatData)->int: + """create the apparat in the database + + Args: + apparat (ApparatData): the wrapped metadata of the apparat + + Raises: + AppPresentError: an error describing that the apparats chosen id is already present in the database + + Returns: + Optional[int]: the id of the apparat + """ + prof_id = self.getProfId(apparat.profname) app_id = self.getApparatId(apparat.appname) if app_id: - return AppPresentError(app_id) + raise AppPresentError(app_id) self.createProf(apparat.get_prof_details()) prof_id = self.getProfId(apparat.profname) @@ -518,9 +648,25 @@ class Database: logger.log_info(query) self.query_db(query) return self.getApparatId(apparat.appname) - def getApparatsByProf(self, prof_id:int)->list[tuple]: + def getApparatsByProf(self, prof_id:Union[str,int])->list[tuple]: + """Get all apparats based on the professor id + + Args: + prof_id (Union[str,int]): the id of the professor + + Returns: + list[tuple]: a list of tuples containing the apparats + """ return self.query_db("SELECT * FROM semesterapparat WHERE prof_id=?", (prof_id,)) - def getApparatsBySemester(self, semester:str)->dict: + def getApparatsBySemester(self, semester:str)->dict[list]: + """get all apparats based on the semester + + Args: + semester (str): the selected semester + + Returns: + dict[list]: a list off all created and deleted apparats for the selected semester + """ data = self.query_db("SELECT name, prof_id FROM semesterapparat WHERE erstellsemester=?", (semester,)) conn = self.connect() cursor = conn.cursor() @@ -550,6 +696,11 @@ class Database: self.close_connection(conn) return {"created": c_ret, "deleted": d_ret} def getApparatCountBySemester(self)->tuple[list[str],list[int]]: + """get a list of all apparats created and deleted by semester + + Returns: + tuple[list[str],list[int]]: a tuple containing two lists, the first list contains the semesters, the second list contains the amount of apparats created and deleted for the corresponding semester + """ conn = self.connect() cursor = conn.cursor() semesters = self.getSemersters() @@ -574,13 +725,41 @@ class Database: ret.append(e_tuple) self.close_connection(conn) return ret - def deleteApparat(self, appnr, semester): - self.query_db("UPDATE semesterapparat SET deletion_status=1, deleted_date=? WHERE appnr=?", (semester,appnr)) + def deleteApparat(self, app_id:Union[str,int], semester:str): + """Delete an apparat from the database + + Args: + app_id (Union[str, int]): the id of the apparat + semester (str): the semester the apparat should be deleted from + """ + self.query_db("UPDATE semesterapparat SET deletion_status=1, deleted_date=? WHERE appnr=?", (semester,app_id)) def isEternal(self, id): + """check if the apparat is eternal (dauerapparat) + + Args: + id (int): the id of the apparat to be checked + + Returns: + int: the state of the apparat + """ return self.query_db("SELECT dauer FROM semesterapparat WHERE appnr=?", (id,), one=True) - def getApparatName(self, app_id, prof_id): + def getApparatName(self, app_id:Union[str,int], prof_id:Union[str,int]): + """get the name of the apparat based on the id + + Args: + app_id (Union[str,int]): the id of the apparat + prof_id (Union[str,int]): the id of the professor + + Returns: + str: the name of the apparat + """ return self.query_db("SELECT name FROM semesterapparat WHERE appnr=? AND prof_id=?", (app_id,prof_id), one=True)[0] def updateApparat(self, apparat_data:ApparatData): + """Update an apparat in the database + + Args: + apparat_data (ApparatData): the new metadata of the apparat + """ query = f"UPDATE semesterapparat SET name = ?, fach = ?, dauer = ?, prof_id = ? WHERE appnr = ?" params = ( apparat_data.appname, @@ -590,13 +769,39 @@ class Database: apparat_data.appnr, ) self.query_db(query, params) - def checkApparatExists(self, apparat_name): + def checkApparatExists(self, apparat_name:str): + """check if the apparat is already present in the database based on the name + + Args: + apparat_name (str): the name of the apparat + + Returns: + bool: True if the apparat is present, False if not + """ return True if self.query_db("SELECT appnr FROM semesterapparat WHERE name=?", (apparat_name,), one=True) else False - def checkApparatExistsById(self, apparat_id): - return True if self.query_db("SELECT appnr FROM semesterapparat WHERE appnr=?", (apparat_id,), one=True) else False + def checkApparatExistsById(self, app_id:Union[str,int])->bool: + """a check to see if the apparat is already present in the database, based on the id + + Args: + app_id (Union[str, int]): the id of the apparat + + Returns: + bool: True if the apparat is present, False if not + """ + return True if self.query_db("SELECT appnr FROM semesterapparat WHERE appnr=?", (app_id,), one=True) else False # Statistics def statistic_request(self, **kwargs: Any): + """Take n amount of kwargs and return the result of the query + """ def __query(query): + """execute the query and return the result + + Args: + query (str): the constructed query + + Returns: + list: the result of the query + """ conn = self.connect() cursor = conn.cursor() result = cursor.execute(query).fetchall() @@ -647,11 +852,23 @@ class Database: # Admin data def getUser(self): + """Get a single user from the database""" return self.query_db("SELECT * FROM user", one=True) - def getUsers(self): + def getUsers(self)->list[tuple]: + """Return a list of tuples of all the users in the database""" return self.query_db("SELECT * FROM user") def login(self, user, hashed_password): + """try to login the user. + The salt for the user will be requested from the database and then added to the hashed password. The password will then be compared to the password in the database + + Args: + user (str): username that tries to login + hashed_password (str): the password the user tries to login with + + Returns: + bool: True if the login was successful, False if not + """ salt = self.query_db("SELECT salt FROM user WHERE username=?", (user,), one=True)[0] if salt is None: return False @@ -662,30 +879,68 @@ class Database: else: return False def changePassword(self, user, new_password): + """change the password of a user. + The password will be added with the salt and then committed to the database + + Args: + user (str): username + new_password (str): the hashed password + """ salt = self.query_db("SELECT salt FROM user WHERE username=?", (user,), one=True)[0] new_password = salt + new_password self.query_db("UPDATE user SET password=? WHERE username=?", (new_password,user)) def getRole(self, user): + """get the role of the user + + Args: + user (str): username + + Returns: + str: the name of the role + """ return self.query_db("SELECT role FROM user WHERE username=?", (user,), one=True)[0] - def getRoles(self): + def getRoles(self)->list[tuple]: + """get all the roles in the database + + Returns: + list[str]: a list of all the roles + """ return self.query_db("SELECT role FROM user") - def checkUsername(self, user): + def checkUsername(self, user)->bool: + """a check to see if the username is already present in the database + + Args: + user (str): the username + + Returns: + bool: True if the username is present, False if not + """ data = self.query_db("SELECT username FROM user WHERE username=?", (user,), one=True) return True if data is not None else False def createUser(self, user, password, role, salt): - """Create a user based on passed data. + """create an user from the AdminCommands class. Args: - ---- - - username (str): Username to be used - - password (str): the salted password - - role (str): Role of the user - - salt (str): a random salt for the user + user (str): the username of the user + password (str): a hashed password + role (str): the role of the user + salt (str): a salt for the password """ self.query_db("INSERT OR IGNORE INTO user (username, password, role, salt) VALUES (?,?,?,?)", (user,password,role,salt)) def deleteUser(self, user): + """delete an unser + + Args: + user (str): username of the user + """ self.query_db("DELETE FROM user WHERE username=?", (user,)) def updateUser(self, username, data:dict[str, str]): + """changge the data of a user + + Args: + username (str): the username of the user + data (dict[str, str]): the data to be changed + """ conn = self.connect() cursor = conn.cursor() query = "UPDATE user SET " @@ -699,13 +954,33 @@ class Database: cursor.execute(query, params) conn.commit() self.close_connection(conn) - def getFacultyMember(self, name:str): + def getFacultyMember(self, name:str)->tuple: + """get a faculty member based on the name + + Args: + name (str): the name to be searched for + + Returns: + tuple: a tuple containing the data of the faculty member + """ return self.query_db("SELECT titel, fname,lname,mail,telnr,fullname FROM prof WHERE fullname=?", (name,), one=True) - def updateFacultyMember(self, data, oldlname, oldfname): + def updateFacultyMember(self, data:dict, oldlname:str, oldfname:str): + """update the data of a faculty member + + Args: + data (dict): a dictionary containing the data to be updated + oldlname (str): the old last name of the faculty member + oldfname (str): the old first name of the faculty member + """ placeholders = ", ".join([f"{i}=:{i} " for i in data.keys()]) query = f"UPDATE prof SET {placeholders} WHERE lname = :oldlname AND fname = :oldfname" data["oldlname"] = oldlname data["oldfname"] = oldfname self.query_db(query, data) def getFacultyMembers(self): + """get a list of all faculty members + + Returns: + list[tuple]: a list of tuples containing the faculty members + """ return self.query_db("SELECT titel, fname,lname,mail,telnr,fullname FROM prof") diff --git a/src/logic/userInterface.py b/src/logic/userInterface.py index 90a376b..66b2ec2 100644 --- a/src/logic/userInterface.py +++ b/src/logic/userInterface.py @@ -24,21 +24,18 @@ from src.ui import ( FilePicker, GraphWidget, Mail_Dialog, - Message_Widget, - Settings, StatusWidget, Ui_Semesterapparat, edit_bookdata_ui, - fileparser_ui, login_ui, medienadder_ui, parsed_titles_ui, popus_confirm, reminder_ui, settings_ui, - new_subject_ui, ) # from src.logic.webrequest import BibTextTransformer, WebRequest +from src.utils import documentationview from src.backend.admin_console import AdminCommands from src.backend.semester import generateSemesterByDate from src.backend.create_file import recreateFile @@ -171,6 +168,9 @@ class Ui(Ui_Semesterapparat): self.tableWidget_apparate.setSortingEnabled(True) # self.tableWidget_apparate.text self.actionEinstellungen.triggered.connect(self.open_settings) + #if help>documentation is clicked, open the documentation or shortcut is pressed + self.actionDokumentation.triggered.connect(self.open_documentation) + # set validators self.sem_year.setText(str(QtCore.QDate.currentDate().year())) self.prof_mail.setValidator( @@ -307,6 +307,10 @@ class Ui(Ui_Semesterapparat): self.app_fach.setCurrentText("") self.app_fach.addItems([subject[1] for subject in self.db.getSubjects()]) + def open_documentation(self): + documentation = documentationview.DocumentationViewer() + documentation.show() + def tabW1_changed(self): if self.tabWidget.currentIndex() == 1: # self.tabWidget.setCurrentIndex(1) diff --git a/src/ui/Ui_semesterapparat_ui.py b/src/ui/Ui_semesterapparat_ui.py index e1225ee..12e9684 100644 --- a/src/ui/Ui_semesterapparat_ui.py +++ b/src/ui/Ui_semesterapparat_ui.py @@ -1,8 +1,10 @@ -# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\semesterapparat_ui.ui' +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file '/home/alexander/GitHub/SemesterapparatsManager/src/ui/semesterapparat_ui.ui' # -# Created by: PyQt6 UI code generator 6.3.1 +# Created by: PyQt6 UI code generator 5.15.10 # -# WARNING: Any manual changes made to this file will be lost when pyuic6 is +# WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not edit this file unless you know what you are doing. @@ -12,20 +14,20 @@ from PyQt6 import QtCore, QtGui, QtWidgets class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") - MainWindow.setWindowModality(QtCore.Qt.WindowModality.WindowModal) + MainWindow.setWindowModality(QtCore.Qt.WindowModal) MainWindow.setEnabled(True) - MainWindow.resize(1593, 800) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed) + MainWindow.resize(1601, 800) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.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) + MainWindow.setContextMenuPolicy(QtCore.Qt.NoContextMenu) MainWindow.setStatusTip("") self.centralwidget = QtWidgets.QWidget(MainWindow) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.centralwidget.sizePolicy().hasHeightForWidth()) @@ -42,10 +44,10 @@ class Ui_MainWindow(object): self.gridLayout = QtWidgets.QGridLayout() self.gridLayout.setObjectName("gridLayout") self.tabWidget = QtWidgets.QTabWidget(self.verticalLayoutWidget) - self.tabWidget.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.tabWidget.setFocusPolicy(QtCore.Qt.NoFocus) self.tabWidget.setObjectName("tabWidget") self.tab = QtWidgets.QWidget() - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Preferred) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.tab.sizePolicy().hasHeightForWidth()) @@ -61,29 +63,29 @@ class Ui_MainWindow(object): 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) + spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.verticalLayout_2.addItem(spacerItem) self.load_app = QtWidgets.QPushButton(self.horizontalLayoutWidget_2) - self.load_app.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.load_app.setFocusPolicy(QtCore.Qt.NoFocus) self.load_app.setObjectName("load_app") self.verticalLayout_2.addWidget(self.load_app) self.create_new_app = QtWidgets.QPushButton(self.horizontalLayoutWidget_2) - self.create_new_app.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.create_new_app.setFocusPolicy(QtCore.Qt.NoFocus) self.create_new_app.setObjectName("create_new_app") self.verticalLayout_2.addWidget(self.create_new_app) self.cancel_active_selection = QtWidgets.QPushButton(self.horizontalLayoutWidget_2) - self.cancel_active_selection.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.cancel_active_selection.setFocusPolicy(QtCore.Qt.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) + spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.verticalLayout_2.addItem(spacerItem1) - self.formLayout.setLayout(1, QtWidgets.QFormLayout.ItemRole.LabelRole, self.verticalLayout_2) + self.formLayout.setLayout(1, QtWidgets.QFormLayout.LabelRole, self.verticalLayout_2) self.tableWidget_apparate = QtWidgets.QTableWidget(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.setFocusPolicy(QtCore.Qt.NoFocus) + self.tableWidget_apparate.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.AdjustToContents) + self.tableWidget_apparate.setEditTriggers(QtWidgets.QAbstractItemView.SelectedClicked) self.tableWidget_apparate.setAlternatingRowColors(True) - self.tableWidget_apparate.setTextElideMode(QtCore.Qt.TextElideMode.ElideMiddle) + self.tableWidget_apparate.setTextElideMode(QtCore.Qt.ElideMiddle) self.tableWidget_apparate.setObjectName("tableWidget_apparate") self.tableWidget_apparate.setColumnCount(6) self.tableWidget_apparate.setRowCount(0) @@ -100,18 +102,18 @@ class Ui_MainWindow(object): 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.formLayout.setWidget(1, QtWidgets.QFormLayout.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.formLayout.setLayout(2, QtWidgets.QFormLayout.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.formLayout.setLayout(3, QtWidgets.QFormLayout.LabelRole, self.horizontalLayout_3) self.horizontalLayout_2.addLayout(self.formLayout) self.line = QtWidgets.QFrame(self.tab) self.line.setGeometry(QtCore.QRect(0, 160, 1261, 21)) - self.line.setFrameShape(QtWidgets.QFrame.Shape.HLine) - self.line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) + self.line.setFrameShape(QtWidgets.QFrame.HLine) + self.line.setFrameShadow(QtWidgets.QFrame.Sunken) self.line.setObjectName("line") self.gridLayoutWidget_2 = QtWidgets.QWidget(self.tab) self.gridLayoutWidget_2.setEnabled(True) @@ -121,7 +123,7 @@ class Ui_MainWindow(object): self.gridLayout_2.setContentsMargins(0, 0, 0, 0) self.gridLayout_2.setObjectName("gridLayout_2") self.app_group_box = QtWidgets.QGroupBox(self.gridLayoutWidget_2) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Fixed) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.app_group_box.sizePolicy().hasHeightForWidth()) @@ -132,7 +134,7 @@ class Ui_MainWindow(object): 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.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter) self.app_group_box.setCheckable(False) self.app_group_box.setObjectName("app_group_box") self.dokument_list = QtWidgets.QTableWidget(self.app_group_box) @@ -143,13 +145,13 @@ class Ui_MainWindow(object): font.setWeight(50) font.setKerning(False) self.dokument_list.setFont(font) - self.dokument_list.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.dokument_list.setFocusPolicy(QtCore.Qt.NoFocus) self.dokument_list.setAcceptDrops(True) - self.dokument_list.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.SizeAdjustPolicy.AdjustToContents) + self.dokument_list.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.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.setDragDropMode(QtWidgets.QAbstractItemView.DropOnly) + self.dokument_list.setDefaultDropAction(QtCore.Qt.LinkAction) + self.dokument_list.setSelectionMode(QtWidgets.QAbstractItemView.SingleSelection) self.dokument_list.setObjectName("dokument_list") self.dokument_list.setColumnCount(4) self.dokument_list.setRowCount(0) @@ -176,13 +178,13 @@ class Ui_MainWindow(object): self.frame = QtWidgets.QFrame(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 = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.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.setFrameShape(QtWidgets.QFrame.StyledPanel) + self.frame.setFrameShadow(QtWidgets.QFrame.Raised) self.frame.setObjectName("frame") self.label_5 = QtWidgets.QLabel(self.frame) self.label_5.setGeometry(QtCore.QRect(250, 20, 91, 21)) @@ -199,7 +201,7 @@ class Ui_MainWindow(object): font.setBold(False) font.setWeight(50) self.sem_winter.setFont(font) - self.sem_winter.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.sem_winter.setFocusPolicy(QtCore.Qt.NoFocus) self.sem_winter.setObjectName("sem_winter") self.label_4 = QtWidgets.QLabel(self.frame) self.label_4.setGeometry(QtCore.QRect(10, 80, 71, 21)) @@ -216,7 +218,7 @@ class Ui_MainWindow(object): 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.setInputMethodHints(QtCore.Qt.ImhDigitsOnly) self.drpdwn_app_nr.setEditable(True) self.drpdwn_app_nr.setObjectName("drpdwn_app_nr") self.app_name = QtWidgets.QLineEdit(self.frame) @@ -226,7 +228,7 @@ class Ui_MainWindow(object): font.setBold(False) font.setWeight(50) self.app_name.setFont(font) - self.app_name.setFocusPolicy(QtCore.Qt.FocusPolicy.StrongFocus) + self.app_name.setFocusPolicy(QtCore.Qt.StrongFocus) self.app_name.setObjectName("app_name") self.sem_sommer = QtWidgets.QRadioButton(self.frame) self.sem_sommer.setGeometry(QtCore.QRect(340, 70, 82, 17)) @@ -235,7 +237,7 @@ class Ui_MainWindow(object): font.setBold(False) font.setWeight(50) self.sem_sommer.setFont(font) - self.sem_sommer.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.sem_sommer.setFocusPolicy(QtCore.Qt.NoFocus) self.sem_sommer.setObjectName("sem_sommer") self.label_3 = QtWidgets.QLabel(self.frame) self.label_3.setGeometry(QtCore.QRect(10, 50, 61, 20)) @@ -260,7 +262,7 @@ class Ui_MainWindow(object): font.setBold(False) font.setWeight(50) self.sem_year.setFont(font) - self.sem_year.setFocusPolicy(QtCore.Qt.FocusPolicy.StrongFocus) + self.sem_year.setFocusPolicy(QtCore.Qt.StrongFocus) self.sem_year.setMaxLength(4) self.sem_year.setObjectName("sem_year") self.label_2 = QtWidgets.QLabel(self.frame) @@ -310,7 +312,7 @@ class Ui_MainWindow(object): font.setBold(False) font.setWeight(50) self.prof_mail.setFont(font) - self.prof_mail.setInputMethodHints(QtCore.Qt.InputMethodHint.ImhEmailCharactersOnly) + self.prof_mail.setInputMethodHints(QtCore.Qt.ImhEmailCharactersOnly) self.prof_mail.setMaxLength(200) self.prof_mail.setPlaceholderText("") self.prof_mail.setObjectName("prof_mail") @@ -329,7 +331,7 @@ class Ui_MainWindow(object): 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.setInputMethodHints(QtCore.Qt.ImhDigitsOnly) self.prof_tel_nr.setPlaceholderText("") self.prof_tel_nr.setObjectName("prof_tel_nr") self.label_10 = QtWidgets.QLabel(self.frame) @@ -347,10 +349,10 @@ class Ui_MainWindow(object): 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.setFocusPolicy(QtCore.Qt.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.setInsertPolicy(QtWidgets.QComboBox.InsertAlphabetically) self.drpdwn_prof_name.setFrame(True) self.drpdwn_prof_name.setObjectName("drpdwn_prof_name") self.mail_mand = QtWidgets.QLabel(self.frame) @@ -392,7 +394,7 @@ class Ui_MainWindow(object): font.setBold(False) font.setWeight(50) self.fach_mand.setFont(font) - self.fach_mand.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.fach_mand.setFocusPolicy(QtCore.Qt.NoFocus) self.fach_mand.setObjectName("fach_mand") self._mand = QtWidgets.QLabel(self.frame) self._mand.setGeometry(QtCore.QRect(330, 60, 16, 21)) @@ -439,7 +441,7 @@ class Ui_MainWindow(object): 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.formLayout_3.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label_12) self.prof_id_adis = QtWidgets.QLineEdit(self.formLayoutWidget_2) font = QtGui.QFont() font.setPointSize(9) @@ -447,7 +449,7 @@ class Ui_MainWindow(object): 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.formLayout_3.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.prof_id_adis) self.label_13 = QtWidgets.QLabel(self.formLayoutWidget_2) font = QtGui.QFont() font.setPointSize(9) @@ -455,10 +457,10 @@ class Ui_MainWindow(object): 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.formLayout_3.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label_13) self.apparat_id_adis = QtWidgets.QLineEdit(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.formLayout_3.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.apparat_id_adis) self.check_send_mail = QtWidgets.QCheckBox(self.frame) self.check_send_mail.setGeometry(QtCore.QRect(450, 120, 91, 17)) font = QtGui.QFont() @@ -469,8 +471,8 @@ class Ui_MainWindow(object): self.check_send_mail.setObjectName("check_send_mail") self.frame_3 = QtWidgets.QFrame(self.frame) self.frame_3.setGeometry(QtCore.QRect(510, 0, 241, 61)) - self.frame_3.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel) - self.frame_3.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) + self.frame_3.setFrameShape(QtWidgets.QFrame.StyledPanel) + self.frame_3.setFrameShadow(QtWidgets.QFrame.Raised) self.frame_3.setObjectName("frame_3") self.gridLayoutWidget_5 = QtWidgets.QWidget(self.frame_3) self.gridLayoutWidget_5.setGeometry(QtCore.QRect(0, 0, 241, 61)) @@ -487,7 +489,7 @@ class Ui_MainWindow(object): self.app_fach.setFont(font) self.app_fach.setObjectName("app_fach") self.gridLayout_6.addWidget(self.app_fach, 0, 0, 1, 1) - spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) + spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.gridLayout_6.addItem(spacerItem2, 0, 1, 1, 1) self.prof_title = QtWidgets.QLineEdit(self.frame) self.prof_title.setGeometry(QtCore.QRect(110, 50, 71, 20)) @@ -496,7 +498,7 @@ class Ui_MainWindow(object): font.setBold(False) font.setWeight(50) self.prof_title.setFont(font) - self.prof_title.setFocusPolicy(QtCore.Qt.FocusPolicy.StrongFocus) + self.prof_title.setFocusPolicy(QtCore.Qt.StrongFocus) self.prof_title.setObjectName("prof_title") self.mail_mand.raise_() self._mand.raise_() @@ -534,18 +536,18 @@ class Ui_MainWindow(object): self.dokument_list.raise_() self.gridLayout_2.addWidget(self.app_group_box, 1, 0, 1, 1) self.tableWidget_apparat_media = QtWidgets.QTableWidget(self.gridLayoutWidget_2) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Expanding) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.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.setFocusPolicy(QtCore.Qt.NoFocus) + self.tableWidget_apparat_media.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) + self.tableWidget_apparat_media.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.AdjustToContents) + self.tableWidget_apparat_media.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers) self.tableWidget_apparat_media.setAlternatingRowColors(True) - self.tableWidget_apparat_media.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectionBehavior.SelectRows) + self.tableWidget_apparat_media.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows) self.tableWidget_apparat_media.setObjectName("tableWidget_apparat_media") self.tableWidget_apparat_media.setColumnCount(7) self.tableWidget_apparat_media.setRowCount(0) @@ -575,12 +577,12 @@ class Ui_MainWindow(object): self.gridLayout_2.addWidget(self.label, 2, 0, 1, 1) self.horizontalLayout_5 = QtWidgets.QHBoxLayout() self.horizontalLayout_5.setObjectName("horizontalLayout_5") - spacerItem3 = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Minimum) + spacerItem3 = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout_5.addItem(spacerItem3) self.chkbx_show_del_media = QtWidgets.QCheckBox(self.gridLayoutWidget_2) self.chkbx_show_del_media.setObjectName("chkbx_show_del_media") self.horizontalLayout_5.addWidget(self.chkbx_show_del_media) - spacerItem4 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Minimum) + spacerItem4 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout_5.addItem(spacerItem4) self.btn_reserve = QtWidgets.QPushButton(self.gridLayoutWidget_2) self.btn_reserve.setObjectName("btn_reserve") @@ -591,15 +593,15 @@ class Ui_MainWindow(object): self.label_info.setObjectName("label_info") self.add_layout.addWidget(self.label_info) self.line_2 = QtWidgets.QFrame(self.gridLayoutWidget_2) - self.line_2.setFrameShape(QtWidgets.QFrame.Shape.VLine) - self.line_2.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) + self.line_2.setFrameShape(QtWidgets.QFrame.VLine) + self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken) self.line_2.setObjectName("line_2") self.add_layout.addWidget(self.line_2) self.progress_label = QtWidgets.QLabel(self.gridLayoutWidget_2) self.progress_label.setObjectName("progress_label") self.add_layout.addWidget(self.progress_label) self.horizontalLayout_5.addLayout(self.add_layout) - spacerItem5 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Minimum) + spacerItem5 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout_5.addItem(spacerItem5) self.avail_layout = QtWidgets.QHBoxLayout() self.avail_layout.setObjectName("avail_layout") @@ -608,19 +610,19 @@ class Ui_MainWindow(object): self.label_20.setObjectName("label_20") self.horizontalLayout_5.addWidget(self.label_20) self.line_3 = QtWidgets.QFrame(self.gridLayoutWidget_2) - self.line_3.setFrameShape(QtWidgets.QFrame.Shape.VLine) - self.line_3.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) + self.line_3.setFrameShape(QtWidgets.QFrame.VLine) + self.line_3.setFrameShadow(QtWidgets.QFrame.Sunken) self.line_3.setObjectName("line_3") self.horizontalLayout_5.addWidget(self.line_3) self.avail_status = QtWidgets.QLabel(self.gridLayoutWidget_2) self.avail_status.setObjectName("avail_status") self.horizontalLayout_5.addWidget(self.avail_status) - spacerItem6 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) + spacerItem6 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout_5.addItem(spacerItem6) self.gridLayout_2.addLayout(self.horizontalLayout_5, 4, 0, 1, 1) self.add_medium = QtWidgets.QPushButton(self.tab) self.add_medium.setGeometry(QtCore.QRect(0, 700, 121, 20)) - self.add_medium.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.add_medium.setFocusPolicy(QtCore.Qt.NoFocus) self.add_medium.setObjectName("add_medium") self.tabWidget.addTab(self.tab, "") self.tab_2 = QtWidgets.QWidget() @@ -686,13 +688,13 @@ class Ui_MainWindow(object): self.box_person.setEditable(True) self.box_person.setObjectName("box_person") self.gridLayout_3.addWidget(self.box_person, 1, 1, 1, 1) - spacerItem7 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) + spacerItem7 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.gridLayout_3.addItem(spacerItem7, 4, 0, 1, 1) self.label_15 = QtWidgets.QLabel(self.gridLayoutWidget) self.label_15.setObjectName("label_15") self.gridLayout_3.addWidget(self.label_15, 3, 0, 1, 1) self.check_deletable = QtWidgets.QCheckBox(self.gridLayoutWidget) - self.check_deletable.setFocusPolicy(QtCore.Qt.FocusPolicy.StrongFocus) + self.check_deletable.setFocusPolicy(QtCore.Qt.StrongFocus) self.check_deletable.setText("") self.check_deletable.setObjectName("check_deletable") self.gridLayout_3.addWidget(self.check_deletable, 3, 1, 1, 1) @@ -711,28 +713,28 @@ class Ui_MainWindow(object): self.formLayout_6.setObjectName("formLayout_6") self.label_25 = QtWidgets.QLabel(self.formLayoutWidget) self.label_25.setObjectName("label_25") - self.formLayout_6.setWidget(0, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_25) + self.formLayout_6.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label_25) self.book_search = QtWidgets.QPushButton(self.formLayoutWidget) self.book_search.setObjectName("book_search") - self.formLayout_6.setWidget(3, QtWidgets.QFormLayout.ItemRole.LabelRole, self.book_search) + self.formLayout_6.setWidget(3, QtWidgets.QFormLayout.LabelRole, self.book_search) self.seach_by_signature = QtWidgets.QLineEdit(self.formLayoutWidget) self.seach_by_signature.setClearButtonEnabled(True) self.seach_by_signature.setObjectName("seach_by_signature") - self.formLayout_6.setWidget(0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.seach_by_signature) + self.formLayout_6.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.seach_by_signature) self.label_26 = QtWidgets.QLabel(self.formLayoutWidget) self.label_26.setObjectName("label_26") - self.formLayout_6.setWidget(1, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_26) + self.formLayout_6.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label_26) self.search_by_title = QtWidgets.QLineEdit(self.formLayoutWidget) self.search_by_title.setClearButtonEnabled(True) self.search_by_title.setObjectName("search_by_title") - self.formLayout_6.setWidget(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.search_by_title) - spacerItem8 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) - self.formLayout_6.setItem(2, QtWidgets.QFormLayout.ItemRole.LabelRole, spacerItem8) + self.formLayout_6.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.search_by_title) + spacerItem8 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + self.formLayout_6.setItem(2, QtWidgets.QFormLayout.LabelRole, spacerItem8) self.tabWidget_2.addTab(self.tab_4, "") self.verticalLayout_3.addWidget(self.tabWidget_2) self.stackedWidget_4 = QtWidgets.QStackedWidget(self.verticalLayoutWidget_2) - self.stackedWidget_4.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel) - self.stackedWidget_4.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) + self.stackedWidget_4.setFrameShape(QtWidgets.QFrame.StyledPanel) + self.stackedWidget_4.setFrameShadow(QtWidgets.QFrame.Raised) self.stackedWidget_4.setObjectName("stackedWidget_4") self.stackedWidget_4Page1 = QtWidgets.QWidget() self.stackedWidget_4Page1.setObjectName("stackedWidget_4Page1") @@ -748,14 +750,14 @@ class Ui_MainWindow(object): self.gridLayout_4.setContentsMargins(0, 0, 0, 0) self.gridLayout_4.setObjectName("gridLayout_4") self.statistics_table = QtWidgets.QTableWidget(self.gridLayoutWidget_3) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Expanding) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) 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, 16777215)) - self.statistics_table.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) - self.statistics_table.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers) + self.statistics_table.setFocusPolicy(QtCore.Qt.NoFocus) + self.statistics_table.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers) self.statistics_table.setAlternatingRowColors(True) self.statistics_table.setObjectName("statistics_table") self.statistics_table.setColumnCount(3) @@ -786,18 +788,18 @@ class Ui_MainWindow(object): self.horizontalLayout_7.setContentsMargins(0, 0, 0, 0) self.horizontalLayout_7.setObjectName("horizontalLayout_7") self.btn_del_select_apparats = QtWidgets.QPushButton(self.horizontalLayoutWidget_3) - self.btn_del_select_apparats.setFocusPolicy(QtCore.Qt.FocusPolicy.StrongFocus) + self.btn_del_select_apparats.setFocusPolicy(QtCore.Qt.StrongFocus) self.btn_del_select_apparats.setObjectName("btn_del_select_apparats") self.horizontalLayout_7.addWidget(self.btn_del_select_apparats) - spacerItem9 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) + spacerItem9 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout_7.addItem(spacerItem9) self.table = QtWidgets.QWidget(self.widget) self.table.setGeometry(QtCore.QRect(0, 50, 761, 391)) self.table.setObjectName("table") self.tableWidget = QtWidgets.QTableWidget(self.table) self.tableWidget.setGeometry(QtCore.QRect(0, 0, 761, 391)) - self.tableWidget.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) - self.tableWidget.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers) + self.tableWidget.setFocusPolicy(QtCore.Qt.NoFocus) + self.tableWidget.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers) self.tableWidget.setObjectName("tableWidget") self.tableWidget.setColumnCount(5) self.tableWidget.setRowCount(0) @@ -816,8 +818,8 @@ class Ui_MainWindow(object): self.page.setObjectName("page") self.book_search_result = QtWidgets.QTableWidget(self.page) self.book_search_result.setGeometry(QtCore.QRect(10, 20, 1081, 421)) - self.book_search_result.setFrameShadow(QtWidgets.QFrame.Shadow.Plain) - self.book_search_result.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers) + self.book_search_result.setFrameShadow(QtWidgets.QFrame.Plain) + self.book_search_result.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers) self.book_search_result.setAlternatingRowColors(True) self.book_search_result.setObjectName("book_search_result") self.book_search_result.setColumnCount(3) @@ -847,8 +849,8 @@ class Ui_MainWindow(object): self.select_action_box.addItem("") self.user_create_frame = QtWidgets.QFrame(self.tab_5) self.user_create_frame.setGeometry(QtCore.QRect(10, 60, 591, 141)) - self.user_create_frame.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel) - self.user_create_frame.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) + self.user_create_frame.setFrameShape(QtWidgets.QFrame.StyledPanel) + self.user_create_frame.setFrameShadow(QtWidgets.QFrame.Raised) self.user_create_frame.setObjectName("user_create_frame") self.gridLayoutWidget_4 = QtWidgets.QWidget(self.user_create_frame) self.gridLayoutWidget_4.setGeometry(QtCore.QRect(0, 0, 581, 141)) @@ -869,7 +871,7 @@ class Ui_MainWindow(object): self.label_23 = QtWidgets.QLabel(self.gridLayoutWidget_4) self.label_23.setObjectName("label_23") self.gridLayout_5.addWidget(self.label_23, 1, 0, 1, 1) - spacerItem10 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) + spacerItem10 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.gridLayout_5.addItem(spacerItem10, 0, 4, 1, 1) self.user_frame_userrole = QtWidgets.QComboBox(self.gridLayoutWidget_4) self.user_frame_userrole.setObjectName("user_frame_userrole") @@ -887,8 +889,8 @@ class Ui_MainWindow(object): self.gridLayout_5.addWidget(self.user_frame_err_message, 1, 4, 1, 1) self.user_delete_frame = QtWidgets.QFrame(self.tab_5) self.user_delete_frame.setGeometry(QtCore.QRect(10, 60, 591, 141)) - self.user_delete_frame.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel) - self.user_delete_frame.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) + self.user_delete_frame.setFrameShape(QtWidgets.QFrame.StyledPanel) + self.user_delete_frame.setFrameShadow(QtWidgets.QFrame.Raised) self.user_delete_frame.setObjectName("user_delete_frame") self.gridLayoutWidget_7 = QtWidgets.QWidget(self.user_delete_frame) self.gridLayoutWidget_7.setGeometry(QtCore.QRect(0, 0, 581, 141)) @@ -898,12 +900,12 @@ class Ui_MainWindow(object): self.gridLayout_8.setObjectName("gridLayout_8") self.horizontalLayout_8 = QtWidgets.QHBoxLayout() self.horizontalLayout_8.setObjectName("horizontalLayout_8") - spacerItem11 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) + spacerItem11 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout_8.addItem(spacerItem11) self.pushButton = QtWidgets.QPushButton(self.gridLayoutWidget_7) self.pushButton.setObjectName("pushButton") self.horizontalLayout_8.addWidget(self.pushButton) - spacerItem12 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) + spacerItem12 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout_8.addItem(spacerItem12) self.gridLayout_8.addLayout(self.horizontalLayout_8, 1, 1, 1, 1) self.label_34 = QtWidgets.QLabel(self.gridLayoutWidget_7) @@ -913,10 +915,10 @@ class Ui_MainWindow(object): self.user_delete_frame_user_select.setObjectName("user_delete_frame_user_select") self.gridLayout_8.addWidget(self.user_delete_frame_user_select, 0, 1, 1, 1) self.user_delete_confirm = QtWidgets.QRadioButton(self.gridLayoutWidget_7) - self.user_delete_confirm.setLayoutDirection(QtCore.Qt.LayoutDirection.RightToLeft) + self.user_delete_confirm.setLayoutDirection(QtCore.Qt.RightToLeft) self.user_delete_confirm.setObjectName("user_delete_confirm") self.gridLayout_8.addWidget(self.user_delete_confirm, 1, 0, 1, 1) - spacerItem13 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) + spacerItem13 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.gridLayout_8.addItem(spacerItem13, 0, 2, 1, 1) self.user_delete_err_message = QtWidgets.QLabel(self.gridLayoutWidget_7) self.user_delete_err_message.setText("") @@ -924,8 +926,8 @@ class Ui_MainWindow(object): self.gridLayout_8.addWidget(self.user_delete_err_message, 1, 2, 1, 1) self.user_edit_frame = QtWidgets.QFrame(self.tab_5) self.user_edit_frame.setGeometry(QtCore.QRect(10, 60, 591, 141)) - self.user_edit_frame.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel) - self.user_edit_frame.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) + self.user_edit_frame.setFrameShape(QtWidgets.QFrame.StyledPanel) + self.user_edit_frame.setFrameShadow(QtWidgets.QFrame.Raised) self.user_edit_frame.setObjectName("user_edit_frame") self.gridLayoutWidget_10 = QtWidgets.QWidget(self.user_edit_frame) self.gridLayoutWidget_10.setGeometry(QtCore.QRect(0, 0, 581, 141)) @@ -956,12 +958,12 @@ class Ui_MainWindow(object): self.user_edit_frame_new_password.setMaximumSize(QtCore.QSize(150, 16777215)) self.user_edit_frame_new_password.setObjectName("user_edit_frame_new_password") self.gridLayout_11.addWidget(self.user_edit_frame_new_password, 1, 1, 1, 1) - spacerItem14 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) + spacerItem14 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.gridLayout_11.addItem(spacerItem14, 0, 4, 1, 1) self.edit_faculty_member = QtWidgets.QFrame(self.tab_5) self.edit_faculty_member.setGeometry(QtCore.QRect(10, 60, 1051, 241)) - self.edit_faculty_member.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel) - self.edit_faculty_member.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) + self.edit_faculty_member.setFrameShape(QtWidgets.QFrame.StyledPanel) + self.edit_faculty_member.setFrameShadow(QtWidgets.QFrame.Raised) self.edit_faculty_member.setObjectName("edit_faculty_member") self.gridLayoutWidget_11 = QtWidgets.QWidget(self.edit_faculty_member) self.gridLayoutWidget_11.setGeometry(QtCore.QRect(0, 0, 751, 223)) @@ -973,66 +975,66 @@ class Ui_MainWindow(object): self.formLayout_2.setObjectName("formLayout_2") self.label_43 = QtWidgets.QLabel(self.gridLayoutWidget_11) self.label_43.setObjectName("label_43") - self.formLayout_2.setWidget(0, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_43) + self.formLayout_2.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label_43) self.edit_faculty_member_new_title = QtWidgets.QComboBox(self.gridLayoutWidget_11) self.edit_faculty_member_new_title.setEditable(True) self.edit_faculty_member_new_title.setObjectName("edit_faculty_member_new_title") - self.formLayout_2.setWidget(0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.edit_faculty_member_new_title) + self.formLayout_2.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.edit_faculty_member_new_title) self.label_44 = QtWidgets.QLabel(self.gridLayoutWidget_11) self.label_44.setObjectName("label_44") - self.formLayout_2.setWidget(1, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_44) + self.formLayout_2.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label_44) self.edit_faculty_member_new_surname = QtWidgets.QLineEdit(self.gridLayoutWidget_11) self.edit_faculty_member_new_surname.setObjectName("edit_faculty_member_new_surname") - self.formLayout_2.setWidget(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.edit_faculty_member_new_surname) + self.formLayout_2.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.edit_faculty_member_new_surname) self.label_45 = QtWidgets.QLabel(self.gridLayoutWidget_11) self.label_45.setObjectName("label_45") - self.formLayout_2.setWidget(2, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_45) + self.formLayout_2.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.label_45) self.user_faculty_member_new_name = QtWidgets.QLineEdit(self.gridLayoutWidget_11) self.user_faculty_member_new_name.setObjectName("user_faculty_member_new_name") - self.formLayout_2.setWidget(2, QtWidgets.QFormLayout.ItemRole.FieldRole, self.user_faculty_member_new_name) + self.formLayout_2.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.user_faculty_member_new_name) self.gridLayout_12.addLayout(self.formLayout_2, 2, 2, 1, 1) self.formLayout_4 = QtWidgets.QFormLayout() self.formLayout_4.setObjectName("formLayout_4") self.edit_faculty_member_title = QtWidgets.QLineEdit(self.gridLayoutWidget_11) - self.edit_faculty_member_title.setFocusPolicy(QtCore.Qt.FocusPolicy.TabFocus) + self.edit_faculty_member_title.setFocusPolicy(QtCore.Qt.TabFocus) self.edit_faculty_member_title.setReadOnly(True) self.edit_faculty_member_title.setObjectName("edit_faculty_member_title") - self.formLayout_4.setWidget(0, QtWidgets.QFormLayout.ItemRole.LabelRole, self.edit_faculty_member_title) + self.formLayout_4.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.edit_faculty_member_title) self.edit_faculty_member_select_member = QtWidgets.QComboBox(self.gridLayoutWidget_11) self.edit_faculty_member_select_member.setObjectName("edit_faculty_member_select_member") - self.formLayout_4.setWidget(0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.edit_faculty_member_select_member) + self.formLayout_4.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.edit_faculty_member_select_member) self.label_46 = QtWidgets.QLabel(self.gridLayoutWidget_11) self.label_46.setObjectName("label_46") - self.formLayout_4.setWidget(1, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_46) + self.formLayout_4.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label_46) self.faculty_member_old_telnr = QtWidgets.QLineEdit(self.gridLayoutWidget_11) - self.faculty_member_old_telnr.setFocusPolicy(QtCore.Qt.FocusPolicy.ClickFocus) + self.faculty_member_old_telnr.setFocusPolicy(QtCore.Qt.ClickFocus) self.faculty_member_old_telnr.setReadOnly(True) self.faculty_member_old_telnr.setObjectName("faculty_member_old_telnr") - self.formLayout_4.setWidget(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.faculty_member_old_telnr) + self.formLayout_4.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.faculty_member_old_telnr) self.label_49 = QtWidgets.QLabel(self.gridLayoutWidget_11) self.label_49.setObjectName("label_49") - self.formLayout_4.setWidget(2, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_49) + self.formLayout_4.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.label_49) self.faculty_member_oldmail = QtWidgets.QLineEdit(self.gridLayoutWidget_11) - self.faculty_member_oldmail.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) - self.faculty_member_oldmail.setInputMethodHints(QtCore.Qt.InputMethodHint.ImhNone) + self.faculty_member_oldmail.setFocusPolicy(QtCore.Qt.NoFocus) + self.faculty_member_oldmail.setInputMethodHints(QtCore.Qt.ImhNone) self.faculty_member_oldmail.setReadOnly(True) self.faculty_member_oldmail.setObjectName("faculty_member_oldmail") - self.formLayout_4.setWidget(2, QtWidgets.QFormLayout.ItemRole.FieldRole, self.faculty_member_oldmail) + self.formLayout_4.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.faculty_member_oldmail) self.gridLayout_12.addLayout(self.formLayout_4, 0, 2, 1, 1) self.formLayout_5 = QtWidgets.QFormLayout() self.formLayout_5.setObjectName("formLayout_5") self.label_47 = QtWidgets.QLabel(self.gridLayoutWidget_11) self.label_47.setObjectName("label_47") - self.formLayout_5.setWidget(0, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_47) + self.formLayout_5.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label_47) self.label_48 = QtWidgets.QLabel(self.gridLayoutWidget_11) self.label_48.setObjectName("label_48") - self.formLayout_5.setWidget(1, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_48) + self.formLayout_5.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label_48) self.user_faculty_member_new_mail = QtWidgets.QLineEdit(self.gridLayoutWidget_11) self.user_faculty_member_new_mail.setObjectName("user_faculty_member_new_mail") - self.formLayout_5.setWidget(0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.user_faculty_member_new_mail) + self.formLayout_5.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.user_faculty_member_new_mail) self.user_faculty_member_new_telnr = QtWidgets.QLineEdit(self.gridLayoutWidget_11) self.user_faculty_member_new_telnr.setObjectName("user_faculty_member_new_telnr") - self.formLayout_5.setWidget(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.user_faculty_member_new_telnr) + self.formLayout_5.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.user_faculty_member_new_telnr) self.gridLayout_12.addLayout(self.formLayout_5, 2, 4, 1, 1) self.label_41 = QtWidgets.QLabel(self.gridLayoutWidget_11) self.label_41.setObjectName("label_41") @@ -1060,7 +1062,7 @@ class Ui_MainWindow(object): self.verticalLayout_4.setObjectName("verticalLayout_4") self.groupBox_2 = QtWidgets.QGroupBox(self.frame_creation_progress) self.groupBox_2.setEnabled(True) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Expanding) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.groupBox_2.sizePolicy().hasHeightForWidth()) @@ -1073,7 +1075,7 @@ class Ui_MainWindow(object): font.setBold(False) font.setWeight(50) self.appdata_check.setFont(font) - self.appdata_check.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.appdata_check.setFocusPolicy(QtCore.Qt.NoFocus) self.appdata_check.setObjectName("appdata_check") self.media_check = QtWidgets.QCheckBox(self.groupBox_2) self.media_check.setGeometry(QtCore.QRect(20, 70, 241, 41)) @@ -1082,7 +1084,7 @@ class Ui_MainWindow(object): font.setBold(False) font.setWeight(50) self.media_check.setFont(font) - self.media_check.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.media_check.setFocusPolicy(QtCore.Qt.NoFocus) self.media_check.setObjectName("media_check") self.ids_check = QtWidgets.QCheckBox(self.groupBox_2) self.ids_check.setGeometry(QtCore.QRect(20, 140, 241, 41)) @@ -1091,11 +1093,11 @@ class Ui_MainWindow(object): font.setBold(False) font.setWeight(50) self.ids_check.setFont(font) - self.ids_check.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.ids_check.setFocusPolicy(QtCore.Qt.NoFocus) self.ids_check.setObjectName("ids_check") self.verticalLayout_4.addWidget(self.groupBox_2) self.groupBox = QtWidgets.QGroupBox(self.frame_creation_progress) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Expanding) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.groupBox.sizePolicy().hasHeightForWidth()) @@ -1110,9 +1112,9 @@ class Ui_MainWindow(object): font.setUnderline(False) font.setWeight(50) font.setKerning(True) - font.setStyleStrategy(QtGui.QFont.StyleStrategy.PreferDefault) + font.setStyleStrategy(QtGui.QFont.PreferDefault) self.media_checked.setFont(font) - self.media_checked.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.media_checked.setFocusPolicy(QtCore.Qt.NoFocus) self.media_checked.setObjectName("media_checked") self.media_edited_check = QtWidgets.QCheckBox(self.groupBox) self.media_edited_check.setGeometry(QtCore.QRect(20, 70, 241, 41)) @@ -1123,9 +1125,9 @@ class Ui_MainWindow(object): font.setUnderline(False) font.setWeight(50) font.setKerning(True) - font.setStyleStrategy(QtGui.QFont.StyleStrategy.PreferDefault) + font.setStyleStrategy(QtGui.QFont.PreferDefault) self.media_edited_check.setFont(font) - self.media_edited_check.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.media_edited_check.setFocusPolicy(QtCore.Qt.NoFocus) self.media_edited_check.setObjectName("media_edited_check") self.app_created = QtWidgets.QCheckBox(self.groupBox) self.app_created.setGeometry(QtCore.QRect(20, 110, 161, 41)) @@ -1136,9 +1138,9 @@ class Ui_MainWindow(object): font.setUnderline(False) font.setWeight(50) font.setKerning(True) - font.setStyleStrategy(QtGui.QFont.StyleStrategy.PreferDefault) + font.setStyleStrategy(QtGui.QFont.PreferDefault) self.app_created.setFont(font) - self.app_created.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.app_created.setFocusPolicy(QtCore.Qt.NoFocus) self.app_created.setObjectName("app_created") self.btn_copy_adis_command = QtWidgets.QPushButton(self.groupBox) self.btn_copy_adis_command.setGeometry(QtCore.QRect(170, 120, 101, 23)) @@ -1149,14 +1151,14 @@ class Ui_MainWindow(object): font.setUnderline(False) font.setWeight(50) font.setKerning(True) - font.setStyleStrategy(QtGui.QFont.StyleStrategy.PreferDefault) + font.setStyleStrategy(QtGui.QFont.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\\../../../.designer/backup/icons/information.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) + icon.addPixmap(QtGui.QPixmap("/home/alexander/GitHub/SemesterapparatsManager/src/ui/../../../.designer/backup/icons/information.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.btn_copy_adis_command.setIcon(icon) self.btn_copy_adis_command.setCheckable(False) self.btn_copy_adis_command.setChecked(False) @@ -1166,19 +1168,19 @@ class Ui_MainWindow(object): self.horizontalLayout_6.addWidget(self.frame_creation_progress) self.frame_2 = QtWidgets.QFrame(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.setFrameShape(QtWidgets.QFrame.StyledPanel) + self.frame_2.setFrameShadow(QtWidgets.QFrame.Raised) self.frame_2.setObjectName("frame_2") self.calendarWidget = QtWidgets.QCalendarWidget(self.frame_2) self.calendarWidget.setGeometry(QtCore.QRect(0, 0, 291, 191)) - self.calendarWidget.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.calendarWidget.setFocusPolicy(QtCore.Qt.NoFocus) self.calendarWidget.setGridVisible(True) - self.calendarWidget.setVerticalHeaderFormat(QtWidgets.QCalendarWidget.VerticalHeaderFormat.NoVerticalHeader) + self.calendarWidget.setVerticalHeaderFormat(QtWidgets.QCalendarWidget.NoVerticalHeader) self.calendarWidget.setObjectName("calendarWidget") self.message_frame = QtWidgets.QFrame(self.frame_2) self.message_frame.setGeometry(QtCore.QRect(0, 210, 301, 121)) - self.message_frame.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel) - self.message_frame.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) + self.message_frame.setFrameShape(QtWidgets.QFrame.StyledPanel) + self.message_frame.setFrameShadow(QtWidgets.QFrame.Raised) self.message_frame.setObjectName("message_frame") self.label_14 = QtWidgets.QLabel(self.message_frame) self.label_14.setGeometry(QtCore.QRect(10, 10, 47, 20)) @@ -1186,15 +1188,15 @@ class Ui_MainWindow(object): self.line_app_info = QtWidgets.QLineEdit(self.message_frame) self.line_app_info.setEnabled(True) self.line_app_info.setGeometry(QtCore.QRect(60, 10, 31, 20)) - self.line_app_info.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.line_app_info.setFocusPolicy(QtCore.Qt.NoFocus) self.line_app_info.setObjectName("line_app_info") self.message_box = QtWidgets.QTextEdit(self.message_frame) self.message_box.setGeometry(QtCore.QRect(10, 40, 281, 71)) - self.message_box.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.message_box.setFocusPolicy(QtCore.Qt.NoFocus) self.message_box.setObjectName("message_box") self.btn_delete_message = QtWidgets.QPushButton(self.message_frame) self.btn_delete_message.setGeometry(QtCore.QRect(130, 10, 75, 23)) - self.btn_delete_message.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + self.btn_delete_message.setFocusPolicy(QtCore.Qt.NoFocus) self.btn_delete_message.setObjectName("btn_delete_message") self.spin_select_message = QtWidgets.QSpinBox(self.message_frame) self.spin_select_message.setGeometry(QtCore.QRect(210, 10, 74, 22)) @@ -1205,26 +1207,33 @@ class Ui_MainWindow(object): self.label_total_day_messages.setObjectName("label_total_day_messages") MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtWidgets.QMenuBar(MainWindow) - self.menubar.setGeometry(QtCore.QRect(0, 0, 1593, 21)) + self.menubar.setGeometry(QtCore.QRect(0, 0, 1601, 30)) self.menubar.setObjectName("menubar") self.menuDatei = QtWidgets.QMenu(self.menubar) self.menuDatei.setObjectName("menuDatei") self.menuEinstellungen = QtWidgets.QMenu(self.menubar) self.menuEinstellungen.setObjectName("menuEinstellungen") + self.menuHelp = QtWidgets.QMenu(self.menubar) + self.menuHelp.setObjectName("menuHelp") MainWindow.setMenuBar(self.menubar) self.statusbar = QtWidgets.QStatusBar(MainWindow) self.statusbar.setObjectName("statusbar") MainWindow.setStatusBar(self.statusbar) - self.actionBeenden = QtGui.QAction(MainWindow) + self.actionBeenden = QtWidgets.QAction(MainWindow) self.actionBeenden.setShortcutVisibleInContextMenu(True) self.actionBeenden.setObjectName("actionBeenden") - self.actionEinstellungen = QtGui.QAction(MainWindow) + self.actionEinstellungen = QtWidgets.QAction(MainWindow) self.actionEinstellungen.setShortcutVisibleInContextMenu(True) self.actionEinstellungen.setObjectName("actionEinstellungen") + self.actionDokumentation = QtWidgets.QAction(MainWindow) + self.actionDokumentation.setShortcutContext(QtCore.Qt.ApplicationShortcut) + self.actionDokumentation.setObjectName("actionDokumentation") self.menuDatei.addAction(self.actionBeenden) self.menuEinstellungen.addAction(self.actionEinstellungen) + self.menuHelp.addAction(self.actionDokumentation) self.menubar.addAction(self.menuDatei.menuAction()) self.menubar.addAction(self.menuEinstellungen.menuAction()) + self.menubar.addAction(self.menuHelp.menuAction()) self.retranslateUi(MainWindow) self.tabWidget.setCurrentIndex(0) @@ -1447,7 +1456,10 @@ class Ui_MainWindow(object): self.label_total_day_messages.setText(_translate("MainWindow", "TextLabel")) 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")) + self.actionDokumentation.setShortcut(_translate("MainWindow", "F1")) diff --git a/src/ui/resources_rc.py b/src/ui/resources_rc.py new file mode 100644 index 0000000..91cd916 --- /dev/null +++ b/src/ui/resources_rc.py @@ -0,0 +1,155 @@ +# Resource object code (Python 3) +# Created by: object code +# Created by: The Resource Compiler for Qt version 6.6.2 +# WARNING! All changes made in this file will be lost! + +from PySide6 import QtCore + +qt_resource_data = b"\ +\x00\x00\x00\xde\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00 \x00\x00\x00 \x02\x03\x00\x00\x00\x0e\x14\x92g\ +\x00\x00\x00\x0cPLTEe-g\xff\xff\x00\x99\x99\ +\x99\x00\x00\x00\xb2\x18W>\x00\x00\x00\x01tRNS\ +\x00@\xe6\xd8f\x00\x00\x00\x80IDATx\xdaU\ +\xcc\xb1\x0d\xc3 \x10\x85\xe1\x93\xa8Q\xf6HO\x9d)\ +\x9e\xa8\x82\xd7\x88h`\x14\xca\x88)\xb2\xc4\xed`e\ +\x888\xdc\x9d-\x9b\xbfy_\xf5h\xf4\xa0=\xfe\xd8\ +:\xbc\x0ed\x83G\xaa3\x02b\x9b\xc1\xc0j(\x06\ +\x87\x8d\xf3\x04?\x90\xea\x15a \xb6+\x18E\x8eN\ +8\x08\xb2\xe2\xa9\xf0\x8aT\x05P\x04`\x01b\x13\x14\ +\x16\xb0\x02\xab`\x81A\xfb\x9e\x08\xba\xb1\xd3m\x93~\ +\x9d\xa8ko\xa2\xbb\xa2\xfd\x01\xa6\xe9X\x86\xbd\xa6E\ + \x00\x00\x00\x00IEND\xaeB`\x82\ +\x00\x00\x00\xf5\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00 \x00\x00\x00 \x04\x03\x00\x00\x00\x81Tg\xc7\ +\x00\x00\x00\x0fPLTEet-\xff\xff\xff\x99\x99\ +\x99\x00\x00\xff\x00\x00\x00\x06\xefPJ\x00\x00\x00\x01t\ +RNS\x00@\xe6\xd8f\x00\x00\x00\x94IDAT\ +x\xda\xad\x91\xd1\x09\x03!\x10D\x17\xb9\x066g\x01\ +fH\x03\xc1\x06\xa2\xd8\x7fM\xc9:\x1eC$\x9fy\ +?\xe2\xe3\xad\x88\xda$\x01(&pw\xf7\x1b\xb4w\ +r\x99\xe4\x17\x85\x22\xfa\xb3>\xdd=+\xa8\xb5\xc6\xf2\ +b \x91\x19\xac\x91\x99P\x88\xce\x09\x91\x0b\xc5\x19g\ +H\xd0P\xe0/\x22}\x89\xfeCpf\x89\x1c\xefv\ +p?M\x0faM\x17\x07\xcc\x22!\x0c\x82\xe1d\x00\ +\xebQG\x8b~\xe8+\xf0\x18\xd13\xa0A\x0ba\x22\ +}D\xf4\xe2\xd8\x85\xb5]\x1c\xbb0\xec\x22Q\xbc\x01\ +\x01\xb7#\x93\xf0\xcb\xa6\x83\x00\x00\x00\x00IEND\ +\xaeB`\x82\ +\x00\x00\x00\xfc\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00 \x00\x00\x00 \x02\x03\x00\x00\x00\x0e\x14\x92g\ +\x00\x00\x00\x0cPLTEe-g\xff\xff\xff\x99\x99\ +\x99\xff\x00\x00\x9e\xb6)\xe3\x00\x00\x00\x01tRNS\ +\x00@\xe6\xd8f\x00\x00\x00\x9eIDATx\xdaM\ +\x8e\xb1\x0d\xc20\x10E\xbfBI\xc1\x1eP0B\xa6\ +8\xa5\xf4(\xf6()#/\x11\x96H\x0deD\x1f\ +)\xb2p>w!'\xf1\xaa\xa7\xfb\xdf\xbe\x03p\xe2\ +\x07;-\xf9\x00l\xc0\xdf\xe8B\xe5H\xc8\x97\x0a\x8d\ +\xd5*\xc6f\x95'\x19\x99T:\xd6\xa0\xd2V\xe1\xd2\ +i\xbb\xa5\xc4)\xa8\x90S\x90\xc8Ue\x11\xe1.U\ +:\xb2\xa8P\x02\xff\xc5#/\x17\x7f^\xfc\xc3\xd9W\ +\xcc\xbet\xf03z?\xac\x07h\x94\x04\x8c&o\x00\ +w\x93A\xe5|T\xd0\x8c\x9a$(7n\x19F\x93\ +\xb3&\xc65\x03\xf8\x02;d\xa4\x1d\xa53i\xfd\x00\ +\x00\x00\x00IEND\xaeB`\x82\ +\x00\x00\x00\xfc\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00 \x00\x00\x00 \x04\x03\x00\x00\x00\x81Tg\xc7\ +\x00\x00\x00\x0fPLTEet-\xff\xff\xff\x99\x99\ +\x99\x00\x00\xff\x00\x00\x00\x06\xefPJ\x00\x00\x00\x01t\ +RNS\x00@\xe6\xd8f\x00\x00\x00\x9bIDAT\ +x\xda\x85\xd1\xc1\x0d\x03!\x0cD\xd1\x11\xda\x06\x1c(\ +\x00\xac4\x80h \xfa\xaf)\xf1:\xc6\x84K\xe6\ +\xb2\xda\xa7\x0f\x17p/0s\x86\x8f\x0b\x11=\xd8\xff\ +Ig\x12\xc8\x96\x15\xca\x82\xe4AkM>/\x0b\x22\ +\xc5V%Y\x01\x91%v\xe2\x0bCO8\xa4\xac\x10\ +\xab\xdc\xe1\xa0\xcd\x0d\xbc\xa0\x9e@\xff\x80\x16\x84\x9fb\ +\x18\xc4V\x0dP6H\x9c\x81k;2\x04\xd0\xb7+\ +\x19\xb0\xc4\x03`\x92nJ \x0b\xb3K?\xfd)\xf8\ +9\xa5\x97\xc0\x84\xbb\x00|\xe1\x03\x19\xfb\xae\x13\xd0O\ +\xb8N\x00\x9f\x10\x14\xde\xf9|#;u\x5c\xf4%\x00\ +\x00\x00\x00IEND\xaeB`\x82\ +" + +qt_resource_name = b"\ +\x00\x08\ +\x0b\xca\xa3^\ +\x00q\ +\x00u\x00e\x00s\x00t\x00i\x00o\x00n\ +\x00\x08\ +\x09\x0a\xf4<\ +\x00c\ +\x00r\x00i\x00t\x00i\x00c\x00a\x00l\ +\x00\x0b\ +\x09\xd86\x9e\ +\x00i\ +\x00n\x00f\x00o\x00r\x00m\x00a\x00t\x00i\x00o\x00n\ +\x00\x0a\ +\x04S\x86\xf5\ +\x00w\ +\x00a\x00r\x00n\x00_\x00i\x00m\x00a\x00g\x00e\ +\x00\x05\ +\x00o\xa6S\ +\x00i\ +\x00c\x00o\x00n\x00s\ +\x00\x0b\ +\x00\xb5E\xe7\ +\x00w\ +\x00a\x00r\x00n\x00i\x00n\x00g\x00.\x00p\x00n\x00g\ +\x00\x0f\ +\x06\xb2\xe7'\ +\x00i\ +\x00n\x00f\x00o\x00r\x00m\x00a\x00t\x00i\x00o\x00n\x00.\x00p\x00n\x00g\ +\x00\x0c\ +\x04-B\xa7\ +\x00c\ +\x00r\x00i\x00t\x00i\x00c\x00a\x00l\x00.\x00p\x00n\x00g\ +\x00\x0c\ +\x03v\xc2\x07\ +\x00q\ +\x00u\x00e\x00s\x00t\x00i\x00o\x00n\x00.\x00p\x00n\x00g\ +" + +qt_resource_struct = b"\ +\x00\x00\x00\x00\x00\x02\x00\x00\x00\x04\x00\x00\x00\x01\ +\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00H\x00\x02\x00\x00\x00\x01\x00\x00\x00\x0b\ +\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x16\x00\x02\x00\x00\x00\x01\x00\x00\x00\x09\ +\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00,\x00\x02\x00\x00\x00\x01\x00\x00\x00\x07\ +\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x05\ +\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00b\x00\x02\x00\x00\x00\x01\x00\x00\x00\x06\ +\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\xd0\x00\x00\x00\x00\x00\x01\x00\x00\x02\xdb\ +\x00\x00\x01\x8d\xabem#\ +\x00\x00\x00b\x00\x02\x00\x00\x00\x01\x00\x00\x00\x08\ +\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x8e\x00\x00\x00\x00\x00\x01\x00\x00\x00\xe2\ +\x00\x00\x01\x8d\xabem!\ +\x00\x00\x00b\x00\x02\x00\x00\x00\x01\x00\x00\x00\x0a\ +\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\xb2\x00\x00\x00\x00\x00\x01\x00\x00\x01\xdb\ +\x00\x00\x01\x8d\xabem!\ +\x00\x00\x00b\x00\x02\x00\x00\x00\x01\x00\x00\x00\x0c\ +\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00r\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\ +\x00\x00\x01\x8d\xabem#\ +" + +def qInitResources(): + QtCore.qRegisterResourceData(0x03, qt_resource_struct, qt_resource_name, qt_resource_data) + +def qCleanupResources(): + QtCore.qUnregisterResourceData(0x03, qt_resource_struct, qt_resource_name, qt_resource_data) + +qInitResources() diff --git a/src/ui/semesterapparat_ui.ui b/src/ui/semesterapparat_ui.ui index a4bc69c..4c4a34b 100644 --- a/src/ui/semesterapparat_ui.ui +++ b/src/ui/semesterapparat_ui.ui @@ -12,7 +12,7 @@ 0 0 - 1593 + 1601 800 @@ -1725,12 +1725,12 @@ true - - 59 - 24 + + 59 + true @@ -2817,8 +2817,8 @@ 0 0 - 1593 - 21 + 1601 + 30 @@ -2870,6 +2870,12 @@ Dokumentation + + F1 + + + Qt::ApplicationShortcut + diff --git a/src/ui/semesterapparat_ui_ui.py b/src/ui/semesterapparat_ui_ui.py index 582742a..a5583e3 100644 --- a/src/ui/semesterapparat_ui_ui.py +++ b/src/ui/semesterapparat_ui_ui.py @@ -1,491 +1,416 @@ -# Form implementation generated from reading ui file '/home/alexander/GitHub/Semesterapparate/ui/semesterapparat_ui.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. +# -*- coding: utf-8 -*- +################################################################################ +## Form generated from reading UI file 'semesterapparat_ui.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 import QtCore, QtGui, QtWidgets - +from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, + QMetaObject, QObject, QPoint, QRect, + QSize, QTime, QUrl, Qt) +from PySide6.QtGui import (QAction, QBrush, QColor, QConicalGradient, + QCursor, QFont, QFontDatabase, QGradient, + QIcon, QImage, QKeySequence, QLinearGradient, + QPainter, QPalette, QPixmap, QRadialGradient, + QTransform) +from PySide6.QtWidgets import (QAbstractItemView, QAbstractScrollArea, QApplication, QCalendarWidget, + QCheckBox, QComboBox, QFormLayout, QFrame, + QGridLayout, QGroupBox, QHBoxLayout, QHeaderView, + QLabel, QLineEdit, QMainWindow, QMenu, + QMenuBar, QPushButton, QRadioButton, QSizePolicy, + QSpacerItem, QSpinBox, QStackedWidget, QStatusBar, + QTabWidget, QTableWidget, QTableWidgetItem, QTextEdit, + QVBoxLayout, QWidget) class Ui_MainWindow(object): def setupUi(self, MainWindow): - MainWindow.setObjectName("MainWindow") - MainWindow.setWindowModality(QtCore.Qt.WindowModality.WindowModal) + if not MainWindow.objectName(): + MainWindow.setObjectName(u"MainWindow") + MainWindow.setWindowModality(Qt.WindowModal) MainWindow.setEnabled(True) - MainWindow.resize(1593, 800) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed) + MainWindow.resize(1601, 800) + sizePolicy = QSizePolicy(QSizePolicy.Policy.Fixed, 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) + MainWindow.setMinimumSize(QSize(1278, 800)) + MainWindow.setMaximumSize(QSize(1920, 800)) + MainWindow.setContextMenuPolicy(Qt.NoContextMenu) + self.actionBeenden = QAction(MainWindow) + self.actionBeenden.setObjectName(u"actionBeenden") + self.actionBeenden.setShortcutVisibleInContextMenu(True) + self.actionEinstellungen = QAction(MainWindow) + self.actionEinstellungen.setObjectName(u"actionEinstellungen") + self.actionEinstellungen.setShortcutVisibleInContextMenu(True) + self.actionDokumentation = QAction(MainWindow) + self.actionDokumentation.setObjectName(u"actionDokumentation") + self.actionDokumentation.setShortcutContext(Qt.ApplicationShortcut) + self.centralwidget = QWidget(MainWindow) + self.centralwidget.setObjectName(u"centralwidget") 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.verticalLayoutWidget = QWidget(self.centralwidget) + self.verticalLayoutWidget.setObjectName(u"verticalLayoutWidget") + self.verticalLayoutWidget.setGeometry(QRect(0, 0, 1271, 761)) + self.verticalLayout = QVBoxLayout(self.verticalLayoutWidget) + self.verticalLayout.setObjectName(u"verticalLayout") 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 = QHBoxLayout() + self.horizontalLayout.setObjectName(u"horizontalLayout") + self.gridLayout = QGridLayout() + self.gridLayout.setObjectName(u"gridLayout") + self.tabWidget = QTabWidget(self.verticalLayoutWidget) + self.tabWidget.setObjectName(u"tabWidget") + self.tabWidget.setFocusPolicy(Qt.NoFocus) + self.tab = QWidget() + self.tab.setObjectName(u"tab") + sizePolicy1 = QSizePolicy(QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Preferred) + sizePolicy1.setHorizontalStretch(0) + sizePolicy1.setVerticalStretch(0) + sizePolicy1.setHeightForWidth(self.tab.sizePolicy().hasHeightForWidth()) + self.tab.setSizePolicy(sizePolicy1) + self.horizontalLayoutWidget_2 = QWidget(self.tab) + self.horizontalLayoutWidget_2.setObjectName(u"horizontalLayoutWidget_2") + self.horizontalLayoutWidget_2.setGeometry(QRect(0, 0, 1261, 163)) + self.horizontalLayout_2 = QHBoxLayout(self.horizontalLayoutWidget_2) + self.horizontalLayout_2.setObjectName(u"horizontalLayout_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.formLayout = QFormLayout() + self.formLayout.setObjectName(u"formLayout") + self.verticalLayout_2 = QVBoxLayout() + self.verticalLayout_2.setObjectName(u"verticalLayout_2") + self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding) + + self.verticalLayout_2.addItem(self.verticalSpacer) + + self.load_app = QPushButton(self.horizontalLayoutWidget_2) + self.load_app.setObjectName(u"load_app") + self.load_app.setFocusPolicy(Qt.NoFocus) + 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.create_new_app = QPushButton(self.horizontalLayoutWidget_2) + self.create_new_app.setObjectName(u"create_new_app") + self.create_new_app.setFocusPolicy(Qt.NoFocus) + self.verticalLayout_2.addWidget(self.create_new_app) - self.cancel_active_selection = QtWidgets.QPushButton(parent=self.horizontalLayoutWidget_2) - self.cancel_active_selection.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) - self.cancel_active_selection.setObjectName("cancel_active_selection") + + self.cancel_active_selection = QPushButton(self.horizontalLayoutWidget_2) + self.cancel_active_selection.setObjectName(u"cancel_active_selection") + self.cancel_active_selection.setFocusPolicy(Qt.NoFocus) + 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.verticalSpacer_2 = QSpacerItem(20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding) + + self.verticalLayout_2.addItem(self.verticalSpacer_2) + + + self.formLayout.setLayout(1, QFormLayout.LabelRole, self.verticalLayout_2) + + self.tableWidget_apparate = QTableWidget(self.horizontalLayoutWidget_2) + if (self.tableWidget_apparate.columnCount() < 6): + self.tableWidget_apparate.setColumnCount(6) + __qtablewidgetitem = QTableWidgetItem() + self.tableWidget_apparate.setHorizontalHeaderItem(0, __qtablewidgetitem) + __qtablewidgetitem1 = QTableWidgetItem() + self.tableWidget_apparate.setHorizontalHeaderItem(1, __qtablewidgetitem1) + __qtablewidgetitem2 = QTableWidgetItem() + self.tableWidget_apparate.setHorizontalHeaderItem(2, __qtablewidgetitem2) + __qtablewidgetitem3 = QTableWidgetItem() + self.tableWidget_apparate.setHorizontalHeaderItem(3, __qtablewidgetitem3) + __qtablewidgetitem4 = QTableWidgetItem() + self.tableWidget_apparate.setHorizontalHeaderItem(4, __qtablewidgetitem4) + __qtablewidgetitem5 = QTableWidgetItem() + self.tableWidget_apparate.setHorizontalHeaderItem(5, __qtablewidgetitem5) + self.tableWidget_apparate.setObjectName(u"tableWidget_apparate") + self.tableWidget_apparate.setFocusPolicy(Qt.NoFocus) + self.tableWidget_apparate.setSizeAdjustPolicy(QAbstractScrollArea.AdjustToContents) + self.tableWidget_apparate.setEditTriggers(QAbstractItemView.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.setTextElideMode(Qt.ElideMiddle) + self.tableWidget_apparate.setSortingEnabled(True) 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.formLayout.setWidget(1, QFormLayout.FieldRole, self.tableWidget_apparate) + + self.horizontalLayout_4 = QHBoxLayout() + self.horizontalLayout_4.setObjectName(u"horizontalLayout_4") + + self.formLayout.setLayout(2, QFormLayout.FieldRole, self.horizontalLayout_4) + + self.horizontalLayout_3 = QHBoxLayout() + self.horizontalLayout_3.setObjectName(u"horizontalLayout_3") + + self.formLayout.setLayout(3, QFormLayout.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.line = QFrame(self.tab) + self.line.setObjectName(u"line") + self.line.setGeometry(QRect(0, 160, 1261, 21)) + self.line.setFrameShape(QFrame.HLine) + self.line.setFrameShadow(QFrame.Sunken) + self.gridLayoutWidget_2 = QWidget(self.tab) + self.gridLayoutWidget_2.setObjectName(u"gridLayoutWidget_2") 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.gridLayoutWidget_2.setGeometry(QRect(0, 180, 1261, 511)) + self.gridLayout_2 = QGridLayout(self.gridLayoutWidget_2) + self.gridLayout_2.setObjectName(u"gridLayout_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() + self.app_group_box = QGroupBox(self.gridLayoutWidget_2) + self.app_group_box.setObjectName(u"app_group_box") + sizePolicy2 = QSizePolicy(QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Fixed) + sizePolicy2.setHorizontalStretch(0) + sizePolicy2.setVerticalStretch(0) + sizePolicy2.setHeightForWidth(self.app_group_box.sizePolicy().hasHeightForWidth()) + self.app_group_box.setSizePolicy(sizePolicy2) + self.app_group_box.setMinimumSize(QSize(0, 210)) + font = 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.setAlignment(Qt.AlignLeading|Qt.AlignLeft|Qt.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 = QTableWidget(self.app_group_box) + if (self.dokument_list.columnCount() < 4): + self.dokument_list.setColumnCount(4) + font1 = QFont() + font1.setFamilies([u"Arial"]) + font1.setPointSize(8) + __qtablewidgetitem6 = QTableWidgetItem() + __qtablewidgetitem6.setFont(font1); + self.dokument_list.setHorizontalHeaderItem(0, __qtablewidgetitem6) + __qtablewidgetitem7 = QTableWidgetItem() + __qtablewidgetitem7.setFont(font1); + self.dokument_list.setHorizontalHeaderItem(1, __qtablewidgetitem7) + __qtablewidgetitem8 = QTableWidgetItem() + __qtablewidgetitem8.setFont(font1); + self.dokument_list.setHorizontalHeaderItem(2, __qtablewidgetitem8) + __qtablewidgetitem9 = QTableWidgetItem() + self.dokument_list.setHorizontalHeaderItem(3, __qtablewidgetitem9) + self.dokument_list.setObjectName(u"dokument_list") + self.dokument_list.setGeometry(QRect(765, 20, 321, 181)) + font2 = QFont() + font2.setPointSize(10) + font2.setBold(False) + font2.setKerning(False) + self.dokument_list.setFont(font2) + self.dokument_list.setFocusPolicy(Qt.NoFocus) self.dokument_list.setAcceptDrops(True) - self.dokument_list.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.SizeAdjustPolicy.AdjustToContents) + self.dokument_list.setSizeAdjustPolicy(QAbstractScrollArea.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.dokument_list.setDragDropMode(QAbstractItemView.DropOnly) + self.dokument_list.setDefaultDropAction(Qt.LinkAction) + self.dokument_list.setSelectionMode(QAbstractItemView.SingleSelection) + self.frame = QFrame(self.app_group_box) + self.frame.setObjectName(u"frame") 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) + self.frame.setGeometry(QRect(10, 30, 1241, 151)) 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.frame.setFrameShape(QFrame.StyledPanel) + self.frame.setFrameShadow(QFrame.Raised) + self.label_5 = QLabel(self.frame) + self.label_5.setObjectName(u"label_5") + self.label_5.setGeometry(QRect(250, 20, 91, 21)) + font3 = QFont() + font3.setPointSize(9) + font3.setBold(False) + self.label_5.setFont(font3) + self.sem_winter = QRadioButton(self.frame) + self.sem_winter.setObjectName(u"sem_winter") + self.sem_winter.setGeometry(QRect(340, 50, 82, 17)) + self.sem_winter.setFont(font3) + self.sem_winter.setFocusPolicy(Qt.NoFocus) + self.label_4 = QLabel(self.frame) + self.label_4.setObjectName(u"label_4") + self.label_4.setGeometry(QRect(10, 80, 71, 21)) + self.label_4.setFont(font3) + self.drpdwn_app_nr = QComboBox(self.frame) + self.drpdwn_app_nr.setObjectName(u"drpdwn_app_nr") + self.drpdwn_app_nr.setGeometry(QRect(110, 20, 69, 22)) + self.drpdwn_app_nr.setFont(font3) + self.drpdwn_app_nr.setInputMethodHints(Qt.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.app_name = QLineEdit(self.frame) + self.app_name.setObjectName(u"app_name") + self.app_name.setGeometry(QRect(340, 20, 113, 20)) + self.app_name.setFont(font3) + self.app_name.setFocusPolicy(Qt.StrongFocus) + self.sem_sommer = QRadioButton(self.frame) + self.sem_sommer.setObjectName(u"sem_sommer") + self.sem_sommer.setGeometry(QRect(340, 70, 82, 17)) + self.sem_sommer.setFont(font3) + self.sem_sommer.setFocusPolicy(Qt.NoFocus) + self.label_3 = QLabel(self.frame) + self.label_3.setObjectName(u"label_3") + self.label_3.setGeometry(QRect(10, 50, 61, 20)) + self.label_3.setFont(font3) + self.label_6 = QLabel(self.frame) + self.label_6.setObjectName(u"label_6") + self.label_6.setGeometry(QRect(270, 60, 61, 21)) + self.label_6.setFont(font3) + self.sem_year = QLineEdit(self.frame) + self.sem_year.setObjectName(u"sem_year") + self.sem_year.setGeometry(QRect(410, 60, 113, 20)) + self.sem_year.setFont(font3) + self.sem_year.setFocusPolicy(Qt.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.label_2 = QLabel(self.frame) + self.label_2.setObjectName(u"label_2") + self.label_2.setGeometry(QRect(10, 20, 101, 21)) + self.label_2.setFont(font3) + self.btn_apparat_save = QPushButton(self.frame) + self.btn_apparat_save.setObjectName(u"btn_apparat_save") + self.btn_apparat_save.setGeometry(QRect(260, 120, 75, 23)) + self.btn_apparat_save.setFont(font3) + self.btn_apparat_apply = QPushButton(self.frame) + self.btn_apparat_apply.setObjectName(u"btn_apparat_apply") + self.btn_apparat_apply.setGeometry(QRect(350, 120, 75, 23)) + self.btn_apparat_apply.setFont(font3) + self.check_eternal_app = QCheckBox(self.frame) + self.check_eternal_app.setObjectName(u"check_eternal_app") + self.check_eternal_app.setGeometry(QRect(340, 90, 101, 17)) + self.check_eternal_app.setFont(font3) + self.label_8 = QLabel(self.frame) + self.label_8.setObjectName(u"label_8") + self.label_8.setGeometry(QRect(10, 110, 71, 21)) + self.label_8.setFont(font3) + self.prof_mail = QLineEdit(self.frame) + self.prof_mail.setObjectName(u"prof_mail") + self.prof_mail.setGeometry(QRect(110, 110, 121, 20)) + self.prof_mail.setFont(font3) + self.prof_mail.setInputMethodHints(Qt.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.label_9 = QLabel(self.frame) + self.label_9.setObjectName(u"label_9") + self.label_9.setGeometry(QRect(10, 130, 71, 21)) + self.label_9.setFont(font3) + self.prof_tel_nr = QLineEdit(self.frame) + self.prof_tel_nr.setObjectName(u"prof_tel_nr") + self.prof_tel_nr.setGeometry(QRect(110, 130, 121, 20)) + self.prof_tel_nr.setFont(font3) + self.prof_tel_nr.setInputMethodHints(Qt.ImhDigitsOnly) + self.label_10 = QLabel(self.frame) + self.label_10.setObjectName(u"label_10") + self.label_10.setGeometry(QRect(470, 20, 51, 21)) + self.label_10.setFont(font3) + self.drpdwn_prof_name = QComboBox(self.frame) + self.drpdwn_prof_name.setObjectName(u"drpdwn_prof_name") + self.drpdwn_prof_name.setGeometry(QRect(110, 80, 121, 22)) + font4 = QFont() + font4.setPointSize(8) + font4.setBold(False) + self.drpdwn_prof_name.setFont(font4) + self.drpdwn_prof_name.setFocusPolicy(Qt.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.setInsertPolicy(QComboBox.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.mail_mand = QLabel(self.frame) + self.mail_mand.setObjectName(u"mail_mand") + self.mail_mand.setGeometry(QRect(100, 110, 47, 21)) + self.mail_mand.setFont(font3) + self.telnr_mand = QLabel(self.frame) + self.telnr_mand.setObjectName(u"telnr_mand") + self.telnr_mand.setGeometry(QRect(100, 130, 47, 21)) + self.telnr_mand.setFont(font3) + self.profname_mand = QLabel(self.frame) + self.profname_mand.setObjectName(u"profname_mand") + self.profname_mand.setGeometry(QRect(100, 80, 47, 21)) + self.profname_mand.setFont(font3) + self.appname_mand = QLabel(self.frame) + self.appname_mand.setObjectName(u"appname_mand") + self.appname_mand.setGeometry(QRect(330, 20, 16, 21)) + self.appname_mand.setFont(font3) + self.fach_mand = QLabel(self.frame) + self.fach_mand.setObjectName(u"fach_mand") + self.fach_mand.setGeometry(QRect(500, 20, 47, 21)) + self.fach_mand.setFont(font3) + self.fach_mand.setFocusPolicy(Qt.NoFocus) + self._mand = QLabel(self.frame) + self._mand.setObjectName(u"_mand") + self._mand.setGeometry(QRect(330, 60, 16, 21)) + self._mand.setFont(font3) + self.btn_add_document = QPushButton(self.frame) + self.btn_add_document.setObjectName(u"btn_add_document") + self.btn_add_document.setGeometry(QRect(1090, 20, 131, 25)) + self.btn_add_document.setFont(font3) + self.btn_open_document = QPushButton(self.frame) + self.btn_open_document.setObjectName(u"btn_open_document") + self.btn_open_document.setGeometry(QRect(1090, 60, 131, 25)) + self.btn_open_document.setFont(font3) + self.check_file = QPushButton(self.frame) + self.check_file.setObjectName(u"check_file") + self.check_file.setGeometry(QRect(1090, 100, 131, 51)) + self.check_file.setFont(font3) + self.formLayoutWidget_2 = QWidget(self.frame) + self.formLayoutWidget_2.setObjectName(u"formLayoutWidget_2") + self.formLayoutWidget_2.setGeometry(QRect(550, 70, 202, 80)) + self.formLayout_3 = QFormLayout(self.formLayoutWidget_2) + self.formLayout_3.setObjectName(u"formLayout_3") 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.label_12 = QLabel(self.formLayoutWidget_2) + self.label_12.setObjectName(u"label_12") + self.label_12.setFont(font3) + + self.formLayout_3.setWidget(0, QFormLayout.LabelRole, self.label_12) + + self.prof_id_adis = QLineEdit(self.formLayoutWidget_2) + self.prof_id_adis.setObjectName(u"prof_id_adis") + self.prof_id_adis.setFont(font3) + + self.formLayout_3.setWidget(0, QFormLayout.FieldRole, self.prof_id_adis) + + self.label_13 = QLabel(self.formLayoutWidget_2) + self.label_13.setObjectName(u"label_13") + self.label_13.setFont(font3) + + self.formLayout_3.setWidget(1, QFormLayout.LabelRole, self.label_13) + + self.apparat_id_adis = QLineEdit(self.formLayoutWidget_2) + self.apparat_id_adis.setObjectName(u"apparat_id_adis") + + self.formLayout_3.setWidget(1, QFormLayout.FieldRole, self.apparat_id_adis) + + self.check_send_mail = QCheckBox(self.frame) + self.check_send_mail.setObjectName(u"check_send_mail") + self.check_send_mail.setGeometry(QRect(450, 120, 91, 17)) + self.check_send_mail.setFont(font3) + self.frame_3 = QFrame(self.frame) + self.frame_3.setObjectName(u"frame_3") + self.frame_3.setGeometry(QRect(510, 0, 241, 61)) + self.frame_3.setFrameShape(QFrame.StyledPanel) + self.frame_3.setFrameShadow(QFrame.Raised) + self.gridLayoutWidget_5 = QWidget(self.frame_3) + self.gridLayoutWidget_5.setObjectName(u"gridLayoutWidget_5") + self.gridLayoutWidget_5.setGeometry(QRect(0, 0, 241, 61)) + self.gridLayout_6 = QGridLayout(self.gridLayoutWidget_5) + self.gridLayout_6.setObjectName(u"gridLayout_6") + self.gridLayout_6.setContentsMargins(0, 0, 0, 0) + self.app_fach = QComboBox(self.gridLayoutWidget_5) + self.app_fach.setObjectName(u"app_fach") + self.app_fach.setMaximumSize(QSize(16777215, 20)) + self.app_fach.setFont(font3) + + self.gridLayout_6.addWidget(self.app_fach, 0, 0, 1, 1) + + self.horizontalSpacer_7 = QSpacerItem(40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum) + + self.gridLayout_6.addItem(self.horizontalSpacer_7, 0, 1, 1, 1) + + self.prof_title = QLineEdit(self.frame) + self.prof_title.setObjectName(u"prof_title") + self.prof_title.setGeometry(QRect(110, 50, 71, 20)) + self.prof_title.setFont(font3) + self.prof_title.setFocusPolicy(Qt.StrongFocus) + self.mail_mand.raise_() self._mand.raise_() - self.drpdwn_prof_title.raise_() self.label_5.raise_() self.sem_winter.raise_() self.label_4.raise_() @@ -501,14 +426,12 @@ class Ui_MainWindow(object): 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_() @@ -516,922 +439,1115 @@ class Ui_MainWindow(object): self.check_file.raise_() self.formLayoutWidget_2.raise_() self.check_send_mail.raise_() + self.frame_3.raise_() + self.prof_title.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 = QTableWidget(self.gridLayoutWidget_2) + if (self.tableWidget_apparat_media.columnCount() < 7): + self.tableWidget_apparat_media.setColumnCount(7) + __qtablewidgetitem10 = QTableWidgetItem() + self.tableWidget_apparat_media.setHorizontalHeaderItem(0, __qtablewidgetitem10) + __qtablewidgetitem11 = QTableWidgetItem() + self.tableWidget_apparat_media.setHorizontalHeaderItem(1, __qtablewidgetitem11) + __qtablewidgetitem12 = QTableWidgetItem() + self.tableWidget_apparat_media.setHorizontalHeaderItem(2, __qtablewidgetitem12) + __qtablewidgetitem13 = QTableWidgetItem() + self.tableWidget_apparat_media.setHorizontalHeaderItem(3, __qtablewidgetitem13) + __qtablewidgetitem14 = QTableWidgetItem() + self.tableWidget_apparat_media.setHorizontalHeaderItem(4, __qtablewidgetitem14) + __qtablewidgetitem15 = QTableWidgetItem() + self.tableWidget_apparat_media.setHorizontalHeaderItem(5, __qtablewidgetitem15) + __qtablewidgetitem16 = QTableWidgetItem() + self.tableWidget_apparat_media.setHorizontalHeaderItem(6, __qtablewidgetitem16) + self.tableWidget_apparat_media.setObjectName(u"tableWidget_apparat_media") + sizePolicy3 = QSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Expanding) + sizePolicy3.setHorizontalStretch(0) + sizePolicy3.setVerticalStretch(0) + sizePolicy3.setHeightForWidth(self.tableWidget_apparat_media.sizePolicy().hasHeightForWidth()) + self.tableWidget_apparat_media.setSizePolicy(sizePolicy3) + self.tableWidget_apparat_media.setMinimumSize(QSize(1259, 0)) + self.tableWidget_apparat_media.setFocusPolicy(Qt.NoFocus) + self.tableWidget_apparat_media.setContextMenuPolicy(Qt.CustomContextMenu) + self.tableWidget_apparat_media.setSizeAdjustPolicy(QAbstractScrollArea.AdjustToContents) + self.tableWidget_apparat_media.setEditTriggers(QAbstractItemView.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.setSelectionBehavior(QAbstractItemView.SelectRows) + self.tableWidget_apparat_media.setSortingEnabled(True) 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.label = QLabel(self.gridLayoutWidget_2) + self.label.setObjectName(u"label") + font5 = QFont() + font5.setPointSize(11) + font5.setBold(True) + self.label.setFont(font5) + 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 = QHBoxLayout() + self.horizontalLayout_5.setObjectName(u"horizontalLayout_5") + self.horizontalSpacer = QSpacerItem(20, 20, QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Minimum) + + self.horizontalLayout_5.addItem(self.horizontalSpacer) + + self.chkbx_show_del_media = QCheckBox(self.gridLayoutWidget_2) + self.chkbx_show_del_media.setObjectName(u"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.horizontalSpacer_3 = QSpacerItem(40, 20, QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Minimum) + + self.horizontalLayout_5.addItem(self.horizontalSpacer_3) + + self.btn_reserve = QPushButton(self.gridLayoutWidget_2) + self.btn_reserve.setObjectName(u"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 = QHBoxLayout() + self.add_layout.setObjectName(u"add_layout") + self.label_info = QLabel(self.gridLayoutWidget_2) + self.label_info.setObjectName(u"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.line_2 = QFrame(self.gridLayoutWidget_2) + self.line_2.setObjectName(u"line_2") + self.line_2.setFrameShape(QFrame.VLine) + self.line_2.setFrameShadow(QFrame.Sunken) + self.add_layout.addWidget(self.line_2) - self.progress_label = QtWidgets.QLabel(parent=self.gridLayoutWidget_2) - self.progress_label.setObjectName("progress_label") + + self.progress_label = QLabel(self.gridLayoutWidget_2) + self.progress_label.setObjectName(u"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.horizontalSpacer_4 = QSpacerItem(40, 20, QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Minimum) + + self.horizontalLayout_5.addItem(self.horizontalSpacer_4) + + self.avail_layout = QHBoxLayout() + self.avail_layout.setObjectName(u"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.label_20 = QLabel(self.gridLayoutWidget_2) + self.label_20.setObjectName(u"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.line_3 = QFrame(self.gridLayoutWidget_2) + self.line_3.setObjectName(u"line_3") + self.line_3.setFrameShape(QFrame.VLine) + self.line_3.setFrameShadow(QFrame.Sunken) + self.horizontalLayout_5.addWidget(self.line_3) - self.avail_status = QtWidgets.QLabel(parent=self.gridLayoutWidget_2) - self.avail_status.setObjectName("avail_status") + + self.avail_status = QLabel(self.gridLayoutWidget_2) + self.avail_status.setObjectName(u"avail_status") + self.horizontalLayout_5.addWidget(self.avail_status) - spacerItem5 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) - self.horizontalLayout_5.addItem(spacerItem5) + + self.horizontalSpacer_2 = QSpacerItem(40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum) + + self.horizontalLayout_5.addItem(self.horizontalSpacer_2) + + 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.add_medium = QPushButton(self.tab) + self.add_medium.setObjectName(u"add_medium") + self.add_medium.setGeometry(QRect(0, 700, 121, 20)) + self.add_medium.setFocusPolicy(Qt.NoFocus) 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.tab_2 = QWidget() + self.tab_2.setObjectName(u"tab_2") + self.verticalLayoutWidget_2 = QWidget(self.tab_2) + self.verticalLayoutWidget_2.setObjectName(u"verticalLayoutWidget_2") + self.verticalLayoutWidget_2.setGeometry(QRect(0, 0, 1251, 721)) + self.verticalLayout_3 = QVBoxLayout(self.verticalLayoutWidget_2) + self.verticalLayout_3.setObjectName(u"verticalLayout_3") 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.tabWidget_2 = QTabWidget(self.verticalLayoutWidget_2) + self.tabWidget_2.setObjectName(u"tabWidget_2") + self.tabWidget_2.setMaximumSize(QSize(16777215, 250)) + self.tab_3 = QWidget() + self.tab_3.setObjectName(u"tab_3") + self.btn_search = QPushButton(self.tab_3) + self.btn_search.setObjectName(u"btn_search") + self.btn_search.setGeometry(QRect(10, 180, 75, 23)) + self.gridLayoutWidget = QWidget(self.tab_3) + self.gridLayoutWidget.setObjectName(u"gridLayoutWidget") + self.gridLayoutWidget.setGeometry(QRect(10, 10, 491, 161)) + self.gridLayout_3 = QGridLayout(self.gridLayoutWidget) + self.gridLayout_3.setObjectName(u"gridLayout_3") 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.label_7 = QLabel(self.gridLayoutWidget) + self.label_7.setObjectName(u"label_7") + self.gridLayout_3.addWidget(self.label_7, 0, 0, 1, 1) - self.box_erstellsemester = QtWidgets.QComboBox(parent=self.gridLayoutWidget) + + self.box_erstellsemester = QComboBox(self.gridLayoutWidget) + self.box_erstellsemester.setObjectName(u"box_erstellsemester") 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.label_18 = QLabel(self.gridLayoutWidget) + self.label_18.setObjectName(u"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.label_17 = QLabel(self.gridLayoutWidget) + self.label_17.setObjectName(u"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.label_19 = QLabel(self.gridLayoutWidget) + self.label_19.setObjectName(u"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.box_dauerapp = QComboBox(self.gridLayoutWidget) + self.box_dauerapp.setObjectName(u"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.label_11 = QLabel(self.gridLayoutWidget) + self.label_11.setObjectName(u"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.label_16 = QLabel(self.gridLayoutWidget) + self.label_16.setObjectName(u"label_16") + self.gridLayout_3.addWidget(self.label_16, 2, 0, 1, 1) - self.box_semester = QtWidgets.QComboBox(parent=self.gridLayoutWidget) + + self.box_semester = QComboBox(self.gridLayoutWidget) + self.box_semester.setObjectName(u"box_semester") 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 = QComboBox(self.gridLayoutWidget) + self.box_appnrs.setObjectName(u"box_appnrs") 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 = QComboBox(self.gridLayoutWidget) + self.box_fach.setObjectName(u"box_fach") 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 = QComboBox(self.gridLayoutWidget) + self.box_person.setObjectName(u"box_person") 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.verticalSpacer_3 = QSpacerItem(20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding) + + self.gridLayout_3.addItem(self.verticalSpacer_3, 4, 0, 1, 1) + + self.label_15 = QLabel(self.gridLayoutWidget) + self.label_15.setObjectName(u"label_15") + self.gridLayout_3.addWidget(self.label_15, 3, 0, 1, 1) - self.check_deletable = QtWidgets.QCheckBox(parent=self.gridLayoutWidget) - self.check_deletable.setFocusPolicy(QtCore.Qt.FocusPolicy.StrongFocus) - self.check_deletable.setText("") - self.check_deletable.setObjectName("check_deletable") + + self.check_deletable = QCheckBox(self.gridLayoutWidget) + self.check_deletable.setObjectName(u"check_deletable") + self.check_deletable.setFocusPolicy(Qt.StrongFocus) + 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.db_err_message = QLabel(self.tab_3) + self.db_err_message.setObjectName(u"db_err_message") + self.db_err_message.setGeometry(QRect(100, 180, 401, 23)) self.tabWidget_2.addTab(self.tab_3, "") - self.tab_4 = QtWidgets.QWidget() - self.tab_4.setObjectName("tab_4") - self.formLayoutWidget = QtWidgets.QWidget(parent=self.tab_4) - self.formLayoutWidget.setGeometry(QtCore.QRect(10, 10, 451, 151)) - self.formLayoutWidget.setObjectName("formLayoutWidget") - self.formLayout_6 = QtWidgets.QFormLayout(self.formLayoutWidget) + self.tab_4 = QWidget() + self.tab_4.setObjectName(u"tab_4") + self.formLayoutWidget = QWidget(self.tab_4) + self.formLayoutWidget.setObjectName(u"formLayoutWidget") + self.formLayoutWidget.setGeometry(QRect(10, 10, 451, 151)) + self.formLayout_6 = QFormLayout(self.formLayoutWidget) + self.formLayout_6.setObjectName(u"formLayout_6") self.formLayout_6.setContentsMargins(0, 0, 0, 0) - self.formLayout_6.setObjectName("formLayout_6") - self.label_25 = QtWidgets.QLabel(parent=self.formLayoutWidget) - self.label_25.setObjectName("label_25") - self.formLayout_6.setWidget(0, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_25) - self.book_search = QtWidgets.QPushButton(parent=self.formLayoutWidget) - self.book_search.setObjectName("book_search") - self.formLayout_6.setWidget(3, QtWidgets.QFormLayout.ItemRole.LabelRole, self.book_search) - self.seach_by_signature = QtWidgets.QLineEdit(parent=self.formLayoutWidget) + self.label_25 = QLabel(self.formLayoutWidget) + self.label_25.setObjectName(u"label_25") + + self.formLayout_6.setWidget(0, QFormLayout.LabelRole, self.label_25) + + self.book_search = QPushButton(self.formLayoutWidget) + self.book_search.setObjectName(u"book_search") + + self.formLayout_6.setWidget(3, QFormLayout.LabelRole, self.book_search) + + self.seach_by_signature = QLineEdit(self.formLayoutWidget) + self.seach_by_signature.setObjectName(u"seach_by_signature") self.seach_by_signature.setClearButtonEnabled(True) - self.seach_by_signature.setObjectName("seach_by_signature") - self.formLayout_6.setWidget(0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.seach_by_signature) - self.label_26 = QtWidgets.QLabel(parent=self.formLayoutWidget) - self.label_26.setObjectName("label_26") - self.formLayout_6.setWidget(1, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_26) - self.search_by_title = QtWidgets.QLineEdit(parent=self.formLayoutWidget) + + self.formLayout_6.setWidget(0, QFormLayout.FieldRole, self.seach_by_signature) + + self.label_26 = QLabel(self.formLayoutWidget) + self.label_26.setObjectName(u"label_26") + + self.formLayout_6.setWidget(1, QFormLayout.LabelRole, self.label_26) + + self.search_by_title = QLineEdit(self.formLayoutWidget) + self.search_by_title.setObjectName(u"search_by_title") self.search_by_title.setClearButtonEnabled(True) - self.search_by_title.setObjectName("search_by_title") - self.formLayout_6.setWidget(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.search_by_title) - spacerItem7 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) - self.formLayout_6.setItem(2, QtWidgets.QFormLayout.ItemRole.LabelRole, spacerItem7) + + self.formLayout_6.setWidget(1, QFormLayout.FieldRole, self.search_by_title) + + self.verticalSpacer_4 = QSpacerItem(20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding) + + self.formLayout_6.setItem(2, QFormLayout.LabelRole, self.verticalSpacer_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.gridLayoutWidget_3 = QtWidgets.QWidget(parent=self.tab_6) - self.gridLayoutWidget_3.setGeometry(QtCore.QRect(0, 0, 431, 411)) - self.gridLayoutWidget_3.setObjectName("gridLayoutWidget_3") - self.gridLayout_4 = QtWidgets.QGridLayout(self.gridLayoutWidget_3) + + self.stackedWidget_4 = QStackedWidget(self.verticalLayoutWidget_2) + self.stackedWidget_4.setObjectName(u"stackedWidget_4") + self.stackedWidget_4.setFrameShape(QFrame.StyledPanel) + self.stackedWidget_4.setFrameShadow(QFrame.Raised) + self.stackedWidget_4Page1 = QWidget() + self.stackedWidget_4Page1.setObjectName(u"stackedWidget_4Page1") + self.tabWidget_3 = QTabWidget(self.stackedWidget_4Page1) + self.tabWidget_3.setObjectName(u"tabWidget_3") + self.tabWidget_3.setGeometry(QRect(780, 10, 441, 441)) + self.tab_6 = QWidget() + self.tab_6.setObjectName(u"tab_6") + self.gridLayoutWidget_3 = QWidget(self.tab_6) + self.gridLayoutWidget_3.setObjectName(u"gridLayoutWidget_3") + self.gridLayoutWidget_3.setGeometry(QRect(0, 0, 431, 411)) + self.gridLayout_4 = QGridLayout(self.gridLayoutWidget_3) + self.gridLayout_4.setObjectName(u"gridLayout_4") self.gridLayout_4.setContentsMargins(0, 0, 0, 0) - self.gridLayout_4.setObjectName("gridLayout_4") - self.statistics_table = QtWidgets.QTableWidget(parent=self.gridLayoutWidget_3) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Expanding) - 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, 16777215)) - self.statistics_table.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) - self.statistics_table.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers) + self.statistics_table = QTableWidget(self.gridLayoutWidget_3) + if (self.statistics_table.columnCount() < 3): + self.statistics_table.setColumnCount(3) + __qtablewidgetitem17 = QTableWidgetItem() + self.statistics_table.setHorizontalHeaderItem(0, __qtablewidgetitem17) + __qtablewidgetitem18 = QTableWidgetItem() + self.statistics_table.setHorizontalHeaderItem(1, __qtablewidgetitem18) + __qtablewidgetitem19 = QTableWidgetItem() + self.statistics_table.setHorizontalHeaderItem(2, __qtablewidgetitem19) + self.statistics_table.setObjectName(u"statistics_table") + sizePolicy4 = QSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Expanding) + sizePolicy4.setHorizontalStretch(0) + sizePolicy4.setVerticalStretch(0) + sizePolicy4.setHeightForWidth(self.statistics_table.sizePolicy().hasHeightForWidth()) + self.statistics_table.setSizePolicy(sizePolicy4) + self.statistics_table.setMaximumSize(QSize(16777215, 16777215)) + self.statistics_table.setFocusPolicy(Qt.NoFocus) + self.statistics_table.setEditTriggers(QAbstractItemView.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(True) - self.statistics_table.horizontalHeader().setDefaultSectionSize(59) self.statistics_table.horizontalHeader().setMinimumSectionSize(24) - self.statistics_table.horizontalHeader().setSortIndicatorShown(True) + self.statistics_table.horizontalHeader().setDefaultSectionSize(59) + self.statistics_table.horizontalHeader().setProperty("showSortIndicator", True) self.statistics_table.horizontalHeader().setStretchLastSection(False) + self.gridLayout_4.addWidget(self.statistics_table, 0, 0, 1, 1) + self.tabWidget_3.addTab(self.tab_6, "") - self.tab_7 = QtWidgets.QWidget() - self.tab_7.setObjectName("tab_7") + self.tab_7 = QWidget() + self.tab_7.setObjectName(u"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.widget = QWidget(self.stackedWidget_4Page1) + self.widget.setObjectName(u"widget") + self.widget.setGeometry(QRect(10, 10, 761, 441)) + self.horizontalLayoutWidget_3 = QWidget(self.widget) + self.horizontalLayoutWidget_3.setObjectName(u"horizontalLayoutWidget_3") + self.horizontalLayoutWidget_3.setGeometry(QRect(0, 0, 761, 51)) + self.horizontalLayout_7 = QHBoxLayout(self.horizontalLayoutWidget_3) + self.horizontalLayout_7.setObjectName(u"horizontalLayout_7") 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.setFocusPolicy(QtCore.Qt.FocusPolicy.StrongFocus) - self.btn_del_select_apparats.setObjectName("btn_del_select_apparats") + self.btn_del_select_apparats = QPushButton(self.horizontalLayoutWidget_3) + self.btn_del_select_apparats.setObjectName(u"btn_del_select_apparats") + self.btn_del_select_apparats.setFocusPolicy(Qt.StrongFocus) + self.horizontalLayout_7.addWidget(self.btn_del_select_apparats) - spacerItem8 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) - self.horizontalLayout_7.addItem(spacerItem8) - 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.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) - 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.horizontalSpacer_5 = QSpacerItem(40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum) + + self.horizontalLayout_7.addItem(self.horizontalSpacer_5) + + self.table = QWidget(self.widget) + self.table.setObjectName(u"table") + self.table.setGeometry(QRect(0, 50, 761, 391)) + self.tableWidget = QTableWidget(self.table) + if (self.tableWidget.columnCount() < 5): + self.tableWidget.setColumnCount(5) + __qtablewidgetitem20 = QTableWidgetItem() + self.tableWidget.setHorizontalHeaderItem(0, __qtablewidgetitem20) + __qtablewidgetitem21 = QTableWidgetItem() + self.tableWidget.setHorizontalHeaderItem(1, __qtablewidgetitem21) + __qtablewidgetitem22 = QTableWidgetItem() + self.tableWidget.setHorizontalHeaderItem(2, __qtablewidgetitem22) + __qtablewidgetitem23 = QTableWidgetItem() + self.tableWidget.setHorizontalHeaderItem(3, __qtablewidgetitem23) + __qtablewidgetitem24 = QTableWidgetItem() + self.tableWidget.setHorizontalHeaderItem(4, __qtablewidgetitem24) + self.tableWidget.setObjectName(u"tableWidget") + self.tableWidget.setGeometry(QRect(0, 0, 761, 391)) + self.tableWidget.setFocusPolicy(Qt.NoFocus) + self.tableWidget.setEditTriggers(QAbstractItemView.NoEditTriggers) self.stackedWidget_4.addWidget(self.stackedWidget_4Page1) - self.page = QtWidgets.QWidget() - self.page.setObjectName("page") - self.book_search_result = QtWidgets.QTableWidget(parent=self.page) - self.book_search_result.setGeometry(QtCore.QRect(10, 20, 1081, 421)) - self.book_search_result.setFrameShadow(QtWidgets.QFrame.Shadow.Plain) - self.book_search_result.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers) + self.page = QWidget() + self.page.setObjectName(u"page") + self.book_search_result = QTableWidget(self.page) + if (self.book_search_result.columnCount() < 3): + self.book_search_result.setColumnCount(3) + __qtablewidgetitem25 = QTableWidgetItem() + self.book_search_result.setHorizontalHeaderItem(0, __qtablewidgetitem25) + __qtablewidgetitem26 = QTableWidgetItem() + self.book_search_result.setHorizontalHeaderItem(1, __qtablewidgetitem26) + __qtablewidgetitem27 = QTableWidgetItem() + self.book_search_result.setHorizontalHeaderItem(2, __qtablewidgetitem27) + self.book_search_result.setObjectName(u"book_search_result") + self.book_search_result.setGeometry(QRect(10, 20, 1081, 421)) + self.book_search_result.setFrameShadow(QFrame.Plain) + self.book_search_result.setEditTriggers(QAbstractItemView.NoEditTriggers) self.book_search_result.setAlternatingRowColors(True) - self.book_search_result.setObjectName("book_search_result") - self.book_search_result.setColumnCount(3) - self.book_search_result.setRowCount(0) - item = QtWidgets.QTableWidgetItem() - self.book_search_result.setHorizontalHeaderItem(0, item) - item = QtWidgets.QTableWidgetItem() - self.book_search_result.setHorizontalHeaderItem(1, item) - item = QtWidgets.QTableWidgetItem() - self.book_search_result.setHorizontalHeaderItem(2, item) self.book_search_result.horizontalHeader().setCascadingSectionResizes(True) self.book_search_result.horizontalHeader().setStretchLastSection(True) self.stackedWidget_4.addWidget(self.page) + 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.label_21 = QtWidgets.QLabel(parent=self.tab_5) - self.label_21.setGeometry(QtCore.QRect(10, 30, 47, 22)) - self.label_21.setObjectName("label_21") - self.select_action_box = QtWidgets.QComboBox(parent=self.tab_5) - self.select_action_box.setGeometry(QtCore.QRect(70, 30, 181, 22)) - self.select_action_box.setObjectName("select_action_box") + self.tab_5 = QWidget() + self.tab_5.setObjectName(u"tab_5") + self.label_21 = QLabel(self.tab_5) + self.label_21.setObjectName(u"label_21") + self.label_21.setGeometry(QRect(10, 30, 47, 22)) + self.select_action_box = QComboBox(self.tab_5) self.select_action_box.addItem("") self.select_action_box.addItem("") self.select_action_box.addItem("") self.select_action_box.addItem("") - self.user_create_frame = QtWidgets.QFrame(parent=self.tab_5) - self.user_create_frame.setGeometry(QtCore.QRect(10, 60, 591, 141)) - self.user_create_frame.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel) - self.user_create_frame.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) - self.user_create_frame.setObjectName("user_create_frame") - self.gridLayoutWidget_4 = QtWidgets.QWidget(parent=self.user_create_frame) - self.gridLayoutWidget_4.setGeometry(QtCore.QRect(0, 0, 581, 141)) - self.gridLayoutWidget_4.setObjectName("gridLayoutWidget_4") - self.gridLayout_5 = QtWidgets.QGridLayout(self.gridLayoutWidget_4) + self.select_action_box.setObjectName(u"select_action_box") + self.select_action_box.setGeometry(QRect(70, 30, 181, 22)) + self.user_create_frame = QFrame(self.tab_5) + self.user_create_frame.setObjectName(u"user_create_frame") + self.user_create_frame.setGeometry(QRect(10, 60, 591, 141)) + self.user_create_frame.setFrameShape(QFrame.StyledPanel) + self.user_create_frame.setFrameShadow(QFrame.Raised) + self.gridLayoutWidget_4 = QWidget(self.user_create_frame) + self.gridLayoutWidget_4.setObjectName(u"gridLayoutWidget_4") + self.gridLayoutWidget_4.setGeometry(QRect(0, 0, 581, 141)) + self.gridLayout_5 = QGridLayout(self.gridLayoutWidget_4) + self.gridLayout_5.setObjectName(u"gridLayout_5") self.gridLayout_5.setContentsMargins(0, 0, 0, 0) - self.gridLayout_5.setObjectName("gridLayout_5") - self.label_22 = QtWidgets.QLabel(parent=self.gridLayoutWidget_4) - self.label_22.setObjectName("label_22") + self.label_22 = QLabel(self.gridLayoutWidget_4) + self.label_22.setObjectName(u"label_22") + self.gridLayout_5.addWidget(self.label_22, 0, 0, 1, 1) - self.user_create_frame_username = QtWidgets.QLineEdit(parent=self.gridLayoutWidget_4) - self.user_create_frame_username.setMaximumSize(QtCore.QSize(150, 16777215)) - self.user_create_frame_username.setObjectName("user_create_frame_username") + + self.user_create_frame_username = QLineEdit(self.gridLayoutWidget_4) + self.user_create_frame_username.setObjectName(u"user_create_frame_username") + self.user_create_frame_username.setMaximumSize(QSize(150, 16777215)) + self.gridLayout_5.addWidget(self.user_create_frame_username, 0, 1, 1, 1) - self.label_24 = QtWidgets.QLabel(parent=self.gridLayoutWidget_4) - self.label_24.setObjectName("label_24") + + self.label_24 = QLabel(self.gridLayoutWidget_4) + self.label_24.setObjectName(u"label_24") + self.gridLayout_5.addWidget(self.label_24, 0, 2, 1, 1) - self.label_23 = QtWidgets.QLabel(parent=self.gridLayoutWidget_4) - self.label_23.setObjectName("label_23") + + self.label_23 = QLabel(self.gridLayoutWidget_4) + self.label_23.setObjectName(u"label_23") + self.gridLayout_5.addWidget(self.label_23, 1, 0, 1, 1) - spacerItem9 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) - self.gridLayout_5.addItem(spacerItem9, 0, 4, 1, 1) - self.user_frame_userrole = QtWidgets.QComboBox(parent=self.gridLayoutWidget_4) - self.user_frame_userrole.setObjectName("user_frame_userrole") + + self.horizontalSpacer_6 = QSpacerItem(40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum) + + self.gridLayout_5.addItem(self.horizontalSpacer_6, 0, 4, 1, 1) + + self.user_frame_userrole = QComboBox(self.gridLayoutWidget_4) + self.user_frame_userrole.setObjectName(u"user_frame_userrole") + self.gridLayout_5.addWidget(self.user_frame_userrole, 0, 3, 1, 1) - self.user_create_frame_password = QtWidgets.QLineEdit(parent=self.gridLayoutWidget_4) - self.user_create_frame_password.setMaximumSize(QtCore.QSize(150, 16777215)) - self.user_create_frame_password.setObjectName("user_create_frame_password") + + self.user_create_frame_password = QLineEdit(self.gridLayoutWidget_4) + self.user_create_frame_password.setObjectName(u"user_create_frame_password") + self.user_create_frame_password.setMaximumSize(QSize(150, 16777215)) + self.gridLayout_5.addWidget(self.user_create_frame_password, 1, 1, 1, 1) - self.user_frame_addUser = QtWidgets.QPushButton(parent=self.gridLayoutWidget_4) - self.user_frame_addUser.setObjectName("user_frame_addUser") + + self.user_frame_addUser = QPushButton(self.gridLayoutWidget_4) + self.user_frame_addUser.setObjectName(u"user_frame_addUser") + self.gridLayout_5.addWidget(self.user_frame_addUser, 1, 3, 1, 1) - self.user_frame_err_message = QtWidgets.QLabel(parent=self.gridLayoutWidget_4) - self.user_frame_err_message.setText("") - self.user_frame_err_message.setObjectName("user_frame_err_message") + + self.user_frame_err_message = QLabel(self.gridLayoutWidget_4) + self.user_frame_err_message.setObjectName(u"user_frame_err_message") + self.gridLayout_5.addWidget(self.user_frame_err_message, 1, 4, 1, 1) - self.user_delete_frame = QtWidgets.QFrame(parent=self.tab_5) - self.user_delete_frame.setGeometry(QtCore.QRect(10, 60, 591, 141)) - self.user_delete_frame.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel) - self.user_delete_frame.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) - self.user_delete_frame.setObjectName("user_delete_frame") - self.gridLayoutWidget_7 = QtWidgets.QWidget(parent=self.user_delete_frame) - self.gridLayoutWidget_7.setGeometry(QtCore.QRect(0, 0, 581, 141)) - self.gridLayoutWidget_7.setObjectName("gridLayoutWidget_7") - self.gridLayout_8 = QtWidgets.QGridLayout(self.gridLayoutWidget_7) + + self.user_delete_frame = QFrame(self.tab_5) + self.user_delete_frame.setObjectName(u"user_delete_frame") + self.user_delete_frame.setGeometry(QRect(10, 60, 591, 141)) + self.user_delete_frame.setFrameShape(QFrame.StyledPanel) + self.user_delete_frame.setFrameShadow(QFrame.Raised) + self.gridLayoutWidget_7 = QWidget(self.user_delete_frame) + self.gridLayoutWidget_7.setObjectName(u"gridLayoutWidget_7") + self.gridLayoutWidget_7.setGeometry(QRect(0, 0, 581, 141)) + self.gridLayout_8 = QGridLayout(self.gridLayoutWidget_7) + self.gridLayout_8.setObjectName(u"gridLayout_8") self.gridLayout_8.setContentsMargins(0, 0, 0, 0) - self.gridLayout_8.setObjectName("gridLayout_8") - self.horizontalLayout_8 = QtWidgets.QHBoxLayout() - self.horizontalLayout_8.setObjectName("horizontalLayout_8") - spacerItem10 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) - self.horizontalLayout_8.addItem(spacerItem10) - self.pushButton = QtWidgets.QPushButton(parent=self.gridLayoutWidget_7) - self.pushButton.setObjectName("pushButton") + self.horizontalLayout_8 = QHBoxLayout() + self.horizontalLayout_8.setObjectName(u"horizontalLayout_8") + self.horizontalSpacer_10 = QSpacerItem(40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum) + + self.horizontalLayout_8.addItem(self.horizontalSpacer_10) + + self.pushButton = QPushButton(self.gridLayoutWidget_7) + self.pushButton.setObjectName(u"pushButton") + self.horizontalLayout_8.addWidget(self.pushButton) - spacerItem11 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) - self.horizontalLayout_8.addItem(spacerItem11) + + self.horizontalSpacer_11 = QSpacerItem(40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum) + + self.horizontalLayout_8.addItem(self.horizontalSpacer_11) + + self.gridLayout_8.addLayout(self.horizontalLayout_8, 1, 1, 1, 1) - self.label_34 = QtWidgets.QLabel(parent=self.gridLayoutWidget_7) - self.label_34.setObjectName("label_34") + + self.label_34 = QLabel(self.gridLayoutWidget_7) + self.label_34.setObjectName(u"label_34") + self.gridLayout_8.addWidget(self.label_34, 0, 0, 1, 1) - self.user_delete_frame_user_select = QtWidgets.QComboBox(parent=self.gridLayoutWidget_7) - self.user_delete_frame_user_select.setObjectName("user_delete_frame_user_select") + + self.user_delete_frame_user_select = QComboBox(self.gridLayoutWidget_7) + self.user_delete_frame_user_select.setObjectName(u"user_delete_frame_user_select") + self.gridLayout_8.addWidget(self.user_delete_frame_user_select, 0, 1, 1, 1) - self.user_delete_confirm = QtWidgets.QRadioButton(parent=self.gridLayoutWidget_7) - self.user_delete_confirm.setLayoutDirection(QtCore.Qt.LayoutDirection.RightToLeft) - self.user_delete_confirm.setObjectName("user_delete_confirm") + + self.user_delete_confirm = QRadioButton(self.gridLayoutWidget_7) + self.user_delete_confirm.setObjectName(u"user_delete_confirm") + self.user_delete_confirm.setLayoutDirection(Qt.RightToLeft) + self.gridLayout_8.addWidget(self.user_delete_confirm, 1, 0, 1, 1) - spacerItem12 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) - self.gridLayout_8.addItem(spacerItem12, 0, 2, 1, 1) - self.user_delete_err_message = QtWidgets.QLabel(parent=self.gridLayoutWidget_7) - self.user_delete_err_message.setText("") - self.user_delete_err_message.setObjectName("user_delete_err_message") + + self.horizontalSpacer_12 = QSpacerItem(40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum) + + self.gridLayout_8.addItem(self.horizontalSpacer_12, 0, 2, 1, 1) + + self.user_delete_err_message = QLabel(self.gridLayoutWidget_7) + self.user_delete_err_message.setObjectName(u"user_delete_err_message") + self.gridLayout_8.addWidget(self.user_delete_err_message, 1, 2, 1, 1) - self.user_edit_frame = QtWidgets.QFrame(parent=self.tab_5) - self.user_edit_frame.setGeometry(QtCore.QRect(10, 60, 591, 141)) - self.user_edit_frame.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel) - self.user_edit_frame.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) - self.user_edit_frame.setObjectName("user_edit_frame") - self.gridLayoutWidget_10 = QtWidgets.QWidget(parent=self.user_edit_frame) - self.gridLayoutWidget_10.setGeometry(QtCore.QRect(0, 0, 581, 141)) - self.gridLayoutWidget_10.setObjectName("gridLayoutWidget_10") - self.gridLayout_11 = QtWidgets.QGridLayout(self.gridLayoutWidget_10) + + self.user_edit_frame = QFrame(self.tab_5) + self.user_edit_frame.setObjectName(u"user_edit_frame") + self.user_edit_frame.setGeometry(QRect(10, 60, 591, 141)) + self.user_edit_frame.setFrameShape(QFrame.StyledPanel) + self.user_edit_frame.setFrameShadow(QFrame.Raised) + self.gridLayoutWidget_10 = QWidget(self.user_edit_frame) + self.gridLayoutWidget_10.setObjectName(u"gridLayoutWidget_10") + self.gridLayoutWidget_10.setGeometry(QRect(0, 0, 581, 141)) + self.gridLayout_11 = QGridLayout(self.gridLayoutWidget_10) + self.gridLayout_11.setObjectName(u"gridLayout_11") self.gridLayout_11.setContentsMargins(0, 0, 0, 0) - self.gridLayout_11.setObjectName("gridLayout_11") - self.user_edit_frame_role_select = QtWidgets.QComboBox(parent=self.gridLayoutWidget_10) - self.user_edit_frame_role_select.setObjectName("user_edit_frame_role_select") + self.user_edit_frame_role_select = QComboBox(self.gridLayoutWidget_10) + self.user_edit_frame_role_select.setObjectName(u"user_edit_frame_role_select") + self.gridLayout_11.addWidget(self.user_edit_frame_role_select, 0, 3, 1, 1) - self.label_38 = QtWidgets.QLabel(parent=self.gridLayoutWidget_10) - self.label_38.setObjectName("label_38") + + self.label_38 = QLabel(self.gridLayoutWidget_10) + self.label_38.setObjectName(u"label_38") + self.gridLayout_11.addWidget(self.label_38, 0, 0, 1, 1) - self.user_edit_frame_user_select = QtWidgets.QComboBox(parent=self.gridLayoutWidget_10) - self.user_edit_frame_user_select.setMaximumSize(QtCore.QSize(150, 16777215)) - self.user_edit_frame_user_select.setObjectName("user_edit_frame_user_select") + + self.user_edit_frame_user_select = QComboBox(self.gridLayoutWidget_10) + self.user_edit_frame_user_select.setObjectName(u"user_edit_frame_user_select") + self.user_edit_frame_user_select.setMaximumSize(QSize(150, 16777215)) + self.gridLayout_11.addWidget(self.user_edit_frame_user_select, 0, 1, 1, 1) - self.update_user = QtWidgets.QPushButton(parent=self.gridLayoutWidget_10) - self.update_user.setObjectName("update_user") + + self.update_user = QPushButton(self.gridLayoutWidget_10) + self.update_user.setObjectName(u"update_user") + self.gridLayout_11.addWidget(self.update_user, 1, 3, 1, 1) - self.label_40 = QtWidgets.QLabel(parent=self.gridLayoutWidget_10) - self.label_40.setObjectName("label_40") + + self.label_40 = QLabel(self.gridLayoutWidget_10) + self.label_40.setObjectName(u"label_40") + self.gridLayout_11.addWidget(self.label_40, 0, 2, 1, 1) - self.label_39 = QtWidgets.QLabel(parent=self.gridLayoutWidget_10) - self.label_39.setObjectName("label_39") + + self.label_39 = QLabel(self.gridLayoutWidget_10) + self.label_39.setObjectName(u"label_39") + self.gridLayout_11.addWidget(self.label_39, 1, 0, 1, 1) - self.user_edit_frame_new_password = QtWidgets.QLineEdit(parent=self.gridLayoutWidget_10) - self.user_edit_frame_new_password.setMaximumSize(QtCore.QSize(150, 16777215)) - self.user_edit_frame_new_password.setObjectName("user_edit_frame_new_password") + + self.user_edit_frame_new_password = QLineEdit(self.gridLayoutWidget_10) + self.user_edit_frame_new_password.setObjectName(u"user_edit_frame_new_password") + self.user_edit_frame_new_password.setMaximumSize(QSize(150, 16777215)) + self.gridLayout_11.addWidget(self.user_edit_frame_new_password, 1, 1, 1, 1) - spacerItem13 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) - self.gridLayout_11.addItem(spacerItem13, 0, 4, 1, 1) - self.edit_faculty_member = QtWidgets.QFrame(parent=self.tab_5) - self.edit_faculty_member.setGeometry(QtCore.QRect(10, 60, 1051, 191)) - self.edit_faculty_member.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel) - self.edit_faculty_member.setFrameShadow(QtWidgets.QFrame.Shadow.Raised) - self.edit_faculty_member.setObjectName("edit_faculty_member") - self.gridLayoutWidget_11 = QtWidgets.QWidget(parent=self.edit_faculty_member) - self.gridLayoutWidget_11.setGeometry(QtCore.QRect(0, 0, 751, 223)) - self.gridLayoutWidget_11.setObjectName("gridLayoutWidget_11") - self.gridLayout_12 = QtWidgets.QGridLayout(self.gridLayoutWidget_11) + + self.horizontalSpacer_14 = QSpacerItem(40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum) + + self.gridLayout_11.addItem(self.horizontalSpacer_14, 0, 4, 1, 1) + + self.edit_faculty_member = QFrame(self.tab_5) + self.edit_faculty_member.setObjectName(u"edit_faculty_member") + self.edit_faculty_member.setGeometry(QRect(10, 60, 1051, 241)) + self.edit_faculty_member.setFrameShape(QFrame.StyledPanel) + self.edit_faculty_member.setFrameShadow(QFrame.Raised) + self.gridLayoutWidget_11 = QWidget(self.edit_faculty_member) + self.gridLayoutWidget_11.setObjectName(u"gridLayoutWidget_11") + self.gridLayoutWidget_11.setGeometry(QRect(0, 0, 751, 223)) + self.gridLayout_12 = QGridLayout(self.gridLayoutWidget_11) + self.gridLayout_12.setObjectName(u"gridLayout_12") self.gridLayout_12.setContentsMargins(0, 0, 0, 0) - self.gridLayout_12.setObjectName("gridLayout_12") - self.formLayout_2 = QtWidgets.QFormLayout() - self.formLayout_2.setObjectName("formLayout_2") - self.label_43 = QtWidgets.QLabel(parent=self.gridLayoutWidget_11) - self.label_43.setObjectName("label_43") - self.formLayout_2.setWidget(0, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_43) - self.edit_faculty_member_new_title = QtWidgets.QComboBox(parent=self.gridLayoutWidget_11) - self.edit_faculty_member_new_title.setObjectName("edit_faculty_member_new_title") - self.formLayout_2.setWidget(0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.edit_faculty_member_new_title) - self.label_44 = QtWidgets.QLabel(parent=self.gridLayoutWidget_11) - self.label_44.setObjectName("label_44") - self.formLayout_2.setWidget(1, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_44) - self.edit_faculty_member_new_surname = QtWidgets.QLineEdit(parent=self.gridLayoutWidget_11) - self.edit_faculty_member_new_surname.setObjectName("edit_faculty_member_new_surname") - self.formLayout_2.setWidget(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.edit_faculty_member_new_surname) - self.label_45 = QtWidgets.QLabel(parent=self.gridLayoutWidget_11) - self.label_45.setObjectName("label_45") - self.formLayout_2.setWidget(2, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_45) - self.user_faculty_member_new_name = QtWidgets.QLineEdit(parent=self.gridLayoutWidget_11) - self.user_faculty_member_new_name.setObjectName("user_faculty_member_new_name") - self.formLayout_2.setWidget(2, QtWidgets.QFormLayout.ItemRole.FieldRole, self.user_faculty_member_new_name) + self.formLayout_2 = QFormLayout() + self.formLayout_2.setObjectName(u"formLayout_2") + self.label_43 = QLabel(self.gridLayoutWidget_11) + self.label_43.setObjectName(u"label_43") + + self.formLayout_2.setWidget(0, QFormLayout.LabelRole, self.label_43) + + self.edit_faculty_member_new_title = QComboBox(self.gridLayoutWidget_11) + self.edit_faculty_member_new_title.setObjectName(u"edit_faculty_member_new_title") + self.edit_faculty_member_new_title.setEditable(True) + + self.formLayout_2.setWidget(0, QFormLayout.FieldRole, self.edit_faculty_member_new_title) + + self.label_44 = QLabel(self.gridLayoutWidget_11) + self.label_44.setObjectName(u"label_44") + + self.formLayout_2.setWidget(1, QFormLayout.LabelRole, self.label_44) + + self.edit_faculty_member_new_surname = QLineEdit(self.gridLayoutWidget_11) + self.edit_faculty_member_new_surname.setObjectName(u"edit_faculty_member_new_surname") + + self.formLayout_2.setWidget(1, QFormLayout.FieldRole, self.edit_faculty_member_new_surname) + + self.label_45 = QLabel(self.gridLayoutWidget_11) + self.label_45.setObjectName(u"label_45") + + self.formLayout_2.setWidget(2, QFormLayout.LabelRole, self.label_45) + + self.user_faculty_member_new_name = QLineEdit(self.gridLayoutWidget_11) + self.user_faculty_member_new_name.setObjectName(u"user_faculty_member_new_name") + + self.formLayout_2.setWidget(2, QFormLayout.FieldRole, self.user_faculty_member_new_name) + + self.gridLayout_12.addLayout(self.formLayout_2, 2, 2, 1, 1) - self.formLayout_4 = QtWidgets.QFormLayout() - self.formLayout_4.setObjectName("formLayout_4") - self.edit_faculty_member_title = QtWidgets.QLineEdit(parent=self.gridLayoutWidget_11) - self.edit_faculty_member_title.setFocusPolicy(QtCore.Qt.FocusPolicy.TabFocus) + + self.formLayout_4 = QFormLayout() + self.formLayout_4.setObjectName(u"formLayout_4") + self.edit_faculty_member_title = QLineEdit(self.gridLayoutWidget_11) + self.edit_faculty_member_title.setObjectName(u"edit_faculty_member_title") + self.edit_faculty_member_title.setFocusPolicy(Qt.TabFocus) self.edit_faculty_member_title.setReadOnly(True) - self.edit_faculty_member_title.setObjectName("edit_faculty_member_title") - self.formLayout_4.setWidget(0, QtWidgets.QFormLayout.ItemRole.LabelRole, self.edit_faculty_member_title) - self.edit_faculty_member_select_member = QtWidgets.QComboBox(parent=self.gridLayoutWidget_11) - self.edit_faculty_member_select_member.setObjectName("edit_faculty_member_select_member") - self.formLayout_4.setWidget(0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.edit_faculty_member_select_member) - self.label_46 = QtWidgets.QLabel(parent=self.gridLayoutWidget_11) - self.label_46.setObjectName("label_46") - self.formLayout_4.setWidget(1, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_46) - self.faculty_member_old_telnr = QtWidgets.QLineEdit(parent=self.gridLayoutWidget_11) - self.faculty_member_old_telnr.setFocusPolicy(QtCore.Qt.FocusPolicy.ClickFocus) + + self.formLayout_4.setWidget(0, QFormLayout.LabelRole, self.edit_faculty_member_title) + + self.edit_faculty_member_select_member = QComboBox(self.gridLayoutWidget_11) + self.edit_faculty_member_select_member.setObjectName(u"edit_faculty_member_select_member") + + self.formLayout_4.setWidget(0, QFormLayout.FieldRole, self.edit_faculty_member_select_member) + + self.label_46 = QLabel(self.gridLayoutWidget_11) + self.label_46.setObjectName(u"label_46") + + self.formLayout_4.setWidget(1, QFormLayout.LabelRole, self.label_46) + + self.faculty_member_old_telnr = QLineEdit(self.gridLayoutWidget_11) + self.faculty_member_old_telnr.setObjectName(u"faculty_member_old_telnr") + self.faculty_member_old_telnr.setFocusPolicy(Qt.ClickFocus) self.faculty_member_old_telnr.setReadOnly(True) - self.faculty_member_old_telnr.setObjectName("faculty_member_old_telnr") - self.formLayout_4.setWidget(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.faculty_member_old_telnr) - self.label_49 = QtWidgets.QLabel(parent=self.gridLayoutWidget_11) - self.label_49.setObjectName("label_49") - self.formLayout_4.setWidget(2, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_49) - self.faculty_member_oldmail = QtWidgets.QLineEdit(parent=self.gridLayoutWidget_11) - self.faculty_member_oldmail.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) - self.faculty_member_oldmail.setInputMethodHints(QtCore.Qt.InputMethodHint.ImhNone) + + self.formLayout_4.setWidget(1, QFormLayout.FieldRole, self.faculty_member_old_telnr) + + self.label_49 = QLabel(self.gridLayoutWidget_11) + self.label_49.setObjectName(u"label_49") + + self.formLayout_4.setWidget(2, QFormLayout.LabelRole, self.label_49) + + self.faculty_member_oldmail = QLineEdit(self.gridLayoutWidget_11) + self.faculty_member_oldmail.setObjectName(u"faculty_member_oldmail") + self.faculty_member_oldmail.setFocusPolicy(Qt.NoFocus) + self.faculty_member_oldmail.setInputMethodHints(Qt.ImhNone) self.faculty_member_oldmail.setReadOnly(True) - self.faculty_member_oldmail.setObjectName("faculty_member_oldmail") - self.formLayout_4.setWidget(2, QtWidgets.QFormLayout.ItemRole.FieldRole, self.faculty_member_oldmail) + + self.formLayout_4.setWidget(2, QFormLayout.FieldRole, self.faculty_member_oldmail) + + self.gridLayout_12.addLayout(self.formLayout_4, 0, 2, 1, 1) - self.formLayout_5 = QtWidgets.QFormLayout() - self.formLayout_5.setObjectName("formLayout_5") - self.label_47 = QtWidgets.QLabel(parent=self.gridLayoutWidget_11) - self.label_47.setObjectName("label_47") - self.formLayout_5.setWidget(0, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_47) - self.label_48 = QtWidgets.QLabel(parent=self.gridLayoutWidget_11) - self.label_48.setObjectName("label_48") - self.formLayout_5.setWidget(1, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_48) - self.lineEdit = QtWidgets.QLineEdit(parent=self.gridLayoutWidget_11) - self.lineEdit.setObjectName("lineEdit") - self.formLayout_5.setWidget(0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.lineEdit) - self.lineEdit_5 = QtWidgets.QLineEdit(parent=self.gridLayoutWidget_11) - self.lineEdit_5.setObjectName("lineEdit_5") - self.formLayout_5.setWidget(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.lineEdit_5) + + self.formLayout_5 = QFormLayout() + self.formLayout_5.setObjectName(u"formLayout_5") + self.label_47 = QLabel(self.gridLayoutWidget_11) + self.label_47.setObjectName(u"label_47") + + self.formLayout_5.setWidget(0, QFormLayout.LabelRole, self.label_47) + + self.label_48 = QLabel(self.gridLayoutWidget_11) + self.label_48.setObjectName(u"label_48") + + self.formLayout_5.setWidget(1, QFormLayout.LabelRole, self.label_48) + + self.user_faculty_member_new_mail = QLineEdit(self.gridLayoutWidget_11) + self.user_faculty_member_new_mail.setObjectName(u"user_faculty_member_new_mail") + + self.formLayout_5.setWidget(0, QFormLayout.FieldRole, self.user_faculty_member_new_mail) + + self.user_faculty_member_new_telnr = QLineEdit(self.gridLayoutWidget_11) + self.user_faculty_member_new_telnr.setObjectName(u"user_faculty_member_new_telnr") + + self.formLayout_5.setWidget(1, QFormLayout.FieldRole, self.user_faculty_member_new_telnr) + + self.gridLayout_12.addLayout(self.formLayout_5, 2, 4, 1, 1) - self.label_41 = QtWidgets.QLabel(parent=self.gridLayoutWidget_11) - self.label_41.setObjectName("label_41") + + self.label_41 = QLabel(self.gridLayoutWidget_11) + self.label_41.setObjectName(u"label_41") + self.gridLayout_12.addWidget(self.label_41, 0, 0, 1, 1) - self.update_faculty_member = QtWidgets.QPushButton(parent=self.gridLayoutWidget_11) - self.update_faculty_member.setObjectName("update_faculty_member") + + self.update_faculty_member = QPushButton(self.gridLayoutWidget_11) + self.update_faculty_member.setObjectName(u"update_faculty_member") + self.gridLayout_12.addWidget(self.update_faculty_member, 3, 4, 1, 1) - self.label_42 = QtWidgets.QLabel(parent=self.gridLayoutWidget_11) - self.label_42.setObjectName("label_42") + + self.label_42 = QLabel(self.gridLayoutWidget_11) + self.label_42.setObjectName(u"label_42") + self.gridLayout_12.addWidget(self.label_42, 2, 0, 1, 1) + 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.horizontalLayoutWidget = QWidget(self.centralwidget) + self.horizontalLayoutWidget.setObjectName(u"horizontalLayoutWidget") + self.horizontalLayoutWidget.setGeometry(QRect(1280, 360, 311, 391)) + self.horizontalLayout_6 = QHBoxLayout(self.horizontalLayoutWidget) + self.horizontalLayout_6.setObjectName(u"horizontalLayout_6") 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.frame_creation_progress = QFrame(self.horizontalLayoutWidget) + self.frame_creation_progress.setObjectName(u"frame_creation_progress") + self.verticalLayout_4 = 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.verticalLayout_4.setObjectName(u"verticalLayout_4") + self.groupBox_2 = QGroupBox(self.frame_creation_progress) + self.groupBox_2.setObjectName(u"groupBox_2") 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.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) - 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.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) - 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.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) - self.ids_check.setObjectName("ids_check") + sizePolicy4.setHeightForWidth(self.groupBox_2.sizePolicy().hasHeightForWidth()) + self.groupBox_2.setSizePolicy(sizePolicy4) + self.appdata_check = QCheckBox(self.groupBox_2) + self.appdata_check.setObjectName(u"appdata_check") + self.appdata_check.setGeometry(QRect(20, 30, 241, 41)) + self.appdata_check.setFont(font4) + self.appdata_check.setFocusPolicy(Qt.NoFocus) + self.media_check = QCheckBox(self.groupBox_2) + self.media_check.setObjectName(u"media_check") + self.media_check.setGeometry(QRect(20, 70, 241, 41)) + self.media_check.setFont(font4) + self.media_check.setFocusPolicy(Qt.NoFocus) + self.ids_check = QCheckBox(self.groupBox_2) + self.ids_check.setObjectName(u"ids_check") + self.ids_check.setGeometry(QRect(20, 140, 241, 41)) + self.ids_check.setFont(font4) + self.ids_check.setFocusPolicy(Qt.NoFocus) + 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.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) - 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.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) - 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.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) - 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.groupBox = QGroupBox(self.frame_creation_progress) + self.groupBox.setObjectName(u"groupBox") + sizePolicy4.setHeightForWidth(self.groupBox.sizePolicy().hasHeightForWidth()) + self.groupBox.setSizePolicy(sizePolicy4) + self.media_checked = QCheckBox(self.groupBox) + self.media_checked.setObjectName(u"media_checked") + self.media_checked.setGeometry(QRect(20, 30, 241, 41)) + font6 = QFont() + font6.setPointSize(8) + font6.setBold(False) + font6.setItalic(False) + font6.setUnderline(False) + font6.setKerning(True) + font6.setStyleStrategy(QFont.PreferDefault) + self.media_checked.setFont(font6) + self.media_checked.setFocusPolicy(Qt.NoFocus) + self.media_edited_check = QCheckBox(self.groupBox) + self.media_edited_check.setObjectName(u"media_edited_check") + self.media_edited_check.setGeometry(QRect(20, 70, 241, 41)) + self.media_edited_check.setFont(font6) + self.media_edited_check.setFocusPolicy(Qt.NoFocus) + self.app_created = QCheckBox(self.groupBox) + self.app_created.setObjectName(u"app_created") + self.app_created.setGeometry(QRect(20, 110, 161, 41)) + self.app_created.setFont(font6) + self.app_created.setFocusPolicy(Qt.NoFocus) + self.btn_copy_adis_command = QPushButton(self.groupBox) + self.btn_copy_adis_command.setObjectName(u"btn_copy_adis_command") + self.btn_copy_adis_command.setGeometry(QRect(170, 120, 101, 23)) + self.btn_copy_adis_command.setFont(font6) self.btn_copy_adis_command.setAutoFillBackground(False) - icon = QtGui.QIcon() - icon.addPixmap(QtGui.QPixmap("/home/alexander/GitHub/Semesterapparate/ui/../../../.designer/backup/icons/information.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) + icon = QIcon() + icon.addFile(u"../../../.designer/backup/icons/information.png", QSize(), QIcon.Normal, QIcon.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.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) + + self.frame_2 = QFrame(self.centralwidget) + self.frame_2.setObjectName(u"frame_2") + self.frame_2.setGeometry(QRect(1280, 10, 301, 341)) + self.frame_2.setFrameShape(QFrame.StyledPanel) + self.frame_2.setFrameShadow(QFrame.Raised) + self.calendarWidget = QCalendarWidget(self.frame_2) + self.calendarWidget.setObjectName(u"calendarWidget") + self.calendarWidget.setGeometry(QRect(0, 0, 291, 191)) + self.calendarWidget.setFocusPolicy(Qt.NoFocus) 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, 301, 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.calendarWidget.setVerticalHeaderFormat(QCalendarWidget.NoVerticalHeader) + self.message_frame = QFrame(self.frame_2) + self.message_frame.setObjectName(u"message_frame") + self.message_frame.setGeometry(QRect(0, 210, 301, 121)) + self.message_frame.setFrameShape(QFrame.StyledPanel) + self.message_frame.setFrameShadow(QFrame.Raised) + self.label_14 = QLabel(self.message_frame) + self.label_14.setObjectName(u"label_14") + self.label_14.setGeometry(QRect(10, 10, 47, 20)) + self.line_app_info = QLineEdit(self.message_frame) + self.line_app_info.setObjectName(u"line_app_info") self.line_app_info.setEnabled(True) - self.line_app_info.setGeometry(QtCore.QRect(60, 10, 31, 20)) - self.line_app_info.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) - 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, 281, 71)) - self.message_box.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) - 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.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus) - 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, 74, 22)) + self.line_app_info.setGeometry(QRect(60, 10, 31, 20)) + self.line_app_info.setFocusPolicy(Qt.NoFocus) + self.message_box = QTextEdit(self.message_frame) + self.message_box.setObjectName(u"message_box") + self.message_box.setGeometry(QRect(10, 40, 281, 71)) + self.message_box.setFocusPolicy(Qt.NoFocus) + self.btn_delete_message = QPushButton(self.message_frame) + self.btn_delete_message.setObjectName(u"btn_delete_message") + self.btn_delete_message.setGeometry(QRect(130, 10, 75, 23)) + self.btn_delete_message.setFocusPolicy(Qt.NoFocus) + self.spin_select_message = QSpinBox(self.message_frame) + self.spin_select_message.setObjectName(u"spin_select_message") + self.spin_select_message.setGeometry(QRect(210, 10, 74, 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") + self.label_total_day_messages = QLabel(self.message_frame) + self.label_total_day_messages.setObjectName(u"label_total_day_messages") + self.label_total_day_messages.setGeometry(QRect(240, 10, 21, 22)) MainWindow.setCentralWidget(self.centralwidget) - self.menubar = QtWidgets.QMenuBar(parent=MainWindow) - self.menubar.setGeometry(QtCore.QRect(0, 0, 1593, 30)) - 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.menubar = QMenuBar(MainWindow) + self.menubar.setObjectName(u"menubar") + self.menubar.setGeometry(QRect(0, 0, 1601, 30)) + self.menuDatei = QMenu(self.menubar) + self.menuDatei.setObjectName(u"menuDatei") + self.menuEinstellungen = QMenu(self.menubar) + self.menuEinstellungen.setObjectName(u"menuEinstellungen") + self.menuHelp = QMenu(self.menubar) + self.menuHelp.setObjectName(u"menuHelp") MainWindow.setMenuBar(self.menubar) - self.statusbar = QtWidgets.QStatusBar(parent=MainWindow) - self.statusbar.setObjectName("statusbar") + self.statusbar = QStatusBar(MainWindow) + self.statusbar.setObjectName(u"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) + QWidget.setTabOrder(self.drpdwn_app_nr, self.drpdwn_prof_name) + QWidget.setTabOrder(self.drpdwn_prof_name, self.prof_mail) + QWidget.setTabOrder(self.prof_mail, self.prof_tel_nr) + QWidget.setTabOrder(self.prof_tel_nr, self.app_name) + QWidget.setTabOrder(self.app_name, self.sem_year) + QWidget.setTabOrder(self.sem_year, self.check_eternal_app) + QWidget.setTabOrder(self.check_eternal_app, self.btn_add_document) + QWidget.setTabOrder(self.btn_add_document, self.btn_open_document) + QWidget.setTabOrder(self.btn_open_document, self.check_file) + QWidget.setTabOrder(self.check_file, self.btn_apparat_save) + QWidget.setTabOrder(self.btn_apparat_save, self.btn_apparat_apply) + QWidget.setTabOrder(self.btn_apparat_apply, self.check_send_mail) + QWidget.setTabOrder(self.check_send_mail, self.chkbx_show_del_media) + QWidget.setTabOrder(self.chkbx_show_del_media, self.btn_reserve) + QWidget.setTabOrder(self.btn_reserve, self.prof_id_adis) + QWidget.setTabOrder(self.prof_id_adis, self.apparat_id_adis) + QWidget.setTabOrder(self.apparat_id_adis, self.tabWidget_2) + QWidget.setTabOrder(self.tabWidget_2, self.btn_del_select_apparats) + QWidget.setTabOrder(self.btn_del_select_apparats, self.tabWidget_3) + QWidget.setTabOrder(self.tabWidget_3, self.select_action_box) + QWidget.setTabOrder(self.select_action_box, self.user_create_frame_username) + QWidget.setTabOrder(self.user_create_frame_username, self.user_frame_userrole) + QWidget.setTabOrder(self.user_frame_userrole, self.user_create_frame_password) + QWidget.setTabOrder(self.user_create_frame_password, self.user_frame_addUser) + QWidget.setTabOrder(self.user_frame_addUser, self.user_delete_frame_user_select) + QWidget.setTabOrder(self.user_delete_frame_user_select, self.user_delete_confirm) + QWidget.setTabOrder(self.user_delete_confirm, self.pushButton) + QWidget.setTabOrder(self.pushButton, self.user_edit_frame_user_select) + QWidget.setTabOrder(self.user_edit_frame_user_select, self.user_edit_frame_role_select) + QWidget.setTabOrder(self.user_edit_frame_role_select, self.user_edit_frame_new_password) + QWidget.setTabOrder(self.user_edit_frame_new_password, self.update_user) + QWidget.setTabOrder(self.update_user, self.edit_faculty_member_title) + QWidget.setTabOrder(self.edit_faculty_member_title, self.edit_faculty_member_select_member) + QWidget.setTabOrder(self.edit_faculty_member_select_member, self.faculty_member_old_telnr) + QWidget.setTabOrder(self.faculty_member_old_telnr, self.faculty_member_oldmail) + QWidget.setTabOrder(self.faculty_member_oldmail, self.edit_faculty_member_new_title) + QWidget.setTabOrder(self.edit_faculty_member_new_title, self.edit_faculty_member_new_surname) + QWidget.setTabOrder(self.edit_faculty_member_new_surname, self.user_faculty_member_new_name) + QWidget.setTabOrder(self.user_faculty_member_new_name, self.user_faculty_member_new_mail) + QWidget.setTabOrder(self.user_faculty_member_new_mail, self.user_faculty_member_new_telnr) + QWidget.setTabOrder(self.user_faculty_member_new_telnr, self.update_faculty_member) + QWidget.setTabOrder(self.update_faculty_member, self.box_fach) + QWidget.setTabOrder(self.box_fach, self.box_person) + QWidget.setTabOrder(self.box_person, self.btn_search) + QWidget.setTabOrder(self.btn_search, self.check_deletable) + QWidget.setTabOrder(self.check_deletable, self.box_erstellsemester) + QWidget.setTabOrder(self.box_erstellsemester, self.box_semester) + QWidget.setTabOrder(self.box_semester, self.box_dauerapp) + QWidget.setTabOrder(self.box_dauerapp, self.box_appnrs) + QWidget.setTabOrder(self.box_appnrs, self.btn_copy_adis_command) + QWidget.setTabOrder(self.btn_copy_adis_command, self.spin_select_message) + self.menubar.addAction(self.menuDatei.menuAction()) self.menubar.addAction(self.menuEinstellungen.menuAction()) + self.menubar.addAction(self.menuHelp.menuAction()) + self.menuDatei.addAction(self.actionBeenden) + self.menuEinstellungen.addAction(self.actionEinstellungen) + self.menuHelp.addAction(self.actionDokumentation) self.retranslateUi(MainWindow) + self.tabWidget.setCurrentIndex(0) - self.tabWidget_2.setCurrentIndex(0) + self.tabWidget_2.setCurrentIndex(1) self.stackedWidget_4.setCurrentIndex(1) self.tabWidget_3.setCurrentIndex(1) - 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_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.btn_apparat_save) - MainWindow.setTabOrder(self.btn_apparat_save, self.btn_apparat_apply) - MainWindow.setTabOrder(self.btn_apparat_apply, self.check_send_mail) - MainWindow.setTabOrder(self.check_send_mail, self.chkbx_show_del_media) - MainWindow.setTabOrder(self.chkbx_show_del_media, self.btn_reserve) - MainWindow.setTabOrder(self.btn_reserve, self.prof_id_adis) - MainWindow.setTabOrder(self.prof_id_adis, self.apparat_id_adis) - MainWindow.setTabOrder(self.apparat_id_adis, self.tabWidget_2) - MainWindow.setTabOrder(self.tabWidget_2, self.btn_del_select_apparats) - MainWindow.setTabOrder(self.btn_del_select_apparats, self.tabWidget_3) - MainWindow.setTabOrder(self.tabWidget_3, self.select_action_box) - MainWindow.setTabOrder(self.select_action_box, self.user_create_frame_username) - MainWindow.setTabOrder(self.user_create_frame_username, self.user_frame_userrole) - MainWindow.setTabOrder(self.user_frame_userrole, self.user_create_frame_password) - MainWindow.setTabOrder(self.user_create_frame_password, self.user_frame_addUser) - MainWindow.setTabOrder(self.user_frame_addUser, self.user_delete_frame_user_select) - MainWindow.setTabOrder(self.user_delete_frame_user_select, self.user_delete_confirm) - MainWindow.setTabOrder(self.user_delete_confirm, self.pushButton) - MainWindow.setTabOrder(self.pushButton, self.user_edit_frame_user_select) - MainWindow.setTabOrder(self.user_edit_frame_user_select, self.user_edit_frame_role_select) - MainWindow.setTabOrder(self.user_edit_frame_role_select, self.user_edit_frame_new_password) - MainWindow.setTabOrder(self.user_edit_frame_new_password, self.update_user) - MainWindow.setTabOrder(self.update_user, self.edit_faculty_member_title) - MainWindow.setTabOrder(self.edit_faculty_member_title, self.edit_faculty_member_select_member) - MainWindow.setTabOrder(self.edit_faculty_member_select_member, self.faculty_member_old_telnr) - MainWindow.setTabOrder(self.faculty_member_old_telnr, self.faculty_member_oldmail) - MainWindow.setTabOrder(self.faculty_member_oldmail, self.edit_faculty_member_new_title) - MainWindow.setTabOrder(self.edit_faculty_member_new_title, self.edit_faculty_member_new_surname) - MainWindow.setTabOrder(self.edit_faculty_member_new_surname, self.user_faculty_member_new_name) - MainWindow.setTabOrder(self.user_faculty_member_new_name, self.lineEdit) - MainWindow.setTabOrder(self.lineEdit, self.lineEdit_5) - MainWindow.setTabOrder(self.lineEdit_5, self.update_faculty_member) - MainWindow.setTabOrder(self.update_faculty_member, self.box_fach) - MainWindow.setTabOrder(self.box_fach, self.box_person) - MainWindow.setTabOrder(self.box_person, self.btn_search) - MainWindow.setTabOrder(self.btn_search, self.check_deletable) - MainWindow.setTabOrder(self.check_deletable, self.box_erstellsemester) - MainWindow.setTabOrder(self.box_erstellsemester, self.box_semester) - MainWindow.setTabOrder(self.box_semester, self.box_dauerapp) - MainWindow.setTabOrder(self.box_dauerapp, self.box_appnrs) - MainWindow.setTabOrder(self.box_appnrs, self.btn_copy_adis_command) - MainWindow.setTabOrder(self.btn_copy_adis_command, self.spin_select_message) + + + QMetaObject.connectSlotsByName(MainWindow) + # setupUi 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.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.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.label_25.setText(_translate("MainWindow", "Signatur")) - self.book_search.setText(_translate("MainWindow", "Suche")) - self.label_26.setText(_translate("MainWindow", "Titel")) - 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(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")) - item = self.book_search_result.horizontalHeaderItem(0) - item.setText(_translate("MainWindow", "Titel")) - item = self.book_search_result.horizontalHeaderItem(1) - item.setText(_translate("MainWindow", "Signatur")) - item = self.book_search_result.horizontalHeaderItem(2) - item.setText(_translate("MainWindow", "Apparat")) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), _translate("MainWindow", "Suchen / Statistik")) - 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 löschen")) - self.select_action_box.setItemText(2, _translate("MainWindow", "Nutzer aktualisieren")) - self.select_action_box.setItemText(3, _translate("MainWindow", "Lehrperson bearbeiten")) - self.label_22.setText(_translate("MainWindow", "Nutzername")) - self.label_24.setText(_translate("MainWindow", "Rolle")) - self.label_23.setText(_translate("MainWindow", "Passwort")) - self.user_frame_addUser.setText(_translate("MainWindow", "Anlegen")) - self.pushButton.setText(_translate("MainWindow", "Nutzer löschen")) - self.label_34.setText(_translate("MainWindow", "Nutzername")) - self.user_delete_confirm.setText(_translate("MainWindow", "Wirklich löschen?")) - self.label_38.setText(_translate("MainWindow", "Nutzername")) - self.update_user.setText(_translate("MainWindow", "Aktualisieren")) - self.label_40.setText(_translate("MainWindow", "Rolle")) - self.label_39.setText(_translate("MainWindow", "Neues Passwort")) - self.label_43.setText(_translate("MainWindow", "Titel")) - self.label_44.setText(_translate("MainWindow", "Vorname")) - self.label_45.setText(_translate("MainWindow", "Nachname")) - self.label_46.setText(_translate("MainWindow", "Telefonnummer")) - self.label_49.setText(_translate("MainWindow", "Mail")) - self.label_47.setText(_translate("MainWindow", "Mail")) - self.label_48.setText(_translate("MainWindow", "Telefon")) - self.label_41.setText(_translate("MainWindow", "Alte Angaben")) - self.update_faculty_member.setText(_translate("MainWindow", "Aktualisieren")) - self.label_42.setText(_translate("MainWindow", "Neue Angaben")) - 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")) + MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"Semesterapparatsmanagement", None)) +#if QT_CONFIG(statustip) + MainWindow.setStatusTip("") +#endif // QT_CONFIG(statustip) + self.actionBeenden.setText(QCoreApplication.translate("MainWindow", u"Beenden", None)) +#if QT_CONFIG(shortcut) + self.actionBeenden.setShortcut(QCoreApplication.translate("MainWindow", u"Ctrl+Q", None)) +#endif // QT_CONFIG(shortcut) + self.actionEinstellungen.setText(QCoreApplication.translate("MainWindow", u"Einstellungen", None)) +#if QT_CONFIG(shortcut) + self.actionEinstellungen.setShortcut(QCoreApplication.translate("MainWindow", u"Alt+S", None)) +#endif // QT_CONFIG(shortcut) + self.actionDokumentation.setText(QCoreApplication.translate("MainWindow", u"Dokumentation", None)) +#if QT_CONFIG(shortcut) + self.actionDokumentation.setShortcut(QCoreApplication.translate("MainWindow", u"F1", None)) +#endif // QT_CONFIG(shortcut) +#if QT_CONFIG(tooltip) + self.load_app.setToolTip(QCoreApplication.translate("MainWindow", u"Load the Semesterapparate from the database", None)) +#endif // QT_CONFIG(tooltip) + self.load_app.setText(QCoreApplication.translate("MainWindow", u"App. aufrufen", None)) + self.create_new_app.setText(QCoreApplication.translate("MainWindow", u"neu. App anlegen", None)) + self.cancel_active_selection.setText(QCoreApplication.translate("MainWindow", u"Auswahl abbrechen", None)) + ___qtablewidgetitem = self.tableWidget_apparate.horizontalHeaderItem(0) + ___qtablewidgetitem.setText(QCoreApplication.translate("MainWindow", u"AppNr", None)); + ___qtablewidgetitem1 = self.tableWidget_apparate.horizontalHeaderItem(1) + ___qtablewidgetitem1.setText(QCoreApplication.translate("MainWindow", u"App Name", None)); + ___qtablewidgetitem2 = self.tableWidget_apparate.horizontalHeaderItem(2) + ___qtablewidgetitem2.setText(QCoreApplication.translate("MainWindow", u"Professor", None)); + ___qtablewidgetitem3 = self.tableWidget_apparate.horizontalHeaderItem(3) + ___qtablewidgetitem3.setText(QCoreApplication.translate("MainWindow", u"g\u00fcltig bis", None)); + ___qtablewidgetitem4 = self.tableWidget_apparate.horizontalHeaderItem(4) + ___qtablewidgetitem4.setText(QCoreApplication.translate("MainWindow", u"Dauerapparat", None)); + ___qtablewidgetitem5 = self.tableWidget_apparate.horizontalHeaderItem(5) + ___qtablewidgetitem5.setText(QCoreApplication.translate("MainWindow", u"KontoNr", None)); + self.app_group_box.setTitle(QCoreApplication.translate("MainWindow", u"Apparatsdetails", None)) + ___qtablewidgetitem6 = self.dokument_list.horizontalHeaderItem(0) + ___qtablewidgetitem6.setText(QCoreApplication.translate("MainWindow", u"Dokumentname", None)); + ___qtablewidgetitem7 = self.dokument_list.horizontalHeaderItem(1) + ___qtablewidgetitem7.setText(QCoreApplication.translate("MainWindow", u"Dateityp", None)); + ___qtablewidgetitem8 = self.dokument_list.horizontalHeaderItem(2) + ___qtablewidgetitem8.setText(QCoreApplication.translate("MainWindow", u"Neu?", None)); + ___qtablewidgetitem9 = self.dokument_list.horizontalHeaderItem(3) + ___qtablewidgetitem9.setText(QCoreApplication.translate("MainWindow", u"path", None)); + self.label_5.setText(QCoreApplication.translate("MainWindow", u"Apparatsname", None)) + self.sem_winter.setText(QCoreApplication.translate("MainWindow", u"Winter", None)) + self.label_4.setText(QCoreApplication.translate("MainWindow", u"Prof. Name", None)) + self.sem_sommer.setText(QCoreApplication.translate("MainWindow", u"Sommer", None)) + self.label_3.setText(QCoreApplication.translate("MainWindow", u"Prof. Titel", None)) + self.label_6.setText(QCoreApplication.translate("MainWindow", u"Semester", None)) + self.sem_year.setPlaceholderText(QCoreApplication.translate("MainWindow", u"2023", None)) + self.label_2.setText(QCoreApplication.translate("MainWindow", u"Apparatsnummer", None)) +#if QT_CONFIG(statustip) + self.btn_apparat_save.setStatusTip(QCoreApplication.translate("MainWindow", u"searching", None)) +#endif // QT_CONFIG(statustip) + self.btn_apparat_save.setText(QCoreApplication.translate("MainWindow", u"Speichern", None)) + self.btn_apparat_apply.setText(QCoreApplication.translate("MainWindow", u"Aktualisieren", None)) + self.check_eternal_app.setText(QCoreApplication.translate("MainWindow", u"Dauerapparat", None)) + self.label_8.setText(QCoreApplication.translate("MainWindow", u"Mail", None)) + self.prof_mail.setPlaceholderText("") + self.label_9.setText(QCoreApplication.translate("MainWindow", u"Tel", None)) + self.prof_tel_nr.setPlaceholderText("") + self.label_10.setText(QCoreApplication.translate("MainWindow", u"Fach", None)) + self.drpdwn_prof_name.setCurrentText("") + self.mail_mand.setText(QCoreApplication.translate("MainWindow", u"*", None)) + self.telnr_mand.setText(QCoreApplication.translate("MainWindow", u"*", None)) + self.profname_mand.setText(QCoreApplication.translate("MainWindow", u"*", None)) + self.appname_mand.setText(QCoreApplication.translate("MainWindow", u"*", None)) + self.fach_mand.setText(QCoreApplication.translate("MainWindow", u"*", None)) + self._mand.setText(QCoreApplication.translate("MainWindow", u"*", None)) + self.btn_add_document.setText(QCoreApplication.translate("MainWindow", u"Dokument hinzuf\u00fcgen", None)) + self.btn_open_document.setText(QCoreApplication.translate("MainWindow", u"Dokument \u00f6ffnen", None)) +#if QT_CONFIG(tooltip) + self.check_file.setToolTip(QCoreApplication.translate("MainWindow", u"Abh\u00e4ngig von der Anzahl der Medien kann die Suche sehr lange dauern", None)) +#endif // QT_CONFIG(tooltip) + self.check_file.setText(QCoreApplication.translate("MainWindow", u"Medien aus Dokument\n" +" hinzuf\u00fcgen", None)) + self.label_12.setText(QCoreApplication.translate("MainWindow", u"Prof-ID-aDIS", None)) + self.label_13.setText(QCoreApplication.translate("MainWindow", u"Apparat-ID-aDIS", None)) + self.check_send_mail.setText(QCoreApplication.translate("MainWindow", u"Mail senden", None)) + ___qtablewidgetitem10 = self.tableWidget_apparat_media.horizontalHeaderItem(0) + ___qtablewidgetitem10.setText(QCoreApplication.translate("MainWindow", u"Buchtitel", None)); +#if QT_CONFIG(tooltip) + ___qtablewidgetitem10.setToolTip(QCoreApplication.translate("MainWindow", u"Es kann sein, dass der Buchtitel leer ist, dies kommt vor, wenn der Titel nicht passend formatiert ist", None)); +#endif // QT_CONFIG(tooltip) + ___qtablewidgetitem11 = self.tableWidget_apparat_media.horizontalHeaderItem(1) + ___qtablewidgetitem11.setText(QCoreApplication.translate("MainWindow", u"Signatur", None)); + ___qtablewidgetitem12 = self.tableWidget_apparat_media.horizontalHeaderItem(2) + ___qtablewidgetitem12.setText(QCoreApplication.translate("MainWindow", u"Auflage", None)); + ___qtablewidgetitem13 = self.tableWidget_apparat_media.horizontalHeaderItem(3) + ___qtablewidgetitem13.setText(QCoreApplication.translate("MainWindow", u"Autor", None)); + ___qtablewidgetitem14 = self.tableWidget_apparat_media.horizontalHeaderItem(4) + ___qtablewidgetitem14.setText(QCoreApplication.translate("MainWindow", u"im Apparat?", None)); +#if QT_CONFIG(tooltip) + ___qtablewidgetitem14.setToolTip(QCoreApplication.translate("MainWindow", u"Diese Angabe ist nicht zuverl\u00e4ssig. Ist das \u274c vorhanden, kann das Medium im Apparat sein, aber aufgrund eines Bugs nicht gefunden worden", None)); +#endif // QT_CONFIG(tooltip) + ___qtablewidgetitem15 = self.tableWidget_apparat_media.horizontalHeaderItem(5) + ___qtablewidgetitem15.setText(QCoreApplication.translate("MainWindow", u"Vorgemerkt", None)); + ___qtablewidgetitem16 = self.tableWidget_apparat_media.horizontalHeaderItem(6) + ___qtablewidgetitem16.setText(QCoreApplication.translate("MainWindow", u"Link", None)); + self.label.setText(QCoreApplication.translate("MainWindow", u" Medienliste", None)) + self.chkbx_show_del_media.setText(QCoreApplication.translate("MainWindow", u"gel. Medien anzeigen", None)) + self.btn_reserve.setText(QCoreApplication.translate("MainWindow", u"im Apparat?", None)) + self.label_info.setText(QCoreApplication.translate("MainWindow", u"Medien werden hinzugef\u00fcgt", None)) + self.progress_label.setText(QCoreApplication.translate("MainWindow", u"Medium x/y", None)) + self.label_20.setText(QCoreApplication.translate("MainWindow", u"Medien werden gepr\u00fcft", None)) + self.avail_status.setText(QCoreApplication.translate("MainWindow", u"TextLabel", None)) + self.add_medium.setText(QCoreApplication.translate("MainWindow", u"Medien hinzuf\u00fcgen", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), QCoreApplication.translate("MainWindow", u"Anlegen", None)) + self.btn_search.setText(QCoreApplication.translate("MainWindow", u"Suchen", None)) + self.label_7.setText(QCoreApplication.translate("MainWindow", u"Appnr.:", None)) + self.label_18.setText(QCoreApplication.translate("MainWindow", u"Dauerapp:", None)) + self.label_17.setText(QCoreApplication.translate("MainWindow", u"Endsemester:", None)) + self.label_19.setText(QCoreApplication.translate("MainWindow", u"Erstellsemester:", None)) + self.label_11.setText(QCoreApplication.translate("MainWindow", u"Person:", None)) + self.label_16.setText(QCoreApplication.translate("MainWindow", u"Fach:", None)) + self.label_15.setText(QCoreApplication.translate("MainWindow", u"L\u00f6schbar", None)) + self.check_deletable.setText("") + self.db_err_message.setText("") + self.tabWidget_2.setTabText(self.tabWidget_2.indexOf(self.tab_3), QCoreApplication.translate("MainWindow", u"Statistik", None)) + self.label_25.setText(QCoreApplication.translate("MainWindow", u"Signatur", None)) + self.book_search.setText(QCoreApplication.translate("MainWindow", u"Suche", None)) + self.label_26.setText(QCoreApplication.translate("MainWindow", u"Titel", None)) + self.tabWidget_2.setTabText(self.tabWidget_2.indexOf(self.tab_4), QCoreApplication.translate("MainWindow", u"Suchen", None)) + ___qtablewidgetitem17 = self.statistics_table.horizontalHeaderItem(0) + ___qtablewidgetitem17.setText(QCoreApplication.translate("MainWindow", u"Semester", None)); + ___qtablewidgetitem18 = self.statistics_table.horizontalHeaderItem(1) + ___qtablewidgetitem18.setText(QCoreApplication.translate("MainWindow", u"Zugang", None)); + ___qtablewidgetitem19 = self.statistics_table.horizontalHeaderItem(2) + ___qtablewidgetitem19.setText(QCoreApplication.translate("MainWindow", u"Abgang", None)); + self.tabWidget_3.setTabText(self.tabWidget_3.indexOf(self.tab_6), QCoreApplication.translate("MainWindow", u"Tabelle", None)) + self.tabWidget_3.setTabText(self.tabWidget_3.indexOf(self.tab_7), QCoreApplication.translate("MainWindow", u"Erstellte und gel\u00f6schte Semesterapparate", None)) + self.btn_del_select_apparats.setText(QCoreApplication.translate("MainWindow", u"Ausgew\u00e4hlte L\u00f6schen", None)) + ___qtablewidgetitem20 = self.tableWidget.horizontalHeaderItem(1) + ___qtablewidgetitem20.setText(QCoreApplication.translate("MainWindow", u"Apparatsname", None)); + ___qtablewidgetitem21 = self.tableWidget.horizontalHeaderItem(2) + ___qtablewidgetitem21.setText(QCoreApplication.translate("MainWindow", u"Apparatsnummer", None)); + ___qtablewidgetitem22 = self.tableWidget.horizontalHeaderItem(3) + ___qtablewidgetitem22.setText(QCoreApplication.translate("MainWindow", u"Person", None)); + ___qtablewidgetitem23 = self.tableWidget.horizontalHeaderItem(4) + ___qtablewidgetitem23.setText(QCoreApplication.translate("MainWindow", u"Fach", None)); + ___qtablewidgetitem24 = self.book_search_result.horizontalHeaderItem(0) + ___qtablewidgetitem24.setText(QCoreApplication.translate("MainWindow", u"Titel", None)); + ___qtablewidgetitem25 = self.book_search_result.horizontalHeaderItem(1) + ___qtablewidgetitem25.setText(QCoreApplication.translate("MainWindow", u"Signatur", None)); + ___qtablewidgetitem26 = self.book_search_result.horizontalHeaderItem(2) + ___qtablewidgetitem26.setText(QCoreApplication.translate("MainWindow", u"Apparat", None)); + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), QCoreApplication.translate("MainWindow", u"Suchen / Statistik", None)) + self.label_21.setText(QCoreApplication.translate("MainWindow", u"Aktion:", None)) + self.select_action_box.setItemText(0, QCoreApplication.translate("MainWindow", u"Nutzer anlegen", None)) + self.select_action_box.setItemText(1, QCoreApplication.translate("MainWindow", u"Nutzer l\u00f6schen", None)) + self.select_action_box.setItemText(2, QCoreApplication.translate("MainWindow", u"Nutzer aktualisieren", None)) + self.select_action_box.setItemText(3, QCoreApplication.translate("MainWindow", u"Lehrperson bearbeiten", None)) + + self.label_22.setText(QCoreApplication.translate("MainWindow", u"Nutzername", None)) + self.label_24.setText(QCoreApplication.translate("MainWindow", u"Rolle", None)) + self.label_23.setText(QCoreApplication.translate("MainWindow", u"Passwort", None)) + self.user_frame_addUser.setText(QCoreApplication.translate("MainWindow", u"Anlegen", None)) + self.user_frame_err_message.setText("") + self.pushButton.setText(QCoreApplication.translate("MainWindow", u"Nutzer l\u00f6schen", None)) + self.label_34.setText(QCoreApplication.translate("MainWindow", u"Nutzername", None)) + self.user_delete_confirm.setText(QCoreApplication.translate("MainWindow", u"Wirklich l\u00f6schen?", None)) + self.user_delete_err_message.setText("") + self.label_38.setText(QCoreApplication.translate("MainWindow", u"Nutzername", None)) + self.update_user.setText(QCoreApplication.translate("MainWindow", u"Aktualisieren", None)) + self.label_40.setText(QCoreApplication.translate("MainWindow", u"Rolle", None)) + self.label_39.setText(QCoreApplication.translate("MainWindow", u"Neues Passwort", None)) + self.label_43.setText(QCoreApplication.translate("MainWindow", u"Titel", None)) + self.label_44.setText(QCoreApplication.translate("MainWindow", u"Vorname", None)) + self.label_45.setText(QCoreApplication.translate("MainWindow", u"Nachname", None)) + self.label_46.setText(QCoreApplication.translate("MainWindow", u"Telefonnummer", None)) + self.label_49.setText(QCoreApplication.translate("MainWindow", u"Mail", None)) + self.label_47.setText(QCoreApplication.translate("MainWindow", u"Mail", None)) + self.label_48.setText(QCoreApplication.translate("MainWindow", u"Telefon", None)) + self.label_41.setText(QCoreApplication.translate("MainWindow", u"Alte Angaben", None)) + self.update_faculty_member.setText(QCoreApplication.translate("MainWindow", u"Aktualisieren", None)) + self.label_42.setText(QCoreApplication.translate("MainWindow", u"Neue Angaben", None)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_5), QCoreApplication.translate("MainWindow", u"Admin", None)) + self.groupBox_2.setTitle(QCoreApplication.translate("MainWindow", u"Software", None)) + self.appdata_check.setText(QCoreApplication.translate("MainWindow", u"Apparatsdaten eingegeben", None)) + self.media_check.setText(QCoreApplication.translate("MainWindow", u"Medien hinzugef\u00fcgt / importiert", None)) + self.ids_check.setText(QCoreApplication.translate("MainWindow", u"Prof-ID und Apparat-ID eingetragen", None)) + self.groupBox.setTitle(QCoreApplication.translate("MainWindow", u"aDIS", None)) + self.media_checked.setText(QCoreApplication.translate("MainWindow", u"Medien gepr\u00fcft", None)) + self.media_edited_check.setText(QCoreApplication.translate("MainWindow", u"Medien bearbeitet", None)) + self.app_created.setText(QCoreApplication.translate("MainWindow", u"Apparat angelegt", None)) +#if QT_CONFIG(tooltip) + self.btn_copy_adis_command.setToolTip(QCoreApplication.translate("MainWindow", u"Hier klicken, um die aDIS Abfrage in die Zwischenablage zu kopieren", None)) +#endif // QT_CONFIG(tooltip) +#if QT_CONFIG(statustip) + self.btn_copy_adis_command.setStatusTip("") +#endif // QT_CONFIG(statustip) +#if QT_CONFIG(whatsthis) + self.btn_copy_adis_command.setWhatsThis("") +#endif // QT_CONFIG(whatsthis) +#if QT_CONFIG(accessibility) + self.btn_copy_adis_command.setAccessibleDescription("") +#endif // QT_CONFIG(accessibility) + self.btn_copy_adis_command.setText(QCoreApplication.translate("MainWindow", u" aDIS Abfrage", None)) + self.label_14.setText(QCoreApplication.translate("MainWindow", u"Apparat", None)) + self.btn_delete_message.setText(QCoreApplication.translate("MainWindow", u"L\u00f6schen", None)) + self.label_total_day_messages.setText(QCoreApplication.translate("MainWindow", u"TextLabel", None)) + self.menuDatei.setTitle(QCoreApplication.translate("MainWindow", u"Datei", None)) + self.menuEinstellungen.setTitle(QCoreApplication.translate("MainWindow", u"Bearbeiten", None)) + self.menuHelp.setTitle(QCoreApplication.translate("MainWindow", u"Help", None)) + # retranslateUi + diff --git a/src/ui/widgets/webview.ui b/src/ui/widgets/webview.ui new file mode 100644 index 0000000..20937c6 --- /dev/null +++ b/src/ui/widgets/webview.ui @@ -0,0 +1,54 @@ + + + MainWindow + + + + 0 + 0 + 800 + 600 + + + + MainWindow + + + + + + 160 + 190 + 300 + 200 + + + + + about:blank + + + + + + + + 0 + 0 + 800 + 30 + + + + + + + + QWebEngineView + QWidget +
QtWebEngineWidgets/QWebEngineView
+
+
+ + +
diff --git a/src/ui/widgets/webview_ui.py b/src/ui/widgets/webview_ui.py new file mode 100644 index 0000000..2ef71ca --- /dev/null +++ b/src/ui/widgets/webview_ui.py @@ -0,0 +1,37 @@ +# Form implementation generated from reading ui file '/home/alexander/GitHub/SemesterapparatsManager/src/ui/widgets/webview.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, QtGui, QtWidgets +from PySide6 import QtWebEngineWidgets + + +class Ui_MainWindow(object): + def setupUi(self, MainWindow): + MainWindow.setObjectName("MainWindow") + MainWindow.resize(800, 600) + self.centralwidget = QtWidgets.QWidget(parent=MainWindow) + self.centralwidget.setObjectName("centralwidget") + self.webEngineView = QtWebEngineWidgets.QWebEngineView(parent=self.centralwidget) + self.webEngineView.setGeometry(QtCore.QRect(160, 190, 300, 200)) + self.webEngineView.setUrl(QtCore.QUrl("about:blank")) + self.webEngineView.setObjectName("webEngineView") + MainWindow.setCentralWidget(self.centralwidget) + self.menubar = QtWidgets.QMenuBar(parent=MainWindow) + self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 30)) + 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")) diff --git a/src/utils/documentationview.py b/src/utils/documentationview.py new file mode 100644 index 0000000..19f446d --- /dev/null +++ b/src/utils/documentationview.py @@ -0,0 +1,37 @@ +import sys +#from PyQt6 import Webview +from PySide6.QtWebEngineWidgets import QWebEngineView +import os +from PySide6.QtWidgets import QTabWidget + +documentation_path = "docs" + +class DocumentationViewer(QMainWindow): + def __init__(self): + super().__init__() + self.setWindowTitle("Documentation Viewer") + self.setGeometry(100, 100, 800, 600) + + self.tabs = QTabWidget() + self.setCentralWidget(self.tabs) + + self.set_documentation_tabs() + + def set_documentation_tabs(self): + files = [os.path.join(documentation_path, file) for file in os.listdir(documentation_path) if file.endswith(".html")] + for file in files: + with open(file, "r") as f: + html_content = f.read() + tab_name = os.path.basename(file).split(".")[0] + self.load_documentation(tab_name, html_content) + def load_documentation(self, tab_name="Documentation", html_content="

Documentation

Your HTML documentation content goes here.

"): + documentation_tab = QWebEngineView() + documentation_tab.setHtml(html_content) + self.tabs.addTab(documentation_tab, tab_name) + +if __name__ == "__main__": + app = QApplication(sys.argv) + viewer = DocumentationViewer() + viewer.show() + sys.exit(app.exec()) + \ No newline at end of file