mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
7e7cddde8a
commit
ec202890b7
3 changed files with 58 additions and 17 deletions
|
@ -56,6 +56,9 @@ DiveLogExportDialog::DiveLogExportDialog(QWidget *parent) : QDialog(parent),
|
||||||
if (settings.contains("listOnly")) {
|
if (settings.contains("listOnly")) {
|
||||||
ui->exportListOnly->setChecked(settings.value("listOnly").toBool());
|
ui->exportListOnly->setChecked(settings.value("listOnly").toBool());
|
||||||
}
|
}
|
||||||
|
if (settings.contains("exportPhotos")) {
|
||||||
|
ui->exportPhotos->setChecked(settings.value("exportPhotos").toBool());
|
||||||
|
}
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,8 +108,12 @@ void DiveLogExportDialog::exportHtmlInit(const QString &filename)
|
||||||
QString json_settings = exportFiles + QDir::separator() + "settings.js";
|
QString json_settings = exportFiles + QDir::separator() + "settings.js";
|
||||||
QString translation = exportFiles + QDir::separator() + "translation.js";
|
QString translation = exportFiles + QDir::separator() + "translation.js";
|
||||||
QString stat_file = exportFiles + QDir::separator() + "stat.js";
|
QString stat_file = exportFiles + QDir::separator() + "stat.js";
|
||||||
QString photos_directory = exportFiles + QDir::separator() + "photos" + QDir::separator();
|
|
||||||
|
QString photos_directory;
|
||||||
|
if (ui->exportPhotos->isChecked()) {
|
||||||
|
photos_directory = exportFiles + QDir::separator() + "photos" + QDir::separator();
|
||||||
mainDir.mkdir(photos_directory);
|
mainDir.mkdir(photos_directory);
|
||||||
|
}
|
||||||
exportFiles += "/";
|
exportFiles += "/";
|
||||||
|
|
||||||
exportHTMLsettings(json_settings);
|
exportHTMLsettings(json_settings);
|
||||||
|
@ -143,6 +150,7 @@ void DiveLogExportDialog::exportHTMLsettings(const QString &filename)
|
||||||
settings.setValue("subsurfaceNumbers", ui->exportSubsurfaceNumber->isChecked());
|
settings.setValue("subsurfaceNumbers", ui->exportSubsurfaceNumber->isChecked());
|
||||||
settings.setValue("yearlyStatistics", ui->exportStatistics->isChecked());
|
settings.setValue("yearlyStatistics", ui->exportStatistics->isChecked());
|
||||||
settings.setValue("listOnly", ui->exportListOnly->isChecked());
|
settings.setValue("listOnly", ui->exportListOnly->isChecked());
|
||||||
|
settings.setValue("exportPhotos", ui->exportPhotos->isChecked());
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
QString fontSize = ui->fontSizeSelection->currentText();
|
QString fontSize = ui->fontSizeSelection->currentText();
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>507</width>
|
<width>507</width>
|
||||||
<height>423</height>
|
<height>468</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
@ -338,13 +338,23 @@
|
||||||
</attribute>
|
</attribute>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="3" column="0">
|
||||||
<widget class="QCheckBox" name="exportListOnly">
|
<widget class="QCheckBox" name="exportListOnly">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Export list only</string>
|
<string>Export list only</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QCheckBox" name="exportPhotos">
|
||||||
|
<property name="text">
|
||||||
|
<string>Export photos</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -363,6 +373,9 @@
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QFormLayout" name="formLayout">
|
<layout class="QFormLayout" name="formLayout">
|
||||||
|
<property name="fieldGrowthPolicy">
|
||||||
|
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
||||||
|
</property>
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="fontLabel">
|
<widget class="QLabel" name="fontLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -517,16 +530,36 @@
|
||||||
<signal>toggled(bool)</signal>
|
<signal>toggled(bool)</signal>
|
||||||
<receiver>groupBox</receiver>
|
<receiver>groupBox</receiver>
|
||||||
<slot>setEnabled(bool)</slot>
|
<slot>setEnabled(bool)</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>20</x>
|
||||||
|
<y>20</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>20</x>
|
||||||
|
<y>20</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
</connection>
|
</connection>
|
||||||
<connection>
|
<connection>
|
||||||
<sender>exportCSVDetails</sender>
|
<sender>exportCSVDetails</sender>
|
||||||
<signal>toggled(bool)</signal>
|
<signal>toggled(bool)</signal>
|
||||||
<receiver>groupBox</receiver>
|
<receiver>groupBox</receiver>
|
||||||
<slot>setEnabled(bool)</slot>
|
<slot>setEnabled(bool)</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>20</x>
|
||||||
|
<y>20</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>20</x>
|
||||||
|
<y>20</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
</connection>
|
</connection>
|
||||||
</connections>
|
</connections>
|
||||||
<buttongroups>
|
<buttongroups>
|
||||||
<buttongroup name="exportGroup"/>
|
|
||||||
<buttongroup name="buttonGroup"/>
|
<buttongroup name="buttonGroup"/>
|
||||||
|
<buttongroup name="exportGroup"/>
|
||||||
</buttongroups>
|
</buttongroups>
|
||||||
</ui>
|
</ui>
|
||||||
|
|
|
@ -329,7 +329,7 @@ void write_one_dive(struct membuffer *b, struct dive *dive, const char *photos_d
|
||||||
put_HTML_samples(b, dive);
|
put_HTML_samples(b, dive);
|
||||||
put_HTML_bookmarks(b, dive);
|
put_HTML_bookmarks(b, dive);
|
||||||
write_dive_status(b, dive);
|
write_dive_status(b, dive);
|
||||||
if (photos_dir)
|
if (photos_dir && strcmp(photos_dir, ""))
|
||||||
save_photos(b, photos_dir, dive);
|
save_photos(b, photos_dir, dive);
|
||||||
write_divecomputers(b, dive);
|
write_divecomputers(b, dive);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue