mirror of
https://github.com/feather-wallet/feather.git
synced 2025-01-10 12:54:46 +00:00
TxConfAdv: label dummy outputs
This commit is contained in:
parent
6c3b691ae9
commit
cfa96e8126
4 changed files with 11 additions and 10 deletions
|
@ -110,7 +110,7 @@ void TxConfAdvDialog::setupConstructionData(ConstructionInfo *ci) {
|
||||||
auto address = o->address();
|
auto address = o->address();
|
||||||
auto amount = WalletManager::displayAmount(o->amount());
|
auto amount = WalletManager::displayAmount(o->amount());
|
||||||
auto index = m_ctx->wallet->subaddressIndex(address);
|
auto index = m_ctx->wallet->subaddressIndex(address);
|
||||||
cursor.insertText(address, Utils::addressTextFormat(index));
|
cursor.insertText(address, Utils::addressTextFormat(index, o->amount()));
|
||||||
cursor.insertText(QString(" %1").arg(amount), QTextCharFormat());
|
cursor.insertText(QString(" %1").arg(amount), QTextCharFormat());
|
||||||
cursor.insertBlock();
|
cursor.insertBlock();
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,7 +52,7 @@ TxInfoDialog::TxInfoDialog(QSharedPointer<AppContext> ctx, TransactionInfo *txIn
|
||||||
auto address = transfer->address();
|
auto address = transfer->address();
|
||||||
auto amount = WalletManager::displayAmount(transfer->amount());
|
auto amount = WalletManager::displayAmount(transfer->amount());
|
||||||
auto index = m_ctx->wallet->subaddressIndex(address);
|
auto index = m_ctx->wallet->subaddressIndex(address);
|
||||||
cursor.insertText(address, Utils::addressTextFormat(index));
|
cursor.insertText(address, Utils::addressTextFormat(index, transfer->amount()));
|
||||||
cursor.insertText(QString(" %1").arg(amount), QTextCharFormat());
|
cursor.insertText(QString(" %1").arg(amount), QTextCharFormat());
|
||||||
cursor.insertBlock();
|
cursor.insertBlock();
|
||||||
}
|
}
|
||||||
|
|
|
@ -453,20 +453,21 @@ int Utils::maxLength(const QVector<QString> &array) {
|
||||||
return maxLength;
|
return maxLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
QTextCharFormat Utils::addressTextFormat(const SubaddressIndex &index) {
|
QTextCharFormat Utils::addressTextFormat(const SubaddressIndex &index, quint64 amount) {
|
||||||
|
QTextCharFormat rec;
|
||||||
if (index.isPrimary()) {
|
if (index.isPrimary()) {
|
||||||
QTextCharFormat rec;
|
|
||||||
rec.setBackground(QBrush(ColorScheme::YELLOW.asColor(true)));
|
rec.setBackground(QBrush(ColorScheme::YELLOW.asColor(true)));
|
||||||
rec.setToolTip("Wallet change/primary address");
|
rec.setToolTip("Wallet change/primary address");
|
||||||
return rec;
|
|
||||||
}
|
}
|
||||||
if (index.isValid()) {
|
else if (index.isValid()) {
|
||||||
QTextCharFormat rec;
|
|
||||||
rec.setBackground(QBrush(ColorScheme::GREEN.asColor(true)));
|
rec.setBackground(QBrush(ColorScheme::GREEN.asColor(true)));
|
||||||
rec.setToolTip("Wallet receive address");
|
rec.setToolTip("Wallet receive address");
|
||||||
return rec;
|
|
||||||
}
|
}
|
||||||
return QTextCharFormat();
|
else if (amount == 0) {
|
||||||
|
rec.setBackground(QBrush(ColorScheme::GRAY.asColor(true)));
|
||||||
|
rec.setToolTip("Dummy output (Min. 2 outs consensus rule)");
|
||||||
|
}
|
||||||
|
return rec;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Utils::isTorsocks() {
|
bool Utils::isTorsocks() {
|
||||||
|
|
|
@ -75,7 +75,7 @@ public:
|
||||||
static QString amountToCurrencyString(double amount, const QString ¤cyCode);
|
static QString amountToCurrencyString(double amount, const QString ¤cyCode);
|
||||||
static int maxLength(const QVector<QString> &array);
|
static int maxLength(const QVector<QString> &array);
|
||||||
static QMap<QString, QLocale> localeCache;
|
static QMap<QString, QLocale> localeCache;
|
||||||
static QTextCharFormat addressTextFormat(const SubaddressIndex &index);
|
static QTextCharFormat addressTextFormat(const SubaddressIndex &index, quint64 amount);
|
||||||
static bool isTorsocks();
|
static bool isTorsocks();
|
||||||
static QString defaultWalletDir();
|
static QString defaultWalletDir();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue