diff options
Diffstat (limited to 'qt-ui/divelistview.cpp')
-rw-r--r-- | qt-ui/divelistview.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/qt-ui/divelistview.cpp b/qt-ui/divelistview.cpp index 19fc51a5d..e64ad217b 100644 --- a/qt-ui/divelistview.cpp +++ b/qt-ui/divelistview.cpp @@ -411,8 +411,10 @@ void DiveListView::contextMenuEvent(QContextMenuEvent *event) popup.addAction(tr("delete dive"), this, SLOT(deleteDive())); if (amount_selected > 1 && consecutive_selected()) popup.addAction(tr("merge selected dives"), this, SLOT(mergeDives())); - if (amount_selected >= 1) + if (amount_selected >= 1) { popup.addAction(tr("save As"), this, SLOT(saveSelectedDivesAs())); + popup.addAction(tr("export As UDDF"), this, SLOT(exportSelectedDivesAsUDDF())); + } // "collapse all" really closes all trips, // "collapse" keeps the trip with the selected dive open QAction * actionTaken = popup.exec(event->globalPos()); @@ -450,3 +452,14 @@ void DiveListView::saveSelectedDivesAs() QByteArray bt = fileName.toLocal8Bit(); save_dives_logic(bt.data(), TRUE); } + +void DiveListView::exportSelectedDivesAsUDDF() +{ + QString filename; + QFileInfo fi(system_default_filename()); + + filename = QFileDialog::getSaveFileName(this, tr("Save File as"), fi.absolutePath(), + tr("UDDF files (*.uddf *.UDDF)")); + if (!filename.isNull() && !filename.isEmpty()) + export_dives_uddf((const char *)filename.toStdString().c_str(), true); +} |