Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct asset type on Asset Info dialog. Updated strings for translation. #396

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions src/qt/assetsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ AssetsDialog::AssetsDialog(QWidget *parent) :
GUIUtil::setFont({ui->label_6, ui->label_4, ui->label_3, ui->label_4, ui->label_5, ui->referenceLabel,
ui->errorLabel}, GUIUtil::FontWeight::Bold, 14);
GUIUtil::setFont({ui->idTextLablel, ui->nameTextLabel, ui->typeLabel,
ui->suplyTextLabel}, GUIUtil::FontWeight::Normal, 14);
ui->supplyTextLabel}, GUIUtil::FontWeight::Normal, 14);

int columnNameWidth = 300;
int columnIdWidth = 80;
Expand Down Expand Up @@ -233,9 +233,9 @@ void AssetsDialog::Asset_clicked() {
if (!passetsCache->GetAssetMetaData(assetId, asset)){
ui->errorLabel->setVisible(true);
ui->errorTextLabel->setVisible(true);
ui->errorTextLabel->setText("Asset metadata not found.\n(Not mined on a block)");
ui->errorTextLabel->setText(tr("Asset metadata not found.\n(Not mined on a block)"));
ui->nameTextLabel->clear();
ui->suplyTextLabel->clear();
ui->supplyTextLabel->clear();
ui->typeLabel->clear();
ui->mintButton->setEnabled(false);
ui->updateButton->setEnabled(false);
Expand All @@ -246,13 +246,17 @@ void AssetsDialog::Asset_clicked() {
ui->errorTextLabel->setVisible(false);

ui->nameTextLabel->setText(QString::fromStdString(asset.name));
ui->typeLabel->setText( asset.isUnique ? "Unique/NFT" : "Root");
if (asset.isRoot) {
ui->typeLabel->setText(tr("Root"));
} else {
ui->typeLabel->setText(asset.isUnique ? tr("Unique/NFT") : tr("Sub"));
}
if (asset.mintCount > 0) {
QString decimal = asset.decimalPoint > 0 ? "." + QString::number(0).rightJustified(asset.decimalPoint, '0') : "";
ui->suplyTextLabel->setText(BitcoinUnits::format(8, asset.circulatingSupply, false,
ui->supplyTextLabel->setText(BitcoinUnits::format(8, asset.circulatingSupply, false,
BitcoinUnits::separatorAlways, 0) + decimal);
} else {
ui->suplyTextLabel->setText("0");
ui->supplyTextLabel->setText("0");
}

if (walletModel->wallet().isSpendable(asset.ownerAddress)){
Expand Down Expand Up @@ -393,7 +397,7 @@ void AssetsDialog::mintAsset() {
CAssetMetaData tmpAsset;
if (!passetsCache->GetAssetMetaData(assetId, tmpAsset)) {
QMessageBox msgBox;
msgBox.setText("ERROR: Asset metadata not found");
msgBox.setText(tr("ERROR: Asset metadata not found"));
msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.exec();
return;
Expand All @@ -402,7 +406,7 @@ void AssetsDialog::mintAsset() {
//check on mempool if have a mint tx for this asset
if (mempool.CheckForMintAssetConflict(tmpAsset.assetId)) {
QMessageBox msgBox;
msgBox.setText("Error: Asset mint or update tx exist on mempool");
msgBox.setText(tr("Error: Asset mint or update tx exists on mempool"));
msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.exec();
return;
Expand Down
2 changes: 1 addition & 1 deletion src/qt/forms/assetsdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="suplyTextLabel">
<widget class="QLabel" name="supplyTextLabel">
<property name="text">
<string notr="true"/>
</property>
Expand Down
Loading