diff options
Diffstat (limited to 'qt-ui/divelistview.cpp')
-rw-r--r-- | qt-ui/divelistview.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/qt-ui/divelistview.cpp b/qt-ui/divelistview.cpp index cbabdcffe..28ed09f2c 100644 --- a/qt-ui/divelistview.cpp +++ b/qt-ui/divelistview.cpp @@ -761,6 +761,7 @@ void DiveListView::contextMenuEvent(QContextMenuEvent *event) if (amount_selected >= 1) { popup.addAction(tr("save As"), this, SLOT(saveSelectedDivesAs())); popup.addAction(tr("export As UDDF"), this, SLOT(exportSelectedDivesAsUDDF())); + popup.addAction(tr("export As CSV"), this, SLOT(exportSelectedDivesAsCSV())); popup.addAction(tr("shift times"), this, SLOT(shiftTimes())); popup.addAction(tr("load images"), this, SLOT(loadImages())); } @@ -816,6 +817,17 @@ void DiveListView::exportSelectedDivesAsUDDF() export_dives_xslt(filename.toUtf8(), true, "uddf-export.xslt"); } +void DiveListView::exportSelectedDivesAsCSV() +{ + QString filename; + QFileInfo fi(system_default_filename()); + + filename = QFileDialog::getSaveFileName(this, tr("Export CSV File as"), fi.absolutePath(), + tr("CSV files (*.csv *.CSV)")); + if (!filename.isNull() && !filename.isEmpty()) + export_dives_xslt(filename.toUtf8(), true, "xml2csv.xslt"); +} + void DiveListView::shiftTimes() { |