diff options
author | Joseph W. Joshua <joejoshw@gmail.com> | 2014-07-16 12:04:54 +0300 |
---|---|---|
committer | Thiago Macieira <thiago@macieira.org> | 2014-08-13 10:48:15 -0700 |
commit | a9b55d7f0d00d68523058c5714fa4b199cbf2211 (patch) | |
tree | 5f86d9083eea3993bb2ff6f1dfcc4775bf9af22c /qt-ui/configuredivecomputerdialog.cpp | |
parent | 91ccd890482c411c91c65a999573ba85fb28aa07 (diff) | |
download | subsurface-a9b55d7f0d00d68523058c5714fa4b199cbf2211.tar.gz |
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>
Diffstat (limited to 'qt-ui/configuredivecomputerdialog.cpp')
-rw-r--r-- | qt-ui/configuredivecomputerdialog.cpp | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/qt-ui/configuredivecomputerdialog.cpp b/qt-ui/configuredivecomputerdialog.cpp index 733d64a4f..c9e8da751 100644 --- a/qt-ui/configuredivecomputerdialog.cpp +++ b/qt-ui/configuredivecomputerdialog.cpp @@ -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); +} |