mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
qt: Use new Qt5 connect syntax
This commit is contained in:
@@ -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));
|
||||
|
||||
connect(overviewPage, &OverviewPage::outOfSyncWarningClicked, this, &WalletView::requestedSyncWarningInfo);
|
||||
|
||||
// Highlight transaction after send
|
||||
connect(sendCoinsPage, SIGNAL(coinsSent(uint256)), transactionView, SLOT(focusTransaction(uint256)));
|
||||
|
||||
// Double-clicking on a transaction on the transaction history page shows details
|
||||
connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails()));
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user