mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
shutdown stats update timer on close
This commit is contained in:
parent
e40731ab34
commit
efc599f328
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
from qt.core import (
|
from qt.core import (
|
||||||
QCheckBox, QHBoxLayout, QLabel, QSpinBox, QTimer, QVBoxLayout, QWidget
|
QCheckBox, QDialog, QHBoxLayout, QLabel, QSpinBox, QTimer, QVBoxLayout, QWidget
|
||||||
)
|
)
|
||||||
|
|
||||||
from calibre import detect_ncpus
|
from calibre import detect_ncpus
|
||||||
@ -88,6 +88,8 @@ class ScanStatus(QWidget):
|
|||||||
|
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
|
if isinstance(parent, QDialog):
|
||||||
|
parent.finished.connect(self.shutdown)
|
||||||
self.indexing_progress = IndexingProgress()
|
self.indexing_progress = IndexingProgress()
|
||||||
self.l = l = QVBoxLayout(self)
|
self.l = l = QVBoxLayout(self)
|
||||||
l.setContentsMargins(0, 0, 0, 0)
|
l.setContentsMargins(0, 0, 0, 0)
|
||||||
@ -137,6 +139,9 @@ class ScanStatus(QWidget):
|
|||||||
def db(self):
|
def db(self):
|
||||||
return get_db()
|
return get_db()
|
||||||
|
|
||||||
|
def shutdown(self):
|
||||||
|
self.indexing_status_timer.stop()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
from calibre.gui2 import Application
|
from calibre.gui2 import Application
|
||||||
@ -146,3 +151,4 @@ if __name__ == '__main__':
|
|||||||
w = ScanStatus()
|
w = ScanStatus()
|
||||||
w.show()
|
w.show()
|
||||||
app.exec_()
|
app.exec_()
|
||||||
|
w.shutdown()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user