diff --git a/src/ui/main_ui.py b/src/ui/main_ui.py index 25c168b..52bc036 100644 --- a/src/ui/main_ui.py +++ b/src/ui/main_ui.py @@ -136,6 +136,7 @@ class MainUI(QtWidgets.QMainWindow, Ui_MainWindow): def generateReport(self): log.info("Generating Report") report = ReportUi() + report.setWindowModality(QtCore.Qt.WindowModality.ApplicationModal) report.exec() def showLoanHistory(self): diff --git a/src/ui/sources/Ui_dialog_generateReport.py b/src/ui/sources/Ui_dialog_generateReport.py index c8292bb..c065ea3 100644 --- a/src/ui/sources/Ui_dialog_generateReport.py +++ b/src/ui/sources/Ui_dialog_generateReport.py @@ -1,6 +1,6 @@ # Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\LibrarySystem\src\ui\sources\dialog_generateReport.ui' # -# Created by: PyQt6 UI code generator 6.6.1 +# Created by: PyQt6 UI code generator 6.7.1 # # WARNING: Any manual changes made to this file will be lost when pyuic6 is # run again. Do not edit this file unless you know what you are doing. @@ -12,6 +12,7 @@ from PyQt6 import QtCore, QtGui, QtWidgets class Ui_Dialog(object): def setupUi(self, Dialog): Dialog.setObjectName("Dialog") + Dialog.setWindowModality(QtCore.Qt.WindowModality.ApplicationModal) Dialog.resize(375, 245) Dialog.setMinimumSize(QtCore.QSize(40, 0)) self.verticalLayout = QtWidgets.QVBoxLayout(Dialog) diff --git a/src/ui/sources/dialog_generateReport.ui b/src/ui/sources/dialog_generateReport.ui index e478a02..c03dd83 100644 --- a/src/ui/sources/dialog_generateReport.ui +++ b/src/ui/sources/dialog_generateReport.ui @@ -2,6 +2,9 @@ Dialog + + Qt::NonModal + 0 diff --git a/src/utils/reportThread.py b/src/utils/reportThread.py index 5546f62..ff7a827 100644 --- a/src/utils/reportThread.py +++ b/src/utils/reportThread.py @@ -4,7 +4,6 @@ from src.logic import Database from src.utils import stringToDate import sqlite3 as sql - class ReportThread(QThread): report_signal = pyqtSignal(str) report_progress_signal = pyqtSignal(int) @@ -54,13 +53,11 @@ class ReportThread(QThread): loan_action_date, ] ) - # # print(table) - # # wruitng the table to a file if self.format == "tsv": table = table.get_csv_string() - tsv_table = table.replace(",", "\t") # .replace("Rückgabe", "Rückgabe") + tsv_table = table.replace(",", "\t") # write the file - with open("report.tsv", "w") as f: + with open("report.tsv", "w", encoding="utf-8") as f: f.write(tsv_table) else: with open("report.txt", "w", encoding="utf-8") as f: