Refresh the transaction view after clearing the...
authorfsb4000 <fsb4000@yandex.ru>
Thu, 20 Nov 2014 07:09:20 +0000 (13:09 +0600)
committerfsb4000 <fsb4000@yandex.ru>
Thu, 20 Nov 2014 07:09:20 +0000 (13:09 +0600)
minted/mined blocks
Взято отсюда
https://github.com/glv2/peerunity/commit/a6a156050ddee6fe0ba60a61d95b0061ebe1c0f9

src/qt/transactiontablemodel.cpp
src/qt/transactiontablemodel.h
src/qt/transactionview.cpp

index 01efd1f..00a5884 100644 (file)
@@ -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);
index 0449303..d74f7fd 100644 (file)
@@ -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;
index 38afba6..7649001 100644 (file)
@@ -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)