Merge pull request #1483 from Diapolo/txtablemodel_updateDisplayUnit
GUI: ensure a changed bitcoin unit immediately updates the tx list amounts
This commit is contained in:
commit
703db97d80
2 changed files with 8 additions and 0 deletions
|
@ -230,6 +230,8 @@ TransactionTableModel::TransactionTableModel(CWallet* wallet, WalletModel *paren
|
||||||
QTimer *timer = new QTimer(this);
|
QTimer *timer = new QTimer(this);
|
||||||
connect(timer, SIGNAL(timeout()), this, SLOT(updateConfirmations()));
|
connect(timer, SIGNAL(timeout()), this, SLOT(updateConfirmations()));
|
||||||
timer->start(MODEL_UPDATE_DELAY);
|
timer->start(MODEL_UPDATE_DELAY);
|
||||||
|
|
||||||
|
connect(walletModel->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit()));
|
||||||
}
|
}
|
||||||
|
|
||||||
TransactionTableModel::~TransactionTableModel()
|
TransactionTableModel::~TransactionTableModel()
|
||||||
|
@ -624,3 +626,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));
|
||||||
|
}
|
||||||
|
|
|
@ -76,6 +76,7 @@ private:
|
||||||
public slots:
|
public slots:
|
||||||
void updateTransaction(const QString &hash, int status);
|
void updateTransaction(const QString &hash, int status);
|
||||||
void updateConfirmations();
|
void updateConfirmations();
|
||||||
|
void updateDisplayUnit();
|
||||||
|
|
||||||
friend class TransactionTablePriv;
|
friend class TransactionTablePriv;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue