Fix indexing status not being updated when dialog is hidden and reshown

This commit is contained in:
Kovid Goyal 2022-06-14 10:51:40 +05:30
parent 209b40d601
commit 6c755112b4
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 9 additions and 1 deletions

View File

@ -88,6 +88,10 @@ class FTSDialog(Dialog):
def sizeHint(self):
return QSize(1000, 680)
def show(self):
super().show()
self.scan_status.startup()
if __name__ == '__main__':
from calibre.gui2 import Application

View File

@ -141,7 +141,8 @@ class ScanStatus(QWidget):
self.enable_fts.toggled.connect(self.change_fts_state)
self.indexing_status_timer = t = QTimer(self)
t.timeout.connect(self.update_stats)
t.start(1000)
t.setInterval(1000)
t.start()
self.update_stats()
def update_stats(self):
@ -198,6 +199,9 @@ class ScanStatus(QWidget):
self.update_stats()
self.apply_fts_state()
def startup(self):
self.indexing_status_timer.start()
def shutdown(self):
self.indexing_status_timer.stop()
self.scan_progress.slow_button.setChecked(True)