diff options
author | Anton Lundin <glance@acc.umu.se> | 2013-12-05 00:48:37 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-12-04 15:49:55 -0800 |
commit | a0df62d913a8bfc54aae0c7b69a3197bdfae3dd5 (patch) | |
tree | a82134e53650111508fb34f9cc2db019d574d857 /qt-ui/preferences.cpp | |
parent | b5d3476b0ba881699c604a3d97c5801b8bb99a08 (diff) | |
download | subsurface-a0df62d913a8bfc54aae0c7b69a3197bdfae3dd5.tar.gz |
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>
Diffstat (limited to 'qt-ui/preferences.cpp')
-rw-r--r-- | qt-ui/preferences.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/qt-ui/preferences.cpp b/qt-ui/preferences.cpp index 5a1a2a5e2..f8b24da42 100644 --- a/qt-ui/preferences.cpp +++ b/qt-ui/preferences.cpp @@ -15,10 +15,28 @@ PreferencesDialog::PreferencesDialog(QWidget* parent, Qt::WindowFlags f) : QDial { ui.setupUi(this); 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(); 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) { setUiFromPrefs(); |