From e8b02d3b2a9bd620e40d6444852c9d86fde41e66 Mon Sep 17 00:00:00 2001 From: Anton Lundin Date: Tue, 20 Jan 2015 22:49:56 +0100 Subject: [PATCH] Add a QProgressDialog to auto-ostc3-firmware Signed-off-by: Anton Lundin Signed-off-by: Dirk Hohndel --- qt-ui/configuredivecomputerdialog.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/qt-ui/configuredivecomputerdialog.cpp b/qt-ui/configuredivecomputerdialog.cpp index 182bf76cb..2c2814dad 100644 --- a/qt-ui/configuredivecomputerdialog.cpp +++ b/qt-ui/configuredivecomputerdialog.cpp @@ -6,6 +6,7 @@ #include #include #include +#include struct product { const char *product; @@ -281,7 +282,13 @@ void OstcFirmwareCheck::saveOstcFirmware(QNetworkReply *reply) file.open(QIODevice::WriteOnly); file.write(firmwareData); file.close(); + QProgressDialog *dialog = new QProgressDialog("Updating firmware", "", 0, 100); + dialog->setCancelButton(0); + dialog->setAutoClose(true); ConfigureDiveComputer *config = new ConfigureDiveComputer(); + connect(config, SIGNAL(message(QString)), dialog, SLOT(setLabelText(QString))); + connect(config, SIGNAL(error(QString)), dialog, SLOT(setLabelText(QString))); + connect(config, SIGNAL(progress(int)), dialog, SLOT(setValue(int))); config->startFirmwareUpdate(storeFirmware, &devData); }