refs #618, allow to set file name for saving in views

This commit is contained in:
Klaus Basan
2016-03-23 03:09:27 +01:00
parent e993ecdeaa
commit 4cecd2a4d0
10 changed files with 91 additions and 24 deletions

View File

@@ -101,6 +101,7 @@ namespace BlackGui
Q_ASSERT_X(simInfo.isSingleSimulator(), Q_FUNC_INFO, "need single simulator");
if (this->m_modelLoader && this->m_modelLoader->supportsSimulator(simInfo))
{
this->setSaveFileName(simInfo);
return true;
}
@@ -123,10 +124,18 @@ namespace BlackGui
bool c = connect(this->m_modelLoader.get(), &IAircraftModelLoader::loadingFinished, this, &CDbOwnModelsComponent::ps_onOwnModelsLoadingFinished);
Q_ASSERT_X(c, Q_FUNC_INFO, "Failed connect for model loader");
Q_UNUSED(c);
this->setSaveFileName(simInfo);
return true;
}
}
void CDbOwnModelsComponent::setSaveFileName(const CSimulatorInfo &sim)
{
Q_ASSERT_X(sim.isSingleSimulator(), Q_FUNC_INFO, "Need single simulator");
const QString n("simulator models " + sim.toQString(true));
this->ui->tvp_OwnAircraftModels->setSaveFileName(n);
}
void CDbOwnModelsComponent::CLoadModelsMenu::customMenu(QMenu &menu) const
{
CSimulatorInfo sims = CSimulatorInfo::getLocallyInstalledSimulators();