diff options
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); + } +} |