mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-29 14:52:12 +01:00
MixerCurve: disable command buttons; add conventional Reset/Advanced buttons;
move min/max/step into SettingsGroup;
This commit is contained in:
parent
685fb4e1d4
commit
4a13554e1f
@ -43,8 +43,10 @@ MixerCurve::MixerCurve(QWidget *parent) :
|
|||||||
|
|
||||||
|
|
||||||
m_mixerUI->SettingsGroup->hide();
|
m_mixerUI->SettingsGroup->hide();
|
||||||
m_mixerUI->ValuesGroup->hide();
|
|
||||||
m_curve->showCommands(false);
|
m_curve->showCommands(false);
|
||||||
|
m_curve->showCommand("Reset", false);
|
||||||
|
m_curve->showCommand("Popup", false);
|
||||||
|
m_curve->showCommand("Commands", false);
|
||||||
|
|
||||||
// create our spin delegate
|
// create our spin delegate
|
||||||
m_spinDelegate = new DoubleSpinDelegate();
|
m_spinDelegate = new DoubleSpinDelegate();
|
||||||
@ -62,6 +64,7 @@ MixerCurve::MixerCurve(QWidget *parent) :
|
|||||||
|
|
||||||
connect(m_mixerUI->CurveType, SIGNAL(currentIndexChanged(int)), this, SLOT(CurveTypeChanged()));
|
connect(m_mixerUI->CurveType, SIGNAL(currentIndexChanged(int)), this, SLOT(CurveTypeChanged()));
|
||||||
connect(m_mixerUI->ResetCurve, SIGNAL(clicked()), this, SLOT(ResetCurve()));
|
connect(m_mixerUI->ResetCurve, SIGNAL(clicked()), this, SLOT(ResetCurve()));
|
||||||
|
connect(m_mixerUI->PopupCurve, SIGNAL(clicked()),this,SLOT(PopupCurve()));
|
||||||
connect(m_mixerUI->GenerateCurve, SIGNAL(clicked()), this, SLOT(GenerateCurve()));
|
connect(m_mixerUI->GenerateCurve, SIGNAL(clicked()), this, SLOT(GenerateCurve()));
|
||||||
connect(m_curve, SIGNAL(curveUpdated()), this, SLOT(UpdateSettingsTable()));
|
connect(m_curve, SIGNAL(curveUpdated()), this, SLOT(UpdateSettingsTable()));
|
||||||
connect(m_curve, SIGNAL(commandActivated(Node*)),this, SLOT(CommandActivated(Node*)));
|
connect(m_curve, SIGNAL(commandActivated(Node*)),this, SLOT(CommandActivated(Node*)));
|
||||||
@ -128,6 +131,21 @@ void MixerCurve::ResetCurve()
|
|||||||
UpdateSettingsTable();
|
UpdateSettingsTable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MixerCurve::PopupCurve()
|
||||||
|
{
|
||||||
|
if (!m_curve->isCommandActive("Popup")) {
|
||||||
|
|
||||||
|
m_mixerUI->SettingsGroup->show();
|
||||||
|
m_mixerUI->PopupCurve->hide();
|
||||||
|
|
||||||
|
PopupWidget* popup = new PopupWidget();
|
||||||
|
popup->popUp(this);
|
||||||
|
|
||||||
|
m_mixerUI->SettingsGroup->hide();
|
||||||
|
m_mixerUI->PopupCurve->show();
|
||||||
|
m_curve->showCommands(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
void MixerCurve::UpdateCurveUI()
|
void MixerCurve::UpdateCurveUI()
|
||||||
{
|
{
|
||||||
//get the user settings
|
//get the user settings
|
||||||
@ -363,18 +381,8 @@ void MixerCurve::CommandActivated(Node* node)
|
|||||||
else if (name == "Commands") {
|
else if (name == "Commands") {
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (name == "Popup" && !m_curve->isCommandActive("Popup")) {
|
else if (name == "Popup" ) {
|
||||||
m_mixerUI->SettingsGroup->show();
|
PopupCurve();
|
||||||
m_mixerUI->ValuesGroup->show();
|
|
||||||
m_curve->showCommand("Popup", false);
|
|
||||||
|
|
||||||
PopupWidget* popup = new PopupWidget();
|
|
||||||
popup->popUp(this);
|
|
||||||
|
|
||||||
m_mixerUI->SettingsGroup->hide();
|
|
||||||
m_mixerUI->ValuesGroup->hide();
|
|
||||||
m_curve->showCommands(false);
|
|
||||||
m_curve->showCommand("Popup", true);
|
|
||||||
}
|
}
|
||||||
else if (name == "Linear") {
|
else if (name == "Linear") {
|
||||||
m_mixerUI->CurveType->setCurrentIndex(m_mixerUI->CurveType->findText("Linear"));
|
m_mixerUI->CurveType->setCurrentIndex(m_mixerUI->CurveType->findText("Linear"));
|
||||||
|
@ -79,6 +79,7 @@ protected:
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void ResetCurve();
|
void ResetCurve();
|
||||||
|
void PopupCurve();
|
||||||
void GenerateCurve();
|
void GenerateCurve();
|
||||||
void UpdateSettingsTable();
|
void UpdateSettingsTable();
|
||||||
|
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>441</width>
|
<width>543</width>
|
||||||
<height>334</height>
|
<height>467</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@ -183,79 +183,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<spacer name="verticalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="ResetCurve">
|
|
||||||
<property name="text">
|
|
||||||
<string>Reset</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
<zorder>GenerateCurve</zorder>
|
|
||||||
<zorder>CurveSettings</zorder>
|
|
||||||
<zorder>ResetCurve</zorder>
|
|
||||||
<zorder>CurveType</zorder>
|
|
||||||
<zorder>verticalSpacer</zorder>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1" colspan="2">
|
|
||||||
<widget class="MixerCurveWidget" name="CurveWidget" native="true">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
|
||||||
<horstretch>5</horstretch>
|
|
||||||
<verstretch>5</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>50</width>
|
|
||||||
<height>50</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>1000</width>
|
|
||||||
<height>1000</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="sizeIncrement">
|
|
||||||
<size>
|
|
||||||
<width>10</width>
|
|
||||||
<height>10</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="baseSize">
|
|
||||||
<size>
|
|
||||||
<width>200</width>
|
|
||||||
<height>200</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<pointsize>7</pointsize>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="QGroupBox" name="ValuesGroup">
|
|
||||||
<property name="title">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="minLabel">
|
<widget class="QLabel" name="minLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -332,21 +259,101 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>40</width>
|
<width>20</width>
|
||||||
<height>20</height>
|
<height>40</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
<zorder>GenerateCurve</zorder>
|
||||||
|
<zorder>CurveSettings</zorder>
|
||||||
|
<zorder>CurveType</zorder>
|
||||||
|
<zorder>CurveMin</zorder>
|
||||||
|
<zorder>minLabel</zorder>
|
||||||
|
<zorder>CurveMax</zorder>
|
||||||
|
<zorder>maxLabel</zorder>
|
||||||
|
<zorder>CurveStep</zorder>
|
||||||
|
<zorder>stepLabel</zorder>
|
||||||
|
<zorder>verticalSpacer</zorder>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="MixerCurveWidget" name="CurveWidget" native="true">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||||
|
<horstretch>5</horstretch>
|
||||||
|
<verstretch>5</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>50</width>
|
||||||
|
<height>50</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>1000</width>
|
||||||
|
<height>1000</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="sizeIncrement">
|
||||||
|
<size>
|
||||||
|
<width>10</width>
|
||||||
|
<height>10</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="baseSize">
|
||||||
|
<size>
|
||||||
|
<width>200</width>
|
||||||
|
<height>200</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>7</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="ResetCurve">
|
||||||
|
<property name="text">
|
||||||
|
<string>Reset</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="PopupCurve">
|
||||||
|
<property name="text">
|
||||||
|
<string>Advanced...</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user