mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Add a reload button to test engine reloading
This commit is contained in:
parent
dd8cbee521
commit
ab0b387dc7
@ -63,6 +63,9 @@ class MainWindow(MainWindow):
|
||||
self.configure_action = ca = QAction('Configure')
|
||||
self.toolbar.addAction(ca)
|
||||
ca.triggered.connect(self.tts.configure)
|
||||
self.reload_action = ra = QAction('Reload')
|
||||
self.toolbar.addAction(ra)
|
||||
ra.triggered.connect(self.tts.test_resume_after_reload)
|
||||
|
||||
self.state_changed(self.tts.state)
|
||||
self.resize(self.sizeHint())
|
||||
|
@ -179,6 +179,12 @@ class TTSManager(QObject):
|
||||
return True
|
||||
return False
|
||||
|
||||
def test_resume_after_reload(self) -> None:
|
||||
with self.resume_after() as rd:
|
||||
if self._tts is not None:
|
||||
rd.needs_full_resume = True
|
||||
self.tts.reload_after_configure()
|
||||
|
||||
def faster(self) -> None:
|
||||
if not self.change_rate(1):
|
||||
QApplication.instance().beep()
|
||||
|
Loading…
x
Reference in New Issue
Block a user