Split of CSimulatorPluginInfo and CSimulatorSetup

refs #404, and discussion https://dev.vatsim-germany.org/issues/404#note-8

* Changed CSimulatorSetup to use CNameVariantPairList as data. The old version was an hack and had to go, CNameVariantPairList would allow complex types in the future and can be already shown in the GUI.
* CNameVariantPairList was improved slightly in the same step
* Functions to get CSimulatorSetup from driver / context
* Removed CSimulatorSetup data from CSimulatorPluginInfo
This commit is contained in:
Klaus Basan
2015-04-11 01:51:21 +02:00
parent 291746bc57
commit 5d819b30f5
26 changed files with 448 additions and 349 deletions

View File

@@ -108,8 +108,9 @@ namespace BlackGui
return;
}
int p = port.toInt();
//! \todo filename is only available if driver has been loaded
QString fileName = this->getIContextSimulator()->getSimulatorInfo().getSimulatorSetupValueAsString(CFsxSimulatorSetup::SetupSimConnectCfgFile);
QString fileName = this->getIContextSimulator()->getSimulatorSetup().getStringValue(CFsxSimulatorSetup::KeyLocalSimConnectCfgFilename());
if (fileName.isEmpty())
{
CLogMessage(this).validationError("Invalid or empty filename empty, driver loaded?");

View File

@@ -75,7 +75,7 @@ namespace BlackGui
if (!this->getIContextSimulator()->isSimulating()) {
this->addOrUpdateByName("info",
tr("Simulator (%1) not yet running").arg(
getIContextSimulator()->getSimulatorInfo().getSimulator()
getIContextSimulator()->getSimulatorPluginInfo().getSimulator()
),
CIcons::StandardIconWarning16);
return;

View File

@@ -62,7 +62,7 @@ namespace BlackGui
int CNameVariantPairModel::getRowIndexForName(const QString &name) const
{
int rowIndex = this->m_container.getNameRowIndex(name);
int rowIndex = this->m_container.getIndexForName(name);
return rowIndex;
}
@@ -82,7 +82,7 @@ namespace BlackGui
bool CNameVariantPairModel::containsNameValue(const QString &name, const BlackMisc::CVariant &value) const
{
int rowIndex = this->getRowIndexForName(name);
if (rowIndex < 0) return false;
if (rowIndex < 0) { return false; }
QModelIndex i = this->index(rowIndex, 0);
const CNameVariantPair cv = this->at(i);
return value == cv.toCVariant();

View File

@@ -22,9 +22,7 @@ namespace BlackGui
namespace Models
{
/*!
* Simple model displaying name / variant values
*/
//! Simple model displaying name / variant values
class CNameVariantPairModel : public CListModelBase<BlackMisc::CNameVariantPair, BlackMisc::CNameVariantPairList>
{