|
|
|
@ -18,16 +18,11 @@
@@ -18,16 +18,11 @@
|
|
|
|
|
#include "overviewpage.h" |
|
|
|
|
#include "askpassphrasedialog.h" |
|
|
|
|
#include "ui_interface.h" |
|
|
|
|
#include "guiutil.h" |
|
|
|
|
|
|
|
|
|
#include <QHBoxLayout> |
|
|
|
|
#include <QVBoxLayout> |
|
|
|
|
#include <QAction> |
|
|
|
|
#if QT_VERSION < 0x050000 |
|
|
|
|
#include <QDesktopServices> |
|
|
|
|
#else |
|
|
|
|
#include <QStandardPaths> |
|
|
|
|
#endif |
|
|
|
|
#include <QFileDialog> |
|
|
|
|
#include <QPushButton> |
|
|
|
|
|
|
|
|
|
WalletView::WalletView(QWidget *parent): |
|
|
|
@ -222,19 +217,19 @@ void WalletView::encryptWallet(bool status)
@@ -222,19 +217,19 @@ void WalletView::encryptWallet(bool status)
|
|
|
|
|
|
|
|
|
|
void WalletView::backupWallet() |
|
|
|
|
{ |
|
|
|
|
#if QT_VERSION < 0x050000 |
|
|
|
|
QString saveDir = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation); |
|
|
|
|
#else |
|
|
|
|
QString saveDir = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation); |
|
|
|
|
#endif |
|
|
|
|
QString filename = QFileDialog::getSaveFileName(this, tr("Backup Wallet"), saveDir, tr("Wallet Data (*.dat)")); |
|
|
|
|
if (!filename.isEmpty()) { |
|
|
|
|
QString filename = GUIUtil::getSaveFileName(this, |
|
|
|
|
tr("Backup Wallet"), QString(), |
|
|
|
|
tr("Wallet Data (*.dat)")); |
|
|
|
|
|
|
|
|
|
if (filename.isEmpty()) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
if (!walletModel->backupWallet(filename)) { |
|
|
|
|
emit message(tr("Backup Failed"), tr("There was an error trying to save the wallet data to the new location."), |
|
|
|
|
emit message(tr("Backup Failed"), tr("There was an error trying to save the wallet data to %1.").arg(filename), |
|
|
|
|
CClientUIInterface::MSG_ERROR); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
emit message(tr("Backup Successful"), tr("The wallet data was successfully saved to the new location."), |
|
|
|
|
else { |
|
|
|
|
emit message(tr("Backup Successful"), tr("The wallet data was successfully saved to %1.").arg(filename), |
|
|
|
|
CClientUIInterface::MSG_INFORMATION); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|