Fix error dialog when there's no zcash.conf
This commit is contained in:
@@ -93,8 +93,6 @@ void ConnectionLoader::refreshZcashdState(Connection* connection) {
|
|||||||
this->doRPCSetConnection(connection);
|
this->doRPCSetConnection(connection);
|
||||||
},
|
},
|
||||||
[=] (auto reply, auto res) {
|
[=] (auto reply, auto res) {
|
||||||
d->show();
|
|
||||||
|
|
||||||
auto err = reply->error();
|
auto err = reply->error();
|
||||||
// Failed, see what it is.
|
// Failed, see what it is.
|
||||||
//qDebug() << err << ":" << QString::fromStdString(res.dump());
|
//qDebug() << err << ":" << QString::fromStdString(res.dump());
|
||||||
@@ -115,6 +113,8 @@ void ConnectionLoader::refreshZcashdState(Connection* connection) {
|
|||||||
|
|
||||||
this->showError(explanation);
|
this->showError(explanation);
|
||||||
} else if (err == QNetworkReply::NetworkError::InternalServerError && !res.is_discarded()) {
|
} else if (err == QNetworkReply::NetworkError::InternalServerError && !res.is_discarded()) {
|
||||||
|
d->show();
|
||||||
|
|
||||||
// The server is loading, so just poll until it succeeds
|
// The server is loading, so just poll until it succeeds
|
||||||
QString status = QString::fromStdString(res["error"]["message"]);
|
QString status = QString::fromStdString(res["error"]["message"]);
|
||||||
|
|
||||||
@@ -130,11 +130,7 @@ void ConnectionLoader::refreshZcashdState(Connection* connection) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ConnectionLoader::showError(QString explanation) {
|
void ConnectionLoader::showError(QString explanation) {
|
||||||
QIcon icon = QApplication::style()->standardIcon(QStyle::SP_MessageBoxCritical);
|
QMessageBox::critical(main, "Connection Error", explanation, QMessageBox::Ok);
|
||||||
connD->icon->setPixmap(icon.pixmap(128, 128));
|
|
||||||
connD->status->setText(explanation);
|
|
||||||
|
|
||||||
connD->buttonBox->setEnabled(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user