Changeset View
Changeset View
Standalone View
Standalone View
src/qt/walletview.cpp
// Copyright (c) 2011-2016 The Bitcoin Core developers | // Copyright (c) 2011-2016 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#include "walletview.h" | #include "walletview.h" | ||||
#include "addressbookpage.h" | #include "addressbookpage.h" | ||||
#include "askpassphrasedialog.h" | #include "askpassphrasedialog.h" | ||||
#include "bitcoingui.h" | #include "bitcoingui.h" | ||||
#include "clientmodel.h" | #include "clientmodel.h" | ||||
#include "encryptwalletadvanceddialog.h" | |||||
#include "guiutil.h" | #include "guiutil.h" | ||||
#include "optionsmodel.h" | #include "optionsmodel.h" | ||||
#include "overviewpage.h" | #include "overviewpage.h" | ||||
#include "platformstyle.h" | #include "platformstyle.h" | ||||
#include "receivecoinsdialog.h" | #include "receivecoinsdialog.h" | ||||
#include "sendcoinsdialog.h" | #include "sendcoinsdialog.h" | ||||
#include "signverifymessagedialog.h" | #include "signverifymessagedialog.h" | ||||
#include "transactiontablemodel.h" | #include "transactiontablemodel.h" | ||||
▲ Show 20 Lines • Show All 85 Lines • ▼ Show 20 Lines | if (gui) { | ||||
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(int)), gui, | ||||
SLOT(setEncryptionStatus(int))); | SLOT(setEncryptionStatus(int))); | ||||
// 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)), | ||||
gui, SLOT(incomingTransaction(QString, int, Amount, QString, | gui, | ||||
QString, QString))); | SLOT(incomingTransaction(QString, int, Amount, QString, QString, | ||||
QString))); | |||||
// Connect HD enabled state signal | // Connect HD enabled state signal | ||||
connect(this, SIGNAL(hdEnabledStatusChanged(int)), gui, | connect(this, SIGNAL(hdEnabledStatusChanged(int)), gui, | ||||
SLOT(setHDStatus(int))); | SLOT(setHDStatus(int))); | ||||
} | } | ||||
} | } | ||||
void WalletView::setClientModel(ClientModel *_clientModel) { | void WalletView::setClientModel(ClientModel *_clientModel) { | ||||
▲ Show 20 Lines • Show All 129 Lines • ▼ Show 20 Lines | AskPassphraseDialog dlg(status ? AskPassphraseDialog::Encrypt | ||||
: AskPassphraseDialog::Decrypt, | : AskPassphraseDialog::Decrypt, | ||||
this); | this); | ||||
dlg.setModel(walletModel); | dlg.setModel(walletModel); | ||||
dlg.exec(); | dlg.exec(); | ||||
updateEncryptionStatus(); | updateEncryptionStatus(); | ||||
} | } | ||||
void WalletView::encryptWalletAdvanced(bool status) { | |||||
if (!walletModel) return; | |||||
EncryptWalletAdvancedDialog dlg(this); | |||||
dlg.setModel(walletModel); | |||||
dlg.exec(); | |||||
updateEncryptionStatus(); | |||||
} | |||||
void WalletView::backupWallet() { | void WalletView::backupWallet() { | ||||
QString filename = | QString filename = | ||||
GUIUtil::getSaveFileName(this, tr("Backup Wallet"), QString(), | GUIUtil::getSaveFileName(this, tr("Backup Wallet"), QString(), | ||||
tr("Wallet Data (*.dat)"), nullptr); | tr("Wallet Data (*.dat)"), nullptr); | ||||
if (filename.isEmpty()) return; | if (filename.isEmpty()) return; | ||||
if (!walletModel->backupWallet(filename)) { | if (!walletModel->backupWallet(filename)) { | ||||
▲ Show 20 Lines • Show All 65 Lines • Show Last 20 Lines |