mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +08:00
[UI] Change distributor buttons to BB/XCSL
XPlane standard DOES NOT make sense, as it adds AI aircraft
This commit is contained in:
committed by
Mat Sutcliffe
parent
32c6ef3fd6
commit
6a95abb194
@@ -38,9 +38,10 @@ namespace BlackGui
|
||||
ui->tvp_Distributors->allowDragDrop(true, false);
|
||||
ui->tvp_Distributors->setFilterWidget(ui->filter_Distributor);
|
||||
|
||||
connect(ui->tvp_Distributors, &CDistributorView::requestNewBackendData, this, &CDbDistributorComponent::reload);
|
||||
connect(ui->tvp_Distributors, &CDistributorView::requestNewBackendData, this, &CDbDistributorComponent::reload);
|
||||
connect(ui->pb_SelectAllFsFamily, &QPushButton::released, this, &CDbDistributorComponent::selectStandardModels);
|
||||
connect(ui->pb_SelectXPlane, &QPushButton::released, this, &CDbDistributorComponent::selectStandardModels);
|
||||
connect(ui->pb_SelectXPlaneBB, &QPushButton::released, this, &CDbDistributorComponent::selectStandardModels);
|
||||
connect(ui->pb_SelectXplaneXCSL, &QPushButton::released, this, &CDbDistributorComponent::selectStandardModels);
|
||||
|
||||
if (sGui && sGui->getWebDataServices())
|
||||
{
|
||||
@@ -81,11 +82,12 @@ namespace BlackGui
|
||||
|
||||
void CDbDistributorComponent::onDistributorsRead(CEntityFlags::Entity entity, CEntityFlags::ReadState readState, int count)
|
||||
{
|
||||
Q_UNUSED(count);
|
||||
Q_UNUSED(count)
|
||||
if (!sGui || sGui->isShuttingDown() || !sGui->hasWebDataServices()) { return; }
|
||||
if (entity.testFlag(CEntityFlags::DistributorEntity) && CEntityFlags::isFinishedReadState(readState))
|
||||
{
|
||||
ui->tvp_Distributors->updateContainer(sGui->getWebDataServices()->getDistributors());
|
||||
const CDistributorList distributors = sGui->getWebDataServices()->getDistributors();
|
||||
ui->tvp_Distributors->updateContainer(distributors);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,10 +100,15 @@ namespace BlackGui
|
||||
this->filterBySimulator(CSimulatorInfo::AllFsFamily);
|
||||
keys = CDistributor::standardAllFsFamily();
|
||||
}
|
||||
else if (s == ui->pb_SelectXPlane)
|
||||
else if (s == ui->pb_SelectXPlaneBB)
|
||||
{
|
||||
this->filterBySimulator(CSimulatorInfo::XPLANE);
|
||||
keys = QSet<QString>({ CDistributor::standardXPlane() });
|
||||
keys = QSet<QString>({ CDistributor::xplaneBlueBell() });
|
||||
}
|
||||
else if (s == ui->pb_SelectXplaneXCSL)
|
||||
{
|
||||
this->filterBySimulator(CSimulatorInfo::XPLANE);
|
||||
keys = QSet<QString>({ CDistributor::xplaneXcsl() });
|
||||
}
|
||||
|
||||
// deferred because filter must first work and update
|
||||
|
||||
@@ -111,9 +111,16 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pb_SelectXPlane">
|
||||
<widget class="QPushButton" name="pb_SelectXPlaneBB">
|
||||
<property name="text">
|
||||
<string>XPlane standard</string>
|
||||
<string>XPlane BlueBell</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pb_SelectXplaneXCSL">
|
||||
<property name="text">
|
||||
<string>XPlane XCSL</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -156,7 +163,7 @@
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>pb_SelectAllFsFamily</tabstop>
|
||||
<tabstop>pb_SelectXPlane</tabstop>
|
||||
<tabstop>pb_SelectXPlaneBB</tabstop>
|
||||
<tabstop>tvp_Distributors</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
|
||||
@@ -218,5 +218,24 @@ namespace BlackMisc
|
||||
static const QSet<QString> fsFamily({standardFS9(), standardFSX(), standardP3D()});
|
||||
return fsFamily;
|
||||
}
|
||||
|
||||
const QSet<QString> &CDistributor::xplaneMostPopular()
|
||||
{
|
||||
static const QSet<QString> mp({ xplaneBlueBell(), xplaneXcsl() });
|
||||
return mp;
|
||||
}
|
||||
|
||||
const QString &CDistributor::xplaneBlueBell()
|
||||
{
|
||||
static const QString k("BB");
|
||||
return k;
|
||||
}
|
||||
|
||||
const QString &CDistributor::xplaneXcsl()
|
||||
{
|
||||
static const QString k("XCSL");
|
||||
return k;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
@@ -132,6 +132,9 @@ namespace BlackMisc
|
||||
static const QString &standardXPlane();
|
||||
static const QString &standardFlightGear();
|
||||
static const QSet<QString> &standardAllFsFamily();
|
||||
static const QSet<QString> &xplaneMostPopular();
|
||||
static const QString &xplaneBlueBell();
|
||||
static const QString &xplaneXcsl();
|
||||
//! @}
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user