summaryrefslogtreecommitdiffstats
path: root/qt-ui/downloadfromdivecomputer.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-12-27 08:31:51 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-12-27 08:31:51 -0800
commit52084c80f7f03f8e8066bc7ccf9f747a38cbd60c (patch)
treef077e98775f53876ef8c6954f7625b5673c6a7a3 /qt-ui/downloadfromdivecomputer.cpp
parent9f95f3ce18a1c25b0407335f472987c64940153d (diff)
downloadsubsurface-52084c80f7f03f8e8066bc7ccf9f747a38cbd60c.tar.gz
Move OSTC firmware check around a bit
This rearranges the code so we can call it from the download dialog and tell the user if there is a newer version of the firmware available. This needs a proper dialog and needs to be hooked up so that the user can accept the suggestion and go directly to the firmware update code. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/downloadfromdivecomputer.cpp')
-rw-r--r--qt-ui/downloadfromdivecomputer.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/qt-ui/downloadfromdivecomputer.cpp b/qt-ui/downloadfromdivecomputer.cpp
index 112d10586..b270def5b 100644
--- a/qt-ui/downloadfromdivecomputer.cpp
+++ b/qt-ui/downloadfromdivecomputer.cpp
@@ -1,11 +1,11 @@
#include "downloadfromdivecomputer.h"
-#include "../divecomputer.h"
-#include "../libdivecomputer.h"
-#include "../helpers.h"
-#include "../display.h"
-#include "../divelist.h"
-
+#include "divecomputer.h"
+#include "libdivecomputer.h"
+#include "helpers.h"
+#include "display.h"
+#include "divelist.h"
#include "mainwindow.h"
+
#include <cstdlib>
#include <QThread>
#include <QDebug>
@@ -46,7 +46,8 @@ DownloadFromDCWidget::DownloadFromDCWidget(QWidget *parent, Qt::WindowFlags f) :
productModel(0),
timer(new QTimer(this)),
dumpWarningShown(false),
- currentState(INITIAL)
+ currentState(INITIAL),
+ ostcFirmwareCheck(0)
{
ui.setupUi(this);
ui.progressBar->hide();
@@ -302,6 +303,9 @@ void DownloadFromDCWidget::on_ok_clicked()
previousLast = dive_table.nr;
thread->start();
+
+ if (ui.product->currentText() == "OSTC 3" || ui.product->currentText() == "OSTC sport")
+ ostcFirmwareCheck = new OstcFirmwareCheck();
}
bool DownloadFromDCWidget::preferDownloaded()
@@ -397,6 +401,9 @@ void DownloadFromDCWidget::onDownloadThreadFinished()
// (but not visible as selected)
MainWindow::instance()->dive_list()->unselectDives();
MainWindow::instance()->dive_list()->selectDive(idx, true);
+ QString dcName = data.devname;
+ if (ostcFirmwareCheck)
+ ostcFirmwareCheck->checkLatest(data.libdc_firmware);
}
} else if (currentState == CANCELLING || currentState == CANCELLED) {
if (import_thread_cancelled) {