Use queued connection to thread-safe MainWindow error handling

Up to now, errors produced by threads were not directly shown in
the MainWindow. Code running in the GUI thread had to manually
show the errors.

This can be simplified by using Qt's queued connection as message
passing facility.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2018-01-28 22:08:30 +01:00 committed by Jan Mulder
parent 1704e08012
commit a25f54e3c2
5 changed files with 11 additions and 20 deletions

View file

@ -222,9 +222,6 @@ void DownloadFromDCWidget::updateState(states state)
else if (state == ERROR) {
timer->stop();
// Show messages that worker thread produced.
MainWindow::instance()->showErrors();
QMessageBox::critical(this, TITLE_OR_TEXT(tr("Error"), thread.error), QMessageBox::Ok);
markChildrenAsEnabled();
progress_bar_text = "";