refs #786, follow up / corresponding adjustments based on context changes

* removed reload models menu item
* changed to renamed functions
This commit is contained in:
Klaus Basan
2016-10-23 03:08:43 +02:00
parent c2bf473f3f
commit 514bcdd055
9 changed files with 10 additions and 29 deletions

View File

@@ -103,6 +103,7 @@ namespace BlackCore
BlackMisc::Simulation::CAircraftModelList getModelSet() const { return m_modelSet; } BlackMisc::Simulation::CAircraftModelList getModelSet() const { return m_modelSet; }
//! Set the models we want to use //! Set the models we want to use
//! \note use a set from "somewhere else" so it can also be used with arbitrary sets for testing
int setModelSet(const BlackMisc::Simulation::CAircraftModelList &models); int setModelSet(const BlackMisc::Simulation::CAircraftModelList &models);
//! Default model //! Default model

View File

@@ -53,7 +53,6 @@ namespace BlackCore
public: public:
//! ISimulator status //! ISimulator status
//! \todo Qt5.5: Make use of QFlags
enum SimulatorStatusFlag enum SimulatorStatusFlag
{ {
Disconnected = 0, Disconnected = 0,
@@ -114,9 +113,6 @@ namespace BlackCore
//! Display a text message //! Display a text message
virtual void displayTextMessage(const BlackMisc::Network::CTextMessage &message) const = 0; virtual void displayTextMessage(const BlackMisc::Network::CTextMessage &message) const = 0;
//! Reload the installed models from disk
virtual void reloadInstalledModels() = 0;
//! Airports in range from simulator //! Airports in range from simulator
virtual BlackMisc::Aviation::CAirportList getAirportsInRange() const = 0; virtual BlackMisc::Aviation::CAirportList getAirportsInRange() const = 0;
@@ -178,10 +174,12 @@ namespace BlackCore
static QString statusToString(int status); static QString statusToString(int status);
//! Status to enum //! Status to enum
//! \fixme remove with Qt 5.5 when SimulatorStatus can be transferred via DBus
static SimulatorStatus statusToEnum(int status); static SimulatorStatus statusToEnum(int status);
signals: signals:
//! Simulator combined status //! Simulator combined status
//! \fixme with Qt 5.5 make use of QFlags
void simulatorStatusChanged(int status); void simulatorStatusChanged(int status);
//! Emitted when own aircraft model has changed //! Emitted when own aircraft model has changed

View File

@@ -241,11 +241,6 @@ namespace BlackCore
this->m_remoteAircraftProviderConnections.disconnectAll(); // disconnect signals from provider this->m_remoteAircraftProviderConnections.disconnectAll(); // disconnect signals from provider
} }
void CSimulatorCommon::reloadInstalledModels()
{
// currently we do nothing here
}
CLength CSimulatorCommon::getRenderedDistanceBoundary() const CLength CSimulatorCommon::getRenderedDistanceBoundary() const
{ {
return CLength(20.0, CLengthUnit::NM()); return CLength(20.0, CLengthUnit::NM());

View File

@@ -82,7 +82,6 @@ namespace BlackCore
virtual const BlackMisc::Simulation::CSimulatorPluginInfo &getSimulatorPluginInfo() const override; virtual const BlackMisc::Simulation::CSimulatorPluginInfo &getSimulatorPluginInfo() const override;
virtual const BlackMisc::Simulation::CSimulatorSetup &getSimulatorSetup() const override; virtual const BlackMisc::Simulation::CSimulatorSetup &getSimulatorSetup() const override;
virtual void unload() override; virtual void unload() override;
virtual void reloadInstalledModels() override;
virtual void deleteAllRenderingRestrictions() override; virtual void deleteAllRenderingRestrictions() override;
virtual int physicallyRemoveMultipleRemoteAircraft(const BlackMisc::Aviation::CCallsignSet &callsigns) override; virtual int physicallyRemoveMultipleRemoteAircraft(const BlackMisc::Aviation::CCallsignSet &callsigns) override;
//! @} //! @}

View File

@@ -103,7 +103,7 @@ namespace BlackGui
{ {
if (!this->m_completerOwnModels) if (!this->m_completerOwnModels)
{ {
const QStringList modelStrings = sGui->getIContextSimulator()->getInstalledModels().getModelStringList(); const QStringList modelStrings = sGui->getIContextSimulator()->getModelSet().getModelStringList();
this->m_completerModelSet = new QCompleter(modelStrings, this); this->m_completerModelSet = new QCompleter(modelStrings, this);
setCompleterParameters(this->m_completerModelSet); setCompleterParameters(this->m_completerModelSet);
} }
@@ -113,7 +113,7 @@ namespace BlackGui
{ {
if (!this->m_completerOwnModels) if (!this->m_completerOwnModels)
{ {
const QStringList modelStrings = sGui->getIContextSimulator()->getInstalledModels().getModelStringList(); const QStringList modelStrings = sGui->getIContextSimulator()->getModelSet().getModelStringList();
this->m_completerOwnModels = new QCompleter(modelStrings, this); this->m_completerOwnModels = new QCompleter(modelStrings, this);
setCompleterParameters(this->m_completerOwnModels); setCompleterParameters(this->m_completerOwnModels);
} }

View File

@@ -201,7 +201,7 @@ namespace BlackGui
return; return;
} }
int models = sGui->getIContextSimulator()->getInstalledModelsCount(); int models = sGui->getIContextSimulator()->getModelSetCount();
bool on = (models > 0); bool on = (models > 0);
ui->led_MapperReady->setOn(on); ui->led_MapperReady->setOn(on);
if (on) if (on)

View File

@@ -66,6 +66,7 @@ namespace BlackGui
ui->tvp_AircraftModels->setAircraftModelMode(CAircraftModelListModel::OwnSimulatorModel); ui->tvp_AircraftModels->setAircraftModelMode(CAircraftModelListModel::OwnSimulatorModel);
ui->tvp_AircraftModels->setResizeMode(CAircraftModelView::ResizingOff); ui->tvp_AircraftModels->setResizeMode(CAircraftModelView::ResizingOff);
ui->tvp_AircraftModels->addFilterDialog(); ui->tvp_AircraftModels->addFilterDialog();
ui->tvp_AircraftModels->menuRemoveItems(CViewBaseNonTemplate::MenuBackend);
ui->tvp_SimulatedAircraft->setAircraftMode(CSimulatedAircraftListModel::ModelMode); ui->tvp_SimulatedAircraft->setAircraftMode(CSimulatedAircraftListModel::ModelMode);
ui->tvp_SimulatedAircraft->setResizeMode(CAircraftModelView::ResizingOnce); ui->tvp_SimulatedAircraft->setResizeMode(CAircraftModelView::ResizingOnce);
@@ -73,7 +74,6 @@ namespace BlackGui
connect(ui->tvp_AircraftModels, &CAircraftModelView::requestUpdate, this, &CMappingComponent::ps_onModelsUpdateRequested); connect(ui->tvp_AircraftModels, &CAircraftModelView::requestUpdate, this, &CMappingComponent::ps_onModelsUpdateRequested);
connect(ui->tvp_AircraftModels, &CAircraftModelView::modelDataChanged, this, &CMappingComponent::ps_onRowCountChanged); connect(ui->tvp_AircraftModels, &CAircraftModelView::modelDataChanged, this, &CMappingComponent::ps_onRowCountChanged);
connect(ui->tvp_AircraftModels, &CAircraftModelView::clicked, this, &CMappingComponent::ps_onModelSelectedInView); connect(ui->tvp_AircraftModels, &CAircraftModelView::clicked, this, &CMappingComponent::ps_onModelSelectedInView);
connect(ui->tvp_AircraftModels, &CAircraftModelView::requestNewBackendData, this, &CMappingComponent::ps_onMenuRequestModelReload);
connect(ui->tvp_SimulatedAircraft, &CSimulatedAircraftView::modelDataChanged, this, &CMappingComponent::ps_onRowCountChanged); connect(ui->tvp_SimulatedAircraft, &CSimulatedAircraftView::modelDataChanged, this, &CMappingComponent::ps_onRowCountChanged);
connect(ui->tvp_SimulatedAircraft, &CSimulatedAircraftView::clicked, this, &CMappingComponent::ps_onAircraftSelectedInView); connect(ui->tvp_SimulatedAircraft, &CSimulatedAircraftView::clicked, this, &CMappingComponent::ps_onAircraftSelectedInView);
@@ -267,7 +267,7 @@ namespace BlackGui
bool changed = false; bool changed = false;
if (aircraftFromBackend.getModelString() != modelString) if (aircraftFromBackend.getModelString() != modelString)
{ {
CAircraftModelList models = sGui->getIContextSimulator()->getInstalledModelsStartingWith(modelString); CAircraftModelList models = sGui->getIContextSimulator()->getModelSetModelsStartingWith(modelString);
if (models.isEmpty()) if (models.isEmpty())
{ {
CLogMessage(this).validationError("No model for title: %1") << modelString; CLogMessage(this).validationError("No model for title: %1") << modelString;
@@ -320,7 +320,7 @@ namespace BlackGui
void CMappingComponent::ps_onModelsUpdateRequested() void CMappingComponent::ps_onModelsUpdateRequested()
{ {
const CAircraftModelList ml(sGui->getIContextSimulator()->getInstalledModels()); const CAircraftModelList ml(sGui->getIContextSimulator()->getModelSet());
ui->tvp_AircraftModels->updateContainer(ml); ui->tvp_AircraftModels->updateContainer(ml);
} }
@@ -381,15 +381,6 @@ namespace BlackGui
} }
} }
void CMappingComponent::ps_onMenuRequestModelReload()
{
if (sGui->getIContextSimulator())
{
sGui->getIContextSimulator()->reloadInstalledModels();
CLogMessage(this).info("Requested to reload simulator aircraft models");
}
}
CIdentifier CMappingComponent::mappingIdentifier() CIdentifier CMappingComponent::mappingIdentifier()
{ {
if (m_identifier.getName().isEmpty()) if (m_identifier.getName().isEmpty())

View File

@@ -130,9 +130,6 @@ namespace BlackGui
//! Enable / disable aircraft //! Enable / disable aircraft
void ps_onMenuEnableAircraft(const BlackMisc::Simulation::CSimulatedAircraft &aircraft); void ps_onMenuEnableAircraft(const BlackMisc::Simulation::CSimulatedAircraft &aircraft);
//! Reload models
void ps_onMenuRequestModelReload();
//! Highlight in simulator //! Highlight in simulator
void ps_onMenuHighlightInSimulator(const BlackMisc::Simulation::CSimulatedAircraft &aircraft); void ps_onMenuHighlightInSimulator(const BlackMisc::Simulation::CSimulatedAircraft &aircraft);