aboutsummaryrefslogtreecommitdiff
path: root/src/qt/overviewpage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qt/overviewpage.cpp')
-rw-r--r--src/qt/overviewpage.cpp39
1 files changed, 22 insertions, 17 deletions
diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp
index 5b5a8f5271..d7bcc6f45e 100644
--- a/src/qt/overviewpage.cpp
+++ b/src/qt/overviewpage.cpp
@@ -94,31 +94,30 @@ OverviewPage::OverviewPage(QWidget *parent) :
ui(new Ui::OverviewPage),
currentBalance(-1),
currentUnconfirmedBalance(-1),
- txdelegate(new TxViewDelegate())
+ txdelegate(new TxViewDelegate()), filter(0)
{
ui->setupUi(this);
- // Balance: <balance>
- ui->labelBalance->setFont(QFont("Monospace", -1, QFont::Bold));
- ui->labelBalance->setToolTip(tr("Your current balance"));
- ui->labelBalance->setTextInteractionFlags(Qt::TextSelectableByMouse|Qt::TextSelectableByKeyboard);
-
- // Unconfirmed balance: <balance>
- ui->labelUnconfirmed->setFont(QFont("Monospace", -1, QFont::Bold));
- ui->labelUnconfirmed->setToolTip(tr("Total of transactions that have yet to be confirmed, and do not yet count toward the current balance"));
- ui->labelUnconfirmed->setTextInteractionFlags(Qt::TextSelectableByMouse|Qt::TextSelectableByKeyboard);
-
- ui->labelNumTransactions->setToolTip(tr("Total number of transactions in wallet"));
-
// Recent transactions
- ui->listTransactions->setStyleSheet("QListView { background:transparent }");
ui->listTransactions->setItemDelegate(txdelegate);
ui->listTransactions->setIconSize(QSize(DECORATION_SIZE, DECORATION_SIZE));
- ui->listTransactions->setSelectionMode(QAbstractItemView::NoSelection);
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)));
+
+ // init "out of sync" warning labels
+ ui->labelWalletStatus->setText("(" + tr("out of sync") + ")");
+ ui->labelTransactionsStatus->setText("(" + tr("out of sync") + ")");
+
+ // start with displaying the "out of sync" warnings
+ showOutOfSyncWarning(true);
+}
+
+void OverviewPage::handleTransactionClicked(const QModelIndex &index)
+{
+ if(filter)
+ emit transactionClicked(filter->mapToSource(index));
}
OverviewPage::~OverviewPage()
@@ -146,7 +145,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);
@@ -177,3 +176,9 @@ void OverviewPage::displayUnitChanged()
txdelegate->unit = model->getOptionsModel()->getDisplayUnit();
ui->listTransactions->update();
}
+
+void OverviewPage::showOutOfSyncWarning(bool fShow)
+{
+ ui->labelWalletStatus->setVisible(fShow);
+ ui->labelTransactionsStatus->setVisible(fShow);
+}