From afe363fa8569c0634e5bc20dc54c204533a638d7 Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Mon, 10 Sep 2018 14:47:56 +0200 Subject: 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 --- desktop-widgets/divelogexportdialog.cpp | 4 +-- desktop-widgets/divelogexportdialog.ui | 44 +++++++++++++++++++++---------- desktop-widgets/subsurfacewebservices.cpp | 2 +- 3 files changed, 33 insertions(+), 17 deletions(-) (limited to 'desktop-widgets') 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 @@ - false + true - CSV units + Options + + false + 30 @@ -304,6 +307,19 @@ + + + + 10 + 50 + 111 + 20 + + + + Anonymize + + @@ -552,7 +568,7 @@ 248 - 254 + 397 157 @@ -568,7 +584,7 @@ 316 - 260 + 397 286 @@ -579,32 +595,32 @@ exportCSV toggled(bool) - groupBox + CSVUnits_2 setEnabled(bool) - 20 - 20 + 39 + 149 - 20 - 20 + 322 + 171 exportCSVDetails toggled(bool) - groupBox + CSVUnits_2 setEnabled(bool) - 20 - 20 + 39 + 168 - 20 - 20 + 322 + 171 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, "\n\n"); } - save_one_dive_to_mb(&mb, dive); + save_one_dive_to_mb(&mb, dive, false); if (ds) { put_format(&mb, "\n"); -- cgit v1.2.3-70-g09d2