mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-08-13 04:55:44 +08:00
refactor(ui): Remove manual model reload from connect page
The reload is already automatically triggered if the model changes in the simulator context.
This commit is contained in:
@@ -124,7 +124,6 @@ namespace BlackGui::Components
|
||||
connect(ui->le_AircraftCombinedType, &QLineEdit::editingFinished, this, &CLoginComponent::validateAircraftValues);
|
||||
connect(ui->selector_AircraftIcao, &CDbAircraftIcaoSelectorComponent::changedAircraftIcao, this, &CLoginComponent::onChangedAircraftIcao, Qt::QueuedConnection);
|
||||
connect(ui->selector_AirlineIcao, &CDbAirlineIcaoSelectorComponent::changedAirlineIcao, this, &CLoginComponent::onChangedAirlineIcao, Qt::QueuedConnection);
|
||||
connect(ui->pb_SimulatorLookup, &QToolButton::clicked, this, &CLoginComponent::lookupOwnAircraftModel);
|
||||
connect(ui->tw_Details, &QTabWidget::currentChanged, this, &CLoginComponent::onDetailsTabChanged);
|
||||
|
||||
if (sGui && sGui->getIContextSimulator())
|
||||
@@ -695,14 +694,6 @@ namespace BlackGui::Components
|
||||
emit this->requestLoginPage();
|
||||
}
|
||||
|
||||
void CLoginComponent::lookupOwnAircraftModel()
|
||||
{
|
||||
if (!this->hasValidContexts()) { return; }
|
||||
if (!sGui->getIContextSimulator()->isSimulatorAvailable()) { return; }
|
||||
const CAircraftModel model(sGui->getIContextOwnAircraft()->getOwnAircraft().getModel());
|
||||
this->onSimulatorModelChanged(model);
|
||||
}
|
||||
|
||||
void CLoginComponent::onSimulatorModelChanged(const CAircraftModel &model)
|
||||
{
|
||||
if (!sGui || !sGui->getIContextNetwork() || sApp->isShuttingDown()) { return; }
|
||||
|
||||
@@ -176,9 +176,6 @@ namespace BlackGui::Components
|
||||
//! Logoff due to insufficient simulator frame rate
|
||||
void autoLogoffFrameRate(bool fatal);
|
||||
|
||||
//! Lookup own model
|
||||
void lookupOwnAircraftModel();
|
||||
|
||||
//! Simulator model has been changed
|
||||
void onSimulatorModelChanged(const BlackMisc::Simulation::CAircraftModel &model);
|
||||
|
||||
|
||||
@@ -450,23 +450,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pb_SimulatorLookup">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>35</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>refresh</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>:/diagona/icons/diagona/icons/arrow-circle-225.png</normaloff>:/diagona/icons/diagona/icons/arrow-circle-225.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -888,7 +871,6 @@
|
||||
<tabstop>tw_Details</tabstop>
|
||||
<tabstop>form_Pilot</tabstop>
|
||||
<tabstop>le_SimulatorModel</tabstop>
|
||||
<tabstop>pb_SimulatorLookup</tabstop>
|
||||
<tabstop>le_Callsign</tabstop>
|
||||
<tabstop>selector_AircraftIcao</tabstop>
|
||||
<tabstop>le_AircraftCombinedType</tabstop>
|
||||
|
||||
@@ -63,7 +63,6 @@ namespace BlackGui::Components
|
||||
connect(ui->le_AircraftCombinedType, &QLineEdit::editingFinished, this, &COwnAircraftComponent::validate);
|
||||
connect(ui->selector_AircraftIcao, &CDbAircraftIcaoSelectorComponent::changedAircraftIcao, this, &COwnAircraftComponent::changedAircraftIcao, Qt::QueuedConnection);
|
||||
connect(ui->selector_AirlineIcao, &CDbAirlineIcaoSelectorComponent::changedAirlineIcao, this, &COwnAircraftComponent::changedAirlineIcao, Qt::QueuedConnection);
|
||||
connect(ui->pb_SimulatorLookup, &QPushButton::clicked, this, &COwnAircraftComponent::lookupOwnAircraftModel);
|
||||
connect(ui->pb_Clear, &QPushButton::clicked, this, &COwnAircraftComponent::clearLivery, Qt::QueuedConnection);
|
||||
|
||||
if (sGui && sGui->getIContextSimulator())
|
||||
@@ -93,14 +92,6 @@ namespace BlackGui::Components
|
||||
}
|
||||
}
|
||||
|
||||
void COwnAircraftComponent::lookupOwnAircraftModel()
|
||||
{
|
||||
if (!this->hasValidContexts()) { return; }
|
||||
if (!sGui->getIContextSimulator()->isSimulatorAvailable()) { return; }
|
||||
const CAircraftModel model(sGui->getIContextOwnAircraft()->getOwnAircraft().getModel());
|
||||
this->onSimulatorModelChanged(model);
|
||||
}
|
||||
|
||||
void COwnAircraftComponent::onSimulatorModelChanged(const CAircraftModel &model)
|
||||
{
|
||||
if (!sGui || !sGui->getIContextNetwork() || sApp->isShuttingDown()) { return; }
|
||||
|
||||
@@ -72,9 +72,6 @@ namespace BlackGui::Components
|
||||
void aircraftDataChanged();
|
||||
|
||||
private:
|
||||
//! Lookup own model
|
||||
void lookupOwnAircraftModel();
|
||||
|
||||
//! Simulator model has been changed
|
||||
void onSimulatorModelChanged(const BlackMisc::Simulation::CAircraftModel &model);
|
||||
|
||||
|
||||
@@ -123,23 +123,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pb_SimulatorLookup">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>35</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>refresh</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../blackmisc/blackmisc.qrc">
|
||||
<normaloff>:/diagona/icons/diagona/icons/arrow-circle-225.png</normaloff>:/diagona/icons/diagona/icons/arrow-circle-225.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -307,7 +290,6 @@
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>le_SimulatorModel</tabstop>
|
||||
<tabstop>pb_SimulatorLookup</tabstop>
|
||||
<tabstop>cb_Model</tabstop>
|
||||
<tabstop>comp_ModelStringCompleter</tabstop>
|
||||
<tabstop>cb_Livery</tabstop>
|
||||
|
||||
Reference in New Issue
Block a user