diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2022-03-20 09:58:04 +0100 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2022-03-20 10:00:25 +0100 |
commit | ccdd9e6784c1aaee8ebb35f192dae647895c67bc (patch) | |
tree | 2ec8164d4b6f504adc3f2d441f4c20a0e77ad8e7 /utils/rbutilqt/base | |
parent | c21d10cb33e0d123d4b53acdc28e73002d240634 (diff) | |
download | rockbox-ccdd9e6784c1aaee8ebb35f192dae647895c67bc.tar.gz rockbox-ccdd9e6784c1aaee8ebb35f192dae647895c67bc.zip |
rbutil: Fix TTS "waiting for engine" appearing randomly.
QProgressDialog shows / hides itself automatically based on the progress
value set, so calling hide() directly doesn't prevent the dialog from
showing itself.
Change the logic to set a value instead. Fixes the progress dialog
sometimes appearing in situations where it wasn't used at all.
Change-Id: Ifef063f31b7f888bb74f180dea0679e81cc5c8fe
Diffstat (limited to 'utils/rbutilqt/base')
-rw-r--r-- | utils/rbutilqt/base/encttssettings.h | 3 | ||||
-rw-r--r-- | utils/rbutilqt/base/ttsfestival.cpp | 6 |
2 files changed, 4 insertions, 5 deletions
diff --git a/utils/rbutilqt/base/encttssettings.h b/utils/rbutilqt/base/encttssettings.h index 1258d81d57..ef3e5728b5 100644 --- a/utils/rbutilqt/base/encttssettings.h +++ b/utils/rbutilqt/base/encttssettings.h | |||
@@ -108,8 +108,7 @@ public: | |||
108 | virtual void saveSettings() = 0; | 108 | virtual void saveSettings() = 0; |
109 | 109 | ||
110 | signals: | 110 | signals: |
111 | void busy(); // emit this if a operation takes time | 111 | void busy(bool show); // emit this if a operation takes time |
112 | void busyEnd(); // emit this at the end of a busy section | ||
113 | 112 | ||
114 | protected: | 113 | protected: |
115 | //! Child class should fill in the setttingsList | 114 | //! Child class should fill in the setttingsList |
diff --git a/utils/rbutilqt/base/ttsfestival.cpp b/utils/rbutilqt/base/ttsfestival.cpp index fbb8166a9a..fce1d8cb3e 100644 --- a/utils/rbutilqt/base/ttsfestival.cpp +++ b/utils/rbutilqt/base/ttsfestival.cpp | |||
@@ -336,14 +336,14 @@ QString TTSFestival::queryServer(QString query, int timeout) | |||
336 | return ""; | 336 | return ""; |
337 | 337 | ||
338 | // this operation could take some time | 338 | // this operation could take some time |
339 | emit busy(); | 339 | emit busy(true); |
340 | 340 | ||
341 | LOG_INFO() << "queryServer with" << query; | 341 | LOG_INFO() << "queryServer with" << query; |
342 | 342 | ||
343 | if (!ensureServerRunning()) | 343 | if (!ensureServerRunning()) |
344 | { | 344 | { |
345 | LOG_ERROR() << "queryServer: ensureServerRunning failed"; | 345 | LOG_ERROR() << "queryServer: ensureServerRunning failed"; |
346 | emit busyEnd(); | 346 | emit busy(false); |
347 | return ""; | 347 | return ""; |
348 | } | 348 | } |
349 | 349 | ||
@@ -391,7 +391,7 @@ QString TTSFestival::queryServer(QString query, int timeout) | |||
391 | while(QDateTime::currentDateTime() < tmpEndTime) | 391 | while(QDateTime::currentDateTime() < tmpEndTime) |
392 | QCoreApplication::processEvents(QEventLoop::AllEvents); | 392 | QCoreApplication::processEvents(QEventLoop::AllEvents); |
393 | } | 393 | } |
394 | emit busyEnd(); | 394 | emit busy(false); |
395 | socket.disconnectFromHost(); | 395 | socket.disconnectFromHost(); |
396 | 396 | ||
397 | if(response == "nil") | 397 | if(response == "nil") |