From: tobtoht Date: Mon, 16 Oct 2023 20:13:59 +0000 (+0200) Subject: Send: clear donate description if address was changed X-Git-Url: https://git.nutra.tk/v1?a=commitdiff_plain;h=a5135ecf8e99fb6877d890b0506778383aba09f0;p=gamesguru%2Ffeather.git Send: clear donate description if address was changed --- diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index d89abb85..15290a2f 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -1067,7 +1067,7 @@ void MainWindow::changeEvent(QEvent* event) } void MainWindow::donateButtonClicked() { - m_sendWidget->fill(constants::donationAddress, "Donation to the Feather development team"); + m_sendWidget->fill(constants::donationAddress, constants::donationDescription); ui->tabWidget->setCurrentIndex(Tabs::SEND); } diff --git a/src/SendWidget.cpp b/src/SendWidget.cpp index 0896dcfb..c012a3a9 100644 --- a/src/SendWidget.cpp +++ b/src/SendWidget.cpp @@ -90,6 +90,11 @@ void SendWidget::addressEdited() { } ui->btn_openAlias->setVisible(ui->lineAddress->isOpenAlias()); + + // Clear donation description if address no longer matches + if (ui->lineDescription->text() == constants::donationDescription && ui->lineAddress->text() != constants::donationAddress) { + ui->lineDescription->clear(); + } } void SendWidget::amountEdited(const QString &text) { diff --git a/src/constants.h b/src/constants.h index f0dbe108..fb946012 100644 --- a/src/constants.h +++ b/src/constants.h @@ -23,6 +23,7 @@ namespace constants // donation constants const QString donationAddress = "47ntfT2Z5384zku39pTM6hGcnLnvpRYW2Azm87GiAAH2bcTidtq278TL6HmwyL8yjMeERqGEBs3cqC8vvHPJd1cWQrGC65f"; + const QString donationDescription = "Donation to the Feather development team"; const int donationBoundary = 25; }