diff --git a/src/coinswidget.cpp b/src/coinswidget.cpp index f72214c..64949da 100644 --- a/src/coinswidget.cpp +++ b/src/coinswidget.cpp @@ -36,6 +36,7 @@ CoinsWidget::CoinsWidget(QWidget *parent) m_copyMenu->addAction("Key Image", this, [this]{copy(copyField::KeyImage);}); m_copyMenu->addAction("Transaction ID", this, [this]{copy(copyField::TxID);}); m_copyMenu->addAction("Address", this, [this]{copy(copyField::Address);}); + m_copyMenu->addAction("Label", this, [this]{copy(copyField::Label);}); m_copyMenu->addAction("Height", this, [this]{copy(copyField::Height);}); m_copyMenu->addAction("Amount", this, [this]{copy(copyField::Amount);}); @@ -229,6 +230,9 @@ void CoinsWidget::copy(copyField field) { case Address: data = c.address(); break; + case Label: + data = c.addressLabel(); + break; case Height: data = QString::number(c.blockHeight()); break; diff --git a/src/coinswidget.h b/src/coinswidget.h index ba158eb..412b55c 100644 --- a/src/coinswidget.h +++ b/src/coinswidget.h @@ -48,6 +48,7 @@ private: KeyImage, TxID, Address, + Label, Height, Amount }; diff --git a/src/libwalletqt/CoinsInfo.cpp b/src/libwalletqt/CoinsInfo.cpp index 01a0ae8..56ec202 100644 --- a/src/libwalletqt/CoinsInfo.cpp +++ b/src/libwalletqt/CoinsInfo.cpp @@ -76,6 +76,10 @@ QString CoinsInfo::address() const { } QString CoinsInfo::addressLabel() const { + if (m_subaddrIndex == 0) { + return m_coinbase ? "Coinbase" : "Change"; + } + return m_addressLabel; } diff --git a/src/model/CoinsModel.cpp b/src/model/CoinsModel.cpp index 655abc2..75ea5b8 100644 --- a/src/model/CoinsModel.cpp +++ b/src/model/CoinsModel.cpp @@ -180,12 +180,7 @@ QVariant CoinsModel::parseTransactionInfo(const CoinsInfo &cInfo, int column, in case Address: return ModelUtils::displayAddress(cInfo.address(), 1, ""); case AddressLabel: - { - if (cInfo.subaddrIndex() == 0) { - return cInfo.coinbase() ? "Coinbase" : "Change"; - } return cInfo.addressLabel(); - } case Spent: return cInfo.spent(); case SpentHeight: