diff options
Diffstat (limited to 'qt-ui/divelogexportdialog.cpp')
-rw-r--r-- | qt-ui/divelogexportdialog.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/qt-ui/divelogexportdialog.cpp b/qt-ui/divelogexportdialog.cpp index 43c41550f..12a8c320f 100644 --- a/qt-ui/divelogexportdialog.cpp +++ b/qt-ui/divelogexportdialog.cpp @@ -9,6 +9,7 @@ #include "subsurfacewebservices.h" #include "worldmap-save.h" #include "save-html.h" +#include "mainwindow.h" #define GET_UNIT(name, field, f, t) \ v = settings.value(QString(name)); \ @@ -55,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(); } @@ -104,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); @@ -142,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(); @@ -312,8 +321,11 @@ void DiveLogExportDialog::on_buttonBox_accepted() settings.setValue("LastDir", fileInfo.dir().path()); settings.endGroup(); // the non XSLT exports are called directly above, the XSLT based ons are called here - if (!stylesheet.isEmpty()) + if (!stylesheet.isEmpty()) { future = QtConcurrent::run(export_dives_xslt, filename.toUtf8(), ui->exportSelected->isChecked(), ui->CSVUnits_2->currentIndex(), stylesheet.toUtf8()); + MainWindow::instance()->getNotificationWidget()->showNotification(tr("Please Wait, Exporting..."), KMessageWidget::Information); + MainWindow::instance()->getNotificationWidget()->setFuture(future); + } } } |