summaryrefslogtreecommitdiffstats
path: root/qt-ui/divelogexportdialog.cpp
diff options
context:
space:
mode:
authorGravatar Gehad Elrobey <gehadelrobey@gmail.com>2015-03-13 15:36:52 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-03-14 18:18:08 -0700
commitec202890b7c86cd3f6d2e5c568a8f4de2b83e793 (patch)
treeafddc60cc3a4a7d1a65562f0c9ce4705b630ad36 /qt-ui/divelogexportdialog.cpp
parent7e7cddde8acc603159879ae34501debacbb9b222 (diff)
downloadsubsurface-ec202890b7c86cd3f6d2e5c568a8f4de2b83e793.tar.gz
Make exporting photos with HTML optional
This adds the ability to choose either to export photos or not. Patch is attached. -- regards, Gehad From 6476e1227b72d8297f9aecc2e6cc6f70d07f87ae Mon Sep 17 00:00:00 2001 From: Gehad elrobey <gehadelrobey@gmail.com> Date: Fri, 13 Mar 2015 15:31:24 +0200 Subject: [PATCH] Make exporting photos with HTML optional Add the option to enable/disable exporting photos with the HTML. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/divelogexportdialog.cpp')
-rw-r--r--qt-ui/divelogexportdialog.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/qt-ui/divelogexportdialog.cpp b/qt-ui/divelogexportdialog.cpp
index 2237fb908..12a8c320f 100644
--- a/qt-ui/divelogexportdialog.cpp
+++ b/qt-ui/divelogexportdialog.cpp
@@ -56,6 +56,9 @@ DiveLogExportDialog::DiveLogExportDialog(QWidget *parent) : QDialog(parent),
if (settings.contains("listOnly")) {
ui->exportListOnly->setChecked(settings.value("listOnly").toBool());
}
+ if (settings.contains("exportPhotos")) {
+ ui->exportPhotos->setChecked(settings.value("exportPhotos").toBool());
+ }
settings.endGroup();
}
@@ -105,8 +108,12 @@ void DiveLogExportDialog::exportHtmlInit(const QString &filename)
QString json_settings = exportFiles + QDir::separator() + "settings.js";
QString translation = exportFiles + QDir::separator() + "translation.js";
QString stat_file = exportFiles + QDir::separator() + "stat.js";
- QString photos_directory = exportFiles + QDir::separator() + "photos" + QDir::separator();
- mainDir.mkdir(photos_directory);
+
+ QString photos_directory;
+ if (ui->exportPhotos->isChecked()) {
+ photos_directory = exportFiles + QDir::separator() + "photos" + QDir::separator();
+ mainDir.mkdir(photos_directory);
+ }
exportFiles += "/";
exportHTMLsettings(json_settings);
@@ -143,6 +150,7 @@ void DiveLogExportDialog::exportHTMLsettings(const QString &filename)
settings.setValue("subsurfaceNumbers", ui->exportSubsurfaceNumber->isChecked());
settings.setValue("yearlyStatistics", ui->exportStatistics->isChecked());
settings.setValue("listOnly", ui->exportListOnly->isChecked());
+ settings.setValue("exportPhotos", ui->exportPhotos->isChecked());
settings.endGroup();
QString fontSize = ui->fontSizeSelection->currentText();