diff options
author | Robert C. Helling <helling@atdotde.de> | 2018-09-10 14:47:56 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-09-13 08:16:54 -0700 |
commit | afe363fa8569c0634e5bc20dc54c204533a638d7 (patch) | |
tree | 556d189afc6fb2a9c2c9573345ade233635dffe8 /desktop-widgets | |
parent | adbb1488e8ae3ff06983c11f954d6079cfc48cce (diff) | |
download | subsurface-afe363fa8569c0634e5bc20dc54c204533a638d7.tar.gz |
Optional anonymization upon export
Add a checkbox that triggers replacement of all English characters by
x's in notes, buddy, dive guide and (while we are at it) suit.
This is ment for people sharing logs for debugging that are concious
about privacy issues. It leaves the lenth of strings in tact as well
as special charcters as those might be needed to track down a particular
parsing problem.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Diffstat (limited to 'desktop-widgets')
-rw-r--r-- | desktop-widgets/divelogexportdialog.cpp | 4 | ||||
-rw-r--r-- | desktop-widgets/divelogexportdialog.ui | 44 | ||||
-rw-r--r-- | desktop-widgets/subsurfacewebservices.cpp | 2 |
3 files changed, 33 insertions, 17 deletions
diff --git a/desktop-widgets/divelogexportdialog.cpp b/desktop-widgets/divelogexportdialog.cpp index 9c21c4ff3..46e121d6c 100644 --- a/desktop-widgets/divelogexportdialog.cpp +++ b/desktop-widgets/divelogexportdialog.cpp @@ -157,7 +157,7 @@ void DiveLogExportDialog::on_buttonBox_accepted() if (!filename.contains('.')) filename.append(".ssrf"); QByteArray bt = QFile::encodeName(filename); - save_dives_logic(bt.data(), ui->exportSelected->isChecked()); + save_dives_logic(bt.data(), ui->exportSelected->isChecked(), ui->anonymize->isChecked()); } } else if (ui->exportImageDepths->isChecked()) { filename = QFileDialog::getSaveFileName(this, tr("Save image depths"), lastDir); @@ -183,7 +183,7 @@ void DiveLogExportDialog::on_buttonBox_accepted() qPrefDisplay::set_lastDir(fileInfo.dir().path()); // the non XSLT exports are called directly above, the XSLT based ons are called here if (!stylesheet.isEmpty()) { - future = QtConcurrent::run(export_dives_xslt, filename.toUtf8(), ui->exportSelected->isChecked(), ui->CSVUnits_2->currentIndex(), stylesheet.toUtf8()); + future = QtConcurrent::run(export_dives_xslt, filename.toUtf8(), ui->exportSelected->isChecked(), ui->CSVUnits_2->currentIndex(), stylesheet.toUtf8(), ui->anonymize->isChecked()); MainWindow::instance()->getNotificationWidget()->showNotification(tr("Please wait, exporting..."), KMessageWidget::Information); MainWindow::instance()->getNotificationWidget()->setFuture(future); } diff --git a/desktop-widgets/divelogexportdialog.ui b/desktop-widgets/divelogexportdialog.ui index 0d02d9fd8..f864902d2 100644 --- a/desktop-widgets/divelogexportdialog.ui +++ b/desktop-widgets/divelogexportdialog.ui @@ -279,12 +279,15 @@ <item> <widget class="QGroupBox" name="groupBox"> <property name="enabled"> - <bool>false</bool> + <bool>true</bool> </property> <property name="title"> - <string>CSV units</string> + <string>Options</string> </property> <widget class="QComboBox" name="CSVUnits_2"> + <property name="enabled"> + <bool>false</bool> + </property> <property name="geometry"> <rect> <x>30</x> @@ -304,6 +307,19 @@ </property> </item> </widget> + <widget class="QCheckBox" name="anonymize"> + <property name="geometry"> + <rect> + <x>10</x> + <y>50</y> + <width>111</width> + <height>20</height> + </rect> + </property> + <property name="text"> + <string>Anonymize</string> + </property> + </widget> </widget> </item> </layout> @@ -552,7 +568,7 @@ <hints> <hint type="sourcelabel"> <x>248</x> - <y>254</y> + <y>397</y> </hint> <hint type="destinationlabel"> <x>157</x> @@ -568,7 +584,7 @@ <hints> <hint type="sourcelabel"> <x>316</x> - <y>260</y> + <y>397</y> </hint> <hint type="destinationlabel"> <x>286</x> @@ -579,32 +595,32 @@ <connection> <sender>exportCSV</sender> <signal>toggled(bool)</signal> - <receiver>groupBox</receiver> + <receiver>CSVUnits_2</receiver> <slot>setEnabled(bool)</slot> <hints> <hint type="sourcelabel"> - <x>20</x> - <y>20</y> + <x>39</x> + <y>149</y> </hint> <hint type="destinationlabel"> - <x>20</x> - <y>20</y> + <x>322</x> + <y>171</y> </hint> </hints> </connection> <connection> <sender>exportCSVDetails</sender> <signal>toggled(bool)</signal> - <receiver>groupBox</receiver> + <receiver>CSVUnits_2</receiver> <slot>setEnabled(bool)</slot> <hints> <hint type="sourcelabel"> - <x>20</x> - <y>20</y> + <x>39</x> + <y>168</y> </hint> <hint type="destinationlabel"> - <x>20</x> - <y>20</y> + <x>322</x> + <y>171</y> </hint> </hints> </connection> diff --git a/desktop-widgets/subsurfacewebservices.cpp b/desktop-widgets/subsurfacewebservices.cpp index b3084da14..0d4d62bac 100644 --- a/desktop-widgets/subsurfacewebservices.cpp +++ b/desktop-widgets/subsurfacewebservices.cpp @@ -223,7 +223,7 @@ bool DivelogsDeWebServices::prepare_dives_for_divelogs(const QString &tempfile, put_format(&mb, "</site>\n</divesites>\n"); } - save_one_dive_to_mb(&mb, dive); + save_one_dive_to_mb(&mb, dive, false); if (ds) { put_format(&mb, "</divelog>\n"); |