Fix error dialog when there's no zcash.conf

This commit is contained in:
adityapk
2018-11-07 12:49:03 -08:00
parent c0d734b8ac
commit 283ecea163

View File

@@ -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);
}