Do not force minimum threshold value below config value

This commit is contained in:
Et0h 2014-07-18 12:51:32 +01:00
parent 25aade06cb
commit eb45f3b6d4
1 changed files with 8 additions and 2 deletions

View File

@ -414,7 +414,10 @@ class ConfigDialog(QtGui.QDialog):
self.slowdownThresholdSpinbox = QDoubleSpinBox() self.slowdownThresholdSpinbox = QDoubleSpinBox()
try: try:
self.slowdownThresholdSpinbox.setValue(float(config['slowdownThreshold'])) slowdownThreshold = float(config['slowdownThreshold'])
self.slowdownThresholdSpinbox.setValue(slowdownThreshold)
if slowdownThreshold < constants.MINIMUM_SLOWDOWN_THRESHOLD:
constants.MINIMUM_SLOWDOWN_THRESHOLD = slowdownThreshold
except ValueError: except ValueError:
self.slowdownThresholdSpinbox.setValue(constants.DEFAULT_SLOWDOWN_KICKIN_THRESHOLD) self.slowdownThresholdSpinbox.setValue(constants.DEFAULT_SLOWDOWN_KICKIN_THRESHOLD)
self.slowdownThresholdSpinbox.setSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum) self.slowdownThresholdSpinbox.setSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum)
@ -429,7 +432,10 @@ class ConfigDialog(QtGui.QDialog):
self.rewindThresholdLabel.setStyleSheet(constants.STYLE_SUBLABEL.format(self.posixresourcespath + "bullet_black.png")) self.rewindThresholdLabel.setStyleSheet(constants.STYLE_SUBLABEL.format(self.posixresourcespath + "bullet_black.png"))
self.rewindThresholdSpinbox = QDoubleSpinBox() self.rewindThresholdSpinbox = QDoubleSpinBox()
try: try:
self.rewindThresholdSpinbox.setValue(float(config['rewindThreshold'])) rewindThreshold = float(config['rewindThreshold'])
self.rewindThresholdSpinbox.setValue(rewindThreshold)
if rewindThreshold < constants.MINIMUM_REWIND_THRESHOLD:
constants.MINIMUM_REWIND_THRESHOLD = rewindThreshold
except ValueError: except ValueError:
self.rewindThresholdSpinbox.setValue(constants.DEFAULT_REWIND_THRESHOLD) self.rewindThresholdSpinbox.setValue(constants.DEFAULT_REWIND_THRESHOLD)
self.rewindThresholdSpinbox.setSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum) self.rewindThresholdSpinbox.setSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum)