mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Add preferences field for default set-point
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
0f7f2195d5
commit
7d8ecf8ec8
2 changed files with 32 additions and 4 deletions
|
@ -1,6 +1,7 @@
|
||||||
#include "preferences.h"
|
#include "preferences.h"
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
#include <QDebug>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QShortcut>
|
#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.buttonBox, SIGNAL(clicked(QAbstractButton *)), this, SLOT(buttonClicked(QAbstractButton *)));
|
||||||
connect(ui.gflow, SIGNAL(valueChanged(int)), this, SLOT(gflowChanged(int)));
|
connect(ui.gflow, SIGNAL(valueChanged(int)), this, SLOT(gflowChanged(int)));
|
||||||
connect(ui.gfhigh, SIGNAL(valueChanged(int)), this, SLOT(gfhighChanged(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);
|
QShortcut *close = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_W), this);
|
||||||
connect(close, SIGNAL(activated()), this, SLOT(close()));
|
connect(close, SIGNAL(activated()), this, SLOT(close()));
|
||||||
QShortcut *quit = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), this);
|
QShortcut *quit = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), this);
|
||||||
|
@ -96,6 +98,7 @@ void PreferencesDialog::setUiFromPrefs()
|
||||||
ui.gfhigh->setValue(prefs.gfhigh);
|
ui.gfhigh->setValue(prefs.gfhigh);
|
||||||
ui.gf_low_at_maxdepth->setChecked(prefs.gf_low_at_maxdepth);
|
ui.gf_low_at_maxdepth->setChecked(prefs.gf_low_at_maxdepth);
|
||||||
ui.show_ccr_setpoint->setChecked(prefs.show_ccr_setpoint);
|
ui.show_ccr_setpoint->setChecked(prefs.show_ccr_setpoint);
|
||||||
|
ui.defaultSetpoint->setValue((double)prefs.defaultsetpoint / 1000.0);
|
||||||
|
|
||||||
// units
|
// units
|
||||||
if (prefs.unit_system == METRIC)
|
if (prefs.unit_system == METRIC)
|
||||||
|
@ -270,6 +273,7 @@ void PreferencesDialog::syncSettings()
|
||||||
s.setValue("default_filename", ui.defaultfilename->text());
|
s.setValue("default_filename", ui.defaultfilename->text());
|
||||||
s.setValue("default_cylinder", ui.default_cylinder->currentText());
|
s.setValue("default_cylinder", ui.default_cylinder->currentText());
|
||||||
s.setValue("use_default_file", ui.btnUseDefaultFile->isChecked());
|
s.setValue("use_default_file", ui.btnUseDefaultFile->isChecked());
|
||||||
|
s.setValue("defaultsetpoint", (int) (ui.defaultSetpoint->value() * 1000.0));
|
||||||
s.endGroup();
|
s.endGroup();
|
||||||
|
|
||||||
s.beginGroup("Display");
|
s.beginGroup("Display");
|
||||||
|
@ -312,7 +316,7 @@ void PreferencesDialog::syncSettings()
|
||||||
|
|
||||||
void PreferencesDialog::loadSettings()
|
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 )
|
// correctly fixed this code yet ( too much stuff on the code calling preferences )
|
||||||
// force this here.
|
// force this here.
|
||||||
|
|
||||||
|
@ -374,6 +378,7 @@ void PreferencesDialog::loadSettings()
|
||||||
GET_TXT("default_filename", default_filename);
|
GET_TXT("default_filename", default_filename);
|
||||||
GET_TXT("default_cylinder", default_cylinder);
|
GET_TXT("default_cylinder", default_cylinder);
|
||||||
GET_BOOL("use_default_file", use_default_file);
|
GET_BOOL("use_default_file", use_default_file);
|
||||||
|
GET_INT("defaultsetpoint", defaultsetpoint);
|
||||||
s.endGroup();
|
s.endGroup();
|
||||||
|
|
||||||
s.beginGroup("Display");
|
s.beginGroup("Display");
|
||||||
|
|
|
@ -151,7 +151,7 @@
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>5</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="page_2">
|
<widget class="QWidget" name="page_2">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
|
@ -782,7 +782,7 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0" colspan="2">
|
<item row="3" column="0" colspan="2">
|
||||||
<widget class="QCheckBox" name="gf_low_at_maxdepth">
|
<widget class="QCheckBox" name="gf_low_at_maxdepth">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>GFLow at max depth</string>
|
<string>GFLow at max depth</string>
|
||||||
|
@ -796,6 +796,29 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="4" column="0">
|
||||||
|
<widget class="QLabel" name="label_26">
|
||||||
|
<property name="text">
|
||||||
|
<string>Default CCR set-point</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="1">
|
||||||
|
<widget class="QDoubleSpinBox" name="defaultSetpoint">
|
||||||
|
<property name="suffix">
|
||||||
|
<string>bar</string>
|
||||||
|
</property>
|
||||||
|
<property name="decimals">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<double>10.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="singleStep">
|
||||||
|
<double>0.100000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -1394,7 +1417,7 @@
|
||||||
<buttongroup name="buttonGroup_3"/>
|
<buttongroup name="buttonGroup_3"/>
|
||||||
<buttongroup name="buttonGroup_4"/>
|
<buttongroup name="buttonGroup_4"/>
|
||||||
<buttongroup name="buttonGroup_5"/>
|
<buttongroup name="buttonGroup_5"/>
|
||||||
<buttongroup name="buttonGroup_6"/>
|
|
||||||
<buttongroup name="buttonGroup"/>
|
<buttongroup name="buttonGroup"/>
|
||||||
|
<buttongroup name="buttonGroup_6"/>
|
||||||
</buttongroups>
|
</buttongroups>
|
||||||
</ui>
|
</ui>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue