refactor: Remove flight plan component prefill method

For the user this method is very opaque on what is actually does. To
avoid confusion and to simplify the component, this commit removes it.
This commit is contained in:
Lars Toenning
2024-03-24 16:06:34 +01:00
parent ce5efaf8e4
commit 21a6a371e9
3 changed files with 0 additions and 75 deletions

View File

@@ -125,7 +125,6 @@ namespace BlackGui::Components
connect(ui->pb_Download, &QPushButton::pressed, this, &CFlightPlanComponent::loadFlightPlanFromNetwork, Qt::QueuedConnection);
connect(ui->pb_Reset, &QPushButton::pressed, this, &CFlightPlanComponent::resetFlightPlan, Qt::QueuedConnection);
connect(ui->tb_SyncWithSimulator, &QPushButton::released, this, &CFlightPlanComponent::syncWithSimulator, Qt::QueuedConnection);
connect(ui->pb_Prefill, &QPushButton::pressed, this, &CFlightPlanComponent::anticipateValues, Qt::QueuedConnection);
connect(ui->pb_SimBrief, &QPushButton::pressed, this, &CFlightPlanComponent::loadFromSimBrief, Qt::QueuedConnection);
connect(ui->pb_SaveTemplate, &QPushButton::released, this, &CFlightPlanComponent::saveTemplateToDisk, Qt::QueuedConnection);
@@ -812,62 +811,6 @@ namespace BlackGui::Components
return true;
}
void CFlightPlanComponent::anticipateValues()
{
if (!this->overrideRemarks()) { return; }
CStatusMessageList msgs;
const bool vfr = this->isVfr();
const bool airline = m_model.hasAirlineDesignator();
if (vfr)
{
ui->cb_NoSidsStarts->setChecked(true);
msgs.push_back(CStatusMessage(this).validationInfo(u"No SID/STARs"));
ui->cb_RequiredNavigationPerformance->setCurrentIndex(0);
ui->cb_PerformanceCategory->setCurrentIndex(0);
msgs.push_back(CStatusMessage(this).validationInfo(u"Set performance to VFR"));
}
else
{
// IFR
const CAircraftIcaoCode icao = this->getAircraftIcaoCode();
if (icao.isLoadedFromDb())
{
if (icao.getEnginesCount() >= 2 && icao.getEngineType() == "J")
{
// jet with >=2 engines
msgs.push_back(CStatusMessage(this).validationInfo(u"Jet >=2 engines"));
msgs.push_back(CStatusMessage(this).validationInfo(u"SID/STARs"));
ui->cb_NoSidsStarts->setChecked(false);
msgs.push_back(CStatusMessage(this).validationInfo(u"Capable of SIDs/STARs"));
// reset those values
ui->cb_RequiredNavigationPerformance->setCurrentIndex(0);
ui->cb_PerformanceCategory->setCurrentIndex(0);
}
} // ICAO
}
// further info if having model from DB
if (m_model.isLoadedFromDb())
{
if (airline)
{
ui->le_AirlineOperator->setText(m_model.getAirlineIcaoCode().getName());
}
}
// messages
this->showOverlayMessages(msgs, false, OverlayTimeoutMs);
// copy over
if (msgs.isSuccess())
{
this->buildRemarksString();
this->copyRemarks(false);
}
}
void CFlightPlanComponent::updateDirectorySettings(const QString &fileOrDirectory)
{
if (fileOrDirectory.isEmpty()) { return; }

View File

@@ -242,9 +242,6 @@ namespace BlackGui::Components
//! Override remarks message dialog
bool overrideRemarks();
//! Guess some FP values/setting
void anticipateValues();
//! Update the diretcory settings
void updateDirectorySettings(const QString &fileOrDirectory);

View File

@@ -743,20 +743,6 @@
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QPushButton" name="pb_Prefill">
<property name="toolTip">
<string>Anticipate (guess) some values</string>
</property>
<property name="text">
<string>&amp;Prefill</string>
</property>
<property name="icon">
<iconset resource="../../blackmisc/blackmisc.qrc">
<normaloff>:/diagona/icons/diagona/icons/compass--pencil.png</normaloff>:/diagona/icons/diagona/icons/compass--pencil.png</iconset>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QPushButton" name="pb_SaveTemplate">
<property name="text">
@@ -1155,7 +1141,6 @@
<tabstop>le_PilotsName</tabstop>
<tabstop>le_PilotsHomeBase</tabstop>
<tabstop>le_LastSent</tabstop>
<tabstop>pb_Prefill</tabstop>
<tabstop>pb_Reset</tabstop>
<tabstop>pb_Send</tabstop>
<tabstop>pb_Download</tabstop>