mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
Ref T265, Ref T430, Ref T473 parts added to mapping UI
This commit is contained in:
committed by
Mat Sutcliffe
parent
000a03b2c9
commit
da0e021332
@@ -12,6 +12,7 @@
|
||||
#include "blackgui/editors/modelmappingform.h"
|
||||
#include "blackgui/editors/validationindicator.h"
|
||||
#include "blackgui/labelandicon.h"
|
||||
#include "blackgui/uppercasevalidator.h"
|
||||
#include "blackmisc/icons.h"
|
||||
#include "blackmisc/network/authenticateduser.h"
|
||||
#include "blackmisc/stringutils.h"
|
||||
@@ -37,8 +38,11 @@ namespace BlackGui
|
||||
ui->setupUi(this);
|
||||
ui->le_LastUpdated->setReadOnly(true);
|
||||
ui->le_Id->setReadOnly(true);
|
||||
|
||||
ui->le_Parts->setPlaceholderText("Allowed: " + CAircraftModel::supportedParts());
|
||||
ui->lai_Id->set(CIcons::appMappings16(), "Id:");
|
||||
CUpperCaseValidator *uc = new CUpperCaseValidator(0, 5, ui->le_Parts);
|
||||
uc->setAllowedCharacters(CAircraftModel::supportedParts());
|
||||
ui->le_Parts->setValidator(uc);
|
||||
|
||||
connect(ui->le_CG, &QLineEdit::editingFinished, this, &CModelMappingForm::onCgEditFinished);
|
||||
connect(ui->pb_Stash, &QPushButton::clicked, this, &CModelMappingForm::requestStash);
|
||||
@@ -59,6 +63,7 @@ namespace BlackGui
|
||||
model.setName(ui->le_Name->text());
|
||||
model.setModelMode(ui->selector_ModelMode->getMode());
|
||||
model.setCG(this->getCGFromUI());
|
||||
model.setSupportedParts(ui->le_Parts->text().trimmed().toUpper());
|
||||
return model;
|
||||
}
|
||||
|
||||
@@ -90,6 +95,7 @@ namespace BlackGui
|
||||
ui->le_Id->setText(model.getDbKeyAsString());
|
||||
ui->le_Description->setText(model.getDescription());
|
||||
ui->le_Name->setText(model.getName());
|
||||
ui->le_Parts->setText(model.getSupportedParts());
|
||||
ui->le_FileName->setText(model.getFileName());
|
||||
ui->selector_ModelMode->setValue(model.getModelMode());
|
||||
ui->selector_Simulator->setValue(model.getSimulator());
|
||||
|
||||
@@ -175,12 +175,6 @@
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::StrongFocus</enum>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="6">
|
||||
@@ -191,6 +185,9 @@
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>e.g. 3ft or 2.3m</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="3" colspan="4">
|
||||
@@ -200,13 +197,30 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3" colspan="4">
|
||||
<item row="0" column="3" colspan="2">
|
||||
<widget class="QLineEdit" name="le_ModelKey">
|
||||
<property name="placeholderText">
|
||||
<string>Model key</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="5">
|
||||
<widget class="QLabel" name="lbl_Parts">
|
||||
<property name="text">
|
||||
<string>Parts:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="6">
|
||||
<widget class="QLineEdit" name="le_Parts">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>75</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -241,6 +255,7 @@
|
||||
<tabstops>
|
||||
<tabstop>le_Id</tabstop>
|
||||
<tabstop>le_ModelKey</tabstop>
|
||||
<tabstop>le_Parts</tabstop>
|
||||
<tabstop>selector_Simulator</tabstop>
|
||||
<tabstop>le_Name</tabstop>
|
||||
<tabstop>le_Description</tabstop>
|
||||
|
||||
@@ -951,16 +951,9 @@ namespace BlackMisc
|
||||
CDistributor::fromDatabaseJson(json, prefixDistributor));
|
||||
|
||||
if (!aircraftIcao.isLoadedFromDb() && idAircraftIcao >= 0) { aircraftIcao.setDbKey(idAircraftIcao); }
|
||||
if (!livery.isLoadedFromDb())
|
||||
{
|
||||
const int idLivery = json.value(prefix % u"idlivery").toInt(-1);
|
||||
if (idLivery >= 0) { livery.setDbKey(idLivery); }
|
||||
}
|
||||
if (!distributor.isLoadedFromDb())
|
||||
{
|
||||
const QString idDistributor = json.value(prefix % u"iddistributor").toString();
|
||||
if (!idDistributor.isEmpty()) { distributor.setDbKey(idDistributor); }
|
||||
}
|
||||
if (!aircraftIcao.isLoadedFromDb() && idAircraftIcao >= 0) { aircraftIcao.setDbKey(idAircraftIcao); }
|
||||
if (!livery.isLoadedFromDb() && idLivery >= 0) { livery.setDbKey(idLivery); }
|
||||
if (!distributor.isLoadedFromDb() && !idDistributor.isEmpty()) { distributor.setDbKey(idDistributor); }
|
||||
|
||||
// store in temp.cache
|
||||
if (!cachedAircraftIcao && aircraftIcao.isLoadedFromDb()) { aircraftIcaos[aircraftIcao.getDbKey()] = aircraftIcao; }
|
||||
|
||||
Reference in New Issue
Block a user