Browse Source

Make miner/dev fee clear on send tab

recurring
Aditya Kulkarni 6 years ago
parent
commit
d6ce1f8b27
  1. 3
      src/mainwindow.cpp
  2. 1
      src/mainwindow.h
  3. 27
      src/mainwindow.ui
  4. 17
      src/sendtab.cpp
  5. 43
      src/ui_mainwindow.h

3
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

1
src/mainwindow.h

@ -17,6 +17,7 @@ struct ToFields {
QString encodedMemo;
};
// Struct used to represent a Transaction.
struct Tx {
QString fromAddr;
QList<ToFields> toAddrs;

27
src/mainwindow.ui

@ -477,19 +477,40 @@
<item>
<widget class="QLabel" name="label_7">
<property name="text">
<string>Fee</string>
<string>Miner Fee:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="sendTxFees">
<widget class="QLabel" name="lblMinerFee">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="sendTxFeesUSD">
<widget class="QLabel" name="lblMinerFeeUSD">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lblDevFeeTxt">
<property name="text">
<string>Dev Fee:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lblDevFee">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lblDevFeeUSD">
<property name="text">
<string>TextLabel</string>
</property>

17
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() {

43
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));

Loading…
Cancel
Save