From a3dbb5865cc3c1ba793f8a05d20a92c5131f4bae Mon Sep 17 00:00:00 2001 From: Gehad elrobey Date: Fri, 23 May 2014 21:49:49 +0300 Subject: HTML list exporter Exporting the raw dive list into JSON format for later viewing with html and js files. Also some worldmap code organizations. Signed-off-by: Gehad elrobey Signed-off-by: Miika Turkia Signed-off-by: Dirk Hohndel --- qt-ui/divelogexportdialog.cpp | 10 ++++++++- qt-ui/divelogexportdialog.ui | 50 ++++++++++++++++++++++++++++--------------- 2 files changed, 42 insertions(+), 18 deletions(-) (limited to 'qt-ui') diff --git a/qt-ui/divelogexportdialog.cpp b/qt-ui/divelogexportdialog.cpp index 28f343257..a3193d5ce 100644 --- a/qt-ui/divelogexportdialog.cpp +++ b/qt-ui/divelogexportdialog.cpp @@ -2,7 +2,6 @@ #include #include #include -#include #include #include "mainwindow.h" @@ -10,6 +9,7 @@ #include "ui_divelogexportdialog.h" #include "subsurfacewebservices.h" #include "worldmap-save.h" +#include "save-html.h" DiveLogExportDialog::DiveLogExportDialog(QWidget *parent) : QDialog(parent), ui(new Ui::DiveLogExportDialog) @@ -39,6 +39,8 @@ void DiveLogExportDialog::showExplanation() ui->description->setText("HTML export of the dive locations, visualized on a world map."); } else if (ui->exportSubsurfaceXML->isChecked()) { ui->description->setText("Subsurface native XML format."); + } else if (ui->exportHtml->isChecked()) { + ui->description->setText("Html export of dive list can be viewed in any web browser."); } } @@ -84,7 +86,13 @@ void DiveLogExportDialog::on_buttonBox_accepted() QByteArray bt = QFile::encodeName(filename); save_dives_logic(bt.data(), true); } + } else if (ui->exportHtml->isChecked()) { + filename = QFileDialog::getSaveFileName(this, tr("Export HTML"), lastDir, + tr("HTML files (*.html)")); + if (!filename.isNull() && !filename.isEmpty()) + export_HTML(filename.toUtf8().data(), ui->exportSelected->isChecked()); } + if (!filename.isNull() && !filename.isEmpty()) { // remember the last export path QFileInfo fileInfo(filename); diff --git a/qt-ui/divelogexportdialog.ui b/qt-ui/divelogexportdialog.ui index 72e373127..09143f0d9 100644 --- a/qt-ui/divelogexportdialog.ui +++ b/qt-ui/divelogexportdialog.ui @@ -7,7 +7,7 @@ 0 0 448 - 473 + 522 @@ -17,7 +17,7 @@ 20 - 420 + 450 341 32 @@ -62,7 +62,7 @@ 20 70 201 - 211 + 241 @@ -166,6 +166,35 @@ exportGroup + + + + 10 + 190 + 117 + 22 + + + + HTML + + + exportGroup + + + + + + 40 + 230 + 231 + 16 + + + + Qt::Horizontal + + @@ -212,24 +241,11 @@ - - - - 60 - 280 - 231 - 16 - - - - Qt::Horizontal - - 30 - 310 + 330 341 91 -- cgit v1.2.3-70-g09d2