Browse Source

Make fees on send tab labels

import_zecw
Aditya Kulkarni 6 years ago
parent
commit
c31111098f
  1. 1
      src/mainwindow.cpp
  2. 24
      src/mainwindow.ui
  3. 13
      src/sendtab.cpp
  4. 22
      src/ui_mainwindow.h

1
src/mainwindow.cpp

@ -328,6 +328,7 @@ void MainWindow::setupRecieveTab() {
}
};
// zAddr toggle button
QObject::connect(ui->rdioZAddr, &QRadioButton::toggled, addZAddrsToComboList);
// Explicitly get new address button.

24
src/mainwindow.ui

@ -474,6 +474,27 @@
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QLabel" name="label_7">
<property name="text">
<string>Fee</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="sendTxFees">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="sendTxFeesUSD">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
@ -573,6 +594,9 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="duplicatesEnabled">
<bool>false</bool>
</property>
</widget>
</item>
<item>

13
src/sendtab.cpp

@ -55,6 +55,19 @@ void MainWindow::setupSendTab() {
QFont f = ui->Address1->font();
f.setPointSize(f.pointSize() - 1);
ui->MemoTxt1->setFont(f);
// Set up focus enter to set fees
QObject::connect(ui->tabWidget, &QTabWidget::currentChanged, [=] (int pos) {
if (pos == 1) {
// Set the fees
ui->sendTxFees->setText(QString::number(Utils::getTotalFee(), 'g', 8) %
" " % Utils::getTokenName());
ui->sendTxFeesUSD->setText(Settings::getInstance()->getUSDFormat(Utils::getTotalFee()));
// Set focus to the first address box
ui->Address1->setFocus();
}
});
}
void MainWindow::setDefaultPayFrom() {

22
src/ui_mainwindow.h

@ -106,6 +106,9 @@ public:
QSpacerItem *horizontalSpacer_3;
QSpacerItem *verticalSpacer_2;
QHBoxLayout *horizontalLayout_6;
QLabel *label_7;
QLabel *sendTxFees;
QLabel *sendTxFeesUSD;
QSpacerItem *horizontalSpacer;
QPushButton *sendTransactionButton;
QPushButton *cancelSendButton;
@ -466,6 +469,21 @@ public:
horizontalLayout_6 = new QHBoxLayout();
horizontalLayout_6->setSpacing(6);
horizontalLayout_6->setObjectName(QStringLiteral("horizontalLayout_6"));
label_7 = new QLabel(tab_2);
label_7->setObjectName(QStringLiteral("label_7"));
horizontalLayout_6->addWidget(label_7);
sendTxFees = new QLabel(tab_2);
sendTxFees->setObjectName(QStringLiteral("sendTxFees"));
horizontalLayout_6->addWidget(sendTxFees);
sendTxFeesUSD = new QLabel(tab_2);
sendTxFeesUSD->setObjectName(QStringLiteral("sendTxFeesUSD"));
horizontalLayout_6->addWidget(sendTxFeesUSD);
horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
horizontalLayout_6->addItem(horizontalSpacer);
@ -532,6 +550,7 @@ public:
sizePolicy1.setVerticalStretch(0);
sizePolicy1.setHeightForWidth(listRecieveAddresses->sizePolicy().hasHeightForWidth());
listRecieveAddresses->setSizePolicy(sizePolicy1);
listRecieveAddresses->setDuplicatesEnabled(false);
horizontalLayout_10->addWidget(listRecieveAddresses);
@ -673,6 +692,9 @@ 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));
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