diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 5ee7aa3..34a047b 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -363,10 +363,11 @@ void MainWindow::setupRecieveTab() { if (Settings::getInstance()->isSaplingActive()) { ui->rdioZSAddr->setVisible(true); ui->rdioZSAddr->setChecked(true); + ui->rdioZAddr->setText("z-Addr(Sprout)"); } else { ui->rdioZSAddr->setVisible(false); ui->rdioZAddr->setChecked(true); - ui->rdioZAddr->setText("z-Addr"); // Don't use the "Sprout" label + ui->rdioZAddr->setText("z-Addr"); // Don't use the "Sprout" label if there's no sapling } // And then select the first one diff --git a/src/mainwindow.h b/src/mainwindow.h index 09abe86..70d9497 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -17,6 +17,7 @@ struct ToFields { QString encodedMemo; }; +// Struct used to represent a Transaction. struct Tx { QString fromAddr; QList toAddrs; diff --git a/src/mainwindow.ui b/src/mainwindow.ui index 5b05d0e..a55a042 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -477,19 +477,40 @@ - Fee + Miner Fee: - + TextLabel - + + + TextLabel + + + + + + + Dev Fee: + + + + + + + TextLabel + + + + + TextLabel diff --git a/src/sendtab.cpp b/src/sendtab.cpp index bf4a4d2..101abd1 100644 --- a/src/sendtab.cpp +++ b/src/sendtab.cpp @@ -60,14 +60,25 @@ void MainWindow::setupSendTab() { QObject::connect(ui->tabWidget, &QTabWidget::currentChanged, [=] (int pos) { if (pos == 1) { // Set the fees - ui->sendTxFees->setText(QString::number(Utils::getTotalFee(), 'g', 8) % + ui->lblMinerFee->setText(QString::number(Utils::getMinerFee(), 'g', 8) % " " % Utils::getTokenName()); - ui->sendTxFeesUSD->setText(Settings::getInstance()->getUSDFormat(Utils::getTotalFee())); + ui->lblMinerFeeUSD->setText(Settings::getInstance()->getUSDFormat(Utils::getMinerFee())); + + // Dev Fee. + if (Utils::getDevFee() < 0.0001) { + ui->lblDevFee->setText(""); + ui->lblDevFeeUSD->setText(""); + ui->lblDevFeeTxt->setText(""); + } else { + ui->lblDevFee->setText(QString::number(Utils::getDevFee(), 'g', 8) % + " " % Utils::getTokenName()); + ui->lblDevFeeUSD->setText(Settings::getInstance()->getUSDFormat(Utils::getDevFee())); + } + // Set focus to the first address box ui->Address1->setFocus(); } }); - } void MainWindow::setDefaultPayFrom() { diff --git a/src/ui_mainwindow.h b/src/ui_mainwindow.h index fd253bd..e367e80 100644 --- a/src/ui_mainwindow.h +++ b/src/ui_mainwindow.h @@ -107,8 +107,11 @@ public: QSpacerItem *verticalSpacer_2; QHBoxLayout *horizontalLayout_6; QLabel *label_7; - QLabel *sendTxFees; - QLabel *sendTxFeesUSD; + QLabel *lblMinerFee; + QLabel *lblMinerFeeUSD; + QLabel *lblDevFeeTxt; + QLabel *lblDevFee; + QLabel *lblDevFeeUSD; QSpacerItem *horizontalSpacer; QPushButton *sendTransactionButton; QPushButton *cancelSendButton; @@ -475,15 +478,30 @@ public: horizontalLayout_6->addWidget(label_7); - sendTxFees = new QLabel(tab_2); - sendTxFees->setObjectName(QStringLiteral("sendTxFees")); + lblMinerFee = new QLabel(tab_2); + lblMinerFee->setObjectName(QStringLiteral("lblMinerFee")); - horizontalLayout_6->addWidget(sendTxFees); + horizontalLayout_6->addWidget(lblMinerFee); - sendTxFeesUSD = new QLabel(tab_2); - sendTxFeesUSD->setObjectName(QStringLiteral("sendTxFeesUSD")); + lblMinerFeeUSD = new QLabel(tab_2); + lblMinerFeeUSD->setObjectName(QStringLiteral("lblMinerFeeUSD")); - horizontalLayout_6->addWidget(sendTxFeesUSD); + horizontalLayout_6->addWidget(lblMinerFeeUSD); + + lblDevFeeTxt = new QLabel(tab_2); + lblDevFeeTxt->setObjectName(QStringLiteral("lblDevFeeTxt")); + + horizontalLayout_6->addWidget(lblDevFeeTxt); + + lblDevFee = new QLabel(tab_2); + lblDevFee->setObjectName(QStringLiteral("lblDevFee")); + + horizontalLayout_6->addWidget(lblDevFee); + + lblDevFeeUSD = new QLabel(tab_2); + lblDevFeeUSD->setObjectName(QStringLiteral("lblDevFeeUSD")); + + horizontalLayout_6->addWidget(lblDevFeeUSD); horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); @@ -698,9 +716,12 @@ public: MemoBtn1->setText(QApplication::translate("MainWindow", "Memo", nullptr)); MemoTxt1->setText(QString()); addAddressButton->setText(QApplication::translate("MainWindow", "Add Address", nullptr)); - label_7->setText(QApplication::translate("MainWindow", "Fee", nullptr)); - sendTxFees->setText(QApplication::translate("MainWindow", "TextLabel", nullptr)); - sendTxFeesUSD->setText(QApplication::translate("MainWindow", "TextLabel", nullptr)); + label_7->setText(QApplication::translate("MainWindow", "Miner Fee:", nullptr)); + lblMinerFee->setText(QApplication::translate("MainWindow", "TextLabel", nullptr)); + lblMinerFeeUSD->setText(QApplication::translate("MainWindow", "TextLabel", nullptr)); + lblDevFeeTxt->setText(QApplication::translate("MainWindow", "Dev Fee:", nullptr)); + lblDevFee->setText(QApplication::translate("MainWindow", "TextLabel", nullptr)); + lblDevFeeUSD->setText(QApplication::translate("MainWindow", "TextLabel", nullptr)); sendTransactionButton->setText(QApplication::translate("MainWindow", "Send", nullptr)); cancelSendButton->setText(QApplication::translate("MainWindow", "Cancel", nullptr)); tabWidget->setTabText(tabWidget->indexOf(tab_2), QApplication::translate("MainWindow", "Send", nullptr));