mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-03-15 07:29:15 +01:00
OP-1685 Simplifying the warning label code and layout.
This commit is contained in:
parent
1b842ec322
commit
6c33fb8185
@ -52,7 +52,6 @@ ConfigOutputWidget::ConfigOutputWidget(QWidget *parent) : ConfigTaskWidget(paren
|
||||
ui = new Ui_OutputWidget();
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->gvWarning->setScene(new QGraphicsScene(this));
|
||||
ui->gvFrame->setVisible(false);
|
||||
|
||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||
@ -453,7 +452,8 @@ void ConfigOutputWidget::updateWarnings(UAVObject *)
|
||||
if (systemAlarms.Alarm[SystemAlarms::ALARM_SYSTEMCONFIGURATION] > SystemAlarms::ALARM_WARNING) {
|
||||
switch (systemAlarms.ExtendedAlarmStatus[SystemAlarms::EXTENDEDALARMSTATUS_SYSTEMCONFIGURATION]) {
|
||||
case SystemAlarms::EXTENDEDALARMSTATUS_UNSUPPORTEDCONFIG_ONESHOT:
|
||||
setWarning(tr("OneShot only works with MainPort settings marked with \"+OneShot\"\nUsing \"PPM_PIN6+OneShot\" bank 4 (output 6) must be set to PWM"));
|
||||
setWarning(tr("OneShot only works with Receiver Port settings marked with '+OneShot'\n"
|
||||
"When using Receiver Port setting 'PPM_PIN6+OneShot' Bank 4 (output 6,9-10) must be set to PWM"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -462,18 +462,7 @@ void ConfigOutputWidget::updateWarnings(UAVObject *)
|
||||
|
||||
void ConfigOutputWidget::setWarning(QString message)
|
||||
{
|
||||
QPixmap warningPic;
|
||||
|
||||
ui->gvWarning->scene()->clear();
|
||||
if (!message.isNull()) {
|
||||
warningPic.load(":/configgadget/images/error.svg");
|
||||
ui->gvFrame->setVisible(true);
|
||||
} else {
|
||||
warningPic.load("");
|
||||
ui->gvFrame->setVisible(false);
|
||||
}
|
||||
ui->gvWarning->scene()->addPixmap(warningPic);
|
||||
ui->gvWarning->setSceneRect(warningPic.rect());
|
||||
ui->gvWarning->fitInView(warningPic.rect(), Qt::KeepAspectRatio);
|
||||
ui->gvFrame->setVisible(!message.isNull());
|
||||
ui->picWarning->setPixmap(message.isNull() ? QPixmap() : QPixmap(":/configgadget/images/error.svg"));
|
||||
ui->txtWarning->setText(message);
|
||||
}
|
||||
|
@ -972,50 +972,26 @@ When using OneShot125 all values set in min/max and idle are divided by eight be
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<width>70</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item alignment="Qt::AlignTop">
|
||||
<widget class="QGraphicsView" name="gvWarning">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background: transparent</string>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<property name="renderHints">
|
||||
<set>QPainter::HighQualityAntialiasing</set>
|
||||
<item>
|
||||
<widget class="QLabel" name="picWarning">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="txtWarning">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
|
Loading…
x
Reference in New Issue
Block a user