mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Add some limits to the GF's
Sets the limit for GF's in the preferences panel to 1<=x<=150 and color it read if gf > 100. Remove the % in the diveplanner view that was rejected for the preferences view. The 150 maximum is needed because QSpinBox defaults to maximum 99. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
b5d3476b0b
commit
a0df62d913
4 changed files with 41 additions and 9 deletions
|
@ -101,25 +101,22 @@
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="0">
|
<item row="5" column="0">
|
||||||
<widget class="QSpinBox" name="gflow">
|
<widget class="QSpinBox" name="gflow">
|
||||||
<property name="suffix">
|
|
||||||
<string>%</string>
|
|
||||||
</property>
|
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
<number>1</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>100</number>
|
<number>150</number>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="1">
|
<item row="5" column="1">
|
||||||
<widget class="QSpinBox" name="gfhigh">
|
<widget class="QSpinBox" name="gfhigh">
|
||||||
<property name="suffix">
|
|
||||||
<string>%</string>
|
|
||||||
</property>
|
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
<number>1</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>150</number>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="0">
|
<item row="6" column="0">
|
||||||
|
|
|
@ -15,10 +15,28 @@ PreferencesDialog::PreferencesDialog(QWidget* parent, Qt::WindowFlags f) : QDial
|
||||||
{
|
{
|
||||||
ui.setupUi(this);
|
ui.setupUi(this);
|
||||||
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.gfhigh, SIGNAL(valueChanged(int)), this, SLOT(gfhighChanged(int)));
|
||||||
setUiFromPrefs();
|
setUiFromPrefs();
|
||||||
rememberPrefs();
|
rememberPrefs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PreferencesDialog::gflowChanged(int gf)
|
||||||
|
{
|
||||||
|
if (gf > 100)
|
||||||
|
ui.gflow->setStyleSheet("* { color: red; }");
|
||||||
|
else
|
||||||
|
ui.gflow->setStyleSheet("");
|
||||||
|
}
|
||||||
|
|
||||||
|
void PreferencesDialog::gfhighChanged(int gf)
|
||||||
|
{
|
||||||
|
if (gf > 100)
|
||||||
|
ui.gfhigh->setStyleSheet("* { color: red; }");
|
||||||
|
else
|
||||||
|
ui.gfhigh->setStyleSheet("");
|
||||||
|
}
|
||||||
|
|
||||||
void PreferencesDialog::showEvent(QShowEvent *event)
|
void PreferencesDialog::showEvent(QShowEvent *event)
|
||||||
{
|
{
|
||||||
setUiFromPrefs();
|
setUiFromPrefs();
|
||||||
|
|
|
@ -22,6 +22,9 @@ public slots:
|
||||||
void syncSettings();
|
void syncSettings();
|
||||||
void restorePrefs();
|
void restorePrefs();
|
||||||
void rememberPrefs();
|
void rememberPrefs();
|
||||||
|
void gflowChanged(int gf);
|
||||||
|
void gfhighChanged(int gf);
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
explicit PreferencesDialog(QWidget* parent = 0, Qt::WindowFlags f = 0);
|
explicit PreferencesDialog(QWidget* parent = 0, Qt::WindowFlags f = 0);
|
||||||
|
|
|
@ -779,7 +779,14 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QSpinBox" name="gflow"/>
|
<widget class="QSpinBox" name="gflow">
|
||||||
|
<property name="minimum">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>150</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="label_20">
|
<widget class="QLabel" name="label_20">
|
||||||
|
@ -789,7 +796,14 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QSpinBox" name="gfhigh"/>
|
<widget class="QSpinBox" name="gfhigh">
|
||||||
|
<property name="minimum">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>150</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0" colspan="2">
|
<item row="2" column="0" colspan="2">
|
||||||
<widget class="QCheckBox" name="gf_low_at_maxdepth">
|
<widget class="QCheckBox" name="gf_low_at_maxdepth">
|
||||||
|
|
Loading…
Add table
Reference in a new issue