Browse Source

Properly disable UI parameters when needed

tags/1.9.4
falkTX 11 years ago
parent
commit
5692fe7ea3
2 changed files with 6 additions and 0 deletions
  1. +2
    -0
      source/carla_shared.py
  2. +4
    -0
      source/widgets/paramspinbox.py

+ 2
- 0
source/carla_shared.py View File

@@ -933,6 +933,8 @@ class PluginParameter(QWidget):
self.ui.widget.setScalePoints(pInfo['scalePoints'], bool(pHints & PARAMETER_USES_SCALEPOINTS))

if not pHints & PARAMETER_IS_ENABLED:
self.ui.label.setEnabled(False)
self.ui.widget.setEnabled(False)
self.ui.widget.setReadOnly(True)
self.ui.sb_control.setEnabled(False)
self.ui.sb_channel.setEnabled(False)


+ 4
- 0
source/widgets/paramspinbox.py View File

@@ -268,6 +268,10 @@ class ParamSpinBox(QAbstractSpinBox):
self.fReadOnly = yesNo
QAbstractSpinBox.setReadOnly(self, yesNo)

def setEnabled(self, yesNo):
self.fBar.setEnabled(yesNo)
QAbstractSpinBox.setEnabled(self, yesNo)

def setScalePoints(self, scalePoints, useScalePoints):
if len(scalePoints) == 0:
self.fScalePoints = None


Loading…
Cancel
Save