From a5135ecf8e99fb6877d890b0506778383aba09f0 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Mon, 16 Oct 2023 22:13:59 +0200 Subject: [PATCH] Send: clear donate description if address was changed --- src/MainWindow.cpp | 2 +- src/SendWidget.cpp | 5 +++++ src/constants.h | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index d89abb8..15290a2 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 0896dcf..c012a3a 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 f0dbe10..fb94601 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; }