diff options
author | Miika Turkia <miika.turkia@gmail.com> | 2014-05-20 19:33:32 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-05-21 03:31:43 +0900 |
commit | 7dc642860def420f85ae25548ddfa674e14636d1 (patch) | |
tree | 65f58d09ec8b5293550c124286fecf606bd23e73 /qt-ui/divelistview.cpp | |
parent | 0b6cbe0f79d7707297211850963323eb77d21c20 (diff) | |
download | subsurface-7dc642860def420f85ae25548ddfa674e14636d1.tar.gz |
Implementing export dialog
As our menus are getting many export entries, it is better to create a
single export dialog where user is able to select the export type and
whether to export selected dives or all of them. This should also be
more intuitive than the current way when export from file menu export
all dives and right click menu on divelist exports only selected dives.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/divelistview.cpp')
-rw-r--r-- | qt-ui/divelistview.cpp | 34 |
1 files changed, 5 insertions, 29 deletions
diff --git a/qt-ui/divelistview.cpp b/qt-ui/divelistview.cpp index 07ce1f001..0e022d1cf 100644 --- a/qt-ui/divelistview.cpp +++ b/qt-ui/divelistview.cpp @@ -9,6 +9,7 @@ #include "modeldelegates.h" #include "mainwindow.h" #include "subsurfacewebservices.h" +#include "divelogexportdialog.h" #include "../display.h" #include "exif.h" #include "../file.h" @@ -775,13 +776,10 @@ void DiveListView::contextMenuEvent(QContextMenuEvent *event) if (amount_selected >= 1) { popup.addAction(tr("renumber dive(s)"), this, SLOT(renumberDives())); 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("export dive log"), this, SLOT(exportDives())); popup.addAction(tr("shift times"), this, SLOT(shiftTimes())); popup.addAction(tr("load images"), this, SLOT(loadImages())); } - if (d) - popup.addAction(tr("upload dive(s) to divelogs.de"), this, SLOT(uploadToDivelogsDE())); // "collapse all" really closes all trips, // "collapse" keeps the trip with the selected dive open QAction *actionTaken = popup.exec(event->globalPos()); @@ -821,29 +819,12 @@ void DiveListView::saveSelectedDivesAs() save_dives_logic(bt.data(), true); } -void DiveListView::exportSelectedDivesAsUDDF() +void DiveListView::exportDives() { - QString filename; - QFileInfo fi(system_default_filename()); - - filename = QFileDialog::getSaveFileName(this, tr("Export UDDF File as"), fi.absolutePath(), - tr("UDDF files (*.uddf *.UDDF)")); - if (!filename.isNull() && !filename.isEmpty()) - 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"); + DiveLogExportDialog *diveLogExport = new DiveLogExportDialog(); + diveLogExport->show(); } - void DiveListView::shiftTimes() { ShiftTimesDialog::instance()->show(); @@ -913,11 +894,6 @@ void DiveListView::loadImages() } } -void DiveListView::uploadToDivelogsDE() -{ - DivelogsDeWebServices::instance()->prepareDivesForUpload(); -} - QString DiveListView::lastUsedImageDir() { QSettings settings; |