From 5fca06c9e60bdbfb708006d14255d4c28e16aced Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Thu, 26 Dec 2013 09:18:57 -0800 Subject: Display warning that dives won't be downloaded when enabling libdc dump The warning is only shown once per session. Signed-off-by: Dirk Hohndel --- qt-ui/downloadfromdivecomputer.cpp | 12 +++++++++--- qt-ui/downloadfromdivecomputer.h | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/qt-ui/downloadfromdivecomputer.cpp b/qt-ui/downloadfromdivecomputer.cpp index d8983e9aa..57415fac5 100644 --- a/qt-ui/downloadfromdivecomputer.cpp +++ b/qt-ui/downloadfromdivecomputer.cpp @@ -45,7 +45,7 @@ DownloadFromDCWidget *DownloadFromDCWidget::instance() DownloadFromDCWidget::DownloadFromDCWidget(QWidget* parent, Qt::WindowFlags f) : QDialog(parent, f), thread(0), timer(new QTimer(this)), - currentState(INITIAL) + currentState(INITIAL), dumpWarningShown(false) { ui.setupUi(this); ui.progressBar->hide(); @@ -279,8 +279,14 @@ void DownloadFromDCWidget::checkDumpFile(int state) { ui.chooseDumpFile->setEnabled(state == Qt::Checked); data.libdc_dump = (state == Qt::Checked); - if (state == Qt::Checked && dumpFile.isEmpty()) { - pickDumpFile(); + if (state == Qt::Checked) { + if (dumpFile.isEmpty()) + pickDumpFile(); + if (!dumpWarningShown) { + QMessageBox::warning(this, tr("Warning"), + tr("Saving the libdivecomputer dump will NOT download dives to the dive list.")); + dumpWarningShown = true; + } } } diff --git a/qt-ui/downloadfromdivecomputer.h b/qt-ui/downloadfromdivecomputer.h index cb09a9f6d..943a1aa43 100644 --- a/qt-ui/downloadfromdivecomputer.h +++ b/qt-ui/downloadfromdivecomputer.h @@ -70,6 +70,7 @@ private: QString logFile; QString dumpFile; QTimer *timer; + bool dumpWarningShown; public: bool preferDownloaded(); -- cgit v1.2.3-70-g09d2