18
18
#include " overviewpage.h"
19
19
#include " askpassphrasedialog.h"
20
20
#include " ui_interface.h"
21
+ #include " guiutil.h"
21
22
22
23
#include < QHBoxLayout>
23
24
#include < QVBoxLayout>
24
25
#include < QAction>
25
- #if QT_VERSION < 0x050000
26
- #include < QDesktopServices>
27
- #else
28
- #include < QStandardPaths>
29
- #endif
30
- #include < QFileDialog>
31
26
#include < QPushButton>
32
27
33
28
WalletView::WalletView (QWidget *parent):
@@ -61,7 +56,7 @@ WalletView::WalletView(QWidget *parent):
61
56
addWidget (receiveCoinsPage);
62
57
addWidget (sendCoinsPage);
63
58
64
- // Clicking on a transaction on the overview page simply sends you to transaction history page
59
+ // Clicking on a transaction on the overview pre-selects the transaction on the transaction history page
65
60
connect (overviewPage, SIGNAL (transactionClicked (QModelIndex)), transactionView, SLOT (focusTransaction (QModelIndex)));
66
61
67
62
// Double-clicking on a transaction on the transaction history page shows details
@@ -82,7 +77,7 @@ void WalletView::setBitcoinGUI(BitcoinGUI *gui)
82
77
{
83
78
if (gui)
84
79
{
85
- // Clicking on a transaction on the overview page sends you to the transactions tab
80
+ // Clicking on a transaction on the overview page simply sends you to transaction history page
86
81
connect (overviewPage, SIGNAL (transactionClicked (QModelIndex)), gui, SLOT (gotoHistoryPage ()));
87
82
88
83
// Receive and report messages
@@ -222,20 +217,20 @@ void WalletView::encryptWallet(bool status)
222
217
223
218
void WalletView::backupWallet ()
224
219
{
225
- # if QT_VERSION < 0x050000
226
- QString saveDir = QDesktopServices::storageLocation (QDesktopServices::DocumentsLocation);
227
- # else
228
- QString saveDir = QStandardPaths::writableLocation (QStandardPaths::DocumentsLocation);
229
- # endif
230
- QString filename = QFileDialog::getSaveFileName ( this , tr ( " Backup Wallet " ), saveDir, tr ( " Wallet Data (*.dat) " )) ;
231
- if (!filename. isEmpty ()) {
232
- if (!walletModel->backupWallet (filename)) {
233
- emit message (tr (" Backup Failed" ), tr (" There was an error trying to save the wallet data to the new location. " ),
234
- CClientUIInterface::MSG_ERROR);
220
+ QString filename = GUIUtil::getSaveFileName ( this ,
221
+ tr ( " Backup Wallet " ), QString (),
222
+ tr ( " Wallet Data (*.dat) " ));
223
+
224
+ if (filename. isEmpty ())
225
+ return ;
226
+
227
+ if (!walletModel->backupWallet (filename)) {
228
+ emit message (tr (" Backup Failed" ), tr (" There was an error trying to save the wallet data to %1. " ). arg (filename ),
229
+ CClientUIInterface::MSG_ERROR);
235
230
}
236
- else
237
- emit message (tr (" Backup Successful" ), tr (" The wallet data was successfully saved to the new location. " ),
238
- CClientUIInterface::MSG_INFORMATION);
231
+ else {
232
+ emit message (tr (" Backup Successful" ), tr (" The wallet data was successfully saved to %1. " ). arg (filename ),
233
+ CClientUIInterface::MSG_INFORMATION);
239
234
}
240
235
}
241
236
0 commit comments