Changeset View
Changeset View
Standalone View
Standalone View
src/qt/walletview.cpp
Show First 20 Lines • Show All 107 Lines • ▼ Show 20 Lines | if (gui) { | ||||
connect(sendCoinsPage, SIGNAL(coinsSent(uint256)), gui, | connect(sendCoinsPage, SIGNAL(coinsSent(uint256)), gui, | ||||
SLOT(gotoHistoryPage())); | SLOT(gotoHistoryPage())); | ||||
// Receive and report messages | // Receive and report messages | ||||
connect(this, SIGNAL(message(QString, QString, unsigned int)), gui, | connect(this, SIGNAL(message(QString, QString, unsigned int)), gui, | ||||
SLOT(message(QString, QString, unsigned int))); | SLOT(message(QString, QString, unsigned int))); | ||||
// Pass through encryption status changed signals | // Pass through encryption status changed signals | ||||
connect(this, SIGNAL(encryptionStatusChanged(int)), gui, | connect(this, SIGNAL(encryptionStatusChanged()), gui, | ||||
SLOT(setEncryptionStatus(int))); | SLOT(updateWalletStatus())); | ||||
// Pass through transaction notifications | // Pass through transaction notifications | ||||
connect(this, SIGNAL(incomingTransaction(QString, int, Amount, QString, | connect(this, SIGNAL(incomingTransaction(QString, int, Amount, QString, | ||||
QString, QString)), | QString, QString, QString)), | ||||
gui, SLOT(incomingTransaction(QString, int, Amount, QString, | gui, SLOT(incomingTransaction(QString, int, Amount, QString, | ||||
QString, QString))); | QString, QString, QString))); | ||||
// Connect HD enabled state signal | // Connect HD enabled state signal | ||||
connect(this, SIGNAL(hdEnabledStatusChanged(int)), gui, | connect(this, SIGNAL(hdEnabledStatusChanged()), gui, | ||||
SLOT(setHDStatus(int))); | SLOT(updateWalletStatus())); | ||||
} | } | ||||
} | } | ||||
void WalletView::setClientModel(ClientModel *_clientModel) { | void WalletView::setClientModel(ClientModel *_clientModel) { | ||||
this->clientModel = _clientModel; | this->clientModel = _clientModel; | ||||
overviewPage->setClientModel(_clientModel); | overviewPage->setClientModel(_clientModel); | ||||
sendCoinsPage->setClientModel(_clientModel); | sendCoinsPage->setClientModel(_clientModel); | ||||
Show All 11 Lines | void WalletView::setWalletModel(WalletModel *_walletModel) { | ||||
usedSendingAddressesPage->setModel(_walletModel->getAddressTableModel()); | usedSendingAddressesPage->setModel(_walletModel->getAddressTableModel()); | ||||
if (_walletModel) { | if (_walletModel) { | ||||
// Receive and pass through messages from wallet model | // Receive and pass through messages from wallet model | ||||
connect(_walletModel, SIGNAL(message(QString, QString, unsigned int)), | connect(_walletModel, SIGNAL(message(QString, QString, unsigned int)), | ||||
this, SIGNAL(message(QString, QString, unsigned int))); | this, SIGNAL(message(QString, QString, unsigned int))); | ||||
// Handle changes in encryption status | // Handle changes in encryption status | ||||
connect(_walletModel, SIGNAL(encryptionStatusChanged(int)), this, | connect(_walletModel, SIGNAL(encryptionStatusChanged()), this, | ||||
SIGNAL(encryptionStatusChanged(int))); | SIGNAL(encryptionStatusChanged())); | ||||
updateEncryptionStatus(); | updateEncryptionStatus(); | ||||
// update HD status | // update HD status | ||||
Q_EMIT hdEnabledStatusChanged(_walletModel->hdEnabled()); | Q_EMIT hdEnabledStatusChanged(); | ||||
// Balloon pop-up for new transaction | // Balloon pop-up for new transaction | ||||
connect(_walletModel->getTransactionTableModel(), | connect(_walletModel->getTransactionTableModel(), | ||||
SIGNAL(rowsInserted(QModelIndex, int, int)), this, | SIGNAL(rowsInserted(QModelIndex, int, int)), this, | ||||
SLOT(processNewTransaction(QModelIndex, int, int))); | SLOT(processNewTransaction(QModelIndex, int, int))); | ||||
// Ask for passphrase if needed | // Ask for passphrase if needed | ||||
connect(_walletModel, SIGNAL(requireUnlock()), this, | connect(_walletModel, SIGNAL(requireUnlock()), this, | ||||
Show All 29 Lines | void WalletView::processNewTransaction(const QModelIndex &parent, int start, | ||||
QModelIndex index = ttm->index(start, 0, parent); | QModelIndex index = ttm->index(start, 0, parent); | ||||
QString address = | QString address = | ||||
ttm->data(index, TransactionTableModel::AddressRole).toString(); | ttm->data(index, TransactionTableModel::AddressRole).toString(); | ||||
QString label = | QString label = | ||||
ttm->data(index, TransactionTableModel::LabelRole).toString(); | ttm->data(index, TransactionTableModel::LabelRole).toString(); | ||||
Q_EMIT incomingTransaction(date, | Q_EMIT incomingTransaction(date, | ||||
walletModel->getOptionsModel()->getDisplayUnit(), | walletModel->getOptionsModel()->getDisplayUnit(), | ||||
int64_t(amount) * SATOSHI, type, address, label); | int64_t(amount) * SATOSHI, type, address, label, | ||||
walletModel->getWalletName()); | |||||
} | } | ||||
void WalletView::gotoOverviewPage() { | void WalletView::gotoOverviewPage() { | ||||
setCurrentWidget(overviewPage); | setCurrentWidget(overviewPage); | ||||
} | } | ||||
void WalletView::gotoHistoryPage() { | void WalletView::gotoHistoryPage() { | ||||
setCurrentWidget(transactionsPage); | setCurrentWidget(transactionsPage); | ||||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | bool WalletView::handlePaymentRequest(const SendCoinsRecipient &recipient) { | ||||
return sendCoinsPage->handlePaymentRequest(recipient); | return sendCoinsPage->handlePaymentRequest(recipient); | ||||
} | } | ||||
void WalletView::showOutOfSyncWarning(bool fShow) { | void WalletView::showOutOfSyncWarning(bool fShow) { | ||||
overviewPage->showOutOfSyncWarning(fShow); | overviewPage->showOutOfSyncWarning(fShow); | ||||
} | } | ||||
void WalletView::updateEncryptionStatus() { | void WalletView::updateEncryptionStatus() { | ||||
Q_EMIT encryptionStatusChanged(walletModel->getEncryptionStatus()); | Q_EMIT encryptionStatusChanged(); | ||||
} | } | ||||
void WalletView::encryptWallet(bool status) { | void WalletView::encryptWallet(bool status) { | ||||
if (!walletModel) { | if (!walletModel) { | ||||
return; | return; | ||||
} | } | ||||
AskPassphraseDialog dlg(status ? AskPassphraseDialog::Encrypt | AskPassphraseDialog dlg(status ? AskPassphraseDialog::Encrypt | ||||
▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines |