Ref T294, display simulator internals correctly

* view rows not selectable
* added settings to ISimulator
* ISimulator implements initSimulatorInternals() and sets default values
* also display plugin name
* XPlane using initSimulatorInternals()
This commit is contained in:
Klaus Basan
2018-07-28 00:19:06 +02:00
parent a05d11fff0
commit fbfbdedb65
10 changed files with 67 additions and 34 deletions

View File

@@ -19,7 +19,7 @@ namespace BlackMisc
{
void CSimulatorInternals::setValue(const QString &name, const QString &value)
{
this->m_data.addOrReplaceValue(name, value);
m_data.addOrReplaceValue(name, value);
}
CVariant CSimulatorInternals::getVariantValue(const QString &name) const
@@ -57,6 +57,16 @@ namespace BlackMisc
this->setValue("all/simulatorName", name);
}
QString CSimulatorInternals::getSimulatorSwiftPluginName() const
{
return this->getStringValue("all/pluginName");
}
void CSimulatorInternals::setSwiftPluginName(const QString &name)
{
this->setValue("all/pluginName", name);
}
QString CSimulatorInternals::getSimulatorVersion() const
{
return this->getStringValue("all/versionInfo");
@@ -82,30 +92,23 @@ namespace BlackMisc
CVariant CSimulatorInternals::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
{
if (index.isMyself()) { return CVariant::from(*this); }
ColumnIndex i = index.frontCasted<ColumnIndex>();
const ColumnIndex i = index.frontCasted<ColumnIndex>();
switch (i)
{
case IndexData:
return CVariant::from(m_data);
default:
return CValueObject::propertyByIndex(index);
case IndexData: return CVariant::from(m_data);
default: return CValueObject::propertyByIndex(index);
}
}
void CSimulatorInternals::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
{
if (index.isMyself()) { (*this) = variant.to<CSimulatorInternals>(); return; }
ColumnIndex i = index.frontCasted<ColumnIndex>();
const ColumnIndex i = index.frontCasted<ColumnIndex>();
switch (i)
{
case IndexData:
this->m_data = variant.to<CNameVariantPairList>();
break;
default:
CValueObject::setPropertyByIndex(index, variant);
break;
case IndexData: m_data = variant.to<CNameVariantPairList>(); break;
default: CValueObject::setPropertyByIndex(index, variant); break;
}
}
} // ns
} // ns

View File

@@ -68,6 +68,12 @@ namespace BlackMisc
//! Set simulator name
void setSimulatorName(const QString &name);
//! Plugin name
QString getSimulatorSwiftPluginName() const;
//! Set plugin name
void setSwiftPluginName(const QString &name);
//! Simulator version info, something like "10.3.2"
QString getSimulatorVersion() const;