aboutsummaryrefslogtreecommitdiff
path: root/src/qt/walletview.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2013-04-12 12:24:41 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2013-04-12 13:13:32 +0200
commit45155d3010a3bbbe3cfbba670538ae18b9772a39 (patch)
treece1a8631df298aef4bda092143651ddf70234769 /src/qt/walletview.cpp
parent2aa462ec30c3960ae546e4d8d50fdbaffefef718 (diff)
downloadbitcoin-45155d3010a3bbbe3cfbba670538ae18b9772a39.tar.xz
qt: move export button to tabs
Having the export button at the top was confusing people into thinking the entire wallet was exported. This commit moves the export button to the address book, receiving addresses and transaction tabs separately.
Diffstat (limited to 'src/qt/walletview.cpp')
-rw-r--r--src/qt/walletview.cpp30
1 files changed, 12 insertions, 18 deletions
diff --git a/src/qt/walletview.cpp b/src/qt/walletview.cpp
index 1d02b81fb6..727b48ded7 100644
--- a/src/qt/walletview.cpp
+++ b/src/qt/walletview.cpp
@@ -23,6 +23,7 @@
#include <QAction>
#include <QDesktopServices>
#include <QFileDialog>
+#include <QPushButton>
WalletView::WalletView(QWidget *parent, BitcoinGUI *_gui):
QStackedWidget(parent),
@@ -35,8 +36,17 @@ WalletView::WalletView(QWidget *parent, BitcoinGUI *_gui):
transactionsPage = new QWidget(this);
QVBoxLayout *vbox = new QVBoxLayout();
+ QHBoxLayout *hbox_buttons = new QHBoxLayout();
transactionView = new TransactionView(this);
vbox->addWidget(transactionView);
+ QPushButton *exportButton = new QPushButton("&Export", this);
+ exportButton->setToolTip(tr("Export the data in the current tab to a file"));
+#ifndef Q_OS_MAC // Icons on push buttons are very uncommon on Mac
+ exportButton->setIcon(QIcon(":/icons/export"));
+#endif
+ hbox_buttons->addStretch();
+ hbox_buttons->addWidget(exportButton);
+ vbox->addLayout(hbox_buttons);
transactionsPage->setLayout(vbox);
addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab);
@@ -66,6 +76,8 @@ WalletView::WalletView(QWidget *parent, BitcoinGUI *_gui):
connect(addressBookPage, SIGNAL(verifyMessage(QString)), this, SLOT(gotoVerifyMessageTab(QString)));
// Clicking on "Sign Message" in the receive coins page opens the sign message tab in the Sign/Verify Message dialog
connect(receiveCoinsPage, SIGNAL(signMessage(QString)), this, SLOT(gotoSignMessageTab(QString)));
+ // Clicking on "Export" allows to export the transaction list
+ connect(exportButton, SIGNAL(clicked()), transactionView, SLOT(exportClicked()));
gotoOverviewPage();
}
@@ -142,39 +154,24 @@ void WalletView::gotoOverviewPage()
{
gui->getOverviewAction()->setChecked(true);
setCurrentWidget(overviewPage);
-
- gui->getExportAction()->setEnabled(false);
- disconnect(gui->getExportAction(), SIGNAL(triggered()), 0, 0);
}
void WalletView::gotoHistoryPage()
{
gui->getHistoryAction()->setChecked(true);
setCurrentWidget(transactionsPage);
-
- gui->getExportAction()->setEnabled(true);
- disconnect(gui->getExportAction(), SIGNAL(triggered()), 0, 0);
- connect(gui->getExportAction(), SIGNAL(triggered()), transactionView, SLOT(exportClicked()));
}
void WalletView::gotoAddressBookPage()
{
gui->getAddressBookAction()->setChecked(true);
setCurrentWidget(addressBookPage);
-
- gui->getExportAction()->setEnabled(true);
- disconnect(gui->getExportAction(), SIGNAL(triggered()), 0, 0);
- connect(gui->getExportAction(), SIGNAL(triggered()), addressBookPage, SLOT(exportClicked()));
}
void WalletView::gotoReceiveCoinsPage()
{
gui->getReceiveCoinsAction()->setChecked(true);
setCurrentWidget(receiveCoinsPage);
-
- gui->getExportAction()->setEnabled(true);
- disconnect(gui->getExportAction(), SIGNAL(triggered()), 0, 0);
- connect(gui->getExportAction(), SIGNAL(triggered()), receiveCoinsPage, SLOT(exportClicked()));
}
void WalletView::gotoSendCoinsPage(QString addr)
@@ -182,9 +179,6 @@ void WalletView::gotoSendCoinsPage(QString addr)
gui->getSendCoinsAction()->setChecked(true);
setCurrentWidget(sendCoinsPage);
- gui->getExportAction()->setEnabled(false);
- disconnect(gui->getExportAction(), SIGNAL(triggered()), 0, 0);
-
if (!addr.isEmpty())
sendCoinsPage->setAddress(addr);
}