mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
8aa7fddb22
commit
cc6c385f33
7 changed files with 94 additions and 14 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,8 @@ private slots:
|
|||
|
||||
void on_tabWidget_currentChanged(int index);
|
||||
|
||||
void on_updateFirmwareButton_clicked();
|
||||
|
||||
private:
|
||||
Ui::ConfigureDiveComputerDialog *ui;
|
||||
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>787</width>
|
||||
<height>672</height>
|
||||
<width>785</width>
|
||||
<height>670</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
|
@ -89,6 +89,13 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="updateFirmwareButton">
|
||||
<property name="text">
|
||||
<string>Update Firmware</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue