From 283ecea16335c49423efe8493fa3cfc5ffecd7f3 Mon Sep 17 00:00:00 2001 From: adityapk Date: Wed, 7 Nov 2018 12:49:03 -0800 Subject: [PATCH] Fix error dialog when there's no zcash.conf --- src/connection.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/connection.cpp b/src/connection.cpp index 7eed231..57dfa2a 100644 --- a/src/connection.cpp +++ b/src/connection.cpp @@ -93,8 +93,6 @@ void ConnectionLoader::refreshZcashdState(Connection* connection) { this->doRPCSetConnection(connection); }, [=] (auto reply, auto res) { - d->show(); - auto err = reply->error(); // Failed, see what it is. //qDebug() << err << ":" << QString::fromStdString(res.dump()); @@ -115,6 +113,8 @@ void ConnectionLoader::refreshZcashdState(Connection* connection) { this->showError(explanation); } else if (err == QNetworkReply::NetworkError::InternalServerError && !res.is_discarded()) { + d->show(); + // The server is loading, so just poll until it succeeds QString status = QString::fromStdString(res["error"]["message"]); @@ -130,11 +130,7 @@ void ConnectionLoader::refreshZcashdState(Connection* connection) { } void ConnectionLoader::showError(QString explanation) { - QIcon icon = QApplication::style()->standardIcon(QStyle::SP_MessageBoxCritical); - connD->icon->setPixmap(icon.pixmap(128, 128)); - connD->status->setText(explanation); - - connD->buttonBox->setEnabled(true); + QMessageBox::critical(main, "Connection Error", explanation, QMessageBox::Ok); }