mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-30 15:52:12 +01:00
Update this with help of FredrikA
This commit is contained in:
parent
ea5c0db322
commit
eaebe3eb30
@ -211,17 +211,20 @@ void AirframeInitialTuningPage::loadValidFiles()
|
||||
|
||||
void AirframeInitialTuningPage::setupTemplateList()
|
||||
{
|
||||
QListWidgetItem *item = new QListWidgetItem(("Current Tuning"), ui->templateList);
|
||||
|
||||
item->setData(Qt::UserRole + 1, QVariant::fromValue((QJsonObject *)NULL));
|
||||
QListWidgetItem *item;
|
||||
foreach(QString templ, m_templates.keys()) {
|
||||
QJsonObject *json = m_templates[templ];
|
||||
|
||||
item = new QListWidgetItem(json->value("name").toString(), ui->templateList);
|
||||
item->setData(Qt::UserRole + 1, QVariant::fromValue(json));
|
||||
}
|
||||
ui->templateList->sortItems();
|
||||
ui->templateList->sortItems(Qt::AscendingOrder);
|
||||
|
||||
item = new QListWidgetItem(tr("Current Tuning"));
|
||||
item->setData(Qt::UserRole + 1, QVariant::fromValue((QJsonObject *)NULL));
|
||||
ui->templateList->insertItem(0, item);
|
||||
ui->templateList->setCurrentRow(0);
|
||||
//TODO Add generics to top under item Current tuning
|
||||
}
|
||||
|
||||
QString AirframeInitialTuningPage::getTemplateKey(QJsonObject *templ)
|
||||
|
Loading…
x
Reference in New Issue
Block a user