Changeset View
Changeset View
Standalone View
Standalone View
src/qt/walletview.cpp
Show All 23 Lines | |||||
#include <QAction> | #include <QAction> | ||||
#include <QActionGroup> | #include <QActionGroup> | ||||
#include <QFileDialog> | #include <QFileDialog> | ||||
#include <QHBoxLayout> | #include <QHBoxLayout> | ||||
#include <QProgressDialog> | #include <QProgressDialog> | ||||
#include <QPushButton> | #include <QPushButton> | ||||
#include <QVBoxLayout> | #include <QVBoxLayout> | ||||
WalletView::WalletView(const PlatformStyle *_platformStyle, QWidget *parent) | WalletView::WalletView(const PlatformStyle *_platformStyle, | ||||
: QStackedWidget(parent), clientModel(nullptr), walletModel(nullptr), | WalletModel *_walletModel, QWidget *parent) | ||||
: QStackedWidget(parent), clientModel(nullptr), walletModel(_walletModel), | |||||
platformStyle(_platformStyle) { | platformStyle(_platformStyle) { | ||||
// Create tabs | // Create tabs | ||||
overviewPage = new OverviewPage(platformStyle); | overviewPage = new OverviewPage(platformStyle); | ||||
transactionsPage = new QWidget(this); | transactionsPage = new QWidget(this); | ||||
QVBoxLayout *vbox = new QVBoxLayout(); | QVBoxLayout *vbox = new QVBoxLayout(); | ||||
QHBoxLayout *hbox_buttons = new QHBoxLayout(); | QHBoxLayout *hbox_buttons = new QHBoxLayout(); | ||||
transactionView = new TransactionView(platformStyle, this); | transactionView = new TransactionView(platformStyle, this); | ||||
vbox->addWidget(transactionView); | vbox->addWidget(transactionView); | ||||
QPushButton *exportButton = new QPushButton(tr("&Export"), this); | QPushButton *exportButton = new QPushButton(tr("&Export"), this); | ||||
exportButton->setToolTip( | exportButton->setToolTip( | ||||
tr("Export the data in the current tab to a file")); | tr("Export the data in the current tab to a file")); | ||||
if (platformStyle->getImagesOnButtons()) { | if (platformStyle->getImagesOnButtons()) { | ||||
exportButton->setIcon(platformStyle->SingleColorIcon(":/icons/export")); | exportButton->setIcon(platformStyle->SingleColorIcon(":/icons/export")); | ||||
} | } | ||||
hbox_buttons->addStretch(); | hbox_buttons->addStretch(); | ||||
hbox_buttons->addWidget(exportButton); | hbox_buttons->addWidget(exportButton); | ||||
vbox->addLayout(hbox_buttons); | vbox->addLayout(hbox_buttons); | ||||
transactionsPage->setLayout(vbox); | transactionsPage->setLayout(vbox); | ||||
receiveCoinsPage = new ReceiveCoinsDialog(platformStyle); | receiveCoinsPage = new ReceiveCoinsDialog(platformStyle); | ||||
sendCoinsPage = new SendCoinsDialog(platformStyle); | sendCoinsPage = new SendCoinsDialog(platformStyle, walletModel); | ||||
usedSendingAddressesPage = | usedSendingAddressesPage = | ||||
new AddressBookPage(platformStyle, AddressBookPage::ForEditing, | new AddressBookPage(platformStyle, AddressBookPage::ForEditing, | ||||
AddressBookPage::SendingTab, this); | AddressBookPage::SendingTab, this); | ||||
usedReceivingAddressesPage = | usedReceivingAddressesPage = | ||||
new AddressBookPage(platformStyle, AddressBookPage::ForEditing, | new AddressBookPage(platformStyle, AddressBookPage::ForEditing, | ||||
AddressBookPage::ReceivingTab, this); | AddressBookPage::ReceivingTab, this); | ||||
Show All 23 Lines | connect(exportButton, SIGNAL(clicked()), transactionView, | ||||
SLOT(exportClicked())); | SLOT(exportClicked())); | ||||
// Pass through messages from sendCoinsPage | // Pass through messages from sendCoinsPage | ||||
connect(sendCoinsPage, SIGNAL(message(QString, QString, unsigned int)), | connect(sendCoinsPage, SIGNAL(message(QString, QString, unsigned int)), | ||||
this, SIGNAL(message(QString, QString, unsigned int))); | this, SIGNAL(message(QString, QString, unsigned int))); | ||||
// Pass through messages from transactionView | // Pass through messages from transactionView | ||||
connect(transactionView, SIGNAL(message(QString, QString, unsigned int)), | connect(transactionView, SIGNAL(message(QString, QString, unsigned int)), | ||||
this, SIGNAL(message(QString, QString, unsigned int))); | this, SIGNAL(message(QString, QString, unsigned int))); | ||||
// Set the model properly. | |||||
setWalletModel(walletModel); | |||||
} | } | ||||
WalletView::~WalletView() {} | WalletView::~WalletView() {} | ||||
void WalletView::setBitcoinGUI(BitcoinGUI *gui) { | void WalletView::setBitcoinGUI(BitcoinGUI *gui) { | ||||
if (gui) { | if (gui) { | ||||
// Clicking on a transaction on the overview page simply sends you to | // Clicking on a transaction on the overview page simply sends you to | ||||
// transaction history page | // transaction history page | ||||
▲ Show 20 Lines • Show All 266 Lines • Show Last 20 Lines |