diff options
author | Joseph W. Joshua <joejoshw@gmail.com> | 2014-06-23 18:16:27 +0300 |
---|---|---|
committer | Thiago Macieira <thiago@macieira.org> | 2014-08-13 10:48:15 -0700 |
commit | cc6c385f3309417727f61b55550d6d47bef004dd (patch) | |
tree | 2b86c64b388ad7005cbf952bc3c93ef9abcbb1d3 /qt-ui/configuredivecomputerdialog.cpp | |
parent | 8aa7fddb22cd6ab4d533082598be04649bb1ff21 (diff) | |
download | subsurface-cc6c385f3309417727f61b55550d6d47bef004dd.tar.gz |
Start Work on Firmware Update
This patch implements the first step towards OSTC 3 firmware update.
Its not much, just file selection, but I will build up on it from there.
Implements a thread to initiate firmware updates. Currently, this is
for the OSTC 3.
Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Diffstat (limited to 'qt-ui/configuredivecomputerdialog.cpp')
-rw-r--r-- | qt-ui/configuredivecomputerdialog.cpp | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/qt-ui/configuredivecomputerdialog.cpp b/qt-ui/configuredivecomputerdialog.cpp index 81d8f0326..733d64a4f 100644 --- a/qt-ui/configuredivecomputerdialog.cpp +++ b/qt-ui/configuredivecomputerdialog.cpp @@ -38,12 +38,12 @@ ConfigureDiveComputerDialog::ConfigureDiveComputerDialog(QWidget *parent) : deviceDetails = new DeviceDetails(this); config = new ConfigureDiveComputer(this); - connect (config, SIGNAL(error(QString)), this, SLOT(configError(QString))); - connect (config, SIGNAL(message(QString)), this, SLOT(configMessage(QString))); - connect (config, SIGNAL(readFinished()), this, SLOT(deviceReadFinished())); - connect (config, SIGNAL(deviceDetailsChanged(DeviceDetails*)), + connect(config, SIGNAL(error(QString)), this, SLOT(configError(QString))); + connect(config, SIGNAL(message(QString)), this, SLOT(configMessage(QString))); + connect(config, SIGNAL(readFinished()), this, SLOT(deviceReadFinished())); + connect(config, SIGNAL(deviceDetailsChanged(DeviceDetails*)), this, SLOT(deviceDetailsReceived(DeviceDetails*))); - connect (ui->retrieveDetails, SIGNAL(clicked()), this, SLOT(readSettings())); + connect(ui->retrieveDetails, SIGNAL(clicked()), this, SLOT(readSettings())); memset(&device_data, 0, sizeof(device_data)); fill_computer_list(); @@ -451,3 +451,18 @@ void ConfigureDiveComputerDialog::on_tabWidget_currentChanged(int index) dcType = DC_TYPE_UEMIS; fill_device_list(dcType); } + +void ConfigureDiveComputerDialog::on_updateFirmwareButton_clicked() +{ + QString filename = existing_filename ?: prefs.default_filename; + QFileInfo fi(filename); + filename = fi.absolutePath(); + QString firmwarePath = QFileDialog::getOpenFileName(this, tr("Select firmware file"), + filename, tr("All files (*.*)") + ); + if (!firmwarePath.isEmpty()) { + getDeviceData(); + QString errText; + config->startFirmwareUpdate(firmwarePath, &device_data, errText); + } +} |