11
11
#include " editaddressdialog.h"
12
12
#include " optionsmodel.h"
13
13
#include " guiutil.h"
14
+ #include " ui_interface.h"
14
15
15
16
#include < QScrollBar>
16
17
#include < QComboBox>
20
21
#include < QLineEdit>
21
22
#include < QTableView>
22
23
#include < QHeaderView>
23
- #include < QMessageBox>
24
24
#include < QPoint>
25
25
#include < QMenu>
26
26
#include < QLabel>
@@ -266,12 +266,12 @@ void TransactionView::changedAmount(const QString &amount)
266
266
void TransactionView::exportClicked ()
267
267
{
268
268
// CSV is currently the only supported format
269
- QString filename = GUIUtil::getSaveFileName (
270
- this ,
271
- tr (" Export Transaction Data" ), QString (),
272
- tr (" Comma separated file (*.csv)" ));
269
+ QString filename = GUIUtil::getSaveFileName (this ,
270
+ tr (" Export Transaction History" ), QString (),
271
+ tr (" Comma separated file (*.csv)" ));
273
272
274
- if (filename.isNull ()) return ;
273
+ if (filename.isNull ())
274
+ return ;
275
275
276
276
CSVModelWriter writer (filename);
277
277
@@ -285,10 +285,13 @@ void TransactionView::exportClicked()
285
285
writer.addColumn (tr (" Amount" ), 0 , TransactionTableModel::FormattedAmountRole);
286
286
writer.addColumn (tr (" ID" ), 0 , TransactionTableModel::TxIDRole);
287
287
288
- if (!writer.write ())
289
- {
290
- QMessageBox::critical (this , tr (" Error exporting" ), tr (" Could not write to file %1." ).arg (filename),
291
- QMessageBox::Abort, QMessageBox::Abort);
288
+ if (!writer.write ()) {
289
+ emit message (tr (" Exporting Failed" ), tr (" There was an error trying to save the transaction history to %1." ).arg (filename),
290
+ CClientUIInterface::MSG_ERROR);
291
+ }
292
+ else {
293
+ emit message (tr (" Exporting Successful" ), tr (" The transaction history was successfully saved to %1." ).arg (filename),
294
+ CClientUIInterface::MSG_INFORMATION);
292
295
}
293
296
}
294
297
0 commit comments