1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

Support for packaged firmware files (opfw) in the uploader gadget.

This commit is contained in:
elafargue 2011-05-25 21:23:22 +02:00
parent ccd383c999
commit 3edd7e3c3d
2 changed files with 33 additions and 8 deletions

View File

@ -42,6 +42,8 @@ deviceWidget::deviceWidget(QWidget *parent) :
QPixmap pix = QPixmap(QString(":uploader/images/view-refresh.svg"));
myDevice->statusIcon->setPixmap(pix);
myDevice->certifiedFW->setText("");
}
@ -123,6 +125,9 @@ void deviceWidget::populate()
QString str = m_dfu->DownloadDescription(size);
myDevice->description->setMaxLength(size);
myDevice->description->setText(str.left(str.indexOf(QChar(255))));
QPixmap pix = QPixmap(QString(":uploader/images/gtk-info.svg"));
myDevice->certifiedFW->setPixmap(pix);
myDevice->certifiedFW->setToolTip(tr("Custom Firmware Build"));
myDevice->buildDate->setText("Warning: development firmware");
myDevice->commitTag->setText("");
}
@ -182,6 +187,9 @@ bool deviceWidget::populateStructuredDescription(QByteArray desc)
QString dscText = QString(desc.mid(14,26));
myDevice->description->setText(dscText);
QPixmap pix = QPixmap(QString(":uploader/images/application-certificate.svg"));
myDevice->certifiedFW->setPixmap(pix);
myDevice->certifiedFW->setToolTip(tr("Official Firmware Build"));
return true;
}
@ -406,7 +414,7 @@ QString deviceWidget::setOpenFileName()
QString fileName = QFileDialog::getOpenFileName(this,
tr("Select firmware file"),
"",
tr("Firmware Files (*.bin)"),
tr("Firmware Files (*.bin *.opfw)"),
&selectedFilter,
options);
return fileName;

View File

@ -137,13 +137,6 @@
</item>
</layout>
</item>
<item row="3" column="0" colspan="2">
<widget class="QLabel" name="buildDate">
<property name="text">
<string>Build Date</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="commitTag">
<property name="text">
@ -151,6 +144,30 @@
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="certifiedFW">
<property name="text">
<string>certified</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="buildDate">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>buildDate</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>