From 0cd9d09410e2631d3a47edcae7569e3b3f011cf1 Mon Sep 17 00:00:00 2001 From: Gehad Date: Sun, 30 Mar 2014 22:14:56 +0200 Subject: Exporting a World-Map This patch adds the world map exporter. - add worldmap-save.c that writes the html to the file - use Google maps v3 API to put the place marks on the map - add worldmap-options.h to contain some settings for the JS which will make it easier for those to be changed - add save HTML action in the mainwindow user interface Signed-off-by: Gehad elrobey Signed-off-by: Dirk Hohndel --- qt-ui/mainwindow.cpp | 10 ++++++++++ qt-ui/mainwindow.h | 1 + qt-ui/mainwindow.ui | 6 ++++++ 3 files changed, 17 insertions(+) (limited to 'qt-ui') diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 86d612457..53f7a15df 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -36,6 +36,7 @@ #include "simplewidgets.h" #include "diveplanner.h" #include "about.h" +#include "worldmap-save.h" #ifndef NO_PRINTING #include "printdialog.h" #endif @@ -277,6 +278,15 @@ void MainWindow::on_actionExportUDDF_triggered() export_dives_uddf(filename.toUtf8(), false); } +void MainWindow::on_actionExportHTMLworldmap_triggered() +{ + QFileInfo fi(system_default_filename()); + QString filename = QFileDialog::getSaveFileName(this, tr("Export World Map"), fi.absolutePath(), + tr("HTML files (*.html)")); + if (!filename.isNull() && !filename.isEmpty()) + export_worldmap_HTML(filename.toUtf8().data()); +} + void MainWindow::on_actionPrint_triggered() { #ifndef NO_PRINTING diff --git a/qt-ui/mainwindow.h b/qt-ui/mainwindow.h index 51e03c3b8..a0c5be333 100644 --- a/qt-ui/mainwindow.h +++ b/qt-ui/mainwindow.h @@ -90,6 +90,7 @@ slots: void on_actionSaveAs_triggered(); void on_actionClose_triggered(); void on_actionExportUDDF_triggered(); + void on_actionExportHTMLworldmap_triggered(); void on_actionPrint_triggered(); void on_actionPreferences_triggered(); void on_actionQuit_triggered(); diff --git a/qt-ui/mainwindow.ui b/qt-ui/mainwindow.ui index a933a2de9..2bf249683 100644 --- a/qt-ui/mainwindow.ui +++ b/qt-ui/mainwindow.ui @@ -551,6 +551,7 @@ + @@ -680,6 +681,11 @@ Ctrl+U + + + + Export HTML World Map + -- cgit v1.2.3-70-g09d2