aboutsummaryrefslogtreecommitdiff
path: root/src/qt/overviewpage.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2012-05-12 13:19:44 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2012-05-12 15:32:22 +0200
commit3ef1f41550d5e9ba032dcc5e550e5f85f7e6aa07 (patch)
tree539fbe8f11a60658365969b759aa44f82bc73e94 /src/qt/overviewpage.cpp
parent97ec4e50b128c201c82dd76b28ab44508d85e94f (diff)
When a transaction is clicked on overview page, focus it on history page
Diffstat (limited to 'src/qt/overviewpage.cpp')
-rw-r--r--src/qt/overviewpage.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp
index 259f819deb..d0ba377967 100644
--- a/src/qt/overviewpage.cpp
+++ b/src/qt/overviewpage.cpp
@@ -94,7 +94,7 @@ OverviewPage::OverviewPage(QWidget *parent) :
ui(new Ui::OverviewPage),
currentBalance(-1),
currentUnconfirmedBalance(-1),
- txdelegate(new TxViewDelegate())
+ txdelegate(new TxViewDelegate()), filter(0)
{
ui->setupUi(this);
@@ -104,7 +104,13 @@ OverviewPage::OverviewPage(QWidget *parent) :
ui->listTransactions->setMinimumHeight(NUM_ITEMS * (DECORATION_SIZE + 2));
ui->listTransactions->setAttribute(Qt::WA_MacShowFocusRect, false);
- connect(ui->listTransactions, SIGNAL(clicked(QModelIndex)), this, SIGNAL(transactionClicked(QModelIndex)));
+ connect(ui->listTransactions, SIGNAL(clicked(QModelIndex)), this, SLOT(handleTransactionClicked(QModelIndex)));
+}
+
+void OverviewPage::handleTransactionClicked(const QModelIndex &index)
+{
+ if(filter)
+ emit transactionClicked(filter->mapToSource(index));
}
OverviewPage::~OverviewPage()
@@ -132,7 +138,7 @@ void OverviewPage::setModel(WalletModel *model)
if(model)
{
// Set up transaction list
- TransactionFilterProxy *filter = new TransactionFilterProxy();
+ filter = new TransactionFilterProxy();
filter->setSourceModel(model->getTransactionTableModel());
filter->setLimit(NUM_ITEMS);
filter->setDynamicSortFilter(true);