]> Nutra Git (v1) - gamesguru/feather.git/commitdiff
Send: clear donate description if address was changed
authortobtoht <tob@featherwallet.org>
Mon, 16 Oct 2023 20:13:59 +0000 (22:13 +0200)
committertobtoht <tob@featherwallet.org>
Mon, 16 Oct 2023 20:13:59 +0000 (22:13 +0200)
src/MainWindow.cpp
src/SendWidget.cpp
src/constants.h

index d89abb850e187b4baa8f5e31a53701348cb567ad..15290a2f333e97b6d78e9fe3a2b4c19e60de5f3f 100644 (file)
@@ -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);
 }
 
index 0896dcfb4994452048fa2140a3988a27fe2cf4ff..c012a3a9c6ebe1e42e2e648be24766e499f4c33d 100644 (file)
@@ -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) {
index f0dbe1084f22e08bdaa4fe4e6a3611b71d409a9b..fb946012a23de63b0ea91f53985806d7ac7a1696 100644 (file)
@@ -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;
 }