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 <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2013-12-26 09:18:57 -08:00
parent 06875c7cbd
commit 5fca06c9e6
2 changed files with 10 additions and 3 deletions

View file

@ -45,7 +45,7 @@ DownloadFromDCWidget *DownloadFromDCWidget::instance()
DownloadFromDCWidget::DownloadFromDCWidget(QWidget* parent, Qt::WindowFlags f) : DownloadFromDCWidget::DownloadFromDCWidget(QWidget* parent, Qt::WindowFlags f) :
QDialog(parent, f), thread(0), timer(new QTimer(this)), QDialog(parent, f), thread(0), timer(new QTimer(this)),
currentState(INITIAL) currentState(INITIAL), dumpWarningShown(false)
{ {
ui.setupUi(this); ui.setupUi(this);
ui.progressBar->hide(); ui.progressBar->hide();
@ -279,8 +279,14 @@ void DownloadFromDCWidget::checkDumpFile(int state)
{ {
ui.chooseDumpFile->setEnabled(state == Qt::Checked); ui.chooseDumpFile->setEnabled(state == Qt::Checked);
data.libdc_dump = (state == Qt::Checked); data.libdc_dump = (state == Qt::Checked);
if (state == Qt::Checked && dumpFile.isEmpty()) { if (state == Qt::Checked) {
pickDumpFile(); 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;
}
} }
} }

View file

@ -70,6 +70,7 @@ private:
QString logFile; QString logFile;
QString dumpFile; QString dumpFile;
QTimer *timer; QTimer *timer;
bool dumpWarningShown;
public: public:
bool preferDownloaded(); bool preferDownloaded();