From d52a0f3bca2c8df8360308b062185d803e34f0d9 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 7 Jul 2011 10:59:00 +0200 Subject: [PATCH] Rename "History" tab to more logical "Transactions", move "Number of transactions" from status bar to overview page --- src/qt/bitcoingui.cpp | 10 ++-------- src/qt/bitcoingui.h | 1 - src/qt/forms/overviewpage.ui | 22 +++++++++++++++++++++- src/qt/overviewpage.cpp | 5 +++++ src/qt/overviewpage.h | 1 + 5 files changed, 29 insertions(+), 10 deletions(-) diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 3ac87262..fbab51bd 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -104,11 +104,6 @@ BitcoinGUI::BitcoinGUI(QWidget *parent): labelBlocks->setMinimumWidth(130); labelBlocks->setToolTip(tr("Number of blocks in the block chain")); - labelTransactions = new QLabel(); - labelTransactions->setFrameStyle(QFrame::Panel | QFrame::Sunken); - labelTransactions->setMinimumWidth(130); - labelTransactions->setToolTip(tr("Number of transactions in your wallet")); - // Progress bar for blocks download progressBarLabel = new QLabel(tr("Synchronizing with network...")); progressBarLabel->setVisible(false); @@ -120,7 +115,6 @@ BitcoinGUI::BitcoinGUI(QWidget *parent): statusBar()->addWidget(progressBar); statusBar()->addPermanentWidget(labelConnections); statusBar()->addPermanentWidget(labelBlocks); - statusBar()->addPermanentWidget(labelTransactions); createTrayIcon(); @@ -133,7 +127,7 @@ void BitcoinGUI::createActions() overviewAction = new QAction(QIcon(":/icons/overview"), tr("&Overview"), this); overviewAction->setCheckable(true); tabGroup->addAction(overviewAction); - historyAction = new QAction(QIcon(":/icons/history"), tr("&History"), this); + historyAction = new QAction(QIcon(":/icons/history"), tr("&Transactions"), this); historyAction->setCheckable(true); tabGroup->addAction(historyAction); @@ -318,7 +312,7 @@ void BitcoinGUI::setNumBlocks(int count) void BitcoinGUI::setNumTransactions(int count) { - labelTransactions->setText(tr("%n transaction(s)", "", count)); + overviewPage->setNumTransactions(count); } void BitcoinGUI::error(const QString &title, const QString &message) diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index 432a9e3b..e04bcf91 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -51,7 +51,6 @@ private: QLabel *labelConnections; QLabel *labelConnectionsIcon; QLabel *labelBlocks; - QLabel *labelTransactions; QLabel *progressBarLabel; QProgressBar *progressBar; diff --git a/src/qt/forms/overviewpage.ui b/src/qt/forms/overviewpage.ui index ef9c0730..4cb28d5b 100644 --- a/src/qt/forms/overviewpage.ui +++ b/src/qt/forms/overviewpage.ui @@ -26,10 +26,16 @@ QFormLayout::AllNonFixedFieldsGrow + + 12 + + + 12 + - Balance + Balance: @@ -40,6 +46,20 @@ + + + + Number of transactions: + + + + + + + 0 + + + diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp index faed2986..87f95fdd 100644 --- a/src/qt/overviewpage.cpp +++ b/src/qt/overviewpage.cpp @@ -30,3 +30,8 @@ void OverviewPage::setBalance(qint64 balance) { ui->labelBalance->setText(GUIUtil::formatMoney(balance) + QString(" BTC")); } + +void OverviewPage::setNumTransactions(int count) +{ + ui->labelNumTransactions->setText(QLocale::system().toString(count)); +} diff --git a/src/qt/overviewpage.h b/src/qt/overviewpage.h index 85b927b8..fbd6853b 100644 --- a/src/qt/overviewpage.h +++ b/src/qt/overviewpage.h @@ -17,6 +17,7 @@ public: public slots: void setBalance(qint64 balance); + void setNumTransactions(int count); private: Ui::OverviewPage *ui;