diff options
author | Gehad elrobey <gehadelrobey@gmail.com> | 2014-05-23 21:49:49 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-05-29 07:24:17 -0700 |
commit | a3dbb5865cc3c1ba793f8a05d20a92c5131f4bae (patch) | |
tree | dbc9b3d7bb34c271aa8ed22c66db8fb60a55983a /qt-ui | |
parent | b37422c4478825f679e05cb19ed22184b6172d44 (diff) | |
download | subsurface-a3dbb5865cc3c1ba793f8a05d20a92c5131f4bae.tar.gz |
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 <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/divelogexportdialog.cpp | 10 | ||||
-rw-r--r-- | qt-ui/divelogexportdialog.ui | 50 |
2 files changed, 42 insertions, 18 deletions
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 <QString> #include <QShortcut> #include <QAbstractButton> -#include <QDebug> #include <QSettings> #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 @@ <x>0</x> <y>0</y> <width>448</width> - <height>473</height> + <height>522</height> </rect> </property> <property name="windowTitle"> @@ -17,7 +17,7 @@ <property name="geometry"> <rect> <x>20</x> - <y>420</y> + <y>450</y> <width>341</width> <height>32</height> </rect> @@ -62,7 +62,7 @@ <x>20</x> <y>70</y> <width>201</width> - <height>211</height> + <height>241</height> </rect> </property> <property name="title"> @@ -166,6 +166,35 @@ <string notr="true">exportGroup</string> </attribute> </widget> + <widget class="QRadioButton" name="exportHtml"> + <property name="geometry"> + <rect> + <x>10</x> + <y>190</y> + <width>117</width> + <height>22</height> + </rect> + </property> + <property name="text"> + <string>HTML</string> + </property> + <attribute name="buttonGroup"> + <string notr="true">exportGroup</string> + </attribute> + </widget> + <widget class="Line" name="line"> + <property name="geometry"> + <rect> + <x>40</x> + <y>230</y> + <width>231</width> + <height>16</height> + </rect> + </property> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + </widget> </widget> <widget class="QGroupBox" name="exportSelection"> <property name="geometry"> @@ -212,24 +241,11 @@ </property> </widget> </widget> - <widget class="Line" name="line"> - <property name="geometry"> - <rect> - <x>60</x> - <y>280</y> - <width>231</width> - <height>16</height> - </rect> - </property> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> <widget class="QLabel" name="description"> <property name="geometry"> <rect> <x>30</x> - <y>310</y> + <y>330</y> <width>341</width> <height>91</height> </rect> |