Browse Source

Place more parameters per tab in editor dialog

tags/1.9.8
falkTX 8 years ago
parent
commit
57dd6027bd
3 changed files with 122 additions and 61 deletions
  1. +109
    -55
      resources/ui/carla_edit.ui
  2. +5
    -2
      resources/ui/carla_parameter.ui
  3. +8
    -4
      source/carla_widgets.py

+ 109
- 55
resources/ui/carla_edit.ui View File

@@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>509</width>
<height>443</height>
<width>758</width>
<height>435</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@@ -440,12 +440,12 @@
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeType"> <property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
<enum>QSizePolicy::Expanding</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>10</width>
<height>20</height>
<width>1</width>
<height>1</height>
</size> </size>
</property> </property>
</spacer> </spacer>
@@ -471,47 +471,19 @@ Plugin Name
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeType"> <property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
<enum>QSizePolicy::Expanding</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>10</width>
<height>20</height>
<width>1</width>
<height>1</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
<item> <item>
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<item row="1" column="0">
<widget class="QPushButton" name="b_save_state">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>Save State</string>
</property>
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/document-save.png</normaloff>:/16x16/document-save.png</iconset>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="b_load_state">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>Load State</string>
</property>
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/document-open.png</normaloff>:/16x16/document-open.png</iconset>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<item row="0" column="1" colspan="2">
<widget class="QStackedWidget" name="sw_programs"> <widget class="QStackedWidget" name="sw_programs">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
@@ -527,6 +499,22 @@ Plugin Name
</property> </property>
<widget class="QWidget" name="sww_programs"> <widget class="QWidget" name="sww_programs">
<layout class="QHBoxLayout" name="horizontalLayout_3"> <layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="margin">
<number>2</number>
</property>
<item>
<spacer name="horizontalSpacer_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>1</width>
<height>1</height>
</size>
</property>
</spacer>
</item>
<item> <item>
<widget class="QLabel" name="label_programs"> <widget class="QLabel" name="label_programs">
<property name="sizePolicy"> <property name="sizePolicy">
@@ -554,6 +542,25 @@ Plugin Name
</widget> </widget>
<widget class="QWidget" name="sww_midiPrograms"> <widget class="QWidget" name="sww_midiPrograms">
<layout class="QHBoxLayout" name="horizontalLayout_4"> <layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="margin">
<number>2</number>
</property>
<item>
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>1</width>
<height>1</height>
</size>
</property>
</spacer>
</item>
<item> <item>
<widget class="QLabel" name="label_midi_programs"> <widget class="QLabel" name="label_midi_programs">
<property name="sizePolicy"> <property name="sizePolicy">
@@ -581,6 +588,50 @@ Plugin Name
</widget> </widget>
</widget> </widget>
</item> </item>
<item row="1" column="1">
<widget class="QPushButton" name="b_save_state">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>Save State</string>
</property>
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/document-save.png</normaloff>:/16x16/document-save.png</iconset>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="b_load_state">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>Load State</string>
</property>
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/document-open.png</normaloff>:/16x16/document-open.png</iconset>
</property>
</widget>
</item>
<item row="1" column="0">
<spacer name="horizontalSpacer_9">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>1</width>
<height>1</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</item> </item>
</layout> </layout>
@@ -651,22 +702,6 @@ Plugin Name
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1">
<widget class="QLineEdit" name="le_label">
<property name="inputMask">
<string notr="true"/>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="frame">
<bool>false</bool>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="1"> <item row="0" column="1">
<widget class="QLineEdit" name="le_type"> <widget class="QLineEdit" name="le_type">
<property name="inputMask"> <property name="inputMask">
@@ -755,6 +790,22 @@ Plugin Name
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1">
<widget class="QLineEdit" name="le_label">
<property name="inputMask">
<string notr="true"/>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="frame">
<bool>false</bool>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
</layout> </layout>
@@ -765,10 +816,13 @@ Plugin Name
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>20</width>
<height>40</height>
<width>1</width>
<height>1</height>
</size> </size>
</property> </property>
</spacer> </spacer>


+ 5
- 2
resources/ui/carla_parameter.ui View File

@@ -6,14 +6,17 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>452</width>
<height>34</height>
<width>369</width>
<height>22</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<property name="margin">
<number>0</number>
</property>
<item> <item>
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
<property name="text"> <property name="text">


+ 8
- 4
source/carla_widgets.py View File

@@ -431,7 +431,7 @@ class PluginEditParentMeta():


class PluginEdit(QDialog): class PluginEdit(QDialog):
# settings # settings
kParamsPerPage = 8
kParamsPerPage = 17


# signals # signals
SIGTERM = pyqtSignal() SIGTERM = pyqtSignal()
@@ -720,7 +720,10 @@ class PluginEdit(QDialog):


@pyqtSlot() @pyqtSlot()
def slot_fixNameWordWrap(self): def slot_fixNameWordWrap(self):
if self.ui.tabWidget.count() > 0:
self.ui.tabWidget.setCurrentIndex(1)
self.adjustSize() self.adjustSize()
self.ui.tabWidget.setCurrentIndex(0)
self.setMinimumSize(self.width(), self.height()) self.setMinimumSize(self.width(), self.height())


#------------------------------------------------------------------ #------------------------------------------------------------------
@@ -874,7 +877,7 @@ class PluginEdit(QDialog):
#parameter['name'] = parameter['name'][:30] + (parameter['name'][30:] and "...") #parameter['name'] = parameter['name'][:30] + (parameter['name'][30:] and "...")


# ----------------------------------------------------------------- # -----------------------------------------------------------------
# Get width values, in packs of 10
# Get width values, in packs of 20


if parameter['type'] == PARAMETER_INPUT: if parameter['type'] == PARAMETER_INPUT:
paramInputWidthTMP = QFontMetrics(self.font()).width(parameter['name']) paramInputWidthTMP = QFontMetrics(self.font()).width(parameter['name'])
@@ -905,10 +908,10 @@ class PluginEdit(QDialog):
# for i in range(parameterCount) # for i in range(parameterCount)
else: else:
# Final page width values # Final page width values
if 0 < len(paramInputList) < 10:
if 0 < len(paramInputList) < self.kParamsPerPage:
paramInputListFull.append((paramInputList, paramInputWidth)) paramInputListFull.append((paramInputList, paramInputWidth))


if 0 < len(paramOutputList) < 10:
if 0 < len(paramOutputList) < self.kParamsPerPage:
paramOutputListFull.append((paramOutputList, paramOutputWidth)) paramOutputListFull.append((paramOutputList, paramOutputWidth))


# Create parameter tabs + widgets # Create parameter tabs + widgets
@@ -1491,6 +1494,7 @@ class PluginEdit(QDialog):
tabIndex = self.ui.tabWidget.count() tabIndex = self.ui.tabWidget.count()
tabPageContainer = QWidget(self.ui.tabWidget) tabPageContainer = QWidget(self.ui.tabWidget)
tabPageLayout = QVBoxLayout(tabPageContainer) tabPageLayout = QVBoxLayout(tabPageContainer)
tabPageLayout.setSpacing(1)
tabPageContainer.setLayout(tabPageLayout) tabPageContainer.setLayout(tabPageLayout)


for paramInfo in paramList: for paramInfo in paramList:


Loading…
Cancel
Save