|
|
@ -46,6 +46,8 @@ |
|
|
|
#include <QStackedWidget> |
|
|
|
#include <QStackedWidget> |
|
|
|
#include <QDateTime> |
|
|
|
#include <QDateTime> |
|
|
|
#include <QMovie> |
|
|
|
#include <QMovie> |
|
|
|
|
|
|
|
#include <QFileDialog> |
|
|
|
|
|
|
|
#include <QDesktopServices> |
|
|
|
|
|
|
|
|
|
|
|
#include <QDragEnterEvent> |
|
|
|
#include <QDragEnterEvent> |
|
|
|
#include <QUrl> |
|
|
|
#include <QUrl> |
|
|
@ -243,6 +245,8 @@ void BitcoinGUI::createActions() |
|
|
|
encryptWalletAction = new QAction(QIcon(":/icons/lock_closed"), tr("&Encrypt Wallet"), this); |
|
|
|
encryptWalletAction = new QAction(QIcon(":/icons/lock_closed"), tr("&Encrypt Wallet"), this); |
|
|
|
encryptWalletAction->setToolTip(tr("Encrypt or decrypt wallet")); |
|
|
|
encryptWalletAction->setToolTip(tr("Encrypt or decrypt wallet")); |
|
|
|
encryptWalletAction->setCheckable(true); |
|
|
|
encryptWalletAction->setCheckable(true); |
|
|
|
|
|
|
|
backupWalletAction = new QAction(QIcon(":/icons/filesave"), tr("&Backup Wallet"), this); |
|
|
|
|
|
|
|
backupWalletAction->setToolTip(tr("Backup wallet to another location")); |
|
|
|
changePassphraseAction = new QAction(QIcon(":/icons/key"), tr("&Change Passphrase"), this); |
|
|
|
changePassphraseAction = new QAction(QIcon(":/icons/key"), tr("&Change Passphrase"), this); |
|
|
|
changePassphraseAction->setToolTip(tr("Change the passphrase used for wallet encryption")); |
|
|
|
changePassphraseAction->setToolTip(tr("Change the passphrase used for wallet encryption")); |
|
|
|
|
|
|
|
|
|
|
@ -252,6 +256,7 @@ void BitcoinGUI::createActions() |
|
|
|
connect(aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt())); |
|
|
|
connect(aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt())); |
|
|
|
connect(openBitcoinAction, SIGNAL(triggered()), this, SLOT(showNormal())); |
|
|
|
connect(openBitcoinAction, SIGNAL(triggered()), this, SLOT(showNormal())); |
|
|
|
connect(encryptWalletAction, SIGNAL(triggered(bool)), this, SLOT(encryptWallet(bool))); |
|
|
|
connect(encryptWalletAction, SIGNAL(triggered(bool)), this, SLOT(encryptWallet(bool))); |
|
|
|
|
|
|
|
connect(backupWalletAction, SIGNAL(triggered()), this, SLOT(backupWallet())); |
|
|
|
connect(changePassphraseAction, SIGNAL(triggered()), this, SLOT(changePassphrase())); |
|
|
|
connect(changePassphraseAction, SIGNAL(triggered()), this, SLOT(changePassphrase())); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -277,6 +282,7 @@ void BitcoinGUI::createMenuBar() |
|
|
|
QMenu *settings = appMenuBar->addMenu(tr("&Settings")); |
|
|
|
QMenu *settings = appMenuBar->addMenu(tr("&Settings")); |
|
|
|
settings->addAction(encryptWalletAction); |
|
|
|
settings->addAction(encryptWalletAction); |
|
|
|
settings->addAction(changePassphraseAction); |
|
|
|
settings->addAction(changePassphraseAction); |
|
|
|
|
|
|
|
settings->addAction(backupWalletAction); |
|
|
|
settings->addSeparator(); |
|
|
|
settings->addSeparator(); |
|
|
|
settings->addAction(optionsAction); |
|
|
|
settings->addAction(optionsAction); |
|
|
|
|
|
|
|
|
|
|
@ -778,6 +784,17 @@ void BitcoinGUI::encryptWallet(bool status) |
|
|
|
setEncryptionStatus(walletModel->getEncryptionStatus()); |
|
|
|
setEncryptionStatus(walletModel->getEncryptionStatus()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void BitcoinGUI::backupWallet() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
QString saveDir = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation); |
|
|
|
|
|
|
|
QString filename = QFileDialog::getSaveFileName(this, tr("Backup Wallet"), saveDir, tr("Wallet Data (*.dat)")); |
|
|
|
|
|
|
|
if(!filename.isEmpty()) { |
|
|
|
|
|
|
|
if(!walletModel->backupWallet(filename)) { |
|
|
|
|
|
|
|
QMessageBox::warning(this, tr("Backup Failed"), tr("There was an error trying to save the wallet data to the new location.")); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void BitcoinGUI::changePassphrase() |
|
|
|
void BitcoinGUI::changePassphrase() |
|
|
|
{ |
|
|
|
{ |
|
|
|
AskPassphraseDialog dlg(AskPassphraseDialog::ChangePass, this); |
|
|
|
AskPassphraseDialog dlg(AskPassphraseDialog::ChangePass, this); |
|
|
|