aboutsummaryrefslogtreecommitdiff
path: root/src/qt/walletview.cpp
diff options
context:
space:
mode:
authorJoão Barbosa <joao.paulo.barbosa@gmail.com>2018-06-24 16:18:22 +0100
committerJoão Barbosa <joao.paulo.barbosa@gmail.com>2018-08-21 09:43:54 +0100
commitf78558f1e39198779bdb17e2b0e256fb99ad4b28 (patch)
treee70cf07bb8f64df2f4b65a4999b8bafa435d9d51 /src/qt/walletview.cpp
parent8aa9badf5ea3ea98980f50d924e88e46c4d5ee38 (diff)
downloadbitcoin-f78558f1e39198779bdb17e2b0e256fb99ad4b28.tar.xz
qt: Use new Qt5 connect syntax
Diffstat (limited to 'src/qt/walletview.cpp')
-rw-r--r--src/qt/walletview.cpp41
1 files changed, 20 insertions, 21 deletions
diff --git a/src/qt/walletview.cpp b/src/qt/walletview.cpp
index 9af29b5d60..053e951921 100644
--- a/src/qt/walletview.cpp
+++ b/src/qt/walletview.cpp
@@ -66,22 +66,20 @@ WalletView::WalletView(const PlatformStyle *_platformStyle, QWidget *parent):
addWidget(sendCoinsPage);
// Clicking on a transaction on the overview pre-selects the transaction on the transaction history page
- connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex)));
- connect(overviewPage, SIGNAL(outOfSyncWarningClicked()), this, SLOT(requestedSyncWarningInfo()));
+ connect(overviewPage, &OverviewPage::transactionClicked, transactionView, static_cast<void (TransactionView::*)(const QModelIndex&)>(&TransactionView::focusTransaction));
- // Highlight transaction after send
- connect(sendCoinsPage, SIGNAL(coinsSent(uint256)), transactionView, SLOT(focusTransaction(uint256)));
+ connect(overviewPage, &OverviewPage::outOfSyncWarningClicked, this, &WalletView::requestedSyncWarningInfo);
- // Double-clicking on a transaction on the transaction history page shows details
- connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails()));
+ // Highlight transaction after send
+ connect(sendCoinsPage, &SendCoinsDialog::coinsSent, transactionView, static_cast<void (TransactionView::*)(const uint256&)>(&TransactionView::focusTransaction));
// Clicking on "Export" allows to export the transaction list
- connect(exportButton, SIGNAL(clicked()), transactionView, SLOT(exportClicked()));
+ connect(exportButton, &QPushButton::clicked, transactionView, &TransactionView::exportClicked);
// Pass through messages from sendCoinsPage
- connect(sendCoinsPage, SIGNAL(message(QString,QString,unsigned int)), this, SIGNAL(message(QString,QString,unsigned int)));
+ connect(sendCoinsPage, &SendCoinsDialog::message, this, &WalletView::message);
// Pass through messages from transactionView
- connect(transactionView, SIGNAL(message(QString,QString,unsigned int)), this, SIGNAL(message(QString,QString,unsigned int)));
+ connect(transactionView, &TransactionView::message, this, &WalletView::message);
}
WalletView::~WalletView()
@@ -93,22 +91,24 @@ void WalletView::setBitcoinGUI(BitcoinGUI *gui)
if (gui)
{
// Clicking on a transaction on the overview page simply sends you to transaction history page
- connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), gui, SLOT(gotoHistoryPage()));
+ connect(overviewPage, &OverviewPage::transactionClicked, gui, &BitcoinGUI::gotoHistoryPage);
// Navigate to transaction history page after send
- connect(sendCoinsPage, SIGNAL(coinsSent(uint256)), gui, SLOT(gotoHistoryPage()));
+ connect(sendCoinsPage, &SendCoinsDialog::coinsSent, gui, &BitcoinGUI::gotoHistoryPage);
// Receive and report messages
- connect(this, SIGNAL(message(QString,QString,unsigned int)), gui, SLOT(message(QString,QString,unsigned int)));
+ connect(this, &WalletView::message, [gui](const QString &title, const QString &message, unsigned int style) {
+ gui->message(title, message, style);
+ });
// Pass through encryption status changed signals
- connect(this, SIGNAL(encryptionStatusChanged()), gui, SLOT(updateWalletStatus()));
+ connect(this, &WalletView::encryptionStatusChanged, gui, &BitcoinGUI::updateWalletStatus);
// Pass through transaction notifications
- connect(this, SIGNAL(incomingTransaction(QString,int,CAmount,QString,QString,QString,QString)), gui, SLOT(incomingTransaction(QString,int,CAmount,QString,QString,QString,QString)));
+ connect(this, &WalletView::incomingTransaction, gui, &BitcoinGUI::incomingTransaction);
// Connect HD enabled state signal
- connect(this, SIGNAL(hdEnabledStatusChanged()), gui, SLOT(updateWalletStatus()));
+ connect(this, &WalletView::hdEnabledStatusChanged, gui, &BitcoinGUI::updateWalletStatus);
}
}
@@ -135,24 +135,23 @@ void WalletView::setWalletModel(WalletModel *_walletModel)
if (_walletModel)
{
// Receive and pass through messages from wallet model
- connect(_walletModel, SIGNAL(message(QString,QString,unsigned int)), this, SIGNAL(message(QString,QString,unsigned int)));
+ connect(_walletModel, &WalletModel::message, this, &WalletView::message);
// Handle changes in encryption status
- connect(_walletModel, SIGNAL(encryptionStatusChanged()), this, SIGNAL(encryptionStatusChanged()));
+ connect(_walletModel, &WalletModel::encryptionStatusChanged, this, &WalletView::encryptionStatusChanged);
updateEncryptionStatus();
// update HD status
Q_EMIT hdEnabledStatusChanged();
// Balloon pop-up for new transaction
- connect(_walletModel->getTransactionTableModel(), SIGNAL(rowsInserted(QModelIndex,int,int)),
- this, SLOT(processNewTransaction(QModelIndex,int,int)));
+ connect(_walletModel->getTransactionTableModel(), &TransactionTableModel::rowsInserted, this, &WalletView::processNewTransaction);
// Ask for passphrase if needed
- connect(_walletModel, SIGNAL(requireUnlock()), this, SLOT(unlockWallet()));
+ connect(_walletModel, &WalletModel::requireUnlock, this, &WalletView::unlockWallet);
// Show progress dialog
- connect(_walletModel, SIGNAL(showProgress(QString,int)), this, SLOT(showProgress(QString,int)));
+ connect(_walletModel, &WalletModel::showProgress, this, &WalletView::showProgress);
}
}