2017-04-27 18:26:05 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2014-05-20 16:33:32 +00:00
|
|
|
#include <QFileDialog>
|
2014-05-21 12:41:46 +00:00
|
|
|
#include <QShortcut>
|
2014-05-24 14:12:03 +00:00
|
|
|
#include <QSettings>
|
Add additional data to TeX-export
The purpose of this work is to allow for generation of more complete log
pages using TeX/LaTeX.
Previously, the exporting to TeX generated a document that contained
very limited information about the dive. For example: the only details
reported about air consumption were delta pressure and SAC. In addition
no data was reported about what equipment (weights, tanks, suit) was
used.
Per feedback, code was updated to use helper functions, and now exports
data with the units set by the user in the Subsurface preferences. Some
characters (Degree symbol) do not render correctly by default in LaTeX,
so sample code to address this was included in the top comments. Volume
units do not export an ideal character string, so another string was
substituted.
This update adds the following information:
* GPS Location
* Dive computer used
* Max, Min, Air, and Water Temperatures
* Average depth
* Number of cylinders listed, mix, and start/end pressure for each
* Total weight used, and the description and quantity of each weight
* Dive rating (previously, only visibility was reported)
* Buddy
* Dive master
* Suit
This update moved several fields that had no output or had unexpected
names (i.e. "spot", "place") into a "Deprecated section"
Future work:
* The export currently only includes the first entry in the tag list.
* Future versions should export all tags.
* Ideally, this would export a screenshot of the dive location.
* Create a table of correct size for weights and cylinders.
* It would be nice to have a bit more control over the generation of
profile images, but that may be beyond me.
Rebased-and-cleaned-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Ben McCandless <mccand@gmail.com>
2017-08-06 17:22:04 +00:00
|
|
|
#include <string.h> // Allows string comparisons and substitutions in TeX export
|
2015-02-22 16:30:34 +00:00
|
|
|
|
2014-05-20 16:33:32 +00:00
|
|
|
#include "ui_divelogexportdialog.h"
|
2019-08-05 18:07:10 +00:00
|
|
|
#include "core/divelogexportlogic.h"
|
2016-04-05 05:02:03 +00:00
|
|
|
#include "core/worldmap-save.h"
|
|
|
|
#include "core/save-html.h"
|
2018-08-18 18:00:55 +00:00
|
|
|
#include "core/settings/qPrefDisplay.h"
|
2019-03-30 19:59:28 +00:00
|
|
|
#include "core/save-profiledata.h"
|
2019-11-17 17:13:55 +00:00
|
|
|
#include "core/divefilter.h"
|
2019-03-04 22:20:29 +00:00
|
|
|
#include "core/divesite.h"
|
2019-08-05 17:41:15 +00:00
|
|
|
#include "core/errorhelper.h"
|
2019-08-05 18:07:10 +00:00
|
|
|
#include "core/file.h"
|
2019-05-30 16:29:36 +00:00
|
|
|
#include "core/tag.h"
|
2019-12-14 20:56:31 +00:00
|
|
|
#include "backend-shared/exportfuncs.h"
|
2019-08-05 18:07:10 +00:00
|
|
|
#include "desktop-widgets/mainwindow.h"
|
|
|
|
#include "desktop-widgets/divelogexportdialog.h"
|
|
|
|
#include "desktop-widgets/diveshareexportdialog.h"
|
|
|
|
#include "desktop-widgets/subsurfacewebservices.h"
|
|
|
|
#include "profile-widget/profilewidget2.h"
|
2016-10-03 15:08:02 +00:00
|
|
|
|
Add additional data to TeX-export
The purpose of this work is to allow for generation of more complete log
pages using TeX/LaTeX.
Previously, the exporting to TeX generated a document that contained
very limited information about the dive. For example: the only details
reported about air consumption were delta pressure and SAC. In addition
no data was reported about what equipment (weights, tanks, suit) was
used.
Per feedback, code was updated to use helper functions, and now exports
data with the units set by the user in the Subsurface preferences. Some
characters (Degree symbol) do not render correctly by default in LaTeX,
so sample code to address this was included in the top comments. Volume
units do not export an ideal character string, so another string was
substituted.
This update adds the following information:
* GPS Location
* Dive computer used
* Max, Min, Air, and Water Temperatures
* Average depth
* Number of cylinders listed, mix, and start/end pressure for each
* Total weight used, and the description and quantity of each weight
* Dive rating (previously, only visibility was reported)
* Buddy
* Dive master
* Suit
This update moved several fields that had no output or had unexpected
names (i.e. "spot", "place") into a "Deprecated section"
Future work:
* The export currently only includes the first entry in the tag list.
* Future versions should export all tags.
* Ideally, this would export a screenshot of the dive location.
* Create a table of correct size for weights and cylinders.
* It would be nice to have a bit more control over the generation of
profile images, but that may be beyond me.
Rebased-and-cleaned-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Ben McCandless <mccand@gmail.com>
2017-08-06 17:22:04 +00:00
|
|
|
// Retrieves the current unit settings defined in the Subsurface preferences.
|
|
|
|
#define GET_UNIT(name, field, f, t) \
|
|
|
|
v = settings.value(QString(name)); \
|
|
|
|
if (v.isValid()) \
|
2014-10-17 20:46:33 +00:00
|
|
|
field = (v.toInt() == 0) ? (t) : (f); \
|
Add additional data to TeX-export
The purpose of this work is to allow for generation of more complete log
pages using TeX/LaTeX.
Previously, the exporting to TeX generated a document that contained
very limited information about the dive. For example: the only details
reported about air consumption were delta pressure and SAC. In addition
no data was reported about what equipment (weights, tanks, suit) was
used.
Per feedback, code was updated to use helper functions, and now exports
data with the units set by the user in the Subsurface preferences. Some
characters (Degree symbol) do not render correctly by default in LaTeX,
so sample code to address this was included in the top comments. Volume
units do not export an ideal character string, so another string was
substituted.
This update adds the following information:
* GPS Location
* Dive computer used
* Max, Min, Air, and Water Temperatures
* Average depth
* Number of cylinders listed, mix, and start/end pressure for each
* Total weight used, and the description and quantity of each weight
* Dive rating (previously, only visibility was reported)
* Buddy
* Dive master
* Suit
This update moved several fields that had no output or had unexpected
names (i.e. "spot", "place") into a "Deprecated section"
Future work:
* The export currently only includes the first entry in the tag list.
* Future versions should export all tags.
* Ideally, this would export a screenshot of the dive location.
* Create a table of correct size for weights and cylinders.
* It would be nice to have a bit more control over the generation of
profile images, but that may be beyond me.
Rebased-and-cleaned-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Ben McCandless <mccand@gmail.com>
2017-08-06 17:22:04 +00:00
|
|
|
else \
|
2014-10-17 20:46:33 +00:00
|
|
|
field = default_prefs.units.field
|
|
|
|
|
2014-05-22 18:40:22 +00:00
|
|
|
DiveLogExportDialog::DiveLogExportDialog(QWidget *parent) : QDialog(parent),
|
2014-06-10 11:02:55 +00:00
|
|
|
ui(new Ui::DiveLogExportDialog)
|
2014-05-20 16:33:32 +00:00
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
2014-05-24 13:42:10 +00:00
|
|
|
showExplanation();
|
2014-05-21 12:41:46 +00:00
|
|
|
QShortcut *quit = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), this);
|
2015-05-25 19:01:57 +00:00
|
|
|
connect(quit, SIGNAL(activated()), MainWindow::instance(), SLOT(close()));
|
2014-05-21 12:41:46 +00:00
|
|
|
QShortcut *close = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_W), this);
|
|
|
|
connect(close, SIGNAL(activated()), this, SLOT(close()));
|
2014-06-01 04:38:59 +00:00
|
|
|
|
|
|
|
/* the names are not the actual values exported to the json files,The font-family property should hold several
|
|
|
|
font names as a "fallback" system, to ensure maximum compatibility between browsers/operating systems */
|
|
|
|
ui->fontSelection->addItem("Arial", "Arial, Helvetica, sans-serif");
|
|
|
|
ui->fontSelection->addItem("Impact", "Impact, Charcoal, sans-serif");
|
|
|
|
ui->fontSelection->addItem("Georgia", "Georgia, serif");
|
|
|
|
ui->fontSelection->addItem("Courier", "Courier, monospace");
|
|
|
|
ui->fontSelection->addItem("Verdana", "Verdana, Geneva, sans-serif");
|
2014-06-02 15:38:35 +00:00
|
|
|
|
|
|
|
QSettings settings;
|
|
|
|
settings.beginGroup("HTML");
|
|
|
|
if (settings.contains("fontSelection")) {
|
|
|
|
ui->fontSelection->setCurrentIndex(settings.value("fontSelection").toInt());
|
|
|
|
}
|
|
|
|
if (settings.contains("fontSizeSelection")) {
|
|
|
|
ui->fontSizeSelection->setCurrentIndex(settings.value("fontSizeSelection").toInt());
|
|
|
|
}
|
|
|
|
if (settings.contains("themeSelection")) {
|
|
|
|
ui->themeSelection->setCurrentIndex(settings.value("themeSelection").toInt());
|
|
|
|
}
|
2014-08-10 04:10:19 +00:00
|
|
|
if (settings.contains("subsurfaceNumbers")) {
|
|
|
|
ui->exportSubsurfaceNumber->setChecked(settings.value("subsurfaceNumbers").toBool());
|
|
|
|
}
|
|
|
|
if (settings.contains("yearlyStatistics")) {
|
|
|
|
ui->exportStatistics->setChecked(settings.value("yearlyStatistics").toBool());
|
|
|
|
}
|
|
|
|
if (settings.contains("listOnly")) {
|
|
|
|
ui->exportListOnly->setChecked(settings.value("listOnly").toBool());
|
|
|
|
}
|
2015-03-13 13:36:52 +00:00
|
|
|
if (settings.contains("exportPhotos")) {
|
|
|
|
ui->exportPhotos->setChecked(settings.value("exportPhotos").toBool());
|
|
|
|
}
|
2014-06-02 15:38:35 +00:00
|
|
|
settings.endGroup();
|
2014-05-20 16:33:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
DiveLogExportDialog::~DiveLogExportDialog()
|
|
|
|
{
|
|
|
|
delete ui;
|
|
|
|
}
|
|
|
|
|
2014-05-24 13:42:10 +00:00
|
|
|
void DiveLogExportDialog::showExplanation()
|
2014-05-23 20:28:08 +00:00
|
|
|
{
|
|
|
|
if (ui->exportUDDF->isChecked()) {
|
2014-07-10 23:06:44 +00:00
|
|
|
ui->description->setText(tr("Generic format that is used for data exchange between a variety of diving related programs."));
|
2014-05-23 20:28:08 +00:00
|
|
|
} else if (ui->exportCSV->isChecked()) {
|
2020-04-18 13:43:24 +00:00
|
|
|
ui->description->setText(tr("Comma separated values describing the dive profile as downloaded from dive computer."));
|
2014-12-29 15:45:28 +00:00
|
|
|
} else if (ui->exportCSVDetails->isChecked()) {
|
|
|
|
ui->description->setText(tr("Comma separated values of the dive information. This includes most of the dive details but no profile information."));
|
2014-05-23 20:28:08 +00:00
|
|
|
} else if (ui->exportDivelogs->isChecked()) {
|
2014-07-10 23:06:44 +00:00
|
|
|
ui->description->setText(tr("Send the dive data to divelogs.de website."));
|
2014-09-21 14:11:58 +00:00
|
|
|
} else if (ui->exportDiveshare->isChecked()) {
|
2017-02-20 09:31:03 +00:00
|
|
|
ui->description->setText(tr("Send the dive data to dive-share.appspot.com website."));
|
2014-05-23 20:28:08 +00:00
|
|
|
} else if (ui->exportWorldMap->isChecked()) {
|
2014-07-10 23:06:44 +00:00
|
|
|
ui->description->setText(tr("HTML export of the dive locations, visualized on a world map."));
|
2014-05-24 14:12:03 +00:00
|
|
|
} else if (ui->exportSubsurfaceXML->isChecked()) {
|
2014-07-10 23:06:44 +00:00
|
|
|
ui->description->setText(tr("Subsurface native XML format."));
|
2019-04-06 19:05:18 +00:00
|
|
|
} else if (ui->exportSubsurfaceSitesXML->isChecked()) {
|
|
|
|
ui->description->setText(tr("Subsurface dive sites native XML format."));
|
2014-09-28 21:47:41 +00:00
|
|
|
} else if (ui->exportImageDepths->isChecked()) {
|
|
|
|
ui->description->setText(tr("Write depths of images to file."));
|
2016-10-03 15:08:02 +00:00
|
|
|
} else if (ui->exportTeX->isChecked()) {
|
|
|
|
ui->description->setText(tr("Write dive as TeX macros to file."));
|
2019-01-03 09:23:24 +00:00
|
|
|
} else if (ui->exportLaTeX->isChecked()) {
|
|
|
|
ui->description->setText(tr("Write dive as LaTeX macros to file."));
|
2019-02-03 14:47:52 +00:00
|
|
|
} else if (ui->exportProfile->isChecked()) {
|
|
|
|
ui->description->setText(tr("Write the profile image as PNG file."));
|
2019-03-30 19:59:28 +00:00
|
|
|
} else if (ui->exportProfileData->isChecked()) {
|
2020-04-18 13:43:24 +00:00
|
|
|
ui->description->setText(tr("Write the computed Profile Panel data to a CSV file."));
|
2014-05-23 20:28:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-06-10 11:02:55 +00:00
|
|
|
void DiveLogExportDialog::exportHtmlInit(const QString &filename)
|
2014-06-01 04:38:59 +00:00
|
|
|
{
|
2015-06-16 13:34:40 +00:00
|
|
|
struct htmlExportSetting hes;
|
|
|
|
hes.themeFile = (ui->themeSelection->currentText() == tr("Light")) ? "light.css" : "sand.css";
|
|
|
|
hes.exportPhotos = ui->exportPhotos->isChecked();
|
|
|
|
hes.selectedOnly = ui->exportSelectedDives->isChecked();
|
|
|
|
hes.listOnly = ui->exportListOnly->isChecked();
|
|
|
|
hes.fontFamily = ui->fontSelection->itemData(ui->fontSelection->currentIndex()).toString();
|
|
|
|
hes.fontSize = ui->fontSizeSelection->currentText();
|
|
|
|
hes.themeSelection = ui->themeSelection->currentIndex();
|
|
|
|
hes.subsurfaceNumbers = ui->exportSubsurfaceNumber->isChecked();
|
|
|
|
hes.yearlyStatistics = ui->exportStatistics->isChecked();
|
|
|
|
|
|
|
|
exportHtmlInitLogic(filename, hes);
|
2014-06-01 04:38:59 +00:00
|
|
|
}
|
|
|
|
|
2018-05-21 16:09:09 +00:00
|
|
|
void DiveLogExportDialog::on_exportGroup_buttonClicked(QAbstractButton*)
|
2014-05-24 13:42:10 +00:00
|
|
|
{
|
|
|
|
showExplanation();
|
|
|
|
}
|
|
|
|
|
2014-05-20 16:33:32 +00:00
|
|
|
void DiveLogExportDialog::on_buttonBox_accepted()
|
|
|
|
{
|
|
|
|
QString filename;
|
|
|
|
QString stylesheet;
|
2014-05-24 14:12:03 +00:00
|
|
|
QString lastDir = QDir::homePath();
|
|
|
|
|
2018-08-18 18:00:55 +00:00
|
|
|
if (QDir(qPrefDisplay::lastDir()).exists())
|
|
|
|
lastDir = qPrefDisplay::lastDir();
|
2014-05-20 16:33:32 +00:00
|
|
|
|
2014-06-01 04:38:59 +00:00
|
|
|
switch (ui->tabWidget->currentIndex()) {
|
|
|
|
case 0:
|
|
|
|
if (ui->exportUDDF->isChecked()) {
|
|
|
|
stylesheet = "uddf-export.xslt";
|
2014-07-10 23:06:43 +00:00
|
|
|
filename = QFileDialog::getSaveFileName(this, tr("Export UDDF file as"), lastDir,
|
2017-10-27 12:52:27 +00:00
|
|
|
tr("UDDF files") + " (*.uddf)");
|
2014-06-01 04:38:59 +00:00
|
|
|
} else if (ui->exportCSV->isChecked()) {
|
|
|
|
stylesheet = "xml2csv.xslt";
|
2014-07-10 23:06:43 +00:00
|
|
|
filename = QFileDialog::getSaveFileName(this, tr("Export CSV file as"), lastDir,
|
2017-10-27 12:52:27 +00:00
|
|
|
tr("CSV files") + " (*.csv)");
|
2014-12-22 01:53:18 +00:00
|
|
|
} else if (ui->exportCSVDetails->isChecked()) {
|
|
|
|
stylesheet = "xml2manualcsv.xslt";
|
|
|
|
filename = QFileDialog::getSaveFileName(this, tr("Export CSV file as"), lastDir,
|
2017-10-27 12:52:27 +00:00
|
|
|
tr("CSV files") + " (*.csv)");
|
2014-06-01 04:38:59 +00:00
|
|
|
} else if (ui->exportDivelogs->isChecked()) {
|
|
|
|
DivelogsDeWebServices::instance()->prepareDivesForUpload(ui->exportSelected->isChecked());
|
2014-09-21 14:11:58 +00:00
|
|
|
} else if (ui->exportDiveshare->isChecked()) {
|
|
|
|
DiveShareExportDialog::instance()->prepareDivesForUpload(ui->exportSelected->isChecked());
|
2014-06-01 04:38:59 +00:00
|
|
|
} else if (ui->exportWorldMap->isChecked()) {
|
2014-07-10 23:06:43 +00:00
|
|
|
filename = QFileDialog::getSaveFileName(this, tr("Export world map"), lastDir,
|
2017-10-27 12:52:27 +00:00
|
|
|
tr("HTML files") + " (*.html)");
|
2014-06-01 04:38:59 +00:00
|
|
|
if (!filename.isNull() && !filename.isEmpty())
|
2018-02-25 12:51:41 +00:00
|
|
|
export_worldmap_HTML(qPrintable(filename), ui->exportSelected->isChecked());
|
2014-06-01 04:38:59 +00:00
|
|
|
} else if (ui->exportSubsurfaceXML->isChecked()) {
|
|
|
|
filename = QFileDialog::getSaveFileName(this, tr("Export Subsurface XML"), lastDir,
|
2017-10-27 12:52:27 +00:00
|
|
|
tr("Subsurface files") + " (*.ssrf *.xml)");
|
2014-06-01 04:38:59 +00:00
|
|
|
if (!filename.isNull() && !filename.isEmpty()) {
|
2014-07-31 17:38:36 +00:00
|
|
|
if (!filename.contains('.'))
|
|
|
|
filename.append(".ssrf");
|
2014-06-01 04:38:59 +00:00
|
|
|
QByteArray bt = QFile::encodeName(filename);
|
2018-09-10 12:47:56 +00:00
|
|
|
save_dives_logic(bt.data(), ui->exportSelected->isChecked(), ui->anonymize->isChecked());
|
2014-06-01 04:38:59 +00:00
|
|
|
}
|
2019-04-06 19:05:18 +00:00
|
|
|
} else if (ui->exportSubsurfaceSitesXML->isChecked()) {
|
|
|
|
filename = QFileDialog::getSaveFileName(this, tr("Export Subsurface dive sites XML"), lastDir,
|
|
|
|
tr("Subsurface files") + " (*.xml)");
|
|
|
|
if (!filename.isNull() && !filename.isEmpty()) {
|
|
|
|
if (!filename.contains('.'))
|
|
|
|
filename.append(".xml");
|
|
|
|
QByteArray bt = QFile::encodeName(filename);
|
2020-02-06 21:38:29 +00:00
|
|
|
std::vector<const dive_site *> sites = getDiveSitesToExport(ui->exportSelected->isChecked());
|
2020-04-21 07:34:40 +00:00
|
|
|
save_dive_sites_logic(bt.data(), sites.data(), (int)sites.size(), ui->anonymize->isChecked());
|
2019-04-06 19:05:18 +00:00
|
|
|
}
|
2014-09-28 21:47:41 +00:00
|
|
|
} else if (ui->exportImageDepths->isChecked()) {
|
|
|
|
filename = QFileDialog::getSaveFileName(this, tr("Save image depths"), lastDir);
|
|
|
|
if (!filename.isNull() && !filename.isEmpty())
|
2020-02-06 21:38:29 +00:00
|
|
|
export_depths(qPrintable(filename), ui->exportSelected->isChecked());
|
2019-01-03 09:23:24 +00:00
|
|
|
} else if (ui->exportTeX->isChecked() || ui->exportLaTeX->isChecked()) {
|
2017-10-27 12:52:27 +00:00
|
|
|
filename = QFileDialog::getSaveFileName(this, tr("Export to TeX file"), lastDir, tr("TeX files") + " (*.tex)");
|
2016-10-03 15:08:02 +00:00
|
|
|
if (!filename.isNull() && !filename.isEmpty())
|
2020-02-06 21:38:29 +00:00
|
|
|
export_TeX(qPrintable(filename), ui->exportSelected->isChecked(), ui->exportTeX->isChecked());
|
2019-02-02 13:41:53 +00:00
|
|
|
} else if (ui->exportProfile->isChecked()) {
|
2019-02-03 14:47:52 +00:00
|
|
|
filename = QFileDialog::getSaveFileName(this, tr("Save profile image"), lastDir);
|
2019-02-02 13:41:53 +00:00
|
|
|
if (!filename.isNull() && !filename.isEmpty())
|
2020-02-06 21:38:29 +00:00
|
|
|
exportProfile(qPrintable(filename), ui->exportSelected->isChecked());
|
2019-03-30 19:59:28 +00:00
|
|
|
} else if (ui->exportProfileData->isChecked()) {
|
|
|
|
filename = QFileDialog::getSaveFileName(this, tr("Save profile data"), lastDir);
|
|
|
|
if (!filename.isNull() && !filename.isEmpty())
|
|
|
|
save_profiledata(qPrintable(filename), ui->exportSelected->isChecked());
|
2014-05-24 14:12:03 +00:00
|
|
|
}
|
2014-06-01 04:38:59 +00:00
|
|
|
break;
|
|
|
|
case 1:
|
2014-06-10 15:55:07 +00:00
|
|
|
filename = QFileDialog::getSaveFileName(this, tr("Export HTML files as"), lastDir,
|
2017-10-27 12:52:27 +00:00
|
|
|
tr("HTML files") + " (*.html)");
|
2014-05-23 18:49:49 +00:00
|
|
|
if (!filename.isNull() && !filename.isEmpty())
|
2014-06-01 04:38:59 +00:00
|
|
|
exportHtmlInit(filename);
|
|
|
|
break;
|
2014-05-24 14:12:03 +00:00
|
|
|
}
|
2014-05-23 18:49:49 +00:00
|
|
|
|
2014-05-24 14:12:03 +00:00
|
|
|
if (!filename.isNull() && !filename.isEmpty()) {
|
|
|
|
// remember the last export path
|
|
|
|
QFileInfo fileInfo(filename);
|
2018-08-18 18:00:55 +00:00
|
|
|
qPrefDisplay::set_lastDir(fileInfo.dir().path());
|
2014-05-24 14:12:03 +00:00
|
|
|
// the non XSLT exports are called directly above, the XSLT based ons are called here
|
2015-02-26 14:07:39 +00:00
|
|
|
if (!stylesheet.isEmpty()) {
|
2020-02-06 21:38:29 +00:00
|
|
|
QFuture<void> future = exportUsingStyleSheet(filename, ui->exportSelected->isChecked(),
|
2020-02-06 21:18:42 +00:00
|
|
|
ui->CSVUnits_2->currentIndex(), stylesheet.toUtf8(), ui->anonymize->isChecked());
|
|
|
|
MainWindow::instance()->getNotificationWidget()->showNotification(tr("Please wait, exporting..."), KMessageWidget::Information);
|
|
|
|
MainWindow::instance()->getNotificationWidget()->setFuture(future);
|
2014-09-28 21:47:41 +00:00
|
|
|
}
|
|
|
|
}
|
2019-02-02 13:41:53 +00:00
|
|
|
}
|
|
|
|
|
2020-02-06 21:38:29 +00:00
|
|
|
void exportProfile(const struct dive *dive, const QString filename)
|
2019-02-02 13:41:53 +00:00
|
|
|
{
|
|
|
|
ProfileWidget2 *profile = MainWindow::instance()->graphics;
|
2019-02-02 20:23:52 +00:00
|
|
|
profile->plotDive(dive, true, false, true);
|
2019-02-02 13:41:53 +00:00
|
|
|
profile->setToolTipVisibile(false);
|
|
|
|
QPixmap pix = profile->grab();
|
|
|
|
profile->setToolTipVisibile(true);
|
|
|
|
pix.save(filename);
|
|
|
|
}
|