diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/airframeinitialtuningpage.cpp b/ground/openpilotgcs/src/plugins/setupwizard/pages/airframeinitialtuningpage.cpp index ca835a886..7cdef960c 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/airframeinitialtuningpage.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/airframeinitialtuningpage.cpp @@ -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)