Skip to content

Commit

Permalink
Crorect asset type on Asset Info dialog. Update strings for translati…
Browse files Browse the repository at this point in the history
…ons. Fixed typo.
  • Loading branch information
CodeIsTheKey committed Aug 19, 2024
1 parent 569a174 commit fc75387
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
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

0 comments on commit fc75387

Please sign in to comment.