From b577a69dadc8b7c38dcaaaf6365e48b072a55d2e Mon Sep 17 00:00:00 2001 From: WorldTeacher Date: Wed, 3 Sep 2025 12:32:42 +0200 Subject: [PATCH] add a progressbar to the statusbar which displays the search progress on searchstat page for signature update --- src/ui/userInterface.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/ui/userInterface.py b/src/ui/userInterface.py index c7847f3..ff40cf8 100644 --- a/src/ui/userInterface.py +++ b/src/ui/userInterface.py @@ -270,6 +270,9 @@ class Ui(Ui_Semesterapparat): self.player = QMediaPlayer() self.audio_output = QAudioOutput() + self.status_progress = QtWidgets.QProgressBar() + self.statusBar.addWidget(self.status_progress) + self.status_progress.hide() self.valid_check_semester.clicked.connect(self.display_valid_semester) # type:ignore def create_doc(self): @@ -370,6 +373,15 @@ class Ui(Ui_Semesterapparat): self.calendarWidget.setMessages([data]) self.calendarWidget.updateCells() + def status_bar_progress(self, current: int, total: int): + self.status_progress.setRange(0, total) + self.status_progress.setValue(current) + if current == total: + self.status_progress.hide() + self.status_progress.setValue(0) + else: + self.status_progress.show() + def tabW1_changed(self): if self.tabWidget.currentIndex() == 1: # Statistics stats_layout = self.search_statistics.layout() @@ -384,6 +396,7 @@ class Ui(Ui_Semesterapparat): statistics.apparat_open.connect(self.open_apparat) statistics.refreshSignal.connect(self.update_apparat_list) statistics.updateCalendar.connect(self.update_calendar) + statistics.status_update.connect(self.status_bar_progress) stats_layout.addWidget(statistics) # #log.debug("searchpage") @@ -1658,7 +1671,7 @@ class Ui(Ui_Semesterapparat): for row in range(self.tableWidget_apparat_media.rowCount()) ] # type: ignore prof_id = self.db.getProfId(self.profdata) # type: ignore - app_id = self.active_apparat + app_id = self.db.getId(self.app_name.text()) # type: ignore books: List[Tuple[int, BookData]] = [] for signature in signatures: book = self.db.getBookBasedOnSignature( @@ -1667,7 +1680,7 @@ class Ui(Ui_Semesterapparat): prof_id=prof_id, ) book_id = self.db.getBookIdBasedOnSignature( - self.active_apparat, + app_id, prof_id, signature, )