GUI: ensure a changed bitcoin unit immediately updates the tx list amounts

This commit is contained in:
Philip Kaufmann
2012-06-18 22:48:35 +02:00
committed by Luke Dashjr
parent 34709a786c
commit d2ee96d88f
2 changed files with 9 additions and 0 deletions

View File

@@ -218,6 +218,8 @@ TransactionTableModel::TransactionTableModel(CWallet* wallet, WalletModel *paren
QTimer *timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(update()));
timer->start(MODEL_UPDATE_DELAY);
connect(walletModel->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit()));
}
TransactionTableModel::~TransactionTableModel()
@@ -619,3 +621,8 @@ QModelIndex TransactionTableModel::index(int row, int column, const QModelIndex
}
}
void TransactionTableModel::updateDisplayUnit()
{
// emit dataChanged to update Amount column with the current unit
emit dataChanged(index(0, Amount), index(priv->size()-1, Amount));
}

View File

@@ -74,6 +74,8 @@ private:
private slots:
void update();
public slots:
void updateDisplayUnit();
friend class TransactionTablePriv;
};