|
|
@ -23,6 +23,7 @@ |
|
|
|
#include <QAction> |
|
|
|
#include <QAction> |
|
|
|
#include <QDesktopServices> |
|
|
|
#include <QDesktopServices> |
|
|
|
#include <QFileDialog> |
|
|
|
#include <QFileDialog> |
|
|
|
|
|
|
|
#include <QPushButton> |
|
|
|
|
|
|
|
|
|
|
|
WalletView::WalletView(QWidget *parent, BitcoinGUI *_gui): |
|
|
|
WalletView::WalletView(QWidget *parent, BitcoinGUI *_gui): |
|
|
|
QStackedWidget(parent), |
|
|
|
QStackedWidget(parent), |
|
|
@ -35,8 +36,17 @@ WalletView::WalletView(QWidget *parent, BitcoinGUI *_gui): |
|
|
|
|
|
|
|
|
|
|
|
transactionsPage = new QWidget(this); |
|
|
|
transactionsPage = new QWidget(this); |
|
|
|
QVBoxLayout *vbox = new QVBoxLayout(); |
|
|
|
QVBoxLayout *vbox = new QVBoxLayout(); |
|
|
|
|
|
|
|
QHBoxLayout *hbox_buttons = new QHBoxLayout(); |
|
|
|
transactionView = new TransactionView(this); |
|
|
|
transactionView = new TransactionView(this); |
|
|
|
vbox->addWidget(transactionView); |
|
|
|
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); |
|
|
|
transactionsPage->setLayout(vbox); |
|
|
|
|
|
|
|
|
|
|
|
addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab); |
|
|
|
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))); |
|
|
|
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
|
|
|
|
// 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))); |
|
|
|
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(); |
|
|
|
gotoOverviewPage(); |
|
|
|
} |
|
|
|
} |
|
|
@ -142,39 +154,24 @@ void WalletView::gotoOverviewPage() |
|
|
|
{ |
|
|
|
{ |
|
|
|
gui->getOverviewAction()->setChecked(true); |
|
|
|
gui->getOverviewAction()->setChecked(true); |
|
|
|
setCurrentWidget(overviewPage); |
|
|
|
setCurrentWidget(overviewPage); |
|
|
|
|
|
|
|
|
|
|
|
gui->getExportAction()->setEnabled(false); |
|
|
|
|
|
|
|
disconnect(gui->getExportAction(), SIGNAL(triggered()), 0, 0); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void WalletView::gotoHistoryPage() |
|
|
|
void WalletView::gotoHistoryPage() |
|
|
|
{ |
|
|
|
{ |
|
|
|
gui->getHistoryAction()->setChecked(true); |
|
|
|
gui->getHistoryAction()->setChecked(true); |
|
|
|
setCurrentWidget(transactionsPage); |
|
|
|
setCurrentWidget(transactionsPage); |
|
|
|
|
|
|
|
|
|
|
|
gui->getExportAction()->setEnabled(true); |
|
|
|
|
|
|
|
disconnect(gui->getExportAction(), SIGNAL(triggered()), 0, 0); |
|
|
|
|
|
|
|
connect(gui->getExportAction(), SIGNAL(triggered()), transactionView, SLOT(exportClicked())); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void WalletView::gotoAddressBookPage() |
|
|
|
void WalletView::gotoAddressBookPage() |
|
|
|
{ |
|
|
|
{ |
|
|
|
gui->getAddressBookAction()->setChecked(true); |
|
|
|
gui->getAddressBookAction()->setChecked(true); |
|
|
|
setCurrentWidget(addressBookPage); |
|
|
|
setCurrentWidget(addressBookPage); |
|
|
|
|
|
|
|
|
|
|
|
gui->getExportAction()->setEnabled(true); |
|
|
|
|
|
|
|
disconnect(gui->getExportAction(), SIGNAL(triggered()), 0, 0); |
|
|
|
|
|
|
|
connect(gui->getExportAction(), SIGNAL(triggered()), addressBookPage, SLOT(exportClicked())); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void WalletView::gotoReceiveCoinsPage() |
|
|
|
void WalletView::gotoReceiveCoinsPage() |
|
|
|
{ |
|
|
|
{ |
|
|
|
gui->getReceiveCoinsAction()->setChecked(true); |
|
|
|
gui->getReceiveCoinsAction()->setChecked(true); |
|
|
|
setCurrentWidget(receiveCoinsPage); |
|
|
|
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) |
|
|
|
void WalletView::gotoSendCoinsPage(QString addr) |
|
|
@ -182,9 +179,6 @@ void WalletView::gotoSendCoinsPage(QString addr) |
|
|
|
gui->getSendCoinsAction()->setChecked(true); |
|
|
|
gui->getSendCoinsAction()->setChecked(true); |
|
|
|
setCurrentWidget(sendCoinsPage); |
|
|
|
setCurrentWidget(sendCoinsPage); |
|
|
|
|
|
|
|
|
|
|
|
gui->getExportAction()->setEnabled(false); |
|
|
|
|
|
|
|
disconnect(gui->getExportAction(), SIGNAL(triggered()), 0, 0); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!addr.isEmpty()) |
|
|
|
if (!addr.isEmpty()) |
|
|
|
sendCoinsPage->setAddress(addr); |
|
|
|
sendCoinsPage->setAddress(addr); |
|
|
|
} |
|
|
|
} |
|
|
|