Files
LibrarySystem/src/ui/extendLoan.py
2025-01-20 11:13:36 +01:00

34 lines
1018 B
Python

from .sources.Ui_dialog_extendLoanDuration import Ui_Dialog
from PyQt6 import QtWidgets, QtCore
from src.utils import Icon
class ExtendLoan(QtWidgets.QDialog, Ui_Dialog):
def __init__(self, user, media):
super(ExtendLoan, self).__init__()
self.setupUi(self)
self.setWindowTitle("Leihfrist verlängern")
self.setWindowIcon(Icon("loan_extend").icon)
self.user = user
self.media = media
self.currentDate = QtCore.QDate.currentDate().addDays(1)
self.extendDate = ""
self.extenduntil.setMinimumDate(self.currentDate)
self.show()
self.buttonBox.accepted.connect(self.extendLoan)
def extendLoan(self):
# print("Extend Loan")
selectedDate = self.extenduntil.selectedDate()
# print(selectedDate)
self.extendDate = selectedDate
self.close()
def launch(user, media):
import sys
app = QtWidgets.QApplication(sys.argv)
window = ExtendLoan(user, media)
sys.exit(app.exec())