fix report generation bug, change modality
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
<ui version="4.0">
|
||||
<class>Dialog</class>
|
||||
<widget class="QDialog" name="Dialog">
|
||||
<property name="windowModality">
|
||||
<enum>Qt::NonModal</enum>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user