From 0259c62f411353c12b0ddb5816eb851314732aba Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Sat, 26 Oct 2013 19:28:47 +0200 Subject: walletview: make backupWallet() use GUIUtil::getSaveFileName() - this allows removal of several Qt headers and makes use of a standardized function in GUIUtil - adds selected path to the UI output --- src/qt/walletview.cpp | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) (limited to 'src/qt') diff --git a/src/qt/walletview.cpp b/src/qt/walletview.cpp index 982041c64a..48695a1418 100644 --- a/src/qt/walletview.cpp +++ b/src/qt/walletview.cpp @@ -18,16 +18,11 @@ #include "overviewpage.h" #include "askpassphrasedialog.h" #include "ui_interface.h" +#include "guiutil.h" #include #include #include -#if QT_VERSION < 0x050000 -#include -#else -#include -#endif -#include #include WalletView::WalletView(QWidget *parent): @@ -222,20 +217,20 @@ 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()) { - if (!walletModel->backupWallet(filename)) { - emit message(tr("Backup Failed"), tr("There was an error trying to save the wallet data to the new location."), - CClientUIInterface::MSG_ERROR); + 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 %1.").arg(filename), + CClientUIInterface::MSG_ERROR); } - else - emit message(tr("Backup Successful"), tr("The wallet data was successfully saved to the new location."), - CClientUIInterface::MSG_INFORMATION); + else { + emit message(tr("Backup Successful"), tr("The wallet data was successfully saved to %1.").arg(filename), + CClientUIInterface::MSG_INFORMATION); } } -- cgit v1.2.3 From d127964a974ad83d01e80ecd82a666b90ffb6793 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Sat, 26 Oct 2013 19:31:42 +0200 Subject: walletview: clarify 2 comments --- src/qt/walletview.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/qt') diff --git a/src/qt/walletview.cpp b/src/qt/walletview.cpp index 48695a1418..5622fcfb17 100644 --- a/src/qt/walletview.cpp +++ b/src/qt/walletview.cpp @@ -56,7 +56,7 @@ WalletView::WalletView(QWidget *parent): addWidget(receiveCoinsPage); addWidget(sendCoinsPage); - // Clicking on a transaction on the overview page simply sends you to transaction history page + // Clicking on a transaction on the overview pre-selects the transaction on the transaction history page connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex))); // Double-clicking on a transaction on the transaction history page shows details @@ -77,7 +77,7 @@ void WalletView::setBitcoinGUI(BitcoinGUI *gui) { if (gui) { - // Clicking on a transaction on the overview page sends you to the transactions tab + // Clicking on a transaction on the overview page simply sends you to transaction history page connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), gui, SLOT(gotoHistoryPage())); // Receive and report messages -- cgit v1.2.3