aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets/configuredivecomputerdialog.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@gmail.com>2016-08-10 18:10:15 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-08-27 11:40:44 -0700
commitdb8e8957abc8b8dc407a94835e686f649c9643a6 (patch)
tree5c21bd7e9a4174704e1c53752146c1229464b2bc /desktop-widgets/configuredivecomputerdialog.cpp
parentb264c3e36704c83a6c9353fe5eac3dc0eb3c9a80 (diff)
downloadsubsurface-db8e8957abc8b8dc407a94835e686f649c9643a6.tar.gz
Settings update: Add "Dive Computer" settings to SettingsObjectWrapper
For some reason, the dive computer settings weren't in the settings prefs. This moves it, makes the boilerplate on Settings ObjectWrapper and make things compile. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'desktop-widgets/configuredivecomputerdialog.cpp')
-rw-r--r--desktop-widgets/configuredivecomputerdialog.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/desktop-widgets/configuredivecomputerdialog.cpp b/desktop-widgets/configuredivecomputerdialog.cpp
index 471db9a65..79cdcaf2f 100644
--- a/desktop-widgets/configuredivecomputerdialog.cpp
+++ b/desktop-widgets/configuredivecomputerdialog.cpp
@@ -3,6 +3,7 @@
#include "core/helpers.h"
#include "desktop-widgets/mainwindow.h"
#include "core/display.h"
+#include "core/subsurface-qt/SettingsObjectWrapper.h"
#include <QFileDialog>
#include <QMessageBox>
@@ -150,8 +151,9 @@ ConfigureDiveComputerDialog::ConfigureDiveComputerDialog(QWidget *parent) : QDia
memset(&device_data, 0, sizeof(device_data));
fill_computer_list();
- if (default_dive_computer_device)
- ui.device->setEditText(default_dive_computer_device);
+ auto dc = SettingsObjectWrapper::instance()->dive_computer_settings;
+ if (!dc->dc_device().isEmpty())
+ ui.device->setEditText(dc->dc_device());
ui.DiveComputerList->setCurrentRow(0);
on_DiveComputerList_currentRowChanged(0);
@@ -775,7 +777,8 @@ void ConfigureDiveComputerDialog::getDeviceData()
device_data.descriptor = descriptorLookup[selected_vendor + selected_product];
device_data.deviceid = device_data.diveid = 0;
- set_default_dive_computer_device(device_data.devname);
+ auto dc = SettingsObjectWrapper::instance()->dive_computer_settings;
+ dc->setDevice(device_data.devname);
}
void ConfigureDiveComputerDialog::on_cancel_clicked()