mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
91ccd89048
commit
a9b55d7f0d
5 changed files with 749 additions and 719 deletions
BIN
icons/ostc3.png
Normal file
BIN
icons/ostc3.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 28 KiB |
|
@ -50,7 +50,8 @@ ConfigureDiveComputerDialog::ConfigureDiveComputerDialog(QWidget *parent) :
|
||||||
if (default_dive_computer_device)
|
if (default_dive_computer_device)
|
||||||
ui->device->setEditText(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()
|
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()
|
void ConfigureDiveComputerDialog::on_updateFirmwareButton_clicked()
|
||||||
{
|
{
|
||||||
QString filename = existing_filename ?: prefs.default_filename;
|
QString filename = existing_filename ?: prefs.default_filename;
|
||||||
|
@ -466,3 +450,20 @@ void ConfigureDiveComputerDialog::on_updateFirmwareButton_clicked()
|
||||||
config->startFirmwareUpdate(firmwarePath, &device_data, errText);
|
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);
|
||||||
|
}
|
||||||
|
|
|
@ -31,10 +31,11 @@ private slots:
|
||||||
|
|
||||||
void on_restoreBackupButton_clicked();
|
void on_restoreBackupButton_clicked();
|
||||||
|
|
||||||
void on_tabWidget_currentChanged(int index);
|
|
||||||
|
|
||||||
void on_updateFirmwareButton_clicked();
|
void on_updateFirmwareButton_clicked();
|
||||||
|
|
||||||
|
void on_DiveComputerList_currentRowChanged(int currentRow);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::ConfigureDiveComputerDialog *ui;
|
Ui::ConfigureDiveComputerDialog *ui;
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -59,10 +59,11 @@
|
||||||
<file alias="icon_ead">icons/ead.png</file>
|
<file alias="icon_ead">icons/ead.png</file>
|
||||||
<file alias="icon_HR">icons/icon-HR.png</file>
|
<file alias="icon_HR">icons/icon-HR.png</file>
|
||||||
<file alias="calendar">icons/calendarbg.png</file>
|
<file alias="calendar">icons/calendarbg.png</file>
|
||||||
<file alias="pictures">icons/pictures.png</file>
|
<file alias="pictures">icons/pictures.png</file>
|
||||||
<file>icons/subsurface/index.theme</file>
|
<file>icons/subsurface/index.theme</file>
|
||||||
<file>icons/subsurface/32x32/actions/go-down.png</file>
|
<file>icons/subsurface/32x32/actions/go-down.png</file>
|
||||||
<file>icons/subsurface/32x32/actions/go-up.png</file>
|
<file>icons/subsurface/32x32/actions/go-up.png</file>
|
||||||
<file>icons/subsurface/32x32/actions/window-close.png</file>
|
<file>icons/subsurface/32x32/actions/window-close.png</file>
|
||||||
|
<file>icons/ostc3.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue