Changeset View
Changeset View
Standalone View
Standalone View
src/qt/walletmodel.cpp
Show First 20 Lines • Show All 332 Lines • ▼ Show 20 Lines | |||||
bool WalletModel::changePassphrase(const SecureString &oldPass, | bool WalletModel::changePassphrase(const SecureString &oldPass, | ||||
const SecureString &newPass) { | const SecureString &newPass) { | ||||
// Make sure wallet is locked before attempting pass change | // Make sure wallet is locked before attempting pass change | ||||
m_wallet->lock(); | m_wallet->lock(); | ||||
return m_wallet->changeWalletPassphrase(oldPass, newPass); | return m_wallet->changeWalletPassphrase(oldPass, newPass); | ||||
} | } | ||||
// Handlers for core signals | // Handlers for core signals | ||||
static void NotifyUnload(WalletModel *walletModel) { | |||||
qDebug() << "NotifyUnload"; | |||||
QMetaObject::invokeMethod(walletModel, "unload", Qt::QueuedConnection); | |||||
} | |||||
static void NotifyKeyStoreStatusChanged(WalletModel *walletmodel) { | static void NotifyKeyStoreStatusChanged(WalletModel *walletmodel) { | ||||
qDebug() << "NotifyKeyStoreStatusChanged"; | qDebug() << "NotifyKeyStoreStatusChanged"; | ||||
QMetaObject::invokeMethod(walletmodel, "updateStatus", | QMetaObject::invokeMethod(walletmodel, "updateStatus", | ||||
Qt::QueuedConnection); | Qt::QueuedConnection); | ||||
} | } | ||||
static void NotifyAddressBookChanged(WalletModel *walletmodel, | static void NotifyAddressBookChanged(WalletModel *walletmodel, | ||||
const CTxDestination &address, | const CTxDestination &address, | ||||
Show All 35 Lines | static void NotifyWatchonlyChanged(WalletModel *walletmodel, | ||||
bool fHaveWatchonly) { | bool fHaveWatchonly) { | ||||
QMetaObject::invokeMethod(walletmodel, "updateWatchOnlyFlag", | QMetaObject::invokeMethod(walletmodel, "updateWatchOnlyFlag", | ||||
Qt::QueuedConnection, | Qt::QueuedConnection, | ||||
Q_ARG(bool, fHaveWatchonly)); | Q_ARG(bool, fHaveWatchonly)); | ||||
} | } | ||||
void WalletModel::subscribeToCoreSignals() { | void WalletModel::subscribeToCoreSignals() { | ||||
// Connect signals to wallet | // Connect signals to wallet | ||||
m_handler_unload = m_wallet->handleUnload(std::bind(&NotifyUnload, this)); | |||||
nakihito: We migrated from boost::bind to std::bind in D4133. | |||||
m_handler_status_changed = m_wallet->handleStatusChanged( | m_handler_status_changed = m_wallet->handleStatusChanged( | ||||
std::bind(&NotifyKeyStoreStatusChanged, this)); | std::bind(&NotifyKeyStoreStatusChanged, this)); | ||||
m_handler_address_book_changed = m_wallet->handleAddressBookChanged( | m_handler_address_book_changed = m_wallet->handleAddressBookChanged( | ||||
std::bind(NotifyAddressBookChanged, this, std::placeholders::_1, | std::bind(NotifyAddressBookChanged, this, std::placeholders::_1, | ||||
std::placeholders::_2, std::placeholders::_3, | std::placeholders::_2, std::placeholders::_3, | ||||
std::placeholders::_4, std::placeholders::_5)); | std::placeholders::_4, std::placeholders::_5)); | ||||
m_handler_transaction_changed = m_wallet->handleTransactionChanged( | m_handler_transaction_changed = m_wallet->handleTransactionChanged( | ||||
std::bind(NotifyTransactionChanged, this, std::placeholders::_1, | std::bind(NotifyTransactionChanged, this, std::placeholders::_1, | ||||
std::placeholders::_2)); | std::placeholders::_2)); | ||||
m_handler_show_progress = m_wallet->handleShowProgress(std::bind( | m_handler_show_progress = m_wallet->handleShowProgress(std::bind( | ||||
ShowProgress, this, std::placeholders::_1, std::placeholders::_2)); | ShowProgress, this, std::placeholders::_1, std::placeholders::_2)); | ||||
m_handler_watch_only_changed = m_wallet->handleWatchOnlyChanged( | m_handler_watch_only_changed = m_wallet->handleWatchOnlyChanged( | ||||
std::bind(NotifyWatchonlyChanged, this, std::placeholders::_1)); | std::bind(NotifyWatchonlyChanged, this, std::placeholders::_1)); | ||||
} | } | ||||
void WalletModel::unsubscribeFromCoreSignals() { | void WalletModel::unsubscribeFromCoreSignals() { | ||||
// Disconnect signals from wallet | // Disconnect signals from wallet | ||||
m_handler_unload->disconnect(); | |||||
m_handler_status_changed->disconnect(); | m_handler_status_changed->disconnect(); | ||||
m_handler_address_book_changed->disconnect(); | m_handler_address_book_changed->disconnect(); | ||||
m_handler_transaction_changed->disconnect(); | m_handler_transaction_changed->disconnect(); | ||||
m_handler_show_progress->disconnect(); | m_handler_show_progress->disconnect(); | ||||
m_handler_watch_only_changed->disconnect(); | m_handler_watch_only_changed->disconnect(); | ||||
} | } | ||||
// WalletModel::UnlockContext implementation | // WalletModel::UnlockContext implementation | ||||
▲ Show 20 Lines • Show All 64 Lines • Show Last 20 Lines |
We migrated from boost::bind to std::bind in D4133.