Skip to content

Commit 229c34f

Browse files
author
Philip Kaufmann
committed
GUI: ensure a changed bitcoin unit immediately updates the tx list amounts
1 parent c283b3c commit 229c34f

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/qt/transactiontablemodel.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,8 @@ TransactionTableModel::TransactionTableModel(CWallet* wallet, WalletModel *paren
230230
QTimer *timer = new QTimer(this);
231231
connect(timer, SIGNAL(timeout()), this, SLOT(updateConfirmations()));
232232
timer->start(MODEL_UPDATE_DELAY);
233+
234+
connect(walletModel->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit()));
233235
}
234236

235237
TransactionTableModel::~TransactionTableModel()
@@ -624,3 +626,8 @@ QModelIndex TransactionTableModel::index(int row, int column, const QModelIndex
624626
}
625627
}
626628

629+
void TransactionTableModel::updateDisplayUnit()
630+
{
631+
// emit dataChanged to update Amount column with the current unit
632+
emit dataChanged(index(0, Amount), index(priv->size()-1, Amount));
633+
}

src/qt/transactiontablemodel.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ class TransactionTableModel : public QAbstractTableModel
7676
public slots:
7777
void updateTransaction(const QString &hash, int status);
7878
void updateConfirmations();
79+
void updateDisplayUnit();
7980

8081
friend class TransactionTablePriv;
8182
};

0 commit comments

Comments
 (0)