diff --git a/SampleDownloader/RemoteFile.cpp b/SampleDownloader/RemoteFile.cpp index 295301317..ddcf6c40f 100644 --- a/SampleDownloader/RemoteFile.cpp +++ b/SampleDownloader/RemoteFile.cpp @@ -139,15 +139,6 @@ void RemoteFile::download (QUrl const& url) listener_->download_progress (bytes_received, total_bytes); } }); - connect (reply_, &QNetworkReply::sslErrors, [this] (QList const& errors) { - QString message; - for (auto const& error: errors) - { - message += '\n' + reply_->request ().url ().toDisplayString () + ": " - + error.errorString (); - } - listener_->error ("Network SSL Errors", message); - }); } void RemoteFile::abort () diff --git a/main.cpp b/main.cpp index 89272f3bd..e1a415695 100644 --- a/main.cpp +++ b/main.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -315,8 +316,25 @@ int main(int argc, char *argv[]) ).toBool () ? 1u : 4u; } + QNetworkAccessManager network_manager {&a}; + // run the application UI - MainWindow w(temp_dir, multiple, &multi_settings, &mem_jt9, downSampleFactor, new QNetworkAccessManager {&a}, &splash); + MainWindow w(temp_dir, multiple, &multi_settings, &mem_jt9, downSampleFactor, &network_manager, &splash); + + // set up handling for any SSL issues + QObject::connect (&network_manager, &QNetworkAccessManager::sslErrors, [&w] (QNetworkReply * reply, QList const& errors) { + QString message; + for (auto const& error: errors) + { + message += '\n' + reply->request ().url ().toDisplayString () + ": " + + error.errorString (); + } + if (QMessageBox::Ignore == QMessageBox::question (&w, "Network SSL Errors", message, QMessageBox::Abort | QMessageBox::Ignore)) + { + reply->ignoreSslErrors (); + } + }); + w.show(); splash.raise (); QObject::connect (&a, SIGNAL (lastWindowClosed()), &a, SLOT (quit()));