Change Dive Computer Configuration dialog

Changes the layout of the ConfigureDiveComputer dialog to use a
list of supported computers on the left, with a stacked widget
showing the configurable details.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
This commit is contained in:
Joseph W. Joshua 2014-07-16 12:04:54 +03:00 committed by Thiago Macieira
parent 91ccd89048
commit a9b55d7f0d
5 changed files with 749 additions and 719 deletions

View file

@ -50,7 +50,8 @@ ConfigureDiveComputerDialog::ConfigureDiveComputerDialog(QWidget *parent) :
if (default_dive_computer_device)
ui->device->setEditText(default_dive_computer_device);
on_tabWidget_currentChanged(0);
ui->DiveComputerList->setCurrentRow(0);
on_DiveComputerList_currentRowChanged(0);
}
ConfigureDiveComputerDialog::~ConfigureDiveComputerDialog()
@ -435,23 +436,6 @@ void ConfigureDiveComputerDialog::on_restoreBackupButton_clicked()
}
}
void ConfigureDiveComputerDialog::on_tabWidget_currentChanged(int index)
{
switch (index) {
case 0:
selected_vendor = "Heinrichs Weikamp";
selected_product = "OSTC 3";
break;
}
int dcType = DC_TYPE_SERIAL;
if (selected_vendor == QString("Uemis"))
dcType = DC_TYPE_UEMIS;
fill_device_list(dcType);
}
void ConfigureDiveComputerDialog::on_updateFirmwareButton_clicked()
{
QString filename = existing_filename ?: prefs.default_filename;
@ -466,3 +450,20 @@ void ConfigureDiveComputerDialog::on_updateFirmwareButton_clicked()
config->startFirmwareUpdate(firmwarePath, &device_data, errText);
}
}
void ConfigureDiveComputerDialog::on_DiveComputerList_currentRowChanged(int currentRow)
{
switch (currentRow) {
case 0:
selected_vendor = "Heinrichs Weikamp";
selected_product = "OSTC 3";
break;
}
int dcType = DC_TYPE_SERIAL;
if (selected_vendor == QString("Uemis"))
dcType = DC_TYPE_UEMIS;
fill_device_list(dcType);
}