diff options
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/divelistview.cpp | 15 | ||||
-rw-r--r-- | qt-ui/divelistview.h | 1 | ||||
-rw-r--r-- | qt-ui/mainwindow.cpp | 8 |
3 files changed, 22 insertions, 2 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); +} diff --git a/qt-ui/divelistview.h b/qt-ui/divelistview.h index 9e0713b49..c1222abdf 100644 --- a/qt-ui/divelistview.h +++ b/qt-ui/divelistview.h @@ -41,6 +41,7 @@ public slots: void mergeTripBelow(); void mergeDives(); void saveSelectedDivesAs(); + void exportSelectedDivesAsUDDF(); signals: void currentDiveChanged(int divenr); diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 72dc1a00e..69cf363c3 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -189,7 +189,13 @@ void MainWindow::on_actionImport_triggered() void MainWindow::on_actionExportUDDF_triggered() { - qDebug("actionExportUDDF"); + 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(), false); } void MainWindow::on_actionPrint_triggered() |