From de5cfb709af6c48f8c3ca0b64dec469ec720a5c8 Mon Sep 17 00:00:00 2001 From: fsb4000 Date: Thu, 20 Nov 2014 13:09:20 +0600 Subject: [PATCH] Refresh the transaction view after clearing the... MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit minted/mined blocks Взято отсюда https://github.com/glv2/peerunity/commit/a6a156050ddee6fe0ba60a61d95b0061ebe1c0f9 --- src/qt/transactiontablemodel.cpp | 6 ++++++ src/qt/transactiontablemodel.h | 1 + src/qt/transactionview.cpp | 5 +++++ 3 files changed, 12 insertions(+), 0 deletions(-) diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp index 01efd1f..00a5884 100644 --- a/src/qt/transactiontablemodel.cpp +++ b/src/qt/transactiontablemodel.cpp @@ -261,6 +261,12 @@ void TransactionTableModel::updateConfirmations() } } +void TransactionTableModel::refresh() +{ + priv->refreshWallet(); + emit dataChanged(index(0, 0), index(priv->size() - 1, Amount)); +} + int TransactionTableModel::rowCount(const QModelIndex &parent) const { Q_UNUSED(parent); diff --git a/src/qt/transactiontablemodel.h b/src/qt/transactiontablemodel.h index 0449303..d74f7fd 100644 --- a/src/qt/transactiontablemodel.h +++ b/src/qt/transactiontablemodel.h @@ -57,6 +57,7 @@ public: QVariant data(const QModelIndex &index, int role) const; QVariant headerData(int section, Qt::Orientation orientation, int role) const; QModelIndex index(int row, int column, const QModelIndex & parent = QModelIndex()) const; + void refresh(); private: CWallet* wallet; WalletModel *walletModel; diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp index 38afba6..7649001 100644 --- a/src/qt/transactionview.cpp +++ b/src/qt/transactionview.cpp @@ -425,6 +425,11 @@ void TransactionView::clearOrphans() return; model->clearOrphans(); + model->getTransactionTableModel()->refresh(); + delete transactionProxyModel; + setModel(model); + transactionView->sortByColumn(TransactionTableModel::Status, Qt::DescendingOrder); + transactionView->sortByColumn(TransactionTableModel::Date, Qt::DescendingOrder); } void TransactionView::openThirdPartyTxUrl(QString url) -- 1.7.1