Skip to content

Commit 21a6a37

Browse files
committed
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.
1 parent ce5efaf commit 21a6a37

File tree

3 files changed

+0
-75
lines changed

3 files changed

+0
-75
lines changed

src/blackgui/components/flightplancomponent.cpp

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ namespace BlackGui::Components
125125
connect(ui->pb_Download, &QPushButton::pressed, this, &CFlightPlanComponent::loadFlightPlanFromNetwork, Qt::QueuedConnection);
126126
connect(ui->pb_Reset, &QPushButton::pressed, this, &CFlightPlanComponent::resetFlightPlan, Qt::QueuedConnection);
127127
connect(ui->tb_SyncWithSimulator, &QPushButton::released, this, &CFlightPlanComponent::syncWithSimulator, Qt::QueuedConnection);
128-
connect(ui->pb_Prefill, &QPushButton::pressed, this, &CFlightPlanComponent::anticipateValues, Qt::QueuedConnection);
129128
connect(ui->pb_SimBrief, &QPushButton::pressed, this, &CFlightPlanComponent::loadFromSimBrief, Qt::QueuedConnection);
130129

131130
connect(ui->pb_SaveTemplate, &QPushButton::released, this, &CFlightPlanComponent::saveTemplateToDisk, Qt::QueuedConnection);
@@ -812,62 +811,6 @@ namespace BlackGui::Components
812811
return true;
813812
}
814813

815-
void CFlightPlanComponent::anticipateValues()
816-
{
817-
if (!this->overrideRemarks()) { return; }
818-
CStatusMessageList msgs;
819-
const bool vfr = this->isVfr();
820-
const bool airline = m_model.hasAirlineDesignator();
821-
822-
if (vfr)
823-
{
824-
ui->cb_NoSidsStarts->setChecked(true);
825-
msgs.push_back(CStatusMessage(this).validationInfo(u"No SID/STARs"));
826-
ui->cb_RequiredNavigationPerformance->setCurrentIndex(0);
827-
ui->cb_PerformanceCategory->setCurrentIndex(0);
828-
msgs.push_back(CStatusMessage(this).validationInfo(u"Set performance to VFR"));
829-
}
830-
else
831-
{
832-
// IFR
833-
const CAircraftIcaoCode icao = this->getAircraftIcaoCode();
834-
if (icao.isLoadedFromDb())
835-
{
836-
if (icao.getEnginesCount() >= 2 && icao.getEngineType() == "J")
837-
{
838-
// jet with >=2 engines
839-
msgs.push_back(CStatusMessage(this).validationInfo(u"Jet >=2 engines"));
840-
msgs.push_back(CStatusMessage(this).validationInfo(u"SID/STARs"));
841-
ui->cb_NoSidsStarts->setChecked(false);
842-
msgs.push_back(CStatusMessage(this).validationInfo(u"Capable of SIDs/STARs"));
843-
844-
// reset those values
845-
ui->cb_RequiredNavigationPerformance->setCurrentIndex(0);
846-
ui->cb_PerformanceCategory->setCurrentIndex(0);
847-
}
848-
} // ICAO
849-
}
850-
851-
// further info if having model from DB
852-
if (m_model.isLoadedFromDb())
853-
{
854-
if (airline)
855-
{
856-
ui->le_AirlineOperator->setText(m_model.getAirlineIcaoCode().getName());
857-
}
858-
}
859-
860-
// messages
861-
this->showOverlayMessages(msgs, false, OverlayTimeoutMs);
862-
863-
// copy over
864-
if (msgs.isSuccess())
865-
{
866-
this->buildRemarksString();
867-
this->copyRemarks(false);
868-
}
869-
}
870-
871814
void CFlightPlanComponent::updateDirectorySettings(const QString &fileOrDirectory)
872815
{
873816
if (fileOrDirectory.isEmpty()) { return; }

src/blackgui/components/flightplancomponent.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,6 @@ namespace BlackGui::Components
242242
//! Override remarks message dialog
243243
bool overrideRemarks();
244244

245-
//! Guess some FP values/setting
246-
void anticipateValues();
247-
248245
//! Update the diretcory settings
249246
void updateDirectorySettings(const QString &fileOrDirectory);
250247

src/blackgui/components/flightplancomponent.ui

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -743,20 +743,6 @@
743743
</property>
744744
</widget>
745745
</item>
746-
<item row="0" column="0">
747-
<widget class="QPushButton" name="pb_Prefill">
748-
<property name="toolTip">
749-
<string>Anticipate (guess) some values</string>
750-
</property>
751-
<property name="text">
752-
<string>&amp;Prefill</string>
753-
</property>
754-
<property name="icon">
755-
<iconset resource="../../blackmisc/blackmisc.qrc">
756-
<normaloff>:/diagona/icons/diagona/icons/compass--pencil.png</normaloff>:/diagona/icons/diagona/icons/compass--pencil.png</iconset>
757-
</property>
758-
</widget>
759-
</item>
760746
<item row="3" column="0">
761747
<widget class="QPushButton" name="pb_SaveTemplate">
762748
<property name="text">
@@ -1155,7 +1141,6 @@
11551141
<tabstop>le_PilotsName</tabstop>
11561142
<tabstop>le_PilotsHomeBase</tabstop>
11571143
<tabstop>le_LastSent</tabstop>
1158-
<tabstop>pb_Prefill</tabstop>
11591144
<tabstop>pb_Reset</tabstop>
11601145
<tabstop>pb_Send</tabstop>
11611146
<tabstop>pb_Download</tabstop>

0 commit comments

Comments
 (0)