Browse Source

Prevent error dialog reentry

recurring
adityapk00 6 years ago
parent
commit
d71d08cd88
  1. 1
      src/addresscombo.cpp
  2. 7
      src/connection.cpp
  3. 16
      src/mainwindow.cpp

1
src/addresscombo.cpp

@ -4,7 +4,6 @@
AddressCombo::AddressCombo(QWidget* parent) :
QComboBox(parent) {
}
QString AddressCombo::itemText(int i) {

7
src/connection.cpp

@ -657,8 +657,15 @@ void Connection::doRPCIgnoreError(const json& payload, const std::function<void(
void Connection::showTxError(const QString& error) {
if (error.isNull()) return;
// Prevent multiple dialog boxes from showing, because they're all called async
static bool shown = false;
if (shown)
return;
shown = true;
QMessageBox::critical(main, "Transaction Error", "There was an error sending the transaction. The error was: \n\n"
+ error, QMessageBox::StandardButton::Ok);
shown = false;
}
/**

16
src/mainwindow.cpp

@ -961,16 +961,16 @@ std::function<void(bool)> MainWindow::addZAddrsToComboList(bool sapling) {
void MainWindow::setupRecieveTab() {
auto addNewTAddr = [=] () {
rpc->newTaddr([=] (json reply) {
QString addr = QString::fromStdString(reply.get<json::string_t>());
QString addr = QString::fromStdString(reply.get<json::string_t>());
// Just double make sure the t-address is still checked
if (ui->rdioTAddr->isChecked()) {
ui->listRecieveAddresses->insertItem(0, addr);
ui->listRecieveAddresses->setCurrentIndex(0);
// Just double make sure the t-address is still checked
if (ui->rdioTAddr->isChecked()) {
ui->listRecieveAddresses->insertItem(0, addr);
ui->listRecieveAddresses->setCurrentIndex(0);
ui->statusBar->showMessage(tr("Created new t-Addr"), 10 * 1000);
}
});
ui->statusBar->showMessage(tr("Created new t-Addr"), 10 * 1000);
}
});
};
auto fnUpdateTAddrCombo = [=] (bool checked) {

Loading…
Cancel
Save