From a3ad7ea6ffe092f0c7f155604c1dbdb998e9d2d6 Mon Sep 17 00:00:00 2001 From: shillo Date: Mon, 20 Dec 2021 09:30:44 -0600 Subject: [PATCH 1/2] elysium ui tweaks and fixes -reorder elysium tabs -fix elysium send address validation -disable/remove reference amount field --- src/qt/createtokendialog.cpp | 2 +- src/qt/elysiumprivatesenddialog.cpp | 20 +++++----- src/qt/forms/elysiumprivatesenddialog.ui | 49 ------------------------ src/qt/walletview.cpp | 4 +- 4 files changed, 13 insertions(+), 62 deletions(-) diff --git a/src/qt/createtokendialog.cpp b/src/qt/createtokendialog.cpp index 9d60ac556d..6a141f60bf 100644 --- a/src/qt/createtokendialog.cpp +++ b/src/qt/createtokendialog.cpp @@ -125,7 +125,7 @@ void CreateTokenDialog::onCreateButtonClicked() } std::string fromAddress = ui->addressLineEdit->text().toStdString(); - if (fromAddress.size() == 0 || !!model->validateAddress(ui->addressLineEdit->text())) { + if (fromAddress.size() == 0 || !model->validateAddress(ui->addressLineEdit->text())) { ui->addressLineEdit->setValid(false); Q_EMIT message(tr("Invalid address"), tr("Invalid FIRO address entered."), CClientUIInterface::MSG_ERROR); return; diff --git a/src/qt/elysiumprivatesenddialog.cpp b/src/qt/elysiumprivatesenddialog.cpp index 431ff3b13c..f1ef673481 100644 --- a/src/qt/elysiumprivatesenddialog.cpp +++ b/src/qt/elysiumprivatesenddialog.cpp @@ -137,14 +137,14 @@ void ElysiumPrivateSendDialog::updateAmountFieldValidators() bool divisible = isPropertyDivisible(propertyId); if (divisible) { ui->amountLineEdit->setValidator(divisibleQuantityValidator); - ui->referenceAmountLineEdit->setValidator(divisibleQuantityValidator); + // ui->referenceAmountLineEdit->setValidator(divisibleQuantityValidator); } else { ui->amountLineEdit->setValidator(indivisibleQuantityValidator); - ui->referenceAmountLineEdit->setValidator(indivisibleQuantityValidator); + // ui->referenceAmountLineEdit->setValidator(indivisibleQuantityValidator); } FormatElysiumAmount(ui->amountLineEdit, divisible); - FormatElysiumAmount(ui->referenceAmountLineEdit, divisible); + // FormatElysiumAmount(ui->referenceAmountLineEdit, divisible); } void ElysiumPrivateSendDialog::onClearButtonClicked() @@ -156,7 +156,7 @@ void ElysiumPrivateSendDialog::clear() { ui->sendToLineEdit->clear(); ui->amountLineEdit->clear(); - ui->referenceAmountLineEdit->clear(); + // ui->referenceAmountLineEdit->clear(); } void ElysiumPrivateSendDialog::onSendButtonClicked() @@ -189,12 +189,12 @@ void ElysiumPrivateSendDialog::onSendButtonClicked() return; } - amountString = ui->referenceAmountLineEdit->text().toStdString(); - int64_t referenceAmount = amountString.size() == 0 ? 0 : elysium::StrToInt64(amountString, divisible); - if ((0.01 * COIN) < referenceAmount) { - Q_EMIT message(tr("Invalid reference amount"), tr("Reference amount higher is than 0.01 FIRO."), CClientUIInterface::MSG_ERROR); - return; - } + // amountString = ui->referenceAmountLineEdit->text().toStdString(); + int64_t referenceAmount = 0; //amountString.size() == 0 ? 0 : elysium::StrToInt64(amountString, divisible); + // if ((0.01 * COIN) < referenceAmount) { + // Q_EMIT message(tr("Invalid reference amount"), tr("Reference amount higher is than 0.01 FIRO."), CClientUIInterface::MSG_ERROR); + // return; + // } if (!IsFeatureActivated(FEATURE_LELANTUS, GetHeight())) { Q_EMIT message(tr("Lelantus Error"), tr("Lelantus feature is not activated yet."), CClientUIInterface::MSG_ERROR); diff --git a/src/qt/forms/elysiumprivatesenddialog.ui b/src/qt/forms/elysiumprivatesenddialog.ui index a6f027ec69..302638be00 100644 --- a/src/qt/forms/elysiumprivatesenddialog.ui +++ b/src/qt/forms/elysiumprivatesenddialog.ui @@ -155,55 +155,6 @@ - - - - - - Reference Amount: - - - - - - - - 133 - 0 - - - - - 240 - 16777215 - - - - If left empty a default amount will be used. - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - (Optional) - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - diff --git a/src/qt/walletview.cpp b/src/qt/walletview.cpp index 30b7f3bd46..20574e9ef9 100644 --- a/src/qt/walletview.cpp +++ b/src/qt/walletview.cpp @@ -180,11 +180,11 @@ void WalletView::setupElysiumTokensPage() setupToolboxPage(); elysiumTokensTabs = new QTabWidget(); - elysiumTokensTabs->addTab(elysiumPrivateSendPage, tr("Send")); elysiumTokensTabs->addTab(elyAssetsPage, tr("Balances")); + elysiumTokensTabs->addTab(elysiumPrivateSendPage, tr("Send")); + elysiumTokensTabs->addTab(mintTokenPage, tr("Anonymize")); elysiumTokensTabs->addTab(elysiumTransactionsView, tr("Transactions")); elysiumTokensTabs->addTab(createTokenPage, tr("Create")); - elysiumTokensTabs->addTab(mintTokenPage, tr("Anonymize")); elysiumTokensTabs->addTab(manageTokenPage, tr("Manage Tokens")); elysiumTokensTabs->addTab(toolboxPage, tr("Toolbox")); From 667f0089adf956ae783c8fccaad26ced340abcc1 Mon Sep 17 00:00:00 2001 From: shillo Date: Mon, 20 Dec 2021 14:46:38 -0600 Subject: [PATCH 2/2] Update walletview.cpp Tab renamed --- src/qt/walletview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/walletview.cpp b/src/qt/walletview.cpp index 20574e9ef9..585da12732 100644 --- a/src/qt/walletview.cpp +++ b/src/qt/walletview.cpp @@ -185,7 +185,7 @@ void WalletView::setupElysiumTokensPage() elysiumTokensTabs->addTab(mintTokenPage, tr("Anonymize")); elysiumTokensTabs->addTab(elysiumTransactionsView, tr("Transactions")); elysiumTokensTabs->addTab(createTokenPage, tr("Create")); - elysiumTokensTabs->addTab(manageTokenPage, tr("Manage Tokens")); + elysiumTokensTabs->addTab(manageTokenPage, tr("Managed Tokens")); elysiumTokensTabs->addTab(toolboxPage, tr("Toolbox")); auto pageLayout = new QVBoxLayout();