summaryrefslogtreecommitdiffstats
path: root/qt-ui/preferences.cpp
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2015-01-10 23:32:36 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-01-10 17:27:24 -0800
commit7d8ecf8ec842c69ea38165023ffbc1ef457df79a (patch)
treea87e8119fc55306ecfba63423b59f01dff98ea2f /qt-ui/preferences.cpp
parent0f7f2195d56effff234430cc4314c5216d518a8d (diff)
downloadsubsurface-7d8ecf8ec842c69ea38165023ffbc1ef457df79a.tar.gz
Add preferences field for default set-point
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/preferences.cpp')
-rw-r--r--qt-ui/preferences.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/qt-ui/preferences.cpp b/qt-ui/preferences.cpp
index 32237aea8..7e718651c 100644
--- a/qt-ui/preferences.cpp
+++ b/qt-ui/preferences.cpp
@@ -1,6 +1,7 @@
#include "preferences.h"
#include "mainwindow.h"
#include <QSettings>
+#include <QDebug>
#include <QFileDialog>
#include <QMessageBox>
#include <QShortcut>
@@ -42,6 +43,7 @@ PreferencesDialog::PreferencesDialog(QWidget *parent, Qt::WindowFlags f) : QDial
connect(ui.buttonBox, SIGNAL(clicked(QAbstractButton *)), this, SLOT(buttonClicked(QAbstractButton *)));
connect(ui.gflow, SIGNAL(valueChanged(int)), this, SLOT(gflowChanged(int)));
connect(ui.gfhigh, SIGNAL(valueChanged(int)), this, SLOT(gfhighChanged(int)));
+// connect(ui.defaultSetpoint, SIGNAL(valueChanged(double)), this, SLOT(defaultSetpointChanged(double)));
QShortcut *close = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_W), this);
connect(close, SIGNAL(activated()), this, SLOT(close()));
QShortcut *quit = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), this);
@@ -96,6 +98,7 @@ void PreferencesDialog::setUiFromPrefs()
ui.gfhigh->setValue(prefs.gfhigh);
ui.gf_low_at_maxdepth->setChecked(prefs.gf_low_at_maxdepth);
ui.show_ccr_setpoint->setChecked(prefs.show_ccr_setpoint);
+ ui.defaultSetpoint->setValue((double)prefs.defaultsetpoint / 1000.0);
// units
if (prefs.unit_system == METRIC)
@@ -270,6 +273,7 @@ void PreferencesDialog::syncSettings()
s.setValue("default_filename", ui.defaultfilename->text());
s.setValue("default_cylinder", ui.default_cylinder->currentText());
s.setValue("use_default_file", ui.btnUseDefaultFile->isChecked());
+ s.setValue("defaultsetpoint", (int) (ui.defaultSetpoint->value() * 1000.0));
s.endGroup();
s.beginGroup("Display");
@@ -312,7 +316,7 @@ void PreferencesDialog::syncSettings()
void PreferencesDialog::loadSettings()
{
- // This code was on the mainwindow, it should belong nowhere, but since we dind't
+ // This code was on the mainwindow, it should belong nowhere, but since we didn't
// correctly fixed this code yet ( too much stuff on the code calling preferences )
// force this here.
@@ -374,6 +378,7 @@ void PreferencesDialog::loadSettings()
GET_TXT("default_filename", default_filename);
GET_TXT("default_cylinder", default_cylinder);
GET_BOOL("use_default_file", use_default_file);
+ GET_INT("defaultsetpoint", defaultsetpoint);
s.endGroup();
s.beginGroup("Display");